code-generate-document
Generate missing documentation or architectural decision records (ADRs).
Process
-
Identify context:
- If code changes are involved: run
jj diff -sfirst to see changed files - If the user specified specific files or paths, focus on those
- If code changes are involved: run
-
Determine Documentation Type:
- Inline Docs: Docstrings, comments for functions/classes
- File/Module Docs: Top-level explanations (README.md updates)
- ADR: Architecture Decision Record for design choices
-
Execute based on type:
Inline/Module Docs:
- Read and understand the code
- Check existing doc style (Google, NumPy, Javadoc, etc.)
- Generate documentation that matches the project style
- Action: Propose changes to files
ADR (Architecture Decision Record):
- Ask user for: Context, Decision, Consequences (if not provided)
- Format it correctly (Title, Status, Context, Decision, Consequences)
- Action: Create new file in
doc/adr/(or project equivalent)
Output
- Documentation Plan (what will be documented)
- Generated Content (preview)
- Changes Applied (file paths)
More from sirn/dotfiles
code-explain
Explain code, triage changes, or map project structure. Use when user asks to explain, understand, triage, or explore project structure.
19code-plan
Generate comprehensive implementation plan based on analysis. Use when user asks to plan this, create a plan, how should I implement, or wants implementation guidance.
19code-commit
Commit current changes using jj. Analyzes changes, suggests commit messages following repository conventions, proposes splits if needed, and creates commits. Use ONLY when user explicitly asks to commit changes or create commits.
18gemini-reference
Reference for calling the Gemini CLI agent from other agents. ALWAYS read BEFORE invoking Gemini to ensure correct JSON protocol, session management, and subtask delegation patterns.
18code-quality
Run comprehensive quality checks by orchestrating review, verification, testing, and linting. Use when user asks to check code quality, run full checks, or verify code health.
18context7
Retrieve up-to-date documentation context for libraries using the Context7 API. Use when needing current library documentation (React, Python stdlib, Rust, etc.) BEFORE implementing or writing code.
17