Code explainer
Analyze any local folder or GitHub repo into a high-fidelity, two-tier onboarding guide with crisp markdown explainers, validated Mermaid diagrams, and rendered SVG/PNG architecture and flow visuals for PMs, designers, and engineers.
npx -y skills add baboonzero/code-explainer --skill code-explainerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Analyze a local codebase folder or GitHub repository URL and generate a grounded onboarding explainer with clear markdown docs, focused Mermaid/SVG/PNG diagrams, evidence anchors, and explanation-quality scoring. Use when users need a codebase explained in simple, concrete language for PM/design/new engineer onboarding.
SKILL.md
6.0 KB, as published. Nobody here has run it
Code Explainer
Builds explanation-first repository explainers from local folders or GitHub URLs.
What Good Output Looks Like
A good run must do all of the following:
- Explain what the repository does in plain language.
- Name real entrypoints, modules, docs, and flow steps from the repository.
- Tell the reader where to start and where change risk lives.
- Produce diagrams that answer specific onboarding questions.
- Emit proof artifacts showing whether the explanation is actually useful.
This skill should fail quality gates if the output is generic, vague, or weakly grounded.
Output Model
overview/OVERVIEW.mdfor the plain-language explanation.deep/*.mdfor architecture, modules, flows, dependencies, and glossary.diagrams/*.mmdplus rendereddiagrams/svg/*.svganddiagrams/png/*.png.diagrams/excalidraw/*.excalidraw.jsonplus mirrored preview assets underdiagrams/excalidraw/svg/*.svganddiagrams/excalidraw/png/*.png.meta/explanation_plan.jsondescribing the intended narrative.meta/explanation_quality.jsonscoring clarity, specificity, grounding, usefulness, diagram usefulness, and honesty.meta/excalidraw_report.jsonproving whether editable Excalidraw scenes were created or why that export was blocked.meta/*.jsonfor indexing, verification, confidence, attribution, and quality reports.
See references/output-contract.md for exact artifacts and references/evaluation-rubric.md for the passing bar.
Command
Run from this skill directory:
python scripts/analyze.py analyze \
--source <local_path_or_github_url> \
--output <output_dir> \
--mode <quick|standard|deep> \
--format <markdown|html|both> \
--explainer-type <onboarding|project-recap|plan-review|diff-review> \
--audience <nontech|mixed|engineering> \
--overview-length <short|medium|long> \
--since <time_window> \
--git-ref <ref> \
--plan-file <path> \
--include-glob <pattern> \
--exclude-glob <pattern> \
--enable-llm-descriptions <true|false> \
--enable-excalidraw-export <true|false> \
--enable-official-excalidraw-bridge <true|false> \
--ask-before-llm-use <true|false> \
--prompt-for-llm-key <true|false> \
--persist-llm-key <ask|true|false> \
--enable-web-enrichment <true|false>
Defaults:
mode=standardformat=markdownexplainer-type=onboardingaudience=nontechoverview-length=mediumenable-llm-descriptions=trueenable-excalidraw-export=trueenable-official-excalidraw-bridge=falseask-before-llm-use=falseprompt-for-llm-key=truepersist-llm-key=askenable-web-enrichment=true
LLM Behavior
- The high-quality path is explanation-first and uses
scripts/llm_describe.py. - The LLM path is the required production path for this skill.
- If
CODE_EXPLAINER_LLM_API_KEYorOPENAI_API_KEYis set, the skill can use a live model. - If no key is available, the skill should prompt for one when the terminal is interactive.
- The user can choose to persist the provided key in a local
.envfile for future runs. CODE_EXPLAINER_MOCK_LLM=trueis only for explicit development or offline test scenarios and is not the normal production path.
Workflow
- Normalize the source and build a repository index.
- Detect stack, entrypoints, dependencies, flows, and documentation coverage.
- Build
explanation_plan.jsonwith top modules, audience starting points, diagram purposes, and caveats. - Generate the narrative layer with LLM or grounded mock/deterministic fallback.
- Build focused diagrams tied to onboarding questions.
- Export those diagrams into editable Excalidraw scenes through the deterministic local exporter.
- Optionally prefer the official Excalidraw bridge only when explicitly enabled for development experiments.
- Generate overview and deep docs from the explanation plan plus narrative layer.
- Run fact-check and explanation-quality evaluation.
- Fail the run if quality gates do not clear the rubric.
Proof Path
Run the shipped self-audit:
python scripts/self_audit.py
This runs the skill on fixture repositories in assets/fixtures/, uses the grounded mock explainer path, and writes proof artifacts under .audit_tmp/code-explainer-self/.
Dependencies
Required:
- Python
3.10+ - Node.js
18++ npm - Git when
--sourceis a GitHub URL
Recommended:
- Mermaid CLI (
mmdc) from@mermaid-js/mermaid-clifor higher-fidelity diagram rendering - Node.js is only required for GitHub cloning and optional development-time Excalidraw bridge experiments
Install dependencies:
powershell -ExecutionPolicy Bypass -File .\scripts\install_runtime.ps1
or
bash ./scripts/install_runtime.sh
Notes
- This skill does not mutate the analyzed repository.
- The skill may create or update a local
.envfile in the skill directory when the user chooses to persist the prompted LLM key. - If the explanation-quality score is below the rubric threshold, treat the output as failed even if files were produced.
- If Excalidraw export is enabled, treat missing or partial editable scene generation as a real quality issue, not a cosmetic extra.
- The deterministic local Excalidraw exporter is the canonical production path.
- The official
@excalidraw/mermaid-to-excalidrawbridge is opt-in only via--enable-official-excalidraw-bridge trueand should be treated as a development experiment, not a required runtime dependency. - Use include/exclude globs to narrow analysis when the repository is very large or noisy.
References
references/output-contract.mdreferences/diagram-style-guide.mdreferences/persona-writing-guide.mdreferences/mode-behavior.mdreferences/evaluation-rubric.md