npx claudepluginhub unclejobs-ai/second-claude-code --plugin second-claude-codeThis skill uses the workspace's default tool permissions.
references/decomposition-guide.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Verify task independence before parallel execution.
Decompose large knowledge work tasks into independent parallel units, each executed in its own worktree.
Inspired by Claude Code's /batch command — designed for high-volume, homogeneous content production.
Dispatch an Explore agent to understand the full scope of the request:
write)?Break the task into 2–10 independent units. Each unit specification must include:
unit:
id: <integer, 1-indexed>
label: <short human-readable title>
topic: <specific topic for this unit — no overlap with other units>
skill: <write|research|analyze|review|refine>
output: <file path: .captures/batch-{run_id}/{slug}.md>
shared_context: <reference to shared context block>
Independence requirements (non-negotiable):
Unit count limits:
--units NPresent the full decomposition plan to the user before any execution begins. This gate is mandatory — no exceptions.
Present as a table:
| # | Label | Topic | Skill | Output File |
|---|---|---|---|---|
| 1 | ... | ... | write | .captures/batch-{run_id}/01-slug.md |
| 2 | ... | ... | write | .captures/batch-{run_id}/02-slug.md |
Show: total units, estimated cost (units × avg token cost), parallelism setting.
Wait for explicit approval. On rejection: re-decompose with user's feedback and re-present.
After approval, spawn one agent per unit. Each agent runs in an isolated worktree:
isolation: worktree
worktree_path: worktree-batch-{run_id}-unit-{id}
Concurrency is capped at --parallel (default: 3). Units beyond the cap queue and start as slots open.
Each unit agent receives:
Track status per unit: PENDING | RUNNING | DONE | FAILED.
Print a live status table as units complete. On unit failure:
After all units complete (or time out), produce a Batch Summary Report:
## Batch Summary — {topic} ({YYYY-MM-DD})
Units: {done}/{total} completed
Failed: {failed_ids} (if any)
### Output Files
| # | Label | Status | Path |
|---|-------|--------|------|
...
### Synthesis
{Optional: if --synthesize is set, produce a combined document merging all outputs}
### Failures
{For each failed unit: label, error summary, recommended action}
Save report to .captures/batch-{run_id}/00-summary.md.
| Flag | Values | Default | Effect |
|---|---|---|---|
--units N | integer 2–20 | auto (up to 10) | Override max unit count |
--skill | write|research|analyze|refine | write | Skill each unit runs |
--topic | string | (required) | The overarching topic being decomposed |
--parallel | integer 1–5 | 3 | Max concurrent unit agents |
--synthesize | flag | off | After all units complete, merge outputs into one document |
--lang | ko|en | ko | Output language passed to each unit skill |
--format | write-skill formats | article | Passed to each unit's write skill |
State persisted at .data/state/batch-{run_id}.json. Schema:
{
"run_id": "batch-{timestamp}",
"topic": "...",
"status": "PENDING | RUNNING | DONE | FAILED",
"units": [...],
"parallel": 3,
"created_at": "ISO-8601",
"completed_at": "ISO-8601 | null"
}
explorer: { model: haiku, tools: [Read], constraint: "scope analysis only, no writing" }
decomposer: { model: sonnet, tools: [], constraint: "produce unit specs, verify independence" }
unit_agent: { model: varies, isolation: worktree, constraint: "run assigned skill, write to assigned output path only" }
synthesizer: { model: opus, tools: [Read, Write], constraint: "merge outputs faithfully, no hallucinated content" }
workflow instead.See references/decomposition-guide.md for split strategies, anti-patterns, and merge strategies.