gstack-investigate
Skill2 starsChanged 23 days agoApache-2.0View on GitHub
Systematic debugging with root cause investigation. (gstack)
2 other projects use a version of this, 1 of them edited.
Adopted by
Most recently taken up by
- robertkarl/rkstackedited, first seen Oct 20, 2026
- sagnikmitra/skillstheir own version, first seen Jun 8, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- robertkarl/rkstack★ 021% same
Wrote their own version · 1
- sagnikmitra/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository40 other files it gives its agents.
- caveman-commitSkill
- caveman-reviewSkill
- cavemanSkill
- gstack-autoplanSkill
- gstack-carefulSkill
- gstack-csoSkill
- gstack-design-reviewSkill
- gstack-freezeSkill
- gstack-guardSkill
- gstack-office-hoursSkill
- gstack-plan-ceo-reviewSkill
- gstack-plan-design-reviewSkill
- gstack-plan-devex-reviewSkill
- gstack-plan-eng-reviewSkill
- gstack-qaSkill
- gstack-retroSkill
- gstack-reviewSkill
- gstack-shipSkill
- ponytail-auditSkill
- ponytail-debtSkill
- ponytail-reviewSkill
- ponytailSkill
- brainstormingSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-git-worktreesSkill
- using-superpowersSkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
- tandem-db-safetySkill
- tandem-harnessSkill
- tandem-reviewSkill
- tandem-worktree-etiquetteSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 15 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈15
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use when asked to "debug this", "fix this bug", "why is this broken", "investigate this error", or "root cause analysis".
- Distinctive: line 35
Collect symptoms: Read the error messages, stack traces, and reproduction steps.
- Distinctive: line 47
Check investigation history: Search prior learnings for investigations on the same files.
- Distinctive: line 51
After forming your root cause hypothesis, lock edits to the affected module to prevent scope creep.
- Distinctive: line 71
If the bug spans the entire repo or the scope is genuinely unclear, skip the lock and note why.
- Distinctive: line 79
Check if this bug matches a known pattern:
- Distinctive: line 94
External pattern search: If the bug doesn't match a known pattern above, WebSearch for:
- Distinctive: line 98
If WebSearch is unavailable, skip this search and proceed with hypothesis testing.
- Distinctive: line 104
Before writing ANY fix, verify your hypothesis.
- Distinctive: line 106
Confirm the hypothesis: Add a temporary log statement, assertion, or debug output at the suspected root cause.
- Distinctive: line 110
3-strike rule: If 3 hypotheses fail, STOP.
- Distinctive: line 141
If the fix touches >5 files: Use ask-the-user to flag the blast radius:
- Distinctive: line 155
Run the test suite and paste the output.
- Distinctive: line 180
Never apply a fix you cannot verify: If you can't reproduce and confirm, don't ship it.
- Distinctive: line 181
Never say "this should fix it.": Verify and prove it. Run the tests.
≈ “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
Tandem vendoring note. Vendored from gstack (MIT, (c) Garry Tan, https://github.com/garrytan/gstack @ a3259400). The upstream Claude-Code-specific boilerplate (telemetry, session tracking, update checks, plan-mode hooks, learnings/brain sync) was removed; the workflow itself is unchanged. Paths below are relative to this skill's directory; sibling skills live at
../<id>/(ids are prefixedgstack-).$GSTACK_ROOTis an optional upstream gstack install (default~/.claude/skills/gstack) needed only for optional helpers such as thebrowsebinary; skip any step that needs it when it is absent. "Ask the user" means a plain chat question when no structured question tool exists.
When to invoke this skill
Four phases: investigate, analyze, hypothesize, implement. Iron Law: no fixes without root cause. Use when asked to "debug this", "fix this bug", "why is this broken", "investigate this error", or "root cause analysis". Proactively invoke this skill (do NOT debug directly) when the user reports errors, 500 errors, stack traces, unexpected behavior, "it was working yesterday", or is troubleshooting why something stopped working.
Iron Law
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST.
Fixing symptoms creates whack-a-mole debugging. Every fix that doesn't address root cause makes the next bug harder to find. Find the root cause, then fix it.
Phase 1: Root Cause Investigation
Gather context before forming any hypothesis.
- Collect symptoms: Read the error messages, stack traces, and reproduction steps. If the user hasn't provided enough context, ask ONE question at a time via ask-the-user.
- Read the code: Trace the code path from the symptom back to potential causes. Use Grep to find all references, Read to understand the logic.
- Check recent changes:
Was this working before? What changed? A regression means the root cause is in the diff.git log --oneline -20 -- <affected-files> - Reproduce: Can you trigger the bug deterministically? If not, gather more evidence before proceeding.
- Check investigation history: Search prior learnings for investigations on the same files. Recurring bugs in the same area are an architectural smell. If prior investigations exist, note patterns and check if the root cause was structural.
Scope Lock
After forming your root cause hypothesis, lock edits to the affected module to prevent scope creep.
_FREEZE_SCRIPT="${CLAUDE_SKILL_DIR}/../freeze/bin/check-freeze.sh"
[ -x "$_FREEZE_SCRIPT" ] || _FREEZE_SCRIPT="${CLAUDE_SKILL_DIR}/../gstack-freeze/bin/check-freeze.sh"
[ -x "$_FREEZE_SCRIPT" ] && echo "FREEZE_AVAILABLE" || echo "FREEZE_UNAVAILABLE"If FREEZE_AVAILABLE: Identify the narrowest directory containing the affected files. Write it to the freeze state file:
eval "$($GSTACK_ROOT/bin/gstack-paths)"
STATE_DIR="$GSTACK_STATE_ROOT"
mkdir -p "$STATE_DIR"
echo "<detected-directory>/" > "$STATE_DIR/freeze-dir.txt"
echo "Debug scope locked to: <detected-directory>/"Substitute <detected-directory> with the actual directory path (e.g., src/auth/). Tell the user: "Edits restricted to <dir>/ for this debug session. This prevents changes to unrelated code. Run /unfreeze to remove the restriction."
If the bug spans the entire repo or the scope is genuinely unclear, skip the lock and note why.
If FREEZE_UNAVAILABLE: Skip scope lock. Edits are unrestricted.
Phase 2: Pattern Analysis
Check if this bug matches a known pattern:
| Pattern | Signature | Where to look |
| Race condition | Intermittent, timing-dependent | Concurrent access to shared state |
| Nil/null propagation | NoMethodError, TypeError | Missing guards on optional values |
| State corruption | Inconsistent data, partial updates | Transactions, callbacks, hooks |
| Integration failure | Timeout, unexpected response | External API calls, service boundaries |
| Configuration drift | Works locally, fails in staging/prod | Env vars, feature flags, DB state |
| Stale cache | Shows old data, fixes on cache clear | Redis, CDN, browser cache, Turbo |
Also check:
TODOS.mdfor related known issuesgit logfor prior fixes in the same area — recurring bugs in the same files are an architectural smell, not a coincidence
External pattern search: If the bug doesn't match a known pattern above, WebSearch for:
- "{framework} {generic error type}" — sanitize first: strip hostnames, IPs, file paths, SQL, customer data. Search the error category, not the raw message.
- "{library} {component} known issues"
If WebSearch is unavailable, skip this search and proceed with hypothesis testing. If a documented solution or known dependency bug surfaces, present it as a candidate hypothesis in Phase 3.
Phase 3: Hypothesis Testing
Before writing ANY fix, verify your hypothesis.
- Confirm the hypothesis: Add a temporary log statement, assertion, or debug output at the suspected root cause. Run the reproduction. Does the evidence match?
- If the hypothesis is wrong: Before forming the next hypothesis, consider searching for the error. Sanitize first — strip hostnames, IPs, file paths, SQL fragments, customer identifiers, and any internal/proprietary data from the error message. Search only the generic error type and framework context: "{component} {sanitized error type} {framework version}". If the error message is too specific to sanitize safely, skip the search. If WebSearch is unavailable, skip and proceed. Then return to Phase 1. Gather more evidence. Do not guess.
- 3-strike rule: If 3 hypotheses fail, STOP. Use ask-the-user:
3 hypotheses tested, none match. This may be an architectural issue rather than a simple bug. A) Continue investigating — I have a new hypothesis: [describe] B) Escalate for human review — this needs someone who knows the system C) Add logging and wait — instrument the area and catch it next time
Red flags — if you see any of these, slow down:
- "Quick fix for now" — there is no "for now." Fix it right or escalate.
- Proposing a fix before tracing data flow — you're guessing.
- Each fix reveals a new problem elsewhere — wrong layer, not wrong code.
Phase 4: Implementation
Once root cause is confirmed:
- Fix the root cause, not the symptom. The smallest change that eliminates the actual problem.
- Minimal diff: Fewest files touched, fewest lines changed. Resist the urge to refactor adjacent code.
- Write a regression test that:
- Fails without the fix (proves the test is meaningful)
- Passes with the fix (proves the fix works)
- Run the full test suite. Paste the output. No regressions allowed.
- If the fix touches >5 files: Use ask-the-user to flag the blast radius:
This fix touches N files. That's a large blast radius for a bug fix. A) Proceed — the root cause genuinely spans these files B) Split — fix the critical path now, defer the rest C) Rethink — maybe there's a more targeted approach
Phase 5: Verification & Report
Fresh verification: Reproduce the original bug scenario and confirm it's fixed. This is not optional.
Run the test suite and paste the output.
Output a structured debug report:
DEBUG REPORT
════════════════════════════════════════
Symptom: [what the user observed]
Root cause: [what was actually wrong]
Fix: [what was changed, with file:line references]
Evidence: [test output, reproduction attempt showing fix works]
Regression test: [file:line of the new test]
Related: [TODOS.md items, prior bugs in same area, architectural notes]
Status: DONE | DONE_WITH_CONCERNS | BLOCKED
════════════════════════════════════════Log the investigation as a learning for future sessions. Use type: "investigation" and include the affected files so future investigations on the same area can find this:
$GSTACK_ROOT/bin/gstack-learnings-log '{"skill":"investigate","type":"investigation","key":"ROOT_CAUSE_KEY","insight":"ROOT_CAUSE_SUMMARY","confidence":9,"source":"observed","files":["affected/file1.ts","affected/file2.ts"]}'Important Rules
- 3+ failed fix attempts → STOP and question the architecture. Wrong architecture, not failed hypothesis.
- Never apply a fix you cannot verify. If you can't reproduce and confirm, don't ship it.
- Never say "this should fix it." Verify and prove it. Run the tests.
- If fix touches >5 files → ask-the-user about blast radius before proceeding.
- Completion status:
- DONE — root cause found, fix applied, regression test written, all tests pass
- DONE_WITH_CONCERNS — fixed but cannot fully verify (e.g., intermittent bug, requires staging)
- BLOCKED — root cause unclear after investigation, escalated
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.

