Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/simonwjackson-se-debug
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/se-debug
What's inside
- Skill name
se-debug- Description
- Systematically find root causes and fix bugs. Use when debugging errors, investigating test failures, reproducing bugs from issue trackers (GitHub, Linear, Jira), or when stuck on a problem after failed fix attempts. Also use when the user says 'debug this', 'why is this failing', 'fix this bug', 'trace this error', or pastes stack traces, error messages, or issue references.
- License
- MIT
- Compatibility
- gh, npm, bun, git
- Instructions
- 247 lines in SKILL.md · view on GitHub
Files (4)
- SKILL.md
- anti-patterns.md · references/
- defense-in-depth.md · references/
- investigation-techniques.md · references/
SKILL.md (first lines)
# Debug and Fix
Find root causes, then fix them. This skill investigates bugs systematically — tracing the full causal chain before proposing a fix — and optionally implements the fix with test-first discipline.
<bug_description> #$ARGUMENTS </bug_description>
## Core Principles
These principles govern every phase. They are repeated at decision points because they matter most when the pressure to skip them is highest.
1. **Investigate before fixing.** Do not propose a fix until you can explain the full causal chain from trigger to symptom with no gaps. "Somehow X leads to Y" is a gap.
2. **No edits before diagnosis.** Do not edit production code, tests, config, docs, or generated files before the Diagnosis Checkpoint in Phase 2. Investigation commands are allowed; mutating changes are not.
**Harness-enforced gate (when `--se-debug-strict` is set).** The `software-engineering` extension refuses `edit`, `write`, and `multi_edit` calls on non-doc paths until you call the `se_capture_repro` tool (or run the `/se-debug-repro` prompt). Recording symptom / steps / observed / expected unblocks subsequent edits. Documentation paths (`docs/`, `*.md`, `README*`, `CHANGELOG*`) bypass the gate. Pass `--se-debug-strict=false` to disable the gate for the session if you genuinely need to make non-debug edits while se-debug is active.
3. **Predictions for uncertain links.** When the causal chain has uncertain or non-obvious links, form a prediction — something in a different code path or scenario that must also be true. If the prediction is wrong but a fix "works," you found a symptom, not the cause. When the chain is obvious (missing import, clear null reference), the chain explanation itself is sufficient.
4. **One change at a time.** Test one hypothesis, change one thing. If you're changing multiple things to "see if it helps," stop — that is shotgun debugging.
5. **When stuck, diagnose why — don't just try harder.**
## Execution Flow
| Phase | Name | Purpose |
|-------|------|---------|
| 0 | Triage | Parse input, fetch issue if referenced, proceed to investigation |
| 1 | Investigate | Reproduce the bug, trace the code path |
| 2 | Root Cause | Form hypotheses with predictions for uncertain links, test them, **causal chain gate**, **Diagnosis Checkpoint**, smart escalation |
| 3 | Fix | Only after the Diagnosis Checkpoint and only if user chose to fix. Test-first fix with workspace safety checks |
| 4 | Handoff | Structured summary, then prompt the user for the next action |
All phases self-size — a simple bug flows through them in seconds, a complex bug spends more time in each naturally. No complexity classification, no phase skipping.
---
### Phase 0: Triage
Parse the input and reach a clear problem statement.
**If the input references an issue tracker**, fetch it:
- GitHub (`#123`, `org/repo#123`, github.com URL): Parse the issue reference from `<bug_description>` and fetch with `gh issue view <number> --json title,body,comments,labels`. For URLs, pass the URL directly to `gh`.
- Other trackers (Linear URL/ID, Jira URL/key, any tracker URL): Attempt to fetch using available MCP tools or by fetching the URL content. If the fetch fails — auth, missing tool, non-public page — ask the user to paste the relevant issue content. Ensure the fetch includes the full comment thread, not just the opening description.
Read the full conversation — the original description AND every comment, with particular attention to the latest ones. Comments frequently contain updated reproduction steps, narrowed scope, prior failed attempts, additional stack traces, or a pivot to a different suspected root cause; treating the opening post as the whole picture often sends the investigation in the wrong direction. Extract reported symptoms, expected behavior, reproduction steps, and environment details from the combined thread. Then proceed to Phase 1.
**Everything else** (stack traces, test paths, error messages, descriptions of broken behavior): Proceed directly to Phase 1.
**Questions:**
- Do not ask questions by default — investigate first (read code, run tests, trace errors)
- Only ask when a genuine ambiguity blocks investigation and cannot be resolved by reading code or running tests
- When asking, ask one specific question
**Prior-attempt awareness:** If the user indicates prior failed attempts ("I've been trying", "keeps failing", "stuck"), ask what they have already tried before investigating. This avoids repeating failed approaches and is one of the few cases where asking first is the right call.
---
### Phase 1: Investigate
#### 1.1 Reproduce the bug
Confirm the bug exists and understand its behavior. Run the test, trigger the error, follow reported reproduction steps — whatever matches the input.
- **Browser bugs:** Prefer `agent-browser` if installed. Otherwise use whatever works — MCP browser tools, direct URL testing, screenshot capture, etc.
- **Manual setup required:** If reproduction needs specific conditions the agent cannot create alone (data states, user roles, external services, environment config), document the exact setup steps and guide the user through them. Clear step-by-step instructions save significant time even when the process is fully manual.
- **Does not reproduce after 2-3 attempts:** Read `references/investigation-techniques.md` for intermittent-bug techniques.
- **Cannot reproduce at all in this environment:** Document what was tried and what conditions appear to be missing.
#### 1.2 Verify environment sanity
Before deep code tracing, confirm the environment is what you think it is:
- Correct branch checked out; no unintended uncommitted changes
- Dependencies installed and up to date (`bun install`, `npm install`, `bundle install`, etc.) — stale `node_modules`/`vendor` is a frequent false lead
- Expected interpreter or runtime version (check `.tool-versions`, `.nvmrc`, `Gemfile`, etc. against what's actually active)
- Required env vars present and non-empty
- No stale build artifacts (`dist/`, `.next/`, compiled binaries from an earlier branch)
- Dependent local services (database, cache, queue) running at expected versions *when the bug plausibly involves them*
#### 1.3 Trace the code path
Read the relevant source files. Follow the execution path from entry point to where the error manifests. Trace backward through the call chain:
- Start at the error
- Ask "where did this value come from?" and "who called this?"
- Keep going upstream until finding the point where valid state first became invalid
- Do not stop at the first function that looks wrong — the root cause is where bad state originates, not where it is first observed
As you trace:
- Check recent changes in files you are reading: `git log --oneline -10 -- [file]`
- If the bug looks like a regression ("it worked before"), use `git bisect` (see `references/investigation-techniques.md`)
- Check the project's observability tools for additional evidence:
- Error trackers (Sentry, AppSignal, Datadog, BetterStack, Bugsnag)
- Application logs
- Browser console output
- Database state
- Each project has different systems available; use whatever gives a more complete picture
---
### Phase 2: Root Cause
*Reminder: investigate before fixing. Do not propose a fix until you can explain the full causal chain from trigger to symptom with no gaps.*
Read `references/anti-patterns.md` before forming hypotheses.
**Assumption audit (before hypothesis formation):** List the concrete "this must be true" beliefs your understanding depends on — the framework behaves as expected here, this function returns what its name implies, the config loads before this runs, the caller passes a non-null value, the database is in the state the test implies. For each, mark *verified* (you read the code, checked state, or ran it) or *assumed*. Assumptions are the most common source of stuck debugging. Many "wrong hypotheses" are actually correct hypotheses tested against a wrong assumption.
**Form hypotheses** ranked by likelihood. For each, state:
- What is wrong and where (file:line)
- The causal chain: how the trigger leads to the observed symptom, step by step
- **For uncertain links in the chain**: a prediction — something in a different code path or scenario that must also be true if this link is correct
When the causal chain is obvious and has no uncertain links (missing import, clear type error, explicit null dereference), the chain explanation itself is the gate — no prediction required. Predictions are a tool for testing uncertain links, not a ritual for every hypothesis.
Before forming a new hypothesis, review what has already been ruled out and why.
**Causal chain gate:** Do not proceed to Phase 3 until you can explain the full causal chain — from the original trigger through every step to the observed symptom — with no gaps. The user can explicitly authorize proceeding with the best-available hypothesis if investigation is stuck.
*Reminder: if a prediction was wrong but the fix appears to work, you found a symptom. The real cause is still active.*
#### Diagnosis Checkpoint — hard gate before fixingFrom simonwjackson/pi-software-engineering, MIT.
More from simonwjackson/pi-software-engineering
- 0.479score
se-ideate
simonwjackson
Generate and critically evaluate grounded ideas about a topic.
SkillCFreshness: CClaude Code +9 - 0.479score
se-demo-reel
simonwjackson
Capture a visual demo reel (GIF, terminal recording, screenshots) for PR descriptions.
SkillCFreshness: CClaude Code +9 - 0.479score
se-brainstorm
simonwjackson
Explore requirements and approaches through collaborative dialogue before writing a right-sized requirements document and planning implementation.
SkillCFreshness: CClaude Code +9 - 0.479score
se-clean-gone-branches
simonwjackson
Clean up local branches whose remote tracking branch is gone.
SkillCFreshness: CClaude Code +9 - 0.479score
se-doc-review
simonwjackson
Review requirements or plan documents using parallel persona agents that surface role-specific issues.
SkillCFreshness: CClaude Code +9 - 0.475score
se-agent-native-architecture
simonwjackson
Build applications where agents are first-class citizens.
SkillCFreshness: CClaude Code +9 - 0.474score
se-frontend-design
simonwjackson
Build web interfaces with genuine design quality, not AI slop.
SkillCFreshness: CClaude Code +9 - 0.474score
se-challenge-plan
simonwjackson
Stress-test an implementation plan or proposed approach against project context, domain language, existing decisions, risks, sequencing, and test strategy.
SkillCFreshness: CClaude Code +9 - 0.474score
se-architecture-improvement
simonwjackson
Find deepening opportunities in a codebase using project context, established domain language, documented decisions, and public-contract test posture.
SkillCFreshness: CClaude Code +9 - 0.474score
se-backlog
simonwjackson
Ambient engineering backlog skill for capturing, reviewing, refining, promoting, and pruning durable follow-up work in a repo-local Backlog.md-style backlog.
SkillCFreshness: CClaude Code +9 - 0.473score
se-polish-beta
simonwjackson
[BETA] Start the dev server, open the feature in a browser, and iterate on improvements together.
SkillCFreshness: CClaude Code +9 - 0.470score
se-optimize
simonwjackson
Run metric-driven iterative optimization loops.
SkillCFreshness: CClaude Code +9
Signals
- Stars
- 0
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- Jun 2, 2026 (4 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from simonwjackson
- 0.479score
se-doc-review
simonwjackson
Review requirements or plan documents using parallel persona agents that surface role-specific issues.
SkillCFreshness: CClaude Code +9 - 0.479score
se-ideate
simonwjackson
Generate and critically evaluate grounded ideas about a topic.
SkillCFreshness: CClaude Code +9 - 0.479score
se-demo-reel
simonwjackson
Capture a visual demo reel (GIF, terminal recording, screenshots) for PR descriptions.
SkillCFreshness: CClaude Code +9 - 0.479score
se-clean-gone-branches
simonwjackson
Clean up local branches whose remote tracking branch is gone.
SkillCFreshness: CClaude Code +9 - 0.479score
se-brainstorm
simonwjackson
Explore requirements and approaches through collaborative dialogue before writing a right-sized requirements document and planning implementation.
SkillCFreshness: CClaude Code +9 - 0.475score
se-agent-native-architecture
simonwjackson
Build applications where agents are first-class citizens.
SkillCFreshness: CClaude Code +9
Cite this page
se-debug skill. Agent Mart. https://agentmart.dev/skills/simonwjackson-se-debug (last updated 2026-10-24)