compound-docs
Capture solved problems as searchable documentation with pattern detection. This skill auto-triggers when users confirm a fix worked ("that worked", "it's fixed", "working now") or manually via /compound command.
Best use case
compound-docs is best used when you need a repeatable AI agent workflow instead of a one-off prompt. It is especially useful for teams working in multi. Capture solved problems as searchable documentation with pattern detection. This skill auto-triggers when users confirm a fix worked ("that worked", "it's fixed", "working now") or manually via /compound command.
Capture solved problems as searchable documentation with pattern detection. This skill auto-triggers when users confirm a fix worked ("that worked", "it's fixed", "working now") or manually via /compound command.
Users should expect a more consistent workflow output, faster repeated execution, and less time spent rewriting prompts from scratch.
Practical example
Example input
Use the "compound-docs" skill to help with this workflow task. Context: Capture solved problems as searchable documentation with pattern detection. This skill auto-triggers when users confirm a fix worked ("that worked", "it's fixed", "working now") or manually via /compound command.Example output
A structured workflow result with clearer steps, more consistent formatting, and an output that is easier to reuse in the next run.
When to use this skill
- Use this skill when you want a reusable workflow rather than writing the same prompt again and again.
When not to use this skill
- Do not use this when you only need a one-off answer and do not need a reusable workflow.
- Do not use it if you cannot install or maintain the related files, repository context, or supporting tools.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/compound-docs/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How compound-docs Compares
| Feature / Agent | compound-docs | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Capture solved problems as searchable documentation with pattern detection. This skill auto-triggers when users confirm a fix worked ("that worked", "it's fixed", "working now") or manually via /compound command.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# compound-docs
> Each documented solution compounds your team's knowledge. The first time
> you solve a problem takes research. Document it, and the next occurrence
> takes minutes. Knowledge compounds.
This skill is inspired by [Every.to's compound-engineering plugin](https://github.com/EveryInc/compound-engineering-plugin).
## Auto-Invoke Triggers
This skill auto-triggers when the user says:
- "that worked"
- "it's fixed"
- "working now"
- "problem solved"
- "that did it"
Manual command: `/compound`
## Workflow
### Step 1: Detect Trigger
When a trigger phrase is detected or `/compound` is invoked:
1. Confirm the problem is actually solved (not still in progress)
2. Check if the fix is worth documenting
**Skip documentation for trivial fixes:**
- Simple typos
- Obvious syntax errors (missing semicolon, bracket)
- Single-line fixes that were immediately obvious
If skipping, briefly explain why: "This was a simple typo fix - skipping documentation."
### Step 2: Gather Context
Read [schema.yaml](schema.yaml) to get valid enum values, then extract from the conversation:
| Field | Required | Description |
|-------|----------|-------------|
| Symptom | Yes | Error message or observable behavior |
| Category | Yes | From schema.yaml `category.values` (or add new) |
| Component | No | From schema.yaml `component.values` (or add new) |
| Root cause | No | From schema.yaml `root_cause.values` (or add new) |
| Solution | Yes | The fix that worked |
| Prevention | No | How to avoid this in the future |
**If a value doesn't exist in schema.yaml:**
1. Add the new value to the appropriate enum in `schema.yaml`
2. If it's a new category, create the directory: `mkdir -p {output_dir}/{new-category}`
**If critical info is missing, ask:**
```
To document this fix, I need a few details:
1. Category: What type of issue was this?
[list current values from schema.yaml]
Or suggest a new category if none fit
```
### Step 3: Check for Similar Issues
Before creating a new doc, search for similar existing issues:
1. **Keyword match** - Search `{output_dir}/` for error message fragments or key symptom phrases
2. **File path match** - Check if the same files are involved in existing docs
3. **Import/dependency match** - Check if the same libraries or modules are mentioned
```bash
# Example searches
grep -rl "ErrorMessage" docs/solutions/
grep -l "path/to/file" docs/solutions/**/*.md
```
**If potential matches found:**
```
Found potentially related issues:
- docs/solutions/integration/api-timeout-20250102.md
- docs/solutions/integration/auth-header-missing-20250105.md
Are any of these the same or related issue? (y/n)
```
If related, add to the `related` field in frontmatter.
### Step 4: Create Documentation
**Validate against schema.yaml:**
1. Read schema.yaml for current valid enum values
2. Ensure all required fields are present
3. Ensure enum values exist (or add them first)
**Generate filename:**
- Format: `{sanitized-symptom}-{YYYYMMDD}.md`
- Sanitize: lowercase, replace spaces with hyphens, remove special chars, truncate to 80 chars
**Create file at:** `{output_dir}/{category}/{filename}`
**Ensure directory exists:**
```bash
mkdir -p {output_dir}/{category}
```
**Use the Solution Doc Template below.**
### Step 5: Pattern Promotion
After creating the doc, check if this issue has occurred multiple times.
**If similar issues >= threshold (default: 2):**
```
This issue has occurred {N} times:
- {link to issue 1}
- {link to issue 2}
- {link to current issue}
Promote to patterns.md? This surfaces it prominently for future sessions.
1. Yes - Add to patterns
2. No - Keep as regular doc only
```
**If yes:** Append to `{output_dir}/patterns.md` using the Pattern Template below.
## Solution Doc Template
```markdown
---
date: {YYYY-MM-DD}
category: {category}
symptoms:
- {symptom 1}
- {symptom 2}
component: {component}
root_cause: {root_cause}
tags: [{keyword1}, {keyword2}]
related: []
---
# {Problem Title}
## Problem
{1-2 sentence description of what went wrong}
## Symptoms
- {What you observed - error messages, behavior, etc.}
## What Didn't Work
- {Attempted solution 1} - {Why it failed}
- {Attempted solution 2} - {Why it failed}
## Solution
{Description of the fix}
```{language}
# Before (broken)
{code before}
# After (fixed)
{code after}
```
## Why This Works
{Technical explanation of the root cause and why the solution addresses it}
## Prevention
{How to avoid this in the future - tests, linting rules, patterns to follow}
```
## Pattern Template
When adding to `patterns.md`:
```markdown
## {Pattern Name}
**Occurrences:** {N} times ({link1}, {link2}, ...)
### WRONG
```{language}
{code that causes the problem}
```
### CORRECT
```{language}
{code that fixes it}
```
**Why:** {Technical explanation}
**When this applies:** {Context or conditions when this pattern is relevant}
```
## Integration
### Reference in AGENTS.md
Add to your project's AGENTS.md to ensure patterns are checked:
```markdown
## Required Reading
Before making changes, review known patterns:
- [Solution Patterns](docs/solutions/patterns.md)
```
### Consuming Solutions
Other workflows can discover and apply documented solutions:
**Search by keyword:**
```bash
grep -rl "keyword" docs/solutions/
```
**Search by category:**
```bash
ls docs/solutions/deployment/
```
**Search by tag:**
```bash
grep -l "tags:.*docker" docs/solutions/**/*.md
```
`patterns.md` is the primary integration point - check it first for critical patterns before making changes.
## Example Scenario
**User:** "That worked! The Docker build was failing because of the cache issue."
**Agent response:**
```
Great! Let me document this fix.
**Reading schema.yaml...**
Current categories: developer-experience, deployment, ui, integration, performance, testing
Current components: (none yet)
Current root_causes: (none yet)
**Gathering context...**
From our conversation:
- Symptom: Docker build failing with "layer not found" error
- Category: deployment
- Component: docker (adding to schema.yaml)
- Root cause: stale-cache (adding to schema.yaml)
- Solution: Added `--no-cache` flag and updated base image tag
- Prevention: Pin base image versions, use `docker system prune` periodically
**Updating schema.yaml...**
Added 'docker' to component.values
Added 'stale-cache' to root_cause.values
**Checking for similar issues...**
No related issues found.
**Creating documentation...**
Created: docs/solutions/deployment/docker-layer-not-found-20250106.md
Documentation complete.
```Related Skills
github-actions-docs
Use when users ask how to write, explain, customize, migrate, secure, or troubleshoot GitHub Actions workflows, workflow syntax, triggers, matrices, runners, reusable workflows, artifacts, caching, secrets, OIDC, deployments, custom actions, or Actions Runner Controller, especially when they need official GitHub documentation, exact links, or docs-grounded YAML guidance.
docs-architect
Creates comprehensive technical documentation from existing codebases. Analyzes architecture, design patterns, and implementation details to produce long-form technical manuals and ebooks. Use PROACTIVELY for system documentation, architecture guides, or technical deep-dives.
docstring
Write docstrings for PyTorch functions and methods following PyTorch conventions. Use when writing or updating docstrings in PyTorch code.
docs-write
Write documentation following Metabase's conversational, clear, and user-focused style. Use when creating or editing documentation files (markdown, MDX, etc.).
docs-review
Review documentation changes for compliance with the Metabase writing style guide. Use when reviewing pull requests, files, or diffs containing documentation markdown files.
langgraph-docs
Use this skill for requests related to LangGraph in order to fetch relevant documentation to provide accurate, up-to-date guidance.
gws-docs
Read and write Google Docs.
gws-docs-write
Google Docs: Append text to a document.
enact-docs-guide
LLM guide for creating, publishing, and running Enact tools
pydanticai-docs
Use this skill for requests related to Pydantic AI framework - building agents, tools, dependencies, structured outputs, and model integrations.
fractal-docs-generator
目录级 CLAUDE.md 生成。触发:mkdir、create directory、目录结构变更。
update-docs
ドキュメント更新スキル(仕様書、設計書、README等の更新)