sw-debug
Investigation-first debugging workflow. Scopes the problem, delegates root cause analysis, produces a diagnosis report, and applies fix/log/defer autonomously.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Investigation-first debugging workflow. Scopes the problem, delegates root cause analysis, produces a diagnosis report, and applies fix/log/defer autonomously.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Specwright health check. Validates shared config, anchor docs, workflow and session state, commands, gates, and hooks. May backfill shipped PR metadata when it can prove the mapping safely.
Detects project stack and existing guardrails, then interactively configures deterministic quality checks across session, commit, push, and CI/CD layers.
Initializes Specwright in a project. Detects stack, asks about practices, creates constitution and charter, configures quality gates and hooks.
Shows current Specwright state for this worktree, the attached work, repo-wide active works, gate results, and lock status. Supports --reset, --cleanup, and --repair {unitId}.
Periodic codebase health check. Analyzes architecture, complexity, consistency, and debt across the full codebase. Produces persistent findings in AUDIT.md.
TDD implementation of one work unit. Delegates test writing to the tester agent and implementation to the executor agent. Commits per task.
| name | sw-debug |
| description | Investigation-first debugging workflow. Scopes the problem, delegates root cause analysis, produces a diagnosis report, and applies fix/log/defer autonomously. |
| argument-hint | [problem description] |
| allowed-tools | ["Read","Write","Bash","Glob","Grep","Task"] |
First-class debugging path. Scope the problem, investigate concurrently,
diagnose with evidence, then decide: fix it now, log it, or defer. Operates
autonomously, applying protocols/decision.md for the fix/log/defer decision.
{projectArtifactsRoot}/config.json — backlog.type and backlog.labeldiagnosis.md at {workArtifactsRoot}/{id}/diagnosis.md — always producedspec.md at {workArtifactsRoot}/{id}/spec.md — Fix path only (2-3 acceptance criteria)decisions.md at {workArtifactsRoot}/{id}/decisions.md — fix/log/defer decision recorded per protocols/decision.mdStage boundary (LOW freedom):
Follow protocols/stage-boundary.md. Investigate and diagnose. NEVER write code,
run tests, branch, or commit. Fix path: produce spec.md, handoff to /sw-build.
Scope (MEDIUM freedom):
Investigate (HIGH freedom):
Delegate concurrently per protocols/delegation.md: specwright-researcher (code
context, call paths) and specwright-architect (root cause, blast radius).
Diagnose (MEDIUM freedom):
Write diagnosis.md: Problem (observed vs expected), Root Cause (confidence level,
file:line evidence), Blast Radius (affected / not affected), Fix Approach (high-level),
Alternatives Considered. If agents return insufficient evidence: produce low-confidence
diagnosis and note the gap in decisions.md.
Decision (MEDIUM freedom):
Apply protocols/decision.md DISAMBIGUATION + reversibility:
/sw-build./sw-design (Type 1 — structural scope).protocols/backlog.md.defer tag.
Record the decision in decisions.md.State (LOW freedom):
Follow protocols/state.md. Work ID: debug-{short-description}.
protocols/stage-boundary.md -- scope and handoffprotocols/decision.md -- autonomous decision framework (fix/log/defer)protocols/state.md -- workflow state updatesprotocols/delegation.md -- concurrent delegationprotocols/backlog.md -- backlog items| Condition | Action |
|---|---|
| No problem description or context | Apply DISAMBIGUATION from conversation history. Record interpretation. |
| Agents return no evidence | Low-confidence diagnosis. Apply fix/log/defer per reversibility. |
| Fix is architectural (>3 files) | Halt. Recommend /sw-design. |
| Compaction during investigation | Re-run investigation; diagnosis.md rebuilt from scratch |