This skill should be used when the user asks to "decompile code to CLAUDE.md", "extract CLAUDE.md from code", "document existing codebase", "reverse engineer spec", "extract documentation from source", or uses "/decompile" or "/decom". Analyzes existing source code and creates CLAUDE.md + DEVELOPERS.md documentation for each directory. Uses parse-tree CLI for directory discovery, then runs decompiler agent per directory in leaf-first order. Trigger keywords: decompile, extract docs from code, document existing code
From claude-md-pluginnpx claudepluginhub 0pg/cc-marketplace --plugin claude-md-pluginThis skill is limited to using the following tools:
references/decompile-templates.mdSearches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Guides agent creation for Claude Code plugins with file templates, frontmatter specs (name, description, model), triggering examples, system prompts, and best practices.
Analyzes source code to extract CLAUDE.md + DEVELOPERS.md.
/decompileextract docs from codedocument existing code| Name | Required | Default | Description |
|---|---|---|---|
path | No | . | Target path |
CLI_PATH=$("${CLAUDE_PLUGIN_ROOT}/scripts/install-cli.sh")
TMP_DIR=".claude/tmp/${CLAUDE_SESSION_ID:+${CLAUDE_SESSION_ID}/}"
mkdir -p "$TMP_DIR"
## Instructions existence and read document languageIf the project root CLAUDE.md does not have a ## Instructions section:
⚠ Instructions section not configured. After decompile is complete, it is recommended to set it up with `/project-setup`.
Output the warning and continue with decompile. Creating Instructions is the role of /project-setup.
Read the ## Instructions section from project root CLAUDE.md and extract the Document language value.
If not found, set document_language to empty (the agent will ask the user).
Handle tree-parse via direct CLI invocation rather than as a separate skill:
$CLI_PATH parse-tree --root {path} --output .claude/extract-tree.json
Sort the needs_claude_md array by depth DESC (leaf-first).
For each directory in sorted order (leaf-first):
${TMP_DIR}decompile-session-{dir-safe}.md:# Decompile Task: {path}
type: decompile | target: {path}
document_language: {document_language or ""}
## Tree Info
source_file_count: {n}
subdir_count: {n}
depth: {n}
## Children CLAUDE.md
{List of already-generated child CLAUDE.md paths, or "None" if empty}
## Project Conventions
{project root Conventions or "None"}
Task(decompiler):Session file: ${TMP_DIR}decompile-session-{dir-safe}.md
Target: {path}
Save results to ${TMP_DIR} and return only the path
Independent directories at the same depth can be executed in parallel (up to 3).
Check decompiler result status:
success: proceed to next modulefailed_with_warnings: collect warnings, proceed to next modulegit diff --stat
---decompile-result---
status: success | partial | failed
total: {n}
generated: {n}
failed: {n}
warnings: {Instructions not configured, etc. — omit if none}
---end-decompile-result---
DO:
DON'T:
| Situation | Response |
|---|---|
| CLI build failure | install-cli.sh handles automatic build |
| Directory with no source files | skip |
| decompiler agent failure (single module) | warn, continue with the rest |