core/skills/sw-design/SKILL.md
Autonomous solution architecture. Researches the codebase, designs a solution, challenges it adversarially, and produces design artifacts.
npx skillsauth add obsidian-owl/specwright sw-designInstall 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.
Research the codebase, design a solution, challenge it adversarially, and produce
design artifacts. Output is a design — not specs, not code. Operates autonomously
between research and gate handoff, applying protocols/decision.md for all decisions.
{projectArtifactsRoot}/CONSTITUTION.md -- practices to follow{projectArtifactsRoot}/CHARTER.md -- vision and invariants{projectArtifactsRoot}/config.json -- project configuration{worktreeStateRoot}/session.json -- current worktree attachment, when present{repoStateRoot}/work/*/workflow.json -- other active works for collision checksWhen complete, runtime and auditable artifacts exist in both locations:
{repoStateRoot}/work/{id}/stage-report.md -- runtime-local design handoff digest with attention-required at the top{workArtifactsRoot}/{id}/design.md -- solution overview, approach, integration points, risk assessment
## Blast Radius listing: modules/files the design touches, failure propagation scope for each (local/adjacent/systemic), and what the design does NOT change.{workArtifactsRoot}/{id}/context.md -- research findings, file paths, gotchas (travels with downstream agents){workArtifactsRoot}/{id}/ -- classified assumptions with resolution status{workArtifactsRoot}/{id}/decisions.md -- all autonomous decisions recorded per protocols/decision.mdWhen warranted: data-model.md, contracts.md, testing-strategy.md, infra.md, migrations.md.
Stage boundary (LOW freedom):
Follow protocols/stage-boundary.md. Produce design artifacts and research context.
NEVER write specs, decompose, implement, branch, or test. After gate handoff, STOP.
Ownership guard (LOW freedom):
session.json, not from branch names alone./sw-adopt flow rather than mutating design
artifacts here./sw-adopt may attach only the current worktree session. sw-design must
never rewrite another worktree's session.json.Research (HIGH freedom):
specwright-researcher and specwright-architect as needed.protocols/decision.md DISAMBIGUATION:
infer intent from the argument, codebase context, and charter vision. Record the
interpretation in decisions.md. If genuinely undetermined, surface at the gate.Design (HIGH freedom):
protocols/decision.md DISAMBIGUATION
hierarchy. Record the choice and which rule resolved it in decisions.md.Critic (HIGH freedom):
specwright-architect for adversarial review.protocols/decision.md#convergence-loop for the iterative critic loop.
Convergence at ≥4/5 on all dimensions with no BLOCKs auto-approves per
protocols/decision.md#approval.Assumption resolution (MEDIUM freedom):
protocols/decision.md#assumption-lifecycle for format, classification,
and autonomous resolution.protocols/decision.md#autonomous-resolution.
Clarify+technical → auto-ACCEPT. Reference/external → auto-DEFER to backlog per
protocols/backlog.md.Change requests (MEDIUM freedom):
design.md exists + argument: change request, re-run critic.design.md exists + no argument: apply DISAMBIGUATION — if the user's prior message
implies a change, treat as change request. Otherwise, present status at the gate.Approval target (LOW freedom):
Per protocols/approvals.md, identify the design artifact set awaiting approval
for /sw-plan: design.md, context.md, decisions.md, the design
assumptions artifact, and any optional design supplements written in this run.
sw-design does not write APPROVED entries itself.
Gate handoff (LOW freedom):
On completion, emit the three-line handoff per the protocols/decision.md
Gate Handoff section. Write {repoStateRoot}/work/{id}/stage-report.md
before the handoff. The Artifacts line points at
Artifacts: {repoStateRoot}/work/{id}/stage-report.md. Detail lives in the
auditable artifact files under {workArtifactsRoot}/{id}/ (design.md,
decisions.md, design assumptions artifact, context.md). The Next line
remains machine-parseable: Next: /sw-plan.
State mutations (LOW freedom):
Follow protocols/state.md for read-modify-write mechanics. Postconditions:
{repoStateRoot}/work/{id}/.{worktreeStateRoot}/session.json.attachedWorkId is set to the new work ID for
the current worktree only.Clearing prior shipped work {unitId}. Run /sw-learn first if pattern capture is desired.
The notice is informational only; sw-learn remains optional.currentWork has status shipped,
clear that legacy attachment and reset workUnits to null before retargeting
this worktree.workflow.json.status is designing.targetRef records the concrete remote, branch, role, resolution source, and resolution time for the selected work.freshness is seeded from the resolved git.freshness config at design time, carrying validation, reconcile, and checkpoints, with status: "unknown" and lastCheckedAt: null.baselineCommit is the SHA of the resolved target branch HEAD captured before any work begins and is never overwritten on re-entry.targetRef also written to {workDir}/context.md for historical reference.baselineCommit also written to {workDir}/context.md for historical
reference.protocols/stage-boundary.md -- scope, termination, and handoffprotocols/decision.md -- autonomous decision framework, gate handoff, convergence loop, assumption lifecycleprotocols/state.md -- workflow state updates and lockingprotocols/context.md -- anchor doc and config loadingprotocols/delegation.md -- agent delegation for research and criticprotocols/recovery.md -- compaction recoveryprotocols/landscape.md -- codebase reference document formatprotocols/audit.md -- codebase health findings formatprotocols/backlog.md -- backlog item format and write targetsprotocols/approvals.md -- pending design artifact set and approval contractprotocols/research.md -- external research brief format and consumption| Condition | Action |
|-----------|--------|
| Request too vague | Apply DISAMBIGUATION from codebase + charter context. Record interpretation. If undetermined, surface at gate. |
| Active work in progress | Apply DISAMBIGUATION: if argument provided, start new. If no argument, continue existing. Record choice. |
| Selected work owned by another live top-level worktree | STOP with explicit /sw-adopt guidance |
| design.md exists, no argument | Apply DISAMBIGUATION: if user's message implies change, treat as change request. Otherwise, present status at gate. |
| Critic rejects entire approach | Apply DISAMBIGUATION to choose best alternative. Record in decisions.md. |
| User rejects design at gate | Revise per user feedback and re-run critic. User overrides critic — note in design.md. |
| Unresolved Type 1 assumptions | Surface at gate handoff as deficiencies. Do not auto-proceed. |
| Compaction during design | Read workflow.json, check which artifacts exist, resume next missing phase |
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}.