Skip to content
Back to skills

Adopt Wip

ASecurity

Salvage coherent uncommitted work left in a stalled worktree or abandoned agent session. Use when resuming a run, when a parallel worktree contains valuable WIP, or when deciding whether to adopt, finish, and ship existing work instead of rebuilding from scratch.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 26, 2026
ai-agentsrustbashgitapi

Works with

  • api

Security analysis

A100/100

Scanned September 26, 2026

npx -y skills add austinmao/feature-fix-swarm --skill adopt-wip --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Adopt Wip?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Adopt Wip
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/austinmao-adopt-wip/badge)](https://www.skillsdirectory.com/skills/austinmao-adopt-wip)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: adopt-wip
description: "Salvage coherent uncommitted work left in a stalled worktree or abandoned agent session. Use when resuming a run, when a parallel worktree contains valuable WIP, or when deciding whether to adopt, finish, and ship existing work instead of rebuilding from scratch."
version: "1.2.0"
---

# /adopt-wip

## Host dispatch contract

- Codex: `$skill`, Codex collaboration roles, and GPT-5.6 tiers.
- Claude: `/skill`, Agent/Skill tools, and Claude aliases.
- A bare `/skill` in this shared source denotes the Claude form; Codex dispatches the same named skill as `$skill`.

Adopt stalled work only after confirming it is not active, and give the
adopted diff NO gate discount.

Ported from the fable-agent-orchestration `orphaned-wip-adopter` skill
(Apache-2.0).

## When to run

- `/feature-implement --resume` finds a worktree with uncommitted changes for
  a task it is about to rebuild.
- A parallel spec worktree under `.claude/worktrees/` went quiet mid-run.
- An agent session died (context exhaustion, kill, crash) leaving a dirty
  tree.

## Procedure

1. **Confirm the worktree is stale — never touch active work:**
   - file mtimes (`find <worktree> -newer <ref> -type f` — anything touched in
     the last few minutes suggests a live session);
   - running processes / session status where observable;
   - **composite liveness consult** — before declaring the WIP abandoned, run
     `bash scripts/gsd/liveness-check.sh <pidfile> <state-dir>` (adds to, does
     not replace, the checks above). It ANDs three signals — pid alive,
     newest mtime under `<state-dir>` fresh within `LIVENESS_WINDOW_MIN`
     (default 30), and an in-flight `ship:gsd` grant — and reports ALIVE
     (exit 0) if ANY holds. Exit 1 (DEAD, all three signals false) → truly
     abandoned, safe to adopt. Exit 0 (ALIVE) → WAIT, do not touch; one
     transient failed probe must never kill a live overnight wave. Accepted
     risk: a reused PID reads as alive (window-bounded false-alive, not
     unbounded — mtime and grant signals bound the exposure).
   - when in doubt, WAIT.
2. **Read the uncommitted diff** (`git -C <worktree> diff` + `status`). Whole
   thing, not a skim.
3. **Assess coherence:**
   - does it compile / plausibly compile?
   - does it use existing APIs correctly (spot-check 2-3 call sites against
     current signatures)?
   - is the design sound, or a dead-end the session was already backing out
     of?
4. **Exercise the load-bearing claim** — run the one test/command that shows
   whether the WIP's core change works.
5. **Decide:**
   - **Adopt** when coherent and faster than rebuilding: rebase or replay
     onto current main, fill gaps, add the fail-under-broken (RED) proof, run
     the FULL normal gate chain (`gates.py run-red` / `run-gate`,
     review-gate). Adopted code earns zero trust — it skipped no gates, it
     merely skipped retyping.
   - **Rebuild** when incoherent or unsalvageable — delete-or-stash the WIP
     with a one-line note so the next reader doesn't re-litigate it.
   - **Wait** when the session may still be active.
6. **Credit the adoption** in the PR/commit body ("adopts WIP from
   <worktree/branch>") so history explains where the diff came from.

## Anti-patterns

- Adopting a diff because it's big ("so much work, must be valuable") —
  coherence and correctness decide, not volume.
- Skipping the RED proof because "the WIP already had tests" — verify those
  tests fail under broken behavior before trusting them.
- Merging adopted work without review-gate because the original task "already
  passed review" — that review saw different code.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.