sw-debug

An investigation-first workflow for diagnosing software problems. It gathers evidence, determines the likely cause, and records whether the issue should be fixed, logged, or deferred.

In plain words
What is it for?
Use it with an error report, logs, or failing test output to investigate the problem and prepare a short handoff specification when a code fix is needed.
Why use it?
It separates diagnosis from implementation so developers can understand a failure before changing code. The workflow also produces written records for the diagnosis and any proposed fix.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/obsidian-owl/specwright/sw-debug
Any agent
npx skills add Obsidian-Owl/specwright --skill sw-debug
Clone the repo
git clone --depth 1 https://github.com/Obsidian-Owl/specwright

Made for: Claude Code, Codex.

Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 860 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.00860
Opus 5 $0.00016 $0.00430
Sonnet 5 $0.00007 $0.00172
Haiku 4.5 $0.00003 $0.00086

Measured 2d ago against content hash 3a9c41c56aba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sw-debug scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

core/skills/sw-debug/SKILL.md · 88 lines

How it starts

The opening of the file, as written. The whole thing — 88 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Specwright Debug

Goal

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.

Inputs

  • Problem description (argument or recent error context)
  • Initial evidence: error messages, logs, failing test output
  • {projectArtifactsRoot}/config.jsonbacklog.type and backlog.label
  • Codebase files — read during investigation

Outputs

  • diagnosis.md at {workArtifactsRoot}/{id}/diagnosis.md — always produced
  • spec.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.md

Constraints

Stage 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):

  • If argument provided, use it. If no argument, infer from recent error context (last failed command, error output in conversation). If genuinely undetermined, apply DISAMBIGUATION: choose the most likely problem from available context.
  • Collect evidence: error messages, stack traces, failing tests. Define boundary.

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:

  • Fix spans ≤3 files with local architectural scope → Fix it now (Type 2). Write spec.md, handoff to /sw-build.
  • Fix spans >3 files or crosses architectural boundaries → halt and recommend /sw-design (Type 1 — structural scope).
  • Known pattern (matches patterns.md entry) → Log it as BL-{n} per protocols/backlog.md.
  • Requires design-level decisions → Defer as BL-{n} with defer tag. Record the decision in decisions.md.

Read the full file on GitHub · 88 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 88 lines · 33 tokens per session scan A 3a9c41c56aba

Subscribe to this mod's changes

sw-debug is a skill published in the GitHub repository Obsidian-Owl/specwright (9 stars, last pushed 4mo ago), licensed MIT. It adds 33 tokens to every session and 860 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ai-spec-project-start

Install or upgrade SDAD; migrate an existing SDAD project; recover or repair sdad-state.yaml, INDEX, ledger, or handoff consistency; run or interpret SDAD Doctor; or diagnose the SDAD control plane. Use only for SDAD-specific bootstrap, migration, repair, and Doctor operations.

LiveTrack-X/spec-driven-ai-development · 67 tokens

phase-7-testing

Phase 7 — Test Strategy with pyramid, coverage gates, load tests, and Critical User Journeys.

exchanet/method_enterprise_builder_planning · 25 tokens

gsd-audit-milestone

Audit milestone completion against original intent before archiving.

open-gsd/gsd-core · 17 tokens

spec-kitty-charter-doctrine

Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers: "interview for charter", "generate charter"…

Priivacy-ai/spec-kitty · 135 tokens

create-mcp-server

Build, iterate, and evaluate Model Context Protocol (MCP) servers that expose external services as tools an LLM can call. Covers schema/tool design, error handling, pagination, MCP Inspector testing, and an eval set. Use when asked to "build an MCP server", "create an MCP tool", "wrap this API as MCP", "expose X to…

open-gsd/gsd-pi · 90 tokens

spk-team-auth

Handle Spec Kitty team authentication, hosted credentials, account selection, and auth-related recovery.

Priivacy-ai/spec-kitty · 22 tokens