agentleFS
OrionArchitektonOrionArchitekton/orion-skills/skills/investigate/SKILL.md

investigate

Skill2 starsChanged 14 days agoMITView on GitHub

Systematic debugging with root cause investigation. 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.

129 other projects use a version of this, 12 of them edited.

Adopted by

Most recently taken up by

Used with

Projects with it also use pair-agent, plan-devex-review and 9 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • seek888Skill

    pair-agent

    Pair a remote AI agent with your browser. One command generates a setup key and prints instructions the other agent can follow to connect. Works with OpenClaw, Hermes, Codex, Cursor, or any agent that can make HTTP requests. The remote agent gets its own tab with scoped access (read+write by default, admin on request). Use when asked to "pair agent", "connect agent", "share browser", "remote browser", "let another agent use my browser", or "give browser access". (gstack) Voice triggers (speech-to-text aliases): "pair agent", "connect agent", "share my browser", "remote browser access".

    Also in 10 projects that use this

  • seek888Skill

    plan-devex-review

    Interactive developer experience plan review. Explores developer personas, benchmarks against competitors, designs magical moments, and traces friction points before scoring. Three modes: DX EXPANSION (competitive advantage), DX POLISH (bulletproof every touchpoint), DX TRIAGE (critical gaps only). Use when asked to "DX review", "developer experience audit", "devex review", or "API design review". Proactively suggest when the user has a plan for developer-facing products (APIs, CLIs, SDKs, libraries, platforms, docs). (gstack) Voice triggers (speech-to-text aliases): "dx review", "developer experience review", "devex review", "devex audit", "API design review", "onboarding review".

    Also in 13 projects that use this

  • ShreyRaviSkill

    landing-report

    Read-only queue dashboard for workspace-aware ship. Shows which VERSION slots are currently claimed by open PRs, which sibling Conductor workspaces have WIP work likely to ship soon, and what slot /ship would pick next. No mutations — just a snapshot. Use when asked to "landing report", "what's in the queue", "show me open PRs", or "which version do I claim next". (gstack)

    Also in 7 projects that use this

  • ayudaySkill

    setup-deploy

    Configure deployment settings for /land-and-deploy. Detects your deploy platform (Fly.io, Render, Vercel, Netlify, Heroku, GitHub Actions, custom), production URL, health check endpoints, and deploy status commands. Writes the configuration to CLAUDE.md so all future deploys are automatic. Use when: "setup deploy", "configure deployment", "set up land-and-deploy", "how do I deploy with gstack", "add deploy config".

    Also in 14 projects that use this

  • ayudaySkill

    cso

    Chief Security Officer mode. Performs OWASP Top 10 audit, STRIDE threat modeling, attack surface analysis, auth flow verification, secret detection, dependency CVE scanning, supply chain risk assessment, and data classification review. Use when: "security audit", "threat model", "pentest review", "OWASP", "CSO review".

    Also in 17 projects that use this

  • GeiserXSkill

    docs-loop

    Use when the user asks to audit docs, check documentation for stale claims, or verify docs against the code.

    Also in 3 projects that use this

  • +1 more from seek888

The file

Show its rules and text

We split this skill into the rules it gives an agent

13 rules. 0 are common, 12 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 116 edited versions we read keep these.

  • 12

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Collect symptoms: Read the error messages, stack traces, and reproduction steps.

    line 26
  2. Distinctive:

    Check investigation history: Search prior learnings for investigations on the same files.

    line 44
  3. Distinctive:

    Check if this bug matches a known pattern:

    line 54
  4. Distinctive:

    External pattern search: If the bug doesn't match a known pattern above, WebSearch for:

    line 69
  5. Distinctive:

    If WebSearch is unavailable, skip this search and proceed with hypothesis testing.

    line 73
  6. Distinctive:

    Before writing ANY fix, verify your hypothesis.

    line 79
  7. Distinctive:

    3-strike rule: If 3 hypotheses fail, STOP.

    line 85
  8. Distinctive:

    Red flags: if you see any of these, slow down:

    line 95
  9. Distinctive:

    If the fix touches >5 files: Use AskUserQuestion to flag the blast radius:

    line 116
  10. Very specific:

    Instrumentation cleanup: Remove all temporary probes (grep the [DEBUG-...] prefix and confirm none survive) and delete any throwaway repro …

    line 130
  11. Distinctive:

    Run the test suite and paste the output.

    line 132
  12. Distinctive:

    Never apply a fix you cannot verify: If you can't reproduce and confirm, don't ship it.

    line 153
  13. Distinctive:

    Never say "this should fix it.": Verify and prove it. Run the tests.

    line 154

“Common” is measured: kept by at least 6 in 10 of the 116 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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.

  1. 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 AskUserQuestion.
  2. 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.
  3. Check recent changes:
    git log --oneline -20 -- <affected-files>
    Was this working before? What changed? A regression means the root cause is in the diff.
  4. Build a red-capable reproduction: this is the GATE, not a soft step. Before forming ANY hypothesis (Phase 3), you must be able to name ONE command (a failing test, curl/HTTP script, CLI invocation, replayed trace, or throwaway harness) that you have already run at least once (paste the invocation + its output) and that is:

    • Red-capable: drives the actual bug code path and asserts the user's exact symptom, so it goes red on this bug and green once fixed (not merely "runs without erroring").
    • Deterministic: same verdict every run. For non-deterministic bugs the goal is not a clean repro but a high reproduction rate: loop the trigger 100 times, parallelise, add stress/sleeps/narrow timing (a 50%-flake bug is debuggable, a 1% one is not, so keep raising the rate until it is).
    • Fast: seconds, not minutes (cache setup, skip unrelated init, narrow scope).
    • Agent-runnable: runnable unattended; only put a human in the loop via the structured HITL script ${CLAUDE_SKILL_DIR}/scripts/hitl-loop.template.sh.

    If you catch yourself reading code to build a theory before this command exists, STOP: jumping straight to a hypothesis is the exact failure this skill prevents. No red-capable command, no Phase 3. If you genuinely cannot build one, say so explicitly, list what you tried, and ask the user for repro access / a captured artifact (HAR, log dump, core dump, timestamped recording) / permission to add temporary instrumentation; do not proceed to hypothesise without a loop. (Adapted from mattpocock/skills diagnosing-bugs.)

  5. 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, identify the narrowest directory containing the affected files and stay within it for the rest of the investigation, to prevent scope creep. If the bug spans the entire repo or the scope is genuinely unclear, skip the lock and note why.


Phase 2: Pattern Analysis

Check if this bug matches a known pattern:

PatternSignatureWhere to look
Race conditionIntermittent, timing-dependentConcurrent access to shared state
Nil/null propagationNoMethodError, TypeErrorMissing guards on optional values
State corruptionInconsistent data, partial updatesTransactions, callbacks, hooks
Integration failureTimeout, unexpected responseExternal API calls, service boundaries
Configuration driftWorks locally, fails in staging/prodEnv vars, feature flags, DB state
Stale cacheShows old data, fixes on cache clearRedis, CDN, browser cache, Turbo

Also check:

  • TODOS.md for related known issues
  • git log for 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.

  1. Confirm the hypothesis: Add a temporary log statement, assertion, or debug output at the suspected root cause. Run the reproduction. Does the evidence match? Prefer one debugger breakpoint / REPL inspection over ten logs; never "log everything and grep." Tag every temporary probe with a unique prefix (e.g. [DEBUG-a4f2]) so cleanup is a single grep: untagged logs survive, tagged logs die.
  2. 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. 3-strike rule: If 3 hypotheses fail, STOP. Use AskUserQuestion:
    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:

  1. Fix the root cause, not the symptom. The smallest change that eliminates the actual problem.
  2. Minimal diff: Fewest files touched, fewest lines changed. Resist the urge to refactor adjacent code.
  3. Write a regression test that:
    • Fails without the fix (proves the test is meaningful)
    • Passes with the fix (proves the fix works)
  4. Run the full test suite. Paste the output. No regressions allowed.
  5. If the fix touches >5 files: Use AskUserQuestion 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.

Instrumentation cleanup: Remove all temporary probes (grep the [DEBUG-...] prefix and confirm none survive) and delete any throwaway repro harness (or move it to a clearly-marked debug location).

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 durable learning for future sessions using the learn-capture skill: capture the root cause summary and the affected files so future investigations on the same area can find it.

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 → AskUserQuestion 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

Boundary

This is a debugging-discipline skill, not a tool or environment wrapper. How you capture a stack trace, which test runner or REPL you use, and how your repo's CI reports results are your own project's conventions. The invariant is the shape: no hypothesis before a red-capable reproduction exists, no fix without a regression test that fails before and passes after, and escalate after three failed hypotheses rather than guessing a fourth.

References (progressive disclosure)

To keep this skill lean, depth was moved to references/ (load only when needed):

  • references/preamble.md: retired; was a runtime preamble tied to a toolchain no longer present, not required for this skill's core flow.

Attribution

See source and modification history and the upstream license notices in this skill directory; retain them when copying the skill.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.