Summary
The ralph-compounder plugin has the infrastructure for compounding knowledge (Plan → Work → Review → Compound cycle, docs/solutions/ knowledge base, learnings-researcher agent) but the feedback loop is open: every compounding step requires manual human intervention and the system never learns from its own execution.
This issue tracks 5 capabilities that close the loop, turning the plugin from a workflow orchestrator into a self-improving engineering system.
CURRENT (open loop):
Plan → Work → Review → [stop]
↑ human must manually run /workflows:compound
↑ no tracking of what worked
↑ docs/solutions/ is empty
DESIRED (closed loop):
Plan → Work → Review → Auto-Compound → Telemetry → Agent Tuning
↑ ↓
└── learnings-researcher finds past solutions ←──────────┘
Features (5 capabilities, 4 phases)
P0: Knowledge Seeding — Bootstrap the Flywheel
The entire compounding system depends on docs/solutions/ having content. Without it, learnings-researcher returns nothing and the compound loop has no data.
P1: Auto-Capture — Close the Compound Loop
P1: Agent Scoring — Track Agent Effectiveness
P2: Execution Telemetry — Measure What Matters
P3: Prompt Evolution — Agent Self-Improvement
Key Design Decisions
| Decision |
Choice |
Rationale |
| Metrics format |
JSONL |
Append-only, greppable, no dependencies, jq compatible |
| Metrics storage |
Gitignored by default |
Per-project, per-developer data |
| Auto-capture mode |
Condensed (1 subagent) |
Full compound (5 subagents) too expensive for every session |
| Agent scoring threshold |
10+ reviews |
Statistical significance, learning period for new agents |
| Prompt changes |
Human approval required |
Never auto-apply — bad prompts can cascade |
| Trivial session detection |
< 3 tasks AND no debugging detours |
Avoid noise in docs/solutions/ |
New Commands
| Command |
Phase |
Purpose |
/seed-knowledge |
P0 |
Bootstrap docs/solutions/ from git history and existing learnings |
/agent-scores |
P1 |
Dashboard showing agent precision and fix rate |
/velocity |
P2 |
Dashboard showing workflow trends and plan accuracy |
/improve-agent |
P3 |
Review and apply prompt improvement suggestions |
Modified Files
| File |
Phase |
Change |
commands/workflows/work.md |
P1 |
Add Phase 5: Capture Learnings |
commands/lfg.md |
P1 |
Add compound step to chain |
commands/slfg.md |
P1 |
Add compound step to chain |
commands/workflows/review.md |
P1 |
Read agent scores before launching |
commands/workflows/compound.md |
P1 |
Support condensed autonomous mode |
Success Metrics
| Metric |
Baseline |
Target (P2) |
Target (P4) |
| docs/solutions/ file count |
0 |
15+ |
50+ |
| learnings-researcher hit rate |
0% |
30%+ |
60%+ |
| Auto-capture rate |
0% |
70%+ |
85%+ |
| Agent precision (avg) |
Unknown |
Measured |
+15% improvement |
| Plan accuracy |
Unknown |
Measured |
+10% improvement |
Full PRD
The complete PRD with detailed acceptance criteria, risk analysis, technical design decisions, and implementation phases is at:
specs/closed-loop-self-improvement/PRD.md
Each unit of engineering work should make subsequent units easier — not harder. This issue makes that automatic.
Summary
The ralph-compounder plugin has the infrastructure for compounding knowledge (Plan → Work → Review → Compound cycle,
docs/solutions/knowledge base,learnings-researcheragent) but the feedback loop is open: every compounding step requires manual human intervention and the system never learns from its own execution.This issue tracks 5 capabilities that close the loop, turning the plugin from a workflow orchestrator into a self-improving engineering system.
Features (5 capabilities, 4 phases)
P0: Knowledge Seeding — Bootstrap the Flywheel
The entire compounding system depends on
docs/solutions/having content. Without it,learnings-researcherreturns nothing and the compound loop has no data./seed-knowledgecommand — Scan git history for fix/revert commits, extract problem/solution pairs, generatedocs/solutions/files with valid YAML frontmatterdocs/solutions/filesdocs/solutions/best-practices/(frontmatter conventions, agent prompt structure, command orchestration, hook development, skill structure, multi-agent coordination, state management)docs/solutions/patterns/critical-patterns.md— Top 3 must-know patterns for required readingP1: Auto-Capture — Close the Compound Loop
/workflows:work— After shipping (PR created), automatically detect non-trivial learnings and run condensed compound (1 subagent, auto-classify, no prompts)/lfgand/slfgchains — Insert compound step between resolve-todos and feature-video/resolve_todo_parallelresolves P1/P2 findings, auto-document the resolution indocs/solutions/P1: Agent Scoring — Track Agent Effectiveness
docs/metrics/agent-scores.jsonl(findings, accepted, rejected, fix rate per agent per PR)/agent-scoresdashboard — Show precision and fix rate per agent, flag agents below 50% precision--all-agentsflag to overrideP2: Execution Telemetry — Measure What Matters
docs/metrics/workflow-events.jsonl(plan_created, work_started, work_completed, review_completed, etc.)/velocitydashboard — Show trends for plan-to-ship time, plan accuracy, scope creep, findings per PR, rework rateP3: Prompt Evolution — Agent Self-Improvement
docs/metrics/agent-improvements//improve-agentcommand — Review and apply pending suggestions with diff preview, requires explicit user approvalKey Design Decisions
jqcompatibleNew Commands
/seed-knowledge/agent-scores/velocity/improve-agentModified Files
commands/workflows/work.mdcommands/lfg.mdcommands/slfg.mdcommands/workflows/review.mdcommands/workflows/compound.mdSuccess Metrics
Full PRD
The complete PRD with detailed acceptance criteria, risk analysis, technical design decisions, and implementation phases is at:
specs/closed-loop-self-improvement/PRD.md