/groundwork:swarm-debug [bug description]from groundwork
Runs parallel adversarial debugging with multiple agent teams testing competing hypotheses simultaneously. Replaces standard ISOLATE phase with swarm investigation to fight anchoring bias.
Ships in groundwork. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Parallel adversarial investigation. Multiple teammates test competing hypotheses simultaneously, actively trying to disprove each other. Converges on root cause faster by fighting anchoring bias.
Core principle: One investigator anchors on their first theory. A team of investigators who must disprove each other cannot.
This skill extends the groundwork:debug workflow. Phases 1-2 and 4-5 follow that skill exactly. Phase 3 (ISOLATE) is replaced by parallel swarm investigation using Claude Code agent teams.
Your current effort level is {{effort_level}}. Skip this step silently if effort is high, xhigh, or max (the scale is low < medium < high < xhigh < max, so xhigh and max are already above high) AND you are Opus (1M context). Otherwise ask via AskUserQuestion (header "Model check"; options "Continue anyway" / "Cancel — I'll switch first"):
"Do you want to switch? Hypothesis generation quality determines whether the entire swarm investigates the right space.
Recommended: Opus (1M context) at high effort.
To switch: cancel, run
/model opus[1m]and/effort high, then re-invoke this skill."
If the user selects "Cancel — I'll switch first": output the switching commands and stop. Do not proceed with the skill. Ask once per conversation: a skill invoked by another skill skips this step when the recommendation was already shown. In a non-interactive run (--noninteractive, GROUNDWORK_RUNNER_MODE=true, or GROUNDWORK_BATCH_MODE=true), skip the prompt and continue on the current model.
This skill requires the agent teams experimental feature.
To enable:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS="1""experimentalAgentTeams": trueIf agent teams is not available: Fall back to the standard groundwork:debug skill and run Phase 3 sequentially. Note to the user that enabling agent teams would allow parallel investigation.
Use swarm debugging instead of standard debugging when:
Use standard debugging when:
UNDERSTAND → REPRODUCE → ISOLATE (SWARM) → FIX → VERIFY
│ │ │ │ │
└────────────┴────────────┴───────────────┴───────┘
│
DEBUG JOURNAL
{{debug_dir}}/{slug}-xxxxxx/journal.md
Follow the groundwork:debug skill's Phase 1 exactly.
Read the system. Check your assumptions. Don't touch anything yet. Trace the code path from input to failure. For multi-component systems, instrument at each boundary before forming hypotheses.
Create the debug journal at an invocation-unique path during this phase, following the groundwork:debug skill's journal discipline: derive the slug once (kebab-case of the bug's one-line description, max 40 chars), create the directory with the idempotent .debug/ gitignore append, allocate an atomically unique run directory (RUN_DIR="$(mktemp -d "{{debug_dir}}/${SLUG}-XXXXXX")"; JOURNAL_PATH="$RUN_DIR/journal.md"), migrate any legacy repository-root journal into place with visible commands, generate the literal journal path once, pass it to every hypothesis agent, return it in the final output, and locate prior run directories by slug prefix (ls -dt {{debug_dir}}/${SLUG}-*/) when resuming — if several match, use the handoff's literal path or ask the user; never a fixed name, never a shared current pointer.
Follow the groundwork:debug skill's Phase 2 exactly.
Make it fail consistently and on demand. Create a minimal reproduction. Document reproduction steps in the debug journal.
This is where swarm debugging diverges. Instead of testing hypotheses sequentially, spawn an agent team to investigate them in parallel.
From the evidence gathered in Phases 1-2, generate 3-5 falsifiable hypotheses. Each must be:
Record all hypotheses in the debug journal's ## Hypotheses section now, as its Active list — before any teammate is spawned — so a resumed swarm finds them.
Example:
## Hypotheses
### Active
1. Race condition in session middleware — concurrent requests overwrite session data
2. Database connection leak — pool exhaustion causes timeouts under load
3. Cache invalidation bug — stale user record served after profile update
4. Memory leak in request parser — GC pause causes intermittent 500s
Create one teammate per hypothesis. Each teammate's prompt must include:
Teammate spawn prompt template:
You are investigating a bug as part of a swarm debugging team.
## Bug Context
Reproduction steps: [the steps, briefly]
JOURNAL PATH: <the literal `$RUN_DIR/journal.md` allocated in Phase 1> — read it first, in full
## Your Hypothesis (#N of M)
[The specific hypothesis assigned to this teammate]
## All Hypotheses Being Investigated
[Full numbered list]
## Your Mission
1. Gather evidence to PROVE your hypothesis (#N). Be specific: file paths, line numbers, command outputs.
2. Gather evidence to DISPROVE at least one other hypothesis. Message that teammate with your findings.
3. If another teammate messages you with evidence against your hypothesis, evaluate it honestly. If it's valid, acknowledge it.
4. When you reach a conclusion (Confirmed/Eliminated/Inconclusive), message the team lead with your verdict and all supporting evidence.
## Rules
- READ ONLY. Do not edit source files or tests. You may add temporary logging for diagnostics.
- Cite every claim: file:line, command output, or log entry.
- Be adversarial. Your job is to find truth, not to confirm your assignment.
- If your hypothesis is wrong, say so. Eliminating a hypothesis is as valuable as confirming one.
While teammates investigate:
Call convergence when one of these conditions is met:
debug skill's "Corroborated" level, the minimum a fix requires. ("Verified" cannot be reached before the fix: only Phase 5 of debug grants it.)Do NOT call convergence prematurely. Wait for teammates to actively challenge each other's findings. Early agreement without adversarial testing is a red flag.
Record all teammate findings in the debug journal's ## Swarm Evidence section (see journal format below). Include:
Dismiss the agent team. Remove any temporary logging or instrumentation added by teammates.
Follow the groundwork:debug skill's Phase 4 exactly.
State the root cause with a verification level. Write a failing test using TDD. Make the minimal fix. The root cause was identified by the swarm — now the lead executes the fix directly.
Follow the groundwork:debug skill's Phase 5 exactly.
Run the failing test, full test suite, and original reproduction. Review the fix with fresh eyes. Check related code paths.
Same 3-fix limit as the debug skill. If your third fix attempt fails, stop and escalate.
Escalate with the report format in ${CLAUDE_PLUGIN_ROOT}/references/debug-escalation.md, filling its Swarm Investigation Summary with all teammate findings — the breadth of parallel investigation makes the escalation more valuable than a sequential one.
Use the same invocation-unique run-directory journal as the debug skill — the literal $RUN_DIR/journal.md you allocated in Phase 1 with RUN_DIR="$(mktemp -d "{{debug_dir}}/${SLUG}-XXXXXX")" — with an additional ## Swarm Evidence section:
# Debug: {slug}
## Status
[Active | Swarm Investigating | Root Cause Found | Fixed | Escalated]
## Symptoms
[same as debug skill]
## Reproduction
[same as debug skill]
## Hypotheses
[same as debug skill: the ranked hypotheses from Step 1 go under Active before any teammate is spawned; teammate verdicts then move them to Eliminated or confirm the root cause]
## Swarm Evidence
### Team Composition
| Teammate | Assigned Hypothesis | Status |
|----------|-------------------|--------|
| 1 | [hypothesis] | [Investigating/Concluded] |
| ... | ... | ... |
### Teammate Reports
#### Teammate 1: [Hypothesis summary]
**Verdict:** [Confirmed | Eliminated | Inconclusive]
**Evidence for:**
- [evidence with file:line citations]
**Evidence against:**
- [evidence with file:line citations]
**Cross-hypothesis findings:**
- [findings that affected other hypotheses]
#### Teammate 2: [Hypothesis summary]
[same structure]
### Convergence Decision
**Converged on:** [winning hypothesis or "no convergence"]
**Reasoning:** [why this hypothesis won / why investigation was inconclusive]
**Dissenting evidence:** [any remaining contradictions to address]
## Evidence Log
[same as debug skill]
## Root Cause
[same as debug skill]
## Fix
[same as debug skill]
## Resolution
[same as debug skill]
| Pitfall | Remedy |
|---|---|
| Spawning teammates before reproduction | Complete Phases 1-2 first. Teammates need shared context. |
| Too many hypotheses (>5) | Prioritize. More teammates means more noise, not more signal. |
| Too few hypotheses (<3) | If there's only one plausible theory, use standard debugging. |
| Teammates not challenging each other | Re-prompt with explicit adversarial instructions. Agreement without challenge is suspect. |
| Calling convergence too early | Wait for active disproof attempts. "No one disagreed" is not convergence. |
| Teammates editing code | Enforce read-only. Code conflicts between teammates waste more time than they save. |
| Ignoring dissenting evidence | Record it. If one teammate found contradicting evidence, the root cause analysis must address it. |
| Skipping cleanup | Remove all temporary logging/instrumentation before Phase 4. |
If agent teams is not available (feature not enabled or not supported):
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS="1". Falling back to sequential debugging."Skill(skill="groundwork:debug") and continue with its standard Phase 3 (sequential hypothesis testing)Parallel investigation → Adversarial disproof → Convergence → Fix with failing test → Verify
Otherwise → you're just running multiple guessers in parallel
The swarm's power is adversarial challenge, not parallel agreement. If your teammates aren't trying to prove each other wrong, you're not swarm debugging.
What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (etr/groundwork) — no native marketplace selected
npx claudepluginhub p/etr-groundwork44 skills in this plugin
/build-unplannedBuild a feature from a description with worktree isolation and TDD. Optional flag - --on-unrelated-failure stop-and-ask|expand-and-fix|ignore-and-merge - how validation treats gate failures unrelated to the active project (default stop-and-ask)./check-specs-alignmentVerify alignment between code and specs./create-tasksGenerate implementation tasks from architecture document./debugUse when investigating bugs, unexpected behavior, test failures, or any code that does not work as expected - enforces systematic root cause analysis before any fix/design-architectureUse when the user asks to design system architecture, make architectural decisions, or translate PRD into technical design/design-it-twiceUse before committing to a non-trivial module, service boundary, or public API - generate 2-3 divergent interface designs, compare them on depth/locality/seam, and recommend oneOther plugins' skills for the same job