一键导入
debug
Debug a reported issue like a senior engineer — gather evidence, check environment, scan git history, and diagnose root causes before jumping to code fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Debug a reported issue like a senior engineer — gather evidence, check environment, scan git history, and diagnose root causes before jumping to code fixes.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Research a work item, draft an implementation plan, and begin work after approval.
Guided one-shot install — discover installed plugins (or help install new ones), pick install scope, calibrate risk tolerance into a concrete allowlist + hooks, scaffold or merge CLAUDE.md, and sanity-check the result.
Finalize work — commit via /commit, push, and create PRs on feature branches.
Reviewer-side PR workflow — checks out the branch in a worktree, runs focus-area reviews plus a senior-engineering pass, optionally cross-checks against an autonomous reviewer, and posts inline findings only on explicit approval. Read-only — never edits, commits, or pushes.
Fetch PR review comments, classify by severity and confidence, and fix the selected subset.
Triage CVE and SBOM scanner output (Trivy, Grype, Snyk, Docker Scout, Dependabot) into a ranked, deduplicated action list.
| name | debug |
| description | Debug a reported issue like a senior engineer — gather evidence, check environment, scan git history, and diagnose root causes before jumping to code fixes. |
| user-invocable | true |
| argument-hint | ["description of the issue"] |
| disable-model-invocation | true |
| allowed-tools | Read, Bash, Grep, Glob, Agent, AskUserQuestion |
You are debugging a reported issue. Think like a senior engineer on an incident call: gather evidence first, diagnose second, fix last. Resist the urge to jump to code changes. Most "bugs" are environment issues, stale data, missing migrations, or config problems.
$ARGUMENTS
If superpowers:systematic-debugging is available, invoke it for the root-cause methodology layer. It provides a rigorous four-phase framework (Root Cause Investigation, Pattern Analysis, Hypothesis and Testing, Implementation) that complements this skill's domain-specific triage. Use it alongside the phases below -- it enforces the discipline, this skill tells you where to look.
NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
If you have not completed at least Phase 1 through Phase 4, you cannot propose fixes. Symptom fixes are failure. Random fixes waste time and create new bugs.
Work through these phases in order. Do NOT skip ahead to fixing code until you have a clear diagnosis.
Developers often report symptoms, not root causes. Before touching anything:
Ask these questions directly. Do not proceed with guesswork.
Run these checks and report findings. Stop and diagnose if any check fails -- do not continue to code analysis. Use the commands appropriate to the project's stack (check CLAUDE.md for project-specific commands).
Check if dependencies are current and in sync with the lockfile. Look for missing, extraneous, or mismatched packages. Every package manager has a way to verify this -- use it.
Common culprits:
Verify the build is clean. Look for stale build artifacts, corrupted caches, or build output from a previous configuration. If the project has a build cache directory, check its age and consider clearing it.
Common culprits:
If the project uses a database or has schema migrations, check whether migrations are up to date and whether the local database schema matches what the code expects.
Common culprits:
Check if required environment variables are set (without revealing their values -- just confirm presence and rough length). Check that config files exist and are not stale copies.
# Example pattern -- adapt variable names to the project
for var in REQUIRED_VAR_1 REQUIRED_VAR_2; do
if [ -z "${!var}" ]; then
echo "MISSING: $var"
else
val="${!var}"; echo "SET: $var (${#val} chars)"
fi
done
# Check config files exist
ls -la .env* 2>/dev/null || echo "No .env files found"
Consult CLAUDE.md for the list of required environment variables.
Check whether external services the application depends on are reachable: databases, caches, message queues, third-party APIs. Verify connectivity, not just configuration.
Look at recent changes that could have introduced or exposed this issue:
# What changed recently?
git log --oneline --since="1 week ago" --stat | head -60
# What files were touched in the area related to the issue?
git log --oneline --since="2 weeks ago" -- "path/to/relevant/area/"
# Any recent dependency changes?
git log --oneline --since="2 weeks ago" -- "*lock*" "*.toml" "*.json" "requirements*.txt" "go.sum"
# Diff the relevant files against what was last known working
git diff HEAD~5 -- "path/to/relevant/area/"
What to look for:
Based on evidence gathered, identify the exact layer where things break:
Test each layer independently to isolate the break point. Do not assume -- verify.
This is the number one thing junior engineers miss. The code can be perfect but the data is wrong:
Before proposing any fix, present your findings:
If you have attempted 3 or more fixes and the issue persists:
STOP. Do not attempt fix number 4.
Count the fixes attempted and what each revealed.
Look for the pattern -- each fix revealing a new problem in a different place is a sign of an architectural issue, not a point bug.
Question fundamentals: Is the pattern/approach sound, or are we fixing symptoms of a wrong design?
Get a senior second opinion. Dispatch to the principal-engineer subagent with the evidence and the fixes already attempted. Ask it to reason about root cause versus symptom and whether the failures point at an architectural problem rather than a point bug. Integrate its read into the discussion below — it does not replace the user conversation.
Agent({
subagent_type: "principal-engineer",
description: "Senior debugging consult",
prompt: "We have attempted N fixes for this bug and it persists. Symptom: <description>. Evidence: <logs/diffs/error messages>. Fixes tried and what each revealed: <list>. Reason from first principles about the true root cause. Is this a point bug or an architectural problem? What single hypothesis would you test next, and what evidence would confirm it?"
})
Discuss with the user before attempting more fixes.