decodie-explain
Original:🇺🇸 English
Translated
1 scripts
Explain a selected piece of code — what it does, how it works, potential issues, and improvement suggestions. Ephemeral by default (chat only), optionally saved to .decodie/ on explicit request.
5installs
Sourceowenbush/decodie-skill
Added on
NPX Install
npx skill4agent add owenbush/decodie-skill decodie-explainTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Decodie — Explain Mode
Walk a developer through a specific piece of code they have selected or pasted. Produces a conversational, human-readable explanation directly in the chat.
This mode is read-only with respect to source code and ephemeral by default — nothing is written to unless the user explicitly asks to save.
.decodie/Scope and Inputs
Operates on code the user has selected, pasted, or pointed at. Does not scan projects or discover files.
If no code has been provided, ask the user to share the code they want explained.
Output Format
Produce the explanation as conversational markdown in the chat. Do not write to disk unless asked.
1. Summary
A short paragraph (2-3 sentences) describing what the code does at a high level.
2. Detailed Breakdowns
For each complex or non-obvious section:
- A fenced code block with the code excerpt
- An explanation of what it does, why, and any patterns/idioms it uses
- The pattern name if applicable (e.g., "guard clause", "memoization")
Aim for 2-5 breakdowns depending on complexity. Skip trivial code.
3. Potential Issues
List bugs, security concerns, performance problems, edge cases. For each:
- severity: ,
info, orwarningerror - description: what is wrong and when it manifests
- suggestion: how to address it
If you find no issues, say so plainly.
4. Improvements
Refactoring opportunities, modern alternatives, readability wins. For each:
- description: the proposed change
- rationale: why it helps
5. Key Concepts
Bulleted list of core patterns, principles, and language features to take away.
Saving an Explanation (on explicit request only)
Only persist when the user explicitly requests it.
Setup
-
Check ifexists at the project root. If not, create it:
.decodie/- with
.decodie/index.json{ "version": "1.0", "project": "<directory-name>", "entries": [] } - with default preferences
.decodie/config.json - directory
.decodie/sessions/
-
Determine session ID. Find the highestfor today in
NNNmatching.decodie/sessions/, then increment.explain-YYYY-MM-DD-NNN
Session entry fields
Write to the session file with:
- : The selected code as provided.
code_snippet - : The Summary section.
explanation - : Alternative approaches if relevant; empty string otherwise.
alternatives_considered - : Array of core concepts.
key_concepts - : Array of
breakdowns.{ code_excerpt, explanation, pattern? } - : Array of
issues.{ severity, description, suggestion } - : Array of
improvements.{ description, rationale }
Index entry
- : Format:
identry-{unix-timestamp}-{random-4-hex-chars} - :
decision_type"explanation" - : relative path to session file, e.g.
content_filesessions/explain-2026-03-27-001.json
If the code came from an identifiable file, include a reference with content-based anchoring:
- — relative path from project root
file - — function signature, class declaration, or distinctive code block
anchor - — first 8 hex chars of SHA-256 of the anchor text (
anchor_hash)echo -n "<anchor_text>" | shasum -a 256 | cut -c1-8
If pasted without a known origin, may be empty.
referencesSession Closure
Set , write a brief , and confirm: "Saved explanation as entry in session ."
timestamp_endsummary<id><session_id>Data Format
See references/schema.md for the full data format.
.decodie/Important Notes
- Ephemeral unless asked. Only write to when the user explicitly requests persistence.
.decodie/ - Calibrate depth to the code. A five-line utility does not need five breakdowns.
- Be honest about uncertainty. If code is ambiguous, say so.