Code explainer
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.From its SKILL.md
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.
SKILL.md
6.0 KB, ~1.4k tokens by cl100k_base, 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
What ships with it: 53 files
256.5 KB alongside SKILL.md, 33 of them executable
agents/
- openai.yaml342 B
assets/
- fixtures/insights-dashboard/package.json130 B
- fixtures/insights-dashboard/README.md470 B
- fixtures/insights-dashboard/src/App.tsx106 B
- fixtures/insights-dashboard/src/components/KpiCard.tsx209 B
- fixtures/insights-dashboard/src/hooks/useMetrics.tsruns102 B
- fixtures/insights-dashboard/src/lib/api.tsruns152 B
- fixtures/insights-dashboard/src/main.tsx167 B
- fixtures/insights-dashboard/src/pages/Dashboard.tsx365 B
- fixtures/todo-api/app/api.pyruns421 B
- fixtures/todo-api/app/main.pyruns198 B
- fixtures/todo-api/app/repositories/task_store.pyruns329 B
- fixtures/todo-api/app/services/tasks.pyruns410 B
- fixtures/todo-api/README.md749 B
- fixtures/todo-api/requirements.txt17 B
- fixtures/todo-api/tests/test_tasks.pyruns201 B
- templates/deep_architecture.md.j2679 B
- templates/deep_flows.md.j2843 B
- templates/deep_modules.md.j2669 B
- templates/glossary.md.j2189 B
- templates/overview.md.j21.5 KB
references/
- diagram-style-guide.md1.3 KB
- evaluation-rubric.md1.2 KB
- mode-behavior.md2.2 KB
- output-contract.md4.9 KB
- persona-writing-guide.md1.3 KB
scripts/
- analyze.pyruns19.5 KB
- build_diagrams.pyruns11.2 KB
- common.pyruns15.2 KB
- detect_stack.pyruns1.7 KB
- enrich_external.pyruns5.0 KB
- evaluate_output.pyruns6.0 KB
- explainer_context.pyruns10.2 KB
- explanation_plan.pyruns13.2 KB
- export_excalidraw.pyruns19.0 KB
- fact_check.pyruns4.8 KB
- generate_docs.pyruns20.2 KB
- generate_html.pyruns23.8 KB
- index_repo.pyruns3.5 KB
- .gitignore5 B
13 more files not listed here. See all 53 in the repository.