compound-engineering
Skill1 starsChanged 5 months agoMITView on GitHub
Connected analyze-plan-execute-learn-repeat cycle with persistent memory. The human-in-the-loop version of Ralph for improving existing projects.
We split this skill into the rules it gives an agent
11 rules. 0 are common, 9 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
9
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
After shipping v1 and entering optimization mode
- Distinctive: line 13
When you have error logs, user feedback, or analytics to act on
- Distinctive: line 14
When you want each fix to inform the next one
- Distinctive: line 44
Test failures (CI/CD, local test runs)
- Distinctive: line 67
Document in analysis template
- Very specific: line 69
If no clear priority emerges: Don't force it. Report "no high-impact issues found" and recommend running techdebt scan or asking the user …
- Distinctive: line 95
Goal-driven: Every task in the plan gets success criteria
- Distinctive: line 106
Commit after each task
- Distinctive: line 108
If execution fails: Don't retry the same approach more than twice.
- Very specific: line 114
After execution, append to project LEARNINGS.md:
- Distinctive: line 163
If user approves → loop back to Phase 1 with the next priority.
“Common” is measured: kept by at least 6 in 10 of the 4 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 Engineering
A self-improving development loop that compounds knowledge across sessions.
When to Use
- Improving an existing project iteratively
- After shipping v1 and entering optimization mode
- When you have error logs, user feedback, or analytics to act on
- When you want each fix to inform the next one
- For sustained improvement over multiple sessions
When NOT to Use (Use Ralph Instead)
- Building from scratch with clear specs → Ralph
- Need autonomous overnight builds → Ralph
- Working in sandbox/VM → Ralph
Quick Start
/compound # Full loop: analyze → plan → execute → learn → compound
/compound analyze # Just run analysis phase
/compound plan # Plan from existing analysis (requires prior analysis)
/compound execute # Execute existing plan (requires prior plan)
/compound learn # Run learning phase (requires prior execution)
/compound report # Generate cycle reportThe 5-Phase Loop
ANALYZE → PLAN → EXECUTE → LEARN → COMPOUND → (repeat)
Phase 1: ANALYZE — What needs fixing most?
Inputs to consider:
- Error logs (Sentry, console, server logs)
- User feedback (support tickets, reviews, direct messages)
- Analytics (PostHog, usage metrics)
- Test failures (CI/CD, local test runs)
- Performance data (load times, API response times)
- Previous learning log (
LEARNINGS.md) - Tech debt backlog
Pre-Computed Summary Stats
Gather stats directly — run test suite, check for type errors, scan logs:
# Run tests and capture counts
bun test 2>&1 | tail -5
# Check TypeScript errors (if applicable)
bunx tsc --noEmit 2>&1 | tail -5
# Recent errors in logs (if available)
tail -50 /var/log/app.log 2>/dev/null || echo "No log file found"Process:
- Generate
.compound-stats(once) - Gather available signals (error rates, user complaints, test flakes)
- Score each issue by impact:
severity x frequency x user-facing - Pick the single highest-impact improvement
- Document in analysis template
If no clear priority emerges: Don't force it. Report "no high-impact issues found" and recommend running techdebt scan or asking the user for specific pain points. A cycle with no action is better than a cycle that fixes nothing important.
Output: ~/.claude/artifacts/analysis/YYYY-MM-DD-compound/analysis.md
## Analysis: [Date]
### Signal Review
- Errors: [summary of error patterns]
- Feedback: [summary of user complaints]
- Tests: [flaky or failing tests]
- Performance: [bottlenecks identified]
### Priority: [The #1 Thing]
**Impact score:** [severity] x [frequency] x [user-facing] = [total]
**Why this first:** [justification]
**Scope:** [estimated size: small/medium/large]Phase 2: PLAN — How do we fix it?
- If non-trivial: Invoke
deep-reconfirst (has this been solved before?) - Always: Invoke
writing-planswith:- Analysis output as context
- Research brief (if recon was run)
- Previous learnings (from
LEARNINGS.md)
- Goal-driven: Every task in the plan gets success criteria
Output: Implementation plan (standard writing-plans output)
Phase 3: EXECUTE — Build it
- Choose executor:
executing-plans— default for sequential, well-scoped plans (≤5 tasks)subagent-driven-development— for plans with 3+ independent tasks that can parallelize
- Quality gates between tasks (tests, types, lint)
- Goal-driven execution: loop until success criteria met
- Commit after each task
If execution fails: Don't retry the same approach more than twice. Escalate: check if the plan was wrong (return to Phase 2), or if the analysis missed something (return to Phase 1). Document what failed in the learning log either way.
Output: Working code with passing tests
Phase 4: LEARN — What did we discover?
After execution, append to project LEARNINGS.md:
## [Date] — [What was improved]
### What worked
- [thing that went well]
### What didn't
- [thing that was harder than expected]
### Patterns discovered
- [new pattern worth remembering]
### Avoid next time
- [anti-pattern encountered]
### Time spent
- Analysis: [X min]
- Planning: [X min]
- Execution: [X min]
- Total: [X min]Also update project CLAUDE.md if a new project-specific pattern emerged.
Phase 5: COMPOUND — Set up the next cycle
Generate a cycle report:
## Compound Cycle Report — [Date]
### What improved
- [specific metric or behavior that got better]
### Verification
- [command output proving improvement]
### Next priority
Based on remaining signals:
1. [Next highest-priority issue]
2. [Runner-up]
3. [Third option]
### Recommendation
[Which to tackle next and why]If user approves → loop back to Phase 1 with the next priority.
Persistent Files
| File | Location | Purpose |
LEARNINGS.md | Project root | Persistent learning log across all cycles |
analysis.md | ~/.claude/artifacts/analysis/ | Current cycle analysis |
compound-report.md | ~/.claude/artifacts/reports/ | Cycle completion reports |
Comparison with Ralph
| Aspect | Compound | Ralph |
| Context | Persistent learning log | Fresh per iteration |
| Human | In the loop (approves each phase) | AFK (autonomous) |
| Scope | Incremental improvement | Full build from spec |
| Safety | Normal dev environment | Sandbox required |
| Memory | Learns across sessions | No cross-session memory |
| Use when | Improving existing code | Building from scratch |
Success Criteria
A compound cycle is complete when:
- One measurable improvement was shipped
- All tests pass
- Learning log was updated with insights
- Next priority was identified and documented
- Cycle report saved to artifacts
Model Routing
- Analysis phase:
opus(prioritization requires judgment) - Planning phase:
opus(architectural decisions) - Execution phase:
sonnet(implementing well-defined tasks) - Learning phase:
sonnet(documenting what happened) - Report synthesis:
opus(connecting improvement to metrics)
Integration Points
| Skill | Role |
deep-recon | Research phase when problem is non-trivial |
writing-plans | Creates implementation plan in Phase 2 |
executing-plans | Runs plan in Phase 3 |
subagent-driven-development | Alternative executor for Phase 3 |
verification-before-completion | Ensures claims have evidence |
test-driven-development | Execution follows TDD |
Related Context
- agent-guardrails.md - Time budgets, retry limits
- output-markers.md - Standard output format
- validation-oracles.md - Baseline validation
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- JokerRun/amp-skills★ 8same name
- ak-7/claude-skills-collection★ 1same name
- morshed272/claude-build-workflow★ 1same name
- sirakinb/claude-code-skills★ 1same name
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 repository54 other files it gives its agents.
- AGENTS.mdAGENTS.md
- skills/deep-recon/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- adversarial-researchSkill
- algorithmic-artSkill
- api-integrationSkill
- breakdownSkill
- c4-architectSkill
- canvas-designSkill
- coding-agentsSkill
- context-budgetSkill
- counterfactualSkill
- critiqueSkill
- d3js-visualizationSkill
- data-analyst-agentSkill
- database-migrationsSkill
- deep-reconSkill
- design-tasteSkill
- doc-coauthoringSkill
- e2b-sandboxSkill
- ecosystem-auditSkill
- excalidraw-diagramSkill
- executing-plansSkill
- frontend-designSkill
- fullstack-agentSkill
- grillSkill
- kickoffSkill
- mcp-builderSkill
- model-migrationSkill
- naming-the-machineSkill
- full-output-enforcementSkill
- package-researchSkill
- pdf-generationSkill
- pp2pSkill
- pp3pSkill
- prompt-engineerSkill
- prompt-groundingSkill
- redesignSkill
- requesting-code-reviewSkill
- reverse-engineer-to-learnSkill
- review-changesSkill
- scratchpadSkill
- shipSkill
- slack-gif-creatorSkill
- sprint-architectSkill
- techdebtSkill
- test-and-fixSkill
- threat-modelSkill
- verification-before-completionSkill
- visual-verdictSkill
- webapp-testingSkill
- web-asset-generatorSkill
- whatdidimissSkill
- writing-plansSkill
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.

