npx skills add ...
npx skills add owenbush/decodie-skill --skill decodie-explain
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.
npx skills add owenbush/decodie-skill --skill decodie-explain
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 .decodie/ unless the user explicitly asks to save.
Load rules. Check for ~/.decodie/rules/*.md (global) and .decodie/rules/*.md (project). Read all .md files found. Treat their content as additional instructions controlling documentation output — tone, language, verbosity, format, audience. Project rules override global rules on conflict. If no rules exist, proceed with defaults.
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.
Produce the explanation as conversational markdown in the chat. Do not write to disk unless asked.
A short paragraph (2-3 sentences) describing what the code does at a high level.
For each complex or non-obvious section:
Aim for 2-5 breakdowns depending on complexity. Skip trivial code.
List bugs, security concerns, performance problems, edge cases. For each:
info, warning, or errorIf you find no issues, say so plainly.
Refactoring opportunities, modern alternatives, readability wins. For each:
Bulleted list of core patterns, principles, and language features to take away.
Only persist when the user explicitly requests it.
Check if .decodie/ exists at the project root. If not, create it:
.decodie/index.json with { "version": "1.0", "project": "<directory-name>", "entries": [] }.decodie/config.json with default preferences.decodie/sessions/ directory.decodie/rules/ directoryDetermine session ID. Find the highest NNN for today in .decodie/sessions/ matching explain-YYYY-MM-DD-NNN, then increment.
Write to the session file with:
code_snippet: The selected code as provided.explanation: The Summary section.alternatives_considered: Alternative approaches if relevant; empty string otherwise.key_concepts: Array of core concepts.breakdowns: Array of { code_excerpt, explanation, pattern? }.issues: Array of { severity, description, suggestion }.improvements: Array of { description, rationale }.id: Format: entry-{unix-timestamp}-{random-4-hex-chars}decision_type: "explanation"content_file: relative path to session file, e.g. sessions/explain-2026-03-27-001.jsonIf the code came from an identifiable file, include a reference with content-based anchoring:
file — relative path from project rootanchor — function signature, class declaration, or distinctive code blockanchor_hash — first 8 hex chars of SHA-256 of the anchor text (echo -n "<anchor_text>" | shasum -a 256 | cut -c1-8)If pasted without a known origin, references may be empty.
Set timestamp_end, write a brief summary, and confirm: "Saved explanation as entry <id> in session <session_id>."
See references/schema.md for the full .decodie/ data format.
.decodie/ when the user explicitly requests persistence.