About compound-docs
compound-docs is a skill for capturing resolved engineering problems as structured Markdown documentation. It guides the process from confirming a reusable lesson and checking existing entries to validating metadata and linking related issues.
Key features
- 01Capture confirmed, reusable fixes
- 02Collect root cause and prevention details
- 03Check for existing solution documents
- 04Validate YAML frontmatter
- 05Cross-reference related issues
Use cases
- 01Record a fix that could otherwise be repeated
- 02Update or link documentation for similar issues
- 03Review recurring problems for critical patterns
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ iliaal/ ai-skills --skill compound-docsAfter installing, type/compound-docsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
SPEC.mdagents/openai.yamlassets/critical-pattern-template.mdresolution-template.mdreferences/documentation-process.mdexample-scenario.mdquality-guidelines.mdyaml-schema.mdscripts/validate-frontmatter.pyvalidate-frontmatter.shDetails
From the project READMEcompound-docs
Process
Single-file architecture -- one markdown file per problem in its symptom category directory (e.g., docs/solutions/performance-issues/n-plus-one-briefs.md), with YAML frontmatter for metadata.
Follow the 7-step documentation capture process. For full details, see documentation-process.md.
- Detect confirmation -- Auto-invoke after "that worked", "it's fixed", etc. Skip trivial fixes.
- Gather context -- Extract module, symptom, investigation attempts, root cause, solution, prevention. BLOCK if critical context missing.
- Check existing docs -- Search
docs/solutions/for similar issues. If found, offer: new doc with cross-reference, update existing, or other. - Generate filename -- Format:
[sanitized-symptom]-[module]-[YYYYMMDD].md - Validate YAML -- Save the draft to a temporary Markdown file, then run validate-frontmatter.sh against it. The validator requires Python 3 and PyYAML; report a missing dependency rather than claiming validation. If invalid, fix the frontmatter and re-run until it passes.
- Create documentation -- Write file to
docs/solutions/[category]/[filename].mdusing resolution-template.md. - Cross-reference -- Link related issues. Detect critical patterns (3+ similar issues).
Capture gate (step 1): capture only if, without this doc, a future engineer reading the final code, tests, comments, CLAUDE.md/AGENTS.md, and existing docs or skills would still repeat the mistake or redo the investigation. Skip when any of those already carries the lesson.
Decision Menu
After successful documentation, present the options below via AskUserQuestion (Claude Code; load with ToolSearch select:AskUserQuestion if not loaded) or request_user_input (Codex), falling back to the numbered menu in chat, and WAIT for the user's response:
Solution documented
File created:
- docs/solutions/[category]/[filename].md
What's next?
1. Continue workflow (recommended)
2. Add to Required Reading - Promote to critical patterns
3. Link related issues - Connect to similar problems
4. Add to existing skill - Add to a learning skill
5. Create new skill - Extract into new learning skill
6. View documentation - See what was captured
7. Other
For detailed response handling, see documentation-process.md.
Success Criteria
- YAML frontmatter validated (all required fields, correct formats)
- File created in
docs/solutions/[category]/[filename].md - Enum values match schema exactly
- Code examples included in solution section
- Cross-references added if related issues found
- User presented with decision menu and action confirmed
References
- documentation-process.md - Full 7-step process with validation gates
- yaml-schema.md - YAML frontmatter schema and enum values
- quality-guidelines.md - Quality standards, execution rules, error handling
- example-scenario.md - Complete walkthrough of documenting an N+1 query fix
- resolution-template.md - Template for documentation files
- critical-pattern-template.md - Template for critical pattern entries
- validate-frontmatter.sh - Validate YAML frontmatter against schema
- validate-frontmatter.py - Safe YAML parser and field validation; install its dependency with
python3 -m pip install PyYAMLwhen authorized
Integration
- Stale-learning review (
/ia-compound-refreshin Claude Code) -- reviewsdocs/solutions/for entries that have aged out