skills/competing-hypotheses/SKILL.md
Debug problems by investigating multiple hypotheses in parallel. Use when you have a bug, unexpected behaviour, or mystery where the root cause is unclear. Spawns parallel investigator agents each pursuing a different theory, then compares evidence to identify the most likely cause and fix.
npx skillsauth add shhac/skills competing-hypothesesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Debug problems by racing multiple theories in parallel. Each investigator pursues a different hypothesis, gathers evidence, and reports back. The lead compares findings to identify the root cause.
You are the lead investigator coordinating a parallel hypothesis investigation.
Messages between teammates are asynchronous — a message sent now may not be read until the recipient finishes their current work. You cannot rely on message timing for coordination. Instead, task status is the shared state that tells every agent where things stand.
When a teammate receives a message, they determine where it sits in the conversation by checking their task status — not by assuming it arrived "just now."
| Status | Who sets it | Meaning |
|--------|------------|---------|
| pending | Lead | Not started, waiting for assignment |
| in_progress | Teammate | Working, or finished and parked waiting for lead to acknowledge |
| completed | Lead only | Lead has read the teammate's report — this IS the acknowledgment |
The lead marks tasks completed — not the teammate. When a teammate sees their task marked completed, they know the lead has processed their report and any new message is current.
Include these rules in every teammate's spawn prompt:
in_progress when you begin workTaskGet — the task description contains everything you need (fix details, implementation instructions, etc.). Do NOT search the filesystem or other agents' files for this content.SendMessage, then park — stop all work, do not check TaskList or claim new tasks. Just wait.TaskGet:
in_progress → lead hasn't acknowledged your report yet. This message may pre-date your report. Reply with your current state instead of re-executing.completed → lead has processed your report. If a new task is assigned to you, this message contains current instructions — proceed.completed (your acknowledgment)completed and the new task is created/assignedTaskList — check that all relevant tasks show the expected status, don't track messages mentallygit status to confirm a clean working tree before proceedingTeamCreateTaskCreategeneral-purpose teammate per hypothesis using Task with team_name
race-condition-investigator, data-corruption-investigator)SendMessagecompleted (acknowledging the report) and give the user brief progress updatesInclude the following in each investigator's prompt:
Use subagents (
Tasktool) to keep your context focused. Spawn subagents for:
- Exploring specific files, modules, or subsystems
- Searching through git history, logs, or large codebases
- Any research tangent that might not pan out
Each subagent should report back:
- Relevant findings — what it discovered that matters to your investigation
- Red herrings (1-2 sentences) — anything that looks related but isn't, and why. Calling these out early prevents wasted cycles re-exploring dead ends.
Report red herrings even when your main findings are conclusive — they prevent other agents from re-exploring the same dead ends.
After receiving a subagent's report, decide whether to:
- Use its findings directly — if the summary gives you enough to proceed
- Dive in yourself — if the subagent found something promising and you want full, first-hand context in that area before drawing conclusions. Examples: conflicting evidence that needs direct examination, low confidence in the subagent's assessment, or complex state/flow where first-hand context matters.
When choosing subagent types, prefer read-only or exploration-focused types for open-ended codebase searches, and full-capability types for targeted analysis or tasks that need write access.
Each investigator should:
## Hypothesis: {description}
### Evidence For
- {evidence point}: {where found, what it means}
### Evidence Against
- {evidence point}: {where found, what it means}
### Red Herrings
- {code paths or areas explored that looked related but weren't, and why}
### Confidence: {high/medium/low}
### Root Cause (if found)
{specific root cause, file, line, mechanism}
### Suggested Fix
{what to change and why}
### Open Questions
- {anything unresolved that could help narrow it down}
completed in TaskList, compare findings:
Skip this phase if the user only wanted diagnosis, not a fix.
completed (your acknowledgment).
e. Run git status to confirm a clean working treeTaskList that all implementation tasks are completed and git status shows a clean working tree. Then spawn a fresh validator teammate. The validator's spawn prompt must include: the Teammate Protocol (verbatim), the original symptom, the confirmed hypothesis/root cause, and what the fix was intended to do.TaskUpdate status, not message timing. Always check TaskList to verify state.completed — only the lead marks tasks completed. This is the acknowledgment that closes the loop.TaskGet their assigned task to find everything they need. Do NOT search the filesystem for instructions.development
Audit a codebase's module boundaries — enumerate modules, map their seams (import edges between modules), produce a layered topology diagram, and classify each module as narrow, hub-by-design, or accidental hub (with separate flags for cycles, layer violations, and uncertain import graphs). Outputs a diagram plus a flagged-for-review list; does not change code. Use when assessing whether abstractions live at the right boundaries, before/after a refactor to verify the boundaries improved, or when an unfamiliar codebase needs an architectural map. Not for intra-module refactoring (see improve-code-structure), bug hunting, or feature work.
testing
Investigate and solve problems using a team of specialist agents. Use when facing complex, multi-faceted problems that benefit from parallel research and structured implementation.
tools
Sync a forked repository with its upstream. Fetches both remotes, shows divergence, resets shared branches to upstream, re-merges local-only branches, cleans up branches already merged upstream, and pushes. Use when upstream has accepted PRs or moved ahead and you need to bring your fork in line.
data-ai
Manage stacked branches — rebase cascades, detect landed PRs, show stack status. Use when branches are stacked (B on A on main), trunk has advanced, a mid-stack branch changed, or a PR has landed and descendants need rebasing. Lightweight alternative to Graphite that infers the stack from git history.