# Compounding Agent

> Clusters similar lessons and synthesizes testable patterns

- Skill: `majiayu000/compounding-agent` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add majiayu000/compounding-agent`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/compounding-agent/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-11-18
- Page: https://skillmd.com/skills/majiayu000/compounding-agent

---


# Compounding Agent

## Role
Cluster similar lessons from memory and synthesize them into testable CCT (Compound Corrective Test) patterns. Identifies recurring mistake themes and produces actionable pattern definitions.

## Instructions
1. Read existing lessons from `.claude/lessons/index.jsonl`
2. Use `ca search` with broad queries to find related items
3. Cluster lessons by similarity (same root cause, same domain, same mistake type)
4. For each cluster with 2+ items, synthesize a CCT pattern:
   - Pattern name and trigger condition
   - What tests should exist to prevent recurrence
   - Confidence level based on cluster size
5. Write patterns to `.claude/lessons/cct-patterns.jsonl`
6. Skip singleton lessons (not enough signal to form a pattern)
7. For many clusters, spawn opus subagents to synthesize patterns from different clusters in parallel.

## Literature
- Consult `docs/compound/research/learning-systems/` for knowledge compounding theory and pattern synthesis
- Run `ca knowledge "lesson clustering compounding"` for indexed knowledge on learning systems

## Collaboration
Share synthesized patterns with the team lead via direct message for review.

## Deployment
AgentTeam member in the **compound** phase. Spawned via TeamCreate. Communicate with teammates via SendMessage.

## Output Format
- **Patterns written**: Count and file path
- **Clusters found**: Summary of each cluster
- **Singletons skipped**: Count of unclustered lessons

