sw-doctor

sw-doctor is a skill for Claude Code from Obsidian-Owl/specwright. It costs 43 tokens per session (1,485 once invoked), scanned A, original, MIT.

A project health check for Specwright, a system that organizes coding work and its records. It checks configuration, project documents, work states, commands, quality gates, and hooks.

In plain words
What is it for?
Use it to check whether Specwright is installed and operating correctly, diagnose broken project or worktree state, and review configured commands, gates, and hooks.
Why use it?
It finds missing or inconsistent setup before it causes workflow failures. It also gives repair hints and may safely fill in pull-request details when the match is proven.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to check whether Specwright is installed and operating correctly, diagnose broken project or worktree state, and review configured commands, gates, and hooks.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/obsidian-owl/specwright/sw-doctor
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.

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

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sw-doctor

README.md
[![agentmods](https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-doctor/github.svg)](https://agentmods.dev/skills/obsidian-owl/specwright/sw-doctor)
Your own site
<a href="https://agentmods.dev/skills/obsidian-owl/specwright/sw-doctor"><img src="https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-doctor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sw-doctor

Your own site · 80×15
<a href="https://agentmods.dev/skills/obsidian-owl/specwright/sw-doctor"><img src="https://agentmods.dev/badge/skills/obsidian-owl/specwright/sw-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,485 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00043 $0.01485
Opus 5 $0.00022 $0.00743
Sonnet 5 $0.00009 $0.00297
Haiku 4.5 $0.00004 $0.00148

Measured 9d ago against content hash d2fef13ddac6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

sw-doctor 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 9d 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-doctor/SKILL.md · 149 lines

How it starts

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

Specwright Doctor

Goal

Validate that a Specwright installation is coherent across the tracked project-artifact root, shared repo-state root, and per-worktree session model, then print actionable repair hints using the same runtime-root and ownership vocabulary the adapters expose.

Inputs

  • {projectArtifactsRoot}/config.json
  • {projectArtifactsRoot}/CONSTITUTION.md and {projectArtifactsRoot}/CHARTER.md
  • {worktreeStateRoot}/session.json when present
  • {repoStateRoot}/work/*/workflow.json
  • {workArtifactsRoot}/{workId}/approvals.md and {workDir}/review-packet.md when present
  • gate skill files, hook config, and configured commands

Outputs

  • PASS/WARN/FAIL health table
  • Optional backfill of prNumber and prMergedAt on the owning work's workflow.json

Constraints

Pre-condition (LOW freedom):

  • If neither the shared layout nor the legacy fallback can be resolved, stop immediately and tell the user to run /sw-init.
  • Always report layout status first: shared/session, legacy fallback, or missing.
  • When layout resolves, describe the active runtime mode explicitly: project-visible runtime roots under .specwright-local/ are the preferred interactive default; git-admin roots under .git/specwright/ are compatibility mode.

Checks (LOW freedom — run all 13 in order):

  1. Anchor docs — tracked Constitution and Charter exist and are non-empty
  2. Config — tracked config parses and contains gates and git
  3. State — current session parses when present, every discovered workflow parses with a null or fresh per-work lock, and layout status is explicit
  4. Gates — enabled gate skills exist
  5. Build command — configured build command exists on PATH
  6. Test command — configured test command exists on PATH
  7. Format/lint — configured format or lint commands exist on PATH
  8. Hooks — hook manifest parses and referenced hook files exist
  9. Backlog config — configured backlog target is usable
  10. ast-grep — INFO availability only
  11. OpenGrep — INFO availability only
  12. LSP — PASS/WARN/INFO based on available platform or standalone LSP
  13. STATE_DRIFT — enumerate repo-wide workflows and flag shipped units with status=shipped and prNumber=null

Read the full file on GitHub · 149 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. 9d ago First seen · 149 lines · 43 tokens per session scan A d2fef13ddac6

Subscribe to this mod's changes

sw-doctor is a skill published in the GitHub repository Obsidian-Owl/specwright (9 stars, last pushed 4mo ago), licensed MIT. It adds 43 tokens to every session and 1,485 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-development-guide

Applies language-agnostic and backend technical decision criteria, anti-pattern detection, debugging, and quality gates. Use when reviewing general/backend implementation choices, code smells, failures, or implementation completeness.

shinpr/claude-code-workflows · 43 tokens

recipe-diagnose

Investigate problem, verify findings, and derive solutions.

shinpr/claude-code-workflows · 15 tokens

root-cause

Find the mechanism behind a failure instead of patching its symptom - reproduce first, one variable per experiment with the prediction written before the run, exit by naming the mechanism and pinning it with a failing test. Use for a bug, an unexplained red test, or a failure that will not reproduce.

jjanczur/tyran · 61 tokens

logic-review

Find logic bugs in a single file or function via semi-formal execution tracing (Premises → Trace → Divergence → Trigger → Remedy). Trigger when a user shares code and suspects something is wrong without naming a concrete failure — phrases like "review this", "does this look right", "check this function", "audit this…

hyhmrright/logic-lens · 161 tokens

logic-fix-all

Autonomous repository-wide audit-and-fix pipeline: health → review → locate/explain → fix → diff-verify → iterate until clean. Starts with a mandatory consent prompt (token-intensive); after consent runs hands-free. Trigger when the user wants ALL logic issues found and fixed — "fix everything", "fix all logic…

hyhmrright/logic-lens · 211 tokens

logic-health

Sweep a directory, module, or full codebase for logic correctness and produce a scored health dashboard with systemic patterns. Trigger when the user requests a health view — "audit the whole codebase", "health check", "health overview", "logic health overview", "audit src/", "audit auth and payments modules", "where…

hyhmrright/logic-lens · 180 tokens