gate-build
Runs configured build and test commands in tiered order. Captures output as evidence per tier. Returns PASS, FAIL, WARN, or SKIP based on per-tier verdicts.…
Research-backed rebaselining. Revises design, plan, or in-progress work while preserving completed scope and approval lineage.
$ npx -y skills add Obsidian-Owl/specwright --skill sw-pivot --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/sw-pivotContext preview
The summary Claude sees to decide when to auto-load this skill.
Research-backed rebaselining. Revises design, plan, or in-progress work while preserving completed scope and approval lineage.
name: sw-pivot description: >- Research-backed rebaselining. Revises design, plan, or in-progress work while preserving completed scope and approval lineage. argument-hint: "[reason for pivot]" allowed-tools: - Read - Write - Edit - Bash - Glob - Grep - Task
Research-backed rebaselining for the selected work. Capture preserved scope, understand what changed, classify the pivot, revise the affected open work via architect, and hand back to `/sw-plan` or `/sw-build` as appropriate. Applies `protocols/decision.md` for all decisions. Revisions auto-applied and recorded in `decisions.md`; the revised artifact set is the contract.
active unit, `tasksCompleted`, `tasksTotal`, and work/unit paths
`decisions.md`, `integration-criteria.md` when present
observable behavior change
criteria
affected remaining work updated
**Pre-condition (LOW freedom):** Resolve the selected work from the current worktree session. Valid entry states are `planning`, `building`, and `verifying`. Reject `designing`, `shipping`, and `shipped` with explicit guidance: use `/sw-design` change request flow for `designing`, and start a fresh work or normal ship/fix flow for `shipping` or `shipped`. If another live top-level worktree owns the selected work, STOP with explicit adopt/takeover guidance.
**Snapshot (LOW freedom):** Read the selected work's completed and open scope. Present preserved baseline scope versus delta scope before proposing any mutation.
**Classification (MEDIUM freedom):** Classify the request before mutation:
**Pivot input (MEDIUM freedom):** If argument provided, use it as the pivot reason. If no argument, infer from conversation context per `protocols/decision.md` DISAMBIGUATION.
**Research-first analysis (MEDIUM freedom):** For `unit-pivot` and `work-pivot`, run a bounded research pass before revision. Prefer existing tracked artifacts first, recent retro evidence second, and fresh external research only when the pivot changes an external contract. Capture the synthesized findings in work context rather than requiring the user to restate them.
**Revise (HIGH freedom for architect, LOW freedom for mutation):** Delegate to `specwright-architect` per `protocols/delegation.md`. Completed tasks and shipped units are immutable baseline scope. Architect may revise remaining tasks, affected remaining-unit artifacts, or work-level design artifacts depending on pivot class. If architect proposes rewriting completed criteria or shipped scope: reject and re-delegate (max 2 attempts). If the pivot would invalidate shipped scope anyway, STOP and escalate to a fresh `/sw-design` work instead of rewriting history.
**Apply (MEDIUM freedom):** Auto-apply the classified revision. `task-pivot` may revise the active unit task list; `unit-pivot` may regenerate affected remaining-unit artifacts and `integration-criteria.md`; `work-pivot` may revise work-level design artifacts plus affected remaining units. Update the selected work's `workflow.json`, record preserved baseline scope versus delta scope in `decisions.md`, and mutate only the selected work's workflow state. Never rewrite unrelated active works. Use revision-chain updates for work-level artifacts instead of creating parallel design trees.
**State handling (LOW freedom):** Do not create a new persisted `pivoting` workflow status. `sw-pivot` runs inside `planning`, `building`, or `verifying`; if active or affected unit artifacts change, the touched work returns to `building`. If only future units change and the active unit remains valid, preserve the active unit's current state.
**Approval lineage (LOW freedom):** If the pivot changes work-level or unit-level artifacts, the corresponding design or `unit-spec` approval lineage becomes stale against the revised artifact set. Use `protocols/approvals.md` and the shared approval helper implemented in `adapters/shared/specwright-approvals.mjs` to assess and preserve that stale lineage rather than erasing it. Surface compact stale reasons such as `missing-entry`, `artifact-set-changed`, `missing-lineage`, `expired`, and `superseded`. Never fabricate a replacement `APPROVED` entry during `/sw-pivot`; the next human-triggered `/sw-build` records the replacement approval that supersedes the stale lineage.
**Closeout summary (LOW freedom):** Before the stage handoff, summarize the preserved completed scope, delta scope introduced by the pivot, affected units or tasks, whether the active unit was reset to `building`, and any stale approval reasons (`missing-entry`, `artifact-set-changed`, `missing-lineage`, `expired`, `superseded`). The closeout must make scope preservation explicit instead of implying a remaining-tasks-only rewrite.
**Stage boundary (LOW freedom):** Follow `protocols/stage-boundary
Craft quality software with AI discipline. Spec-driven development plugin for Claude Code and Opencode — quality gates, adversarial testing, and evidence capture.
Repo: Obsidian-Owl/specwright
Runs configured build and test commands in tiered order. Captures output as evidence per tier. Returns PASS, FAIL, WARN, or SKIP based on per-tier verdicts.…
Detects leaked secrets, injection patterns, and sensitive data exposure across changed files. Uses real tooling when configured, LLM judgment for analysis.…
Tiered semantic analysis of changed code (rg → ast-grep → OpenGrep). Detects error-path bugs structural gates miss. Findings default to WARN. Internal —…
Maps every acceptance criterion from the spec to implementation evidence and test evidence. Criteria without evidence fail. The ultimate quality gate. Internal…
Audits test quality — assertion strength, boundary coverage, mock discipline, error path testing. Delegates to the tester agent for adversarial analysis.…
Detects unused exports, orphaned files, architecture layer violations, and circular dependencies across changed files. Delegates to architect agent for…