core/skills/sw-doctor/SKILL.md
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.
npx skillsauth add obsidian-owl/specwright sw-doctorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
{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 presentprNumber and prMergedAt on the owning work's
workflow.jsonPre-condition (LOW freedom):
/sw-init.shared/session, legacy fallback, or
missing.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):
gates and gitstatus=shipped and prNumber=nullWithin the State pass, check all of the following and report them by name:
projectArtifactsRoot, workArtifactsRoot, and the authoritative
runtime roots (repoStateRoot and worktreeStateRoot) for the current
checkoutsession.json and the owning
workflow.json/sw-adopt
instead of implying generic takeoverState-pass output must report the authoritative runtime roots clearly so the
user can see which repoStateRoot and worktreeStateRoot are in force.
Within the Config pass, check all of the following and report them by name:
git-admin even though
project-visible runtime roots are the recommended default for that setup.git mirrors instead of an explicit tracked
artifact pathconfig.git.runtime.projectVisibleRoot values that point at tracked project
artifacts or .git-mirrored paths instead of a dedicated project-visible
runtime rootReject project-visible roots that overlap tracked project artifacts or .git-mirrored paths, and name config.git.runtime.projectVisibleRoot in the result.
CONFIG_MISMATCH findings must name the offending config key and print the corrective action.
STATE_DRIFT findings must print the inline remediation command
sw-status --repair {unitId} and include the owning work ID.
STATE_DRIFT backfill (MEDIUM freedom):
status=shipped and prNumber=null.prNumber=null across all discovered
workflows.gh lookup, then git log / merge confirmation,
then warn and leave the fields untouched.gh, then git log, then warn.prNumber and prMergedAt on the owning work's
workflow file.status; it only writes prNumber and prMergedAt.Output format (MEDIUM freedom):
Workflow mutation scope (LOW freedom):
workflow.json, follow protocols/state.md.status; only prNumber and prMergedAt may change.{projectArtifactsRoot}, split
per-work workflows under {repoStateRoot}, and this worktree's
{worktreeStateRoot}/session.json.protocols/context.md -- logical-root loadingprotocols/state.md -- per-work workflow format and lock handling| Condition | Action | |---|---| | shared config missing | fail that check and continue | | workflow parse error | fail the state check and identify the owning work | | all checks pass | print the table and say all checks passed | | hooks absent | INFO: no hooks configured |
testing
Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency.
testing
Orchestrates quality gates for the current work unit. Runs enabled gates in dependency order, produces an aggregate evidence report with gate handoff.
tools
Syncs the local repository by fetching all remotes, updating the base branch, and removing stale local branches that are not protected by live sessions or helper worktrees.
data-ai
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}.