Use when a task needs single-agent self-correction across multiple iterations — write plan, execute, critique own output, revise plan, re-execute, until convergence or budget exhausted. Different from `agent-debate` (which is 2 agents arguing pro vs con); this is 1 agent looping over its own work.
How this skill is triggered — by the user, by Claude, or both
Slash command
/agent-collab-workspace:agent-plan-act-reflectThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Single-agent iterative self-correction loop. Composes existing
Single-agent iterative self-correction loop. Composes existing building blocks (task-splitter / shared-memory / acceptance-gate) into one closed cycle.
This is the agent equivalent of test-driven development: write
spec, build, test, fail, revise, build again, until pass. Where
agent-debate is "2 agents disagree", PAR is "1 agent revises".
Good for:
Not for:
agent-debate)agent-task-splitter)User must provide:
write plan ──► .coord/par_<topic>.yml
│
▼
┌──────────────────────────────────────┐
│ Iteration loop (cap = max_iterations): │
│ │
│ Act ─► delegate executes │
│ writes result.md │
│ │
│ Reflect ─► run critique source │
│ (test / subagent / │
│ eval / self) │
│ │
│ Pass? ─► YES → exit loop with PASS │
│ NO → continue if N < │
│ max_iterations │
│ │
│ N = max?─► YES → exit loop with │
│ `EXHAUSTED` — │
│ surface to user │
│ NO → continue │
│ │
│ Revise ─► update .coord/par_ │
│ <topic>.yml with │
│ learned-from-failure │
└──────────────────────────────────────┘
│
▼
write final summary → .coord/par_<topic>_final.md
+ promote learned principles → .coord/memory.yml
Exit conditions (be explicit, prevents runaway loops):
PASSmax_iterations without PASS → exit with status EXHAUSTED, surface to user with summary of all failed attemptserror (test infrastructure crash, delegate timeout, etc.) → exit with status ERROR, do NOT continueThe loop NEVER continues past max_iterations. The anti-pattern says
"don't go past 5"; the workflow enforces this by failing closed.
.coord/par_<topic>.yml — running state (plan + iteration history).coord/par_<topic>_final.md — final summary + lessons (≤ 500 words).coord/memory.yml (via agent-shared-memory)goal: "Stage 6 §RAG passes plain-language test"
acceptance_criterion: "subagent code-reviewer scores >= 8/10 on clarity"
max_iterations: 3
critique_source: subagent
delegate: claude-inline
iterations:
- n: 1
plan_summary: "Drop encyclopedic table; replace with prose + 3 concrete examples"
artifact: ".coord/par_rag_iter1.md"
critique:
score: 6
issues:
- "Examples still too abstract (no specific Yelp/database)"
- "DSPy reference confuses scope"
verdict: FAIL
revise: "Add concrete Yelp example; drop DSPy until next iteration"
- n: 2
plan_summary: "Apply iter-1 revisions"
artifact: ".coord/par_rag_iter2.md"
critique:
score: 8
issues:
- "Heading hierarchy still inconsistent"
verdict: CONDITIONAL PASS
revise: "Fix heading levels; minor polish"
- n: 3
plan_summary: "Final polish"
artifact: ".coord/par_rag_iter3.md"
critique:
score: 9
issues: []
verdict: PASS
final_status: PASS
total_cost_usd: 0.45
elapsed_minutes: 22
.coord/memory.yml. Iteration artifacts stay in
.coord/par_*.md and get archived after 14 days like other
.ai/ files.When: PAR loop enters iteration 3+, OR .coord/par_*.yml exceeds 8 KB.
Why: Main session that wrote the original plan + observed iteration 1+2 results doesn't need to re-read all artifacts in later iterations. A subagent can read the par_*.yml + recent iteration artifact + return a structured "should we iterate again or stop?" verdict.
Pattern:
Spawn `code-reviewer` subagent:
- Read .coord/par_<topic>.yml in full
- Read latest iteration artifact (.coord/par_<topic>_iterN.md)
- Apply critique source (test results / preset / etc.)
- Return: { verdict: PASS/CONDITIONAL/FAIL,
top 3 issues: [...],
recommend: continue/stop/escalate,
estimated_iterations_remaining: N }
Main session reads only the verdict.
Every agent boundary is a commit boundary (see global rule:
~/.claude/CLAUDE.md → "Commit Discipline for Multi-Agent Work").
Specific to this skill: each iteration is its own commit with
message par(iter-N): <plan_summary>. The final PASS iteration
commit can be followed by a par(final): merge to main commit
that includes the principle promotion to .coord/memory.yml.
This makes the PAR loop a commit-by-commit replay: a future
maintainer can git log --grep "par(iter" to see the full
self-correction history.
agent-task-splitter — write the initial planagent-shared-memory — promote learned principles after PAR convergesagent-acceptance-gate — can be the critique source for an iterationagent-debate — different tool (multi-agent disagreement). Use PAR
for single-agent self-correction; use debate for adjudicating between
two equally-valid options.[agent-plan-act-reflect]
Goal: <one-line goal>
Status: PASS after N iterations
Final artifact: <path>
Cost: ~$X.XX total
Promoted to memory: <list of principles, if any>
Iteration summary:
iter 1: FAIL (score 6/10) → revised plan
iter 2: CONDITIONAL (score 8/10) → minor polish
iter 3: PASS (score 9/10)
Time: ~N min wall-clock
Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub wenyuchiou/agent-collab-skills --plugin agent-collab-workspace