
Document Code
This is a structured workflow for documenting code entry points with dependency mapping to depth 3 and mermaid diagrams. You point it at a file, folder, function, or API, and it validates the target, searches existing knowledge first, analyzes dependencies while avoiding loops, then writes a markdown doc following a fixed template in docs/ai/implementation/. It optionally generates a standalone HTML artifact with a card based layout if you ask for one, though the markdown is the source of truth. The hard rule is no documentation gets written until validation and analysis finish. It's opinionated about stopping you from skipping the discovery phase, which is probably the right trade off if you've ever documented code in a hurry and regretted it later.
- GitHub stars
- 1.3K
- last updated
- Jun 11, 2026
Install
$ npx -y skills add codeaholicguy/ai-devkit --skill document-code --agent claude-codeInstalls into .claude/skills of the current project.
Files
Code Documentation Assistant
Build structured understanding of code entry points with an analysis-first workflow.
Hard Rule
- Do not create documentation until the entry point is validated and analysis is complete.
Workflow
- Gather & Validate
- Confirm entry point (file, folder, function, API), purpose, and desired depth.
- Verify it exists; resolve ambiguity or suggest alternatives if not found.
- Search for existing knowledge before analyzing:
npx ai-devkit@latest memory search --query "<entry point name or purpose>"
- Collect Source Context
- Summarize purpose, exports, key patterns.
- Folders: list structure, highlight key modules.
- Functions/APIs: capture signature, parameters, return values, error handling.
- Analyze Dependencies
- Build dependency view up to depth 3, track visited nodes to avoid loops.
- Categorize: imports, function calls, services, external packages.
- Exclude external systems or generated code.
- Synthesize
- Overview (purpose, language, high-level behavior).
- Core logic, execution flow, patterns.
- Error handling, performance, security considerations.
- Improvements or risks discovered during analysis.
Sponsors
Details
- Repository
- github.com/codeaholicguy/ai-devkit
- Categories
- Backend & APIs, Documentation, AI & Agent Building
- First seen
- Jun 11, 2026