sw-adopt
Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
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.
Detects project stack and existing guardrails, then interactively configures deterministic quality checks across session, commit, push, and CI/CD layers.
Initializes Specwright in a project. Detects stack, asks about practices, creates constitution and charter, configures quality gates and hooks.
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}.
Periodic codebase health check. Analyzes architecture, complexity, consistency, and debt across the full codebase. Produces persistent findings in AUDIT.md.
TDD implementation of one work unit. Delegates test writing to the tester agent and implementation to the executor agent. Commits per task.
| name | sw-adopt |
| description | Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency. |
| argument-hint | <work-id> |
| allowed-tools | ["Read","Write","Bash","Glob"] |
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 |