core/skills/sw-adopt/SKILL.md
Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency.
npx skillsauth add obsidian-owl/specwright sw-adoptInstall 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.
Attach an existing work to the current worktree without creating split-brain ownership. This skill attaches only the current worktree session.
attachedWorkId when re-adopting the already-selected work{worktreeStateRoot}/session.json for the current worktree{repoStateRoot}/work/{workId}/workflow.jsonsession.json files discovered via git worktree list --porcelain{worktreeStateRoot}/session.json for the current worktree onlyworkflow.json.attachment pointing at the current
worktree when adoption succeedsScope (LOW freedom):
/sw-adopt is the explicit same-work adoption flow. It must not silently run
during /sw-design, /sw-plan, /sw-build, /sw-verify, or /sw-ship./sw-adopt never rewrites another worktree's session.json./sw-adopt.Target resolution (LOW freedom):
session.json.attachedWorkId as a fallback.{repoStateRoot}/work/{workId}./sw-design.Ownership validation (LOW freedom):
session.json files to determine live-versus-dead session
state for the target work.workId./sw-adopt does
not perform remote session surgery.Branch consistency (LOW freedom):
building, verifying, or shipping,
validate branch consistency against workflow.json.branch.Mutation boundary (LOW freedom):
session.json and the target
work's workflow.json.workflow.json.attachment to the current worktree,
refresh workflow.json.branch from the current worktree branch, and refresh
liveness timestamps.protocols/state.md -- live ownership, attachment validation, subordinate rulesprotocols/context.md -- logical roots and session discoveryprotocols/git.md -- recorded branch context| Condition | Action | |-----------|--------| | No target work resolves | STOP: "Pass a work ID or run /sw-design first." | | Target work does not exist | STOP with a missing-work error | | Current session is subordinate | STOP: "Subordinate helper sessions cannot adopt work." | | Another live top-level worktree owns the target work | STOP with live-owner guidance | | Recorded branch mismatch for in-flight work | STOP with branch-consistency guidance |
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}.
tools
Ships the current work unit. Verifies all gates passed, creates a PR with evidence-mapped body, updates workflow state to shipped.