investigation-state
Skill8 starsChanged 6 months agoMITView on GitHub
Persists debugging investigation context (hypotheses, evidence, eliminated approaches) across sessions. Companion to systematic-debugging. Use when starting, resuming, or handing off a multi-turn debugging session.
In this repository129 other files it gives its agents.
- AGENTS.mdAGENTS.md
- guidance/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- guidance/CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- blast-radius-checkSkill
- brainstormingSkill
- branch-flow-gateSkill
- branch-sync-gateSkill
- codebase-reconSkill
- codeowners-drift-auditSkill
- code-review-batterySkill
- cognitive-complexity-refactoringSkill
- debateSkill
- debug-conductorSkill
- dispatching-parallel-agentsSkill
- domain-buildSkill
- evidence-adjudicatorSkill
- executing-plansSkill
- external-cli-auditSkill
- feature-developmentSkill
- field-rename-verificationSkill
- finishing-a-development-branchSkill
- git-branch-conventionsSkill
- gitlab-cliSkill
- hotfix-charterSkill
- implementation-trackerSkill
- incident-revert-reviewSkill
- infra-config-investigatorSkill
- kernel-splitSkill
- llm-behavior-investigatorSkill
- llm-skill-reviewSkill
- merge-authorization-gateSkill
- micro-harsh-reviewSkill
- output-verificationSkill
- pre-commit-gateSkill
- progressive-code-review-gateSkill
- progressive-harsh-reviewSkill
- providing-code-reviewSkill
- pr-triage-gateSkill
- push-authorization-gateSkill
- receiving-code-reviewSkill
- reproduction-experiment-investigatorSkill
- requesting-code-reviewSkill
- requirements-validation-pmSkill
- requirements-validationSkill
- scope-tripwireSkill
- session-handoffSkill
- skills-hierarchy-tuningSkill
- sp-bughuntSkill
- state-consistency-investigatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- timeline-trace-investigatorSkill
- token-estimationSkill
- unified-commit-gateSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 39
think-twice: When investigation hits a wall
- Very specific: line 53
Create ~/.superpowers/investigations/ on first use if it doesn't exist.
- Distinctive: line 67
→ ABANDONED: No longer relevant. Record reason.
- Very specific: line 94
Anti-pattern: Do NOT write investigation JSON manually with heredocs, jq, or inline Python.
- Distinctive: line 112
If > 10 hypotheses: prompt for consolidation (likely scope creep)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Investigation State
Wrong skill? Debugging →
systematic-debugging. Getting unstuck →think-twice. Requirements analysis →requirements-validation.Purpose: Persist debugging investigation context across sessions so no hypothesis, evidence, or eliminated approach is lost. Storage:
~/.superpowers/investigations/<uuid>.jsonAuthoritative format: JSON. Markdown export is read-only.
Announce at start: "I'm using the investigation-state skill to track this investigation."
Companion Skills
- systematic-debugging: Step-by-step bug investigation
- adversarial-search: Confirmation bias prevention during investigation
- think-twice: When investigation hits a wall
- failure-autopsy: Post-mortem analysis
When to Use
- Starting a new multi-turn debugging session
- Resuming a previous investigation after context loss
- Handing off an investigation to another agent or session
- Checking what has already been tried ("what have we tried?")
- Saving a checkpoint before ending a session
Core Principles
- JSON is authoritative. Markdown is a read-only export for handoff.
- Create
~/.superpowers/investigations/on first use if it doesn't exist.
Session Start: Stale Investigation Check
- List
*.jsonin~/.superpowers/investigations/ - Files with
updated> 7 days → prompt: "Resolve, abandon, or resume?" - Active within 7 days → resume (one) or list for selection (multiple)
Investigation Lifecycle
States: active → paused / resolved / abandoned
- → PAUSED: Session ending or blocked. Run
exportmanually. Record next steps viaupdate --next-steps. - → RESOLVED: Root cause confirmed. Create fix TODO tagged
#investigation-<short-id>if needed. - → ABANDONED: No longer relevant. Record reason.
- PAUSED → ACTIVE: Load JSON, display summary, continue from next steps.
Tooling
Use investigation-crud.sh for ALL investigation operations. It handles directory creation, atomic writes, UUID generation, advisory locking, backup, and schema validation.
# Core operations
investigation-crud.sh create --title "Bug title" [--observed OBS] [--expected EXP] [--reproduction REP]
investigation-crud.sh list [--status active] [--stale]
investigation-crud.sh show --id UUID
investigation-crud.sh export --id UUID
# Hypothesis tracking
investigation-crud.sh add-hypothesis --id UUID --text "Hypothesis text"
investigation-crud.sh add-evidence --id UUID --hypothesis N --source SRC --finding TEXT
investigation-crud.sh set-verdict --id UUID --hypothesis N --verdict confirmed|rejected|inconclusive [--reason TEXT]
# Lifecycle
investigation-crud.sh add-eliminated --id UUID --approach "What was tried" --reason "Why it failed"
investigation-crud.sh set-status --id UUID --status paused|resolved|abandoned [--resolution-type fix-needed] [--summary TEXT]
investigation-crud.sh update --id UUID [--next-steps "step1|step2"] [--current-theory N] [--add-ticket TST-123]Anti-pattern: Do NOT write investigation JSON manually with heredocs, jq, or inline Python. Use investigation-crud.sh.
Starting a New Investigation
investigation-crud.sh create --title "Bug title" --observed "..." --expected "..." --reproduction "..."- Note the returned
idandshort_id - Form first hypothesis:
investigation-crud.sh add-hypothesis --id UUID --text "..." - Begin evidence gathering
Hypothesis Tracking
Each hypothesis: {id, text, evidence: [{source, finding, timestamp}], verdict: null|confirmed|rejected|inconclusive, verdict_reason}
investigation-crud.sh add-hypothesis --id UUID --text "..."→ gather evidenceinvestigation-crud.sh add-evidence --id UUID --hypothesis N --source SRC --finding TEXTinvestigation-crud.sh set-verdict --id UUID --hypothesis N --verdict confirmed --reason "..."- If > 10 hypotheses: prompt for consolidation (likely scope creep)
Evidence sources: freeform strings (db:example-conn, ci:<project>, linear, local:grep, etc.)
Eliminated Approaches
Track approaches that were tried and failed (distinct from hypotheses):
investigation-crud.sh add-eliminated --id UUID --approach "Restarted the API service" --reason "Data still stale after restart"This prevents future agents from retrying failed approaches.
Persistence
investigation-crud.sh handles all persistence automatically:
- Atomic writes (temp file +
os.replace) - Auto-updates
updatedtimestamp on every write - Creates
~/.superpowers/investigations/and.gitignoreon first use - Schema: see
references/schema.md
Concurrent Investigations
UUID-based filenames. One active → resume. Multiple active → investigation-crud.sh list --status active, agent picks one.
Markdown Export
Generate on demand for pause/handoff:
investigation-crud.sh export --id UUIDRules: verdict: null → ACTIVE. currentTheory → ← CURRENT THEORY suffix. Generated on demand only, not auto-synced.
Failure Modes
| Failure | Fix |
| Forgot to update JSON after verdict | Always write JSON immediately after each hypothesis verdict |
| Retried an eliminated approach | Check eliminated array before trying any approach |
| Lost investigation on session end | Pause with set-status --status paused, then export before ending |
| JSON corruption from interrupted write | Atomic write pattern (temp + mv) prevents this |
| Investigation scope creep (>10 hypotheses) | Prompt for consolidation — likely multiple bugs |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

