compound
Skill2 starsChanged 8 months agoMITView on GitHub
Use when learnings emerge during development — pattern discoveries, gotchas, architecture decisions, or process improvements. Triggers on "compound", "capture learning", after review cycles, after /review approval, or when insight is fresh.
14 other projects use a version of this.
Adopted by
Most recently taken up by
- rcelebrone/DotAgentstheir own version, first seen Sep 23, 2026
- chrislacey89/skillstheir own version, first seen Sep 18, 2026
- minhtran3124/agent-harnesstheir own version, first seen Aug 12, 2026
- pfeff/claude-skillstheir own version, first seen Aug 3, 2026
- toverux/cantripstheir own version, first seen Jul 25, 2026
- psw7205/skillstheir own version, first seen May 26, 2026
Used with
Projects with it also use tdd and handoff.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
AWSSkilltdd
Test-driven development. Use when the user wants to build features or fix bugs test-first, mentions "red-green-refactor", or wants integration tests.
Also in 3 projects that use this
MicrosoftSkillhandoff
Compact the current conversation into a handoff document for another agent to pick up.
Also in 3 projects that use this
Other versions14 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 14
- garagon/nanostack★ 207same name
- ai-native-camp/camp-2★ 19same name
- rcelebrone/DotAgents★ 15same name
- c-reichert/flowstate★ 9same name
- minhtran3124/agent-harness★ 9same name
- Andamio-Platform/coach★ 6same name
- chrislacey89/skills★ 3same name
- toverux/cantrips★ 3same name
- pfeff/claude-skills★ 2same name
- thoreinstein/obsidian-rag★ 2same name
4 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository23 other files it gives its agents.
- templates/AGENTS.mdAGENTS.md
- templates/CLAUDE.mdCLAUDE.md
- autoresearchSkill
- beadsSkill
- benchmarkSkill
- brainstormSkill
- diagnoseSkill
- discoverySkill
- executeSkill
- initSkill
- planSkill
- prdSkill
- qaSkill
- researchSkill
- review-beadsSkill
- review-designSkill
- review-executeSkill
- review-planSkill
- review-prdSkill
- reviewSkill
- security-auditSkill
- shipSkill
- technical-designSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 19 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 11 edited versions we read keep these.
19
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Run this skill when:
- Distinctive: line 28
After review approval (standard end-of-feature)
- Distinctive: line 31
After discovering a pattern, gotcha, or best practice
- Distinctive: line 32
When /execute or /review identifies learnings to document
- Distinctive: line 61
Not everything is worth documenting.
- Distinctive: line 63
Would this save someone >15 minutes: if they knew it in advance?
- Distinctive: line 119
Default to project scope. Promote to global only when the learning clearly transcends the current codebase.
- Distinctive: line 129
Single learning mode: Ask the user what they learned, or extract from the context of the current conversation.
- Very specific: line 131
Bulk mode (review findings): Read the most recent review output from docs/reviews/review-*.md (select the file with the latest timestamp).
- Distinctive: line 139
If no review file exists, ask the user to describe findings or run /review first.
- Distinctive: line 218
If more than 4 learnings, present in sequential batches.
- Distinctive: line 251
Before saving, verify the learning follows the format:
- Distinctive: line 257
If validation fails, fix the learning before saving.
- Distinctive: line 263
If the file doesn't exist, create it:
- Very specific: line 273
Feature scope: Add as an inline code comment at the relevant location, or create an ADR in docs/adr/.
- Distinctive: line 283
Check that the learnings directory is referenced by files that agents load:
- Very specific: line 286
If not, suggest adding: # Check docs/learnings/ for codebase-specific patterns and gotchas
- Distinctive: line 289
Add a one-line imperative to the global agent instructions file
- Distinctive: line 290
Keep it concise — global files are loaded every session
- Distinctive: line 298
If the learning improves a shared reference file (project conventions, patterns doc, etc.), present the suggestion as formatted markdown …
- Distinctive: line 312
If user approves, update the reference file directly.
- Distinctive: line 321
If any link in the chain is broken, fix it now — don't leave a learning orphaned.
“Common” is measured: kept by at least 6 in 10 of the 11 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Compound: Feature Learning Capture
Philosophy: Large feature development produces valuable learnings at every phase — from brainstorm through review. Capture them while context is fresh so future features benefit. A learning that changes future behaviour is valuable. A learning that merely records history is shelfware. Every entry should tell the reader what to DO differently, not just what happened.
Duration targets: Single learning ~3-5 minutes. Bulk processing (review findings) ~10-20 minutes. Most time should be spent on Step 3 (threshold test and classification) — if you're spending more time writing than deciding what's worth writing, the threshold test isn't filtering hard enough.
Why This Matters
Without structured capture, learnings evaporate between sessions. The same gotchas get rediscovered, the same architectural mistakes get repeated, the same review comments appear on every PR. AI coding agents make this worse — each session starts fresh with no memory of past struggles unless learnings are persisted in files the agent reads at startup (CLAUDE.md, AGENTS.md, learnings files).
Research shows that lessons-learned databases fail when they focus on problems without solutions, or when they're stored in locations nobody visits. This skill solves both: learnings are written in imperative voice (what to DO) and routed to files that agents load automatically.
Trigger Conditions
Run this skill when:
- After review approval (standard end-of-feature)
- During any phase when an important insight surfaces
- User says "capture learning", "compound", "document what we learned"
- After discovering a pattern, gotcha, or best practice
- When /execute or /review identifies learnings to document
Stage Gates — AskUserQuestion
At every PAUSE point in this skill, call the AskUserQuestion tool to present structured options to the user. Do not present options as plain markdown text — use the tool. The YAML blocks at each PAUSE point show the exact parameters to pass.
For pattern details and examples: ../_shared/references/stage-gates.md
Fallback: Only if
AskUserQuestionis not available as a tool (check your tool list), fall back to presenting options as markdown text and waiting for freeform response.
Collaborative Model
Phase 1: Identify & Classify Learnings
── PAUSE 1: "Here's what I've identified. Worth documenting?" ──
Phase 2: Document & Save
Phase 3: Surface & Verify
── PAUSE 2: "Learning saved. Surfacing confirmed." ──
(if "More") → Return to Phase 1For bulk processing (review findings), Phase 1 presents all candidate learnings at once. The user approves, rejects, or modifies each before Phase 2 processes approved ones.
The Threshold Test
Not everything is worth documenting. Before persisting a learning, it should pass at least 2 of these 3 criteria:
- Would this save someone >15 minutes if they knew it in advance?
- Is this not already captured in existing docs, linter rules, or compiler errors?
- Will this still be relevant in 3+ months?
Skip documenting:
- Trivial fixes (typos, syntax errors, formatting)
- Well-documented behaviour easily found in official docs
- One-off debugging steps for a transient state
- Subjective style preferences already covered by linters
- Workarounds for bugs in dependencies that have been fixed
Learning Categories
By Type
| Category | What It Captures | When It Surfaces |
pattern | A reusable approach that worked well | Design and implementation |
gotcha | Something that caused unexpected problems | Implementation (prevents repeat) |
architecture | A significant design choice with trade-offs | Design phase (informs decisions) |
process | A workflow or tooling change that improved velocity | All phases (changes how we work) |
context-gap | Missing knowledge that caused wasted time | Bead creation (adds context refs) |
review-feedback | Recurring review comments worth codifying | Implementation (updates standards) |
By Pipeline Phase
| Phase | Example Learning |
brainstorm | "5 Whys revealed the real problem was X not Y" |
discovery | "Auth framework requires X when configuring Y" |
prd | "Security criteria on FRs caught issue during review" |
design | "Cursor pagination was better than offset for this use case" |
plan | "Sub-plan 03 should have been split — too large for one bead" |
execution | "Tenant filter must be added to every entity query" |
review | "Upstream compliance check caught missing index from design" |
testing | "Concurrent operation scenario uncovered race condition" |
Learning Scope
Learnings have different scopes. The scope determines where the learning is stored and how it's surfaced.
| Scope | Where to Store | Examples |
| Project (default) | ${PROJECT_ROOT}/docs/learnings/{category}.md | Codebase-specific patterns, entity gotchas, service interactions |
| Global | Agent's persistent memory location (configured per agent) | Language-level gotchas, tool usage patterns, general best practices |
| Feature | Inline code comment or ADR in docs/adr/ | "This endpoint uses eventual consistency because..." |
Decision tree:
- Does it apply regardless of project or tech stack? → Global
- Does it apply across this codebase? → Project (default)
- Does it apply only to this feature or module? → Feature (inline comment)
Default to project scope. Promote to global only when the learning clearly transcends the current codebase.
Critical Sequence
Phase 1: Identify & Classify
Step 1.1 — Gather Candidate Learnings:
Single learning mode: Ask the user what they learned, or extract from the context of the current conversation.
Bulk mode (review findings): Read the most recent review output from docs/reviews/review-*.md (select the file with the latest timestamp). For each significant finding category, extract potential learnings:
- Correctness findings →
gotchaorpatternlearnings - Security findings →
gotchalearnings - Performance findings →
patternorarchitecturelearnings - Upstream compliance findings →
processorcontext-gaplearnings - Test coverage findings →
review-feedbacklearnings - Alignment audit findings (from
docs/reference/alignment-audit.md, if exists) →processorcontext-gaplearnings
If no review file exists, ask the user to describe findings or run /review first.
Step 1.2 — Apply Threshold Test:
For each candidate learning, check against the 3 criteria. If it doesn't pass at least 2, flag it: "This seems like {reason it might not qualify}. Still worth documenting, or skip?"
Step 1.3 — Classify Each Learning:
For each learning that passes threshold:
- Category from the type table (pattern, gotcha, architecture, process, context-gap, review-feedback)
- Phase where the learning originated
- Scope (project, global, or feature)
- Feature it was discovered during
PAUSE 1: Present classified learnings to the user.
Single mode:
Present the learning details as formatted markdown:
## Learning Identified
**Title:** {title}
**Category:** {category} | **Phase:** {phase} | **Scope:** {scope}
**Threshold:** Passes {N}/3 criteria ({which ones})
**What to Do:** {imperative statement}
**Context:** {1-2 sentences}Then use AskUserQuestion (Decision Gate — Pattern 1):
AskUserQuestion:
question: "Save this learning?"
header: "Learning"
multiSelect: false
options:
- label: "Accept (Recommended)"
description: "Save this learning as classified."
- label: "Modify"
description: "Change category, scope, or wording."
- label: "Skip"
description: "Doesn't pass threshold after all."Bulk mode:
Present all learnings as formatted markdown:
## Learnings from Review
{N} candidate learnings extracted, {M} passed threshold:
| # | Title | Category | Phase | Scope | Threshold |
|---|-------|----------|-------|-------|-----------|
| 1 | {title} | {category} | {phase} | {scope} | {N}/3 |
| 2 | {title} | {category} | {phase} | {scope} | {N}/3 |
Filtered out: {list of candidates that didn't pass threshold and why}Then use AskUserQuestion (Batch Review — Pattern 3), up to 4 learnings per batch:
AskUserQuestion:
question: "Which learnings should we save? (Unselected items are skipped)"
header: "Learnings"
multiSelect: true
options:
- label: "{learning 1 title}"
description: "{category} — {phase} — {scope}"
- label: "{learning 2 title}"
description: "{category} — {phase} — {scope}"
- label: "{learning 3 title}"
description: "{category} — {phase} — {scope}"
- label: "{learning 4 title}"
description: "{category} — {phase} — {scope}"If more than 4 learnings, present in sequential batches.
Phase 2: Document & Save
For each approved learning:
Step 2.1 — Write in Format:
## {Learning Title}
**Category:** {category}
**Phase:** {phase}
**Feature:** {feature name}
**Date:** {today}
### What to Do
{Imperative statement — what should someone DO differently because of this learning.
"Always add tenant filter to new entity queries."
"Use cursor pagination instead of offset for large datasets."
This is the minimum viable learning. If someone reads nothing else, this line should change their behaviour.}
### Context
{Brief context — what happened that produced this insight. 1-3 sentences.}
### Impact
{What would have happened without this learning? How much time/effort does it save?}Step 2.2 — Format Validation:
Before saving, verify the learning follows the format:
- Has a "What to Do" section with an imperative statement (not narrative)
- "What to Do" is specific and actionable (not vague advice)
- Context is brief (1-3 sentences, not a novel)
- Category and scope are correct
If validation fails, fix the learning before saving. This prevents the "Problem-Only Entry" anti-pattern from slipping through.
Step 2.3 — Save:
Project scope: Append to ${PROJECT_ROOT}/docs/learnings/{category}.md
If the file doesn't exist, create it:
# Learnings: {Category}
Accumulated learnings from feature development.
Referenced by brainstorm and discovery skills.Global scope: Append to the agent's persistent memory location. Keep it concise — global files are loaded every session and consume tokens.
Feature scope: Add as an inline code comment at the relevant location, or create an ADR in docs/adr/. Create the directory if it doesn't exist.
Phase 3: Surface & Verify
A learning that's stored but never found is shelfware. This phase ensures the learning will actually surface in future sessions.
Step 3.1 — Verify Upstream Consumption:
Check that the learnings directory is referenced by files that agents load:
- Does the project's CLAUDE.md (or equivalent) reference
docs/learnings/? - If not, suggest adding:
# Check docs/learnings/ for codebase-specific patterns and gotchas
For global learnings:
- Add a one-line imperative to the global agent instructions file
- Keep it concise — global files are loaded every session
For coding standards (review-feedback category):
- Suggest updating CLAUDE.md with the new standard
- Frame as an imperative: "Always X when Y" or "Never X because Y"
Step 3.2 — Reference Updates (if applicable):
If the learning improves a shared reference file (project conventions, patterns doc, etc.), present the suggestion as formatted markdown then use AskUserQuestion (Decision Gate — Pattern 1):
AskUserQuestion:
question: "This learning about {topic} could improve {reference file}. Update it?"
header: "Reference"
multiSelect: false
options:
- label: "Update (Recommended)"
description: "Add the learning to {reference file}."
- label: "Skip"
description: "Keep the learning in docs/learnings/ only."If user approves, update the reference file directly.
Step 3.3 — Verify End-to-End:
Confirm the learning will actually surface by checking the full chain:
- Learning is saved in the correct location
- That location is referenced from a file agents load at startup
- Upstream skills (research, brainstorm, discovery) will encounter it when they import learnings
If any link in the chain is broken, fix it now — don't leave a learning orphaned.
PAUSE 2: Confirm completion.
Present confirmation as formatted markdown:
## Learning Captured
**Saved:** {file path}
**Surfacing verified:** {Yes — referenced from CLAUDE.md / No — needs reference added}
**Reference updates:** {any files updated}Then use AskUserQuestion (Decision Gate — Pattern 1):
AskUserQuestion:
question: "Learning captured. What next?"
header: "Next"
multiSelect: false
options:
- label: "Done (Recommended)"
description: "Session complete."
- label: "More"
description: "Capture another learning."
- label: "Update reference"
description: "Also update a shared reference file with this learning."Anti-Patterns
The Problem-Only Entry — "We had trouble with X." Without a "What to Do" section, this is a diary entry, not a learning. Every learning must include an imperative statement that tells the reader what to DO differently. The format validation step catches this — if it slips through, the validation isn't running.
The Novel — A 500-word learning about a minor gotcha. Learnings should be scannable — one imperative line, 1-3 sentences of context, done. Detailed analysis belongs in an ADR or design doc, not a learning. If you're writing more than 10 lines, you're probably documenting an architecture decision, not a learning.
The Kitchen Sink — Mixing unrelated learnings into a single entry. Each learning gets its own entry with its own category and scope so it can be independently found and acted on. A single compound session can process multiple learnings (especially in bulk mode), but each one is a separate entry.
CLAUDE.md Pollution — Adding every learning directly to CLAUDE.md. This file is loaded every session and consumes tokens. Only the highest-signal, most frequently relevant learnings belong there. Route everything else to docs/learnings/ and reference the directory. A CLAUDE.md that grows to 500 lines of learnings degrades agent performance.
Write-Only Documentation — Storing learnings in a location nobody visits. This is why Phase 3 exists — verify the full chain from saved file to agent startup. If no upstream skill references the learnings directory, the learning might as well not exist.
Exit Signals
| Signal | Meaning | Next Action |
| "done" | Learning(s) captured | Session complete |
| "more" | Capture another learning | Return to Phase 1 |
| "skip" | Learning doesn't pass threshold | Discard and move on |
Skill Version: 3.5 v3.5: Bulk mode file selection clarified (select latest timestamp). Collaborative model shows "More" loop. Step 3.2 uses AskUserQuestion Decision Gate for reference updates. docs/decisions/ → docs/adr/ alignment. Alignment audit awareness for COMPREHENSIVE reviews. v3.4: PAUSE points use AskUserQuestion tool — Decision Gate for single learning and completion, Batch Review for bulk learnings v3.1: Duration targets, collaborative model with PAUSE points, structured response options (single + bulk mode), format validation before saving, surfacing verification as dedicated phase with end-to-end chain check, generic agent memory path (not hardcoded), clarified one-entry-per-learning vs session-can-process-multiple, removed duplicate Quality Standards section, shell commands replaced with prose, anti-patterns explain WHY
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

