/spwf:pausefrom spwf
Interrupt-safe context switch. Documents the current branch's state in the active todo file, commits and pushes the in-flight work with a structured commit message describing achievements and next steps, then switches to main ready for the next capture. Use when an urgent task interrupts mid-flight and a git worktree isn't an option. Argument optional; pass the next ticket reference (e.g. /spwf:pause ACAD-99) and the report includes a ready-made capture command.
Ships in spwf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Mid-flight context switch. The current branch's state is documented in the
active todo file, committed and pushed with a structured message, and the
user is left on main ready for the next capture.
The expected scenario: you are mid-build on a feature branch, an urgent bug
arrives, worktrees aren't an option (or aren't worth the friction), and you
need to step away cleanly. Resume later with git checkout {branch} —
/spwf:wfstatus will rehydrate context.
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || halt "Not in a git repo."
BRANCH=$(git branch --show-current)
DEFAULT_BASE=${DEFAULT_BASE:-main}
# Already on the base branch — nothing to switch from
if [ "$BRANCH" = "$DEFAULT_BASE" ] || [ "$BRANCH" = "master" ]; then
halt "Already on \`$BRANCH\` — pause has nothing to switch from."
fi
# Anything to pause? Working tree dirty OR commits ahead of upstream
DIRTY=$(git status --porcelain | wc -l | tr -d ' ')
AHEAD=0
if git rev-parse --abbrev-ref @{u} >/dev/null 2>&1; then
AHEAD=$(git rev-list --count @{u}..HEAD 2>/dev/null || echo 0)
fi
if [ "$DIRTY" = "0" ] && [ "$AHEAD" = "0" ]; then
halt "Nothing to pause — working tree is clean and \`$BRANCH\` is up to date with its upstream. Just run \`git checkout $DEFAULT_BASE\`."
fi
Collect, but do not act on yet:
BRANCH — current branchtodo/{slug}.md or todo/BUG-{slug}.md
whose name matches the branch name or change-id slug. If multiple
candidates: take the most recently modified. If none: proceed with no
todo update.change-id if present) or by directory match in openspec/changes/.
Read its tasks.md if it exists.[x] line in tasks.md.[ ] line in tasks.md after the last [x].git status --short parsed into modified, staged,
and untracked counts.git log @{u}..HEAD --oneline.Print a summary and confirm with one prompt:
Pause `{BRANCH}`?
Active todo: todo/{slug}.md ({title}) | (no todo file matched)
OpenSpec: {change-id} — {N}/{M} tasks complete | (no openspec change)
Last task: {last [x] task description} | (none yet)
Next task: {next [ ] task description} | (no tasks pending)
Working tree: {N} modified, {M} staged, {K} untracked
Ahead of upstream: {N} commit(s)
Continue? [Y/n]
If 'n': abort cleanly, change nothing.
The user's own words about what's in flight. This is the most important content of the pause record — don't infer it from commits.
What's the state? One paragraph or a few lines describing what's in flight
and what to do next on resume:
Wait for input. If the user provides nothing, fall back to a generated summary (last task complete + next task) but flag it as auto-generated.
Append a section to the active todo file. Do not overwrite earlier
sections. If the file already has a ## Pause — section, append a new
one — multiple pauses build a journal.
## Pause — {YYYY-MM-DD HH:MM}
### State
{user-provided note}
### Last task complete
{last [x] from tasks.md, or "no tasks completed yet"}
### Next task
{next [ ] from tasks.md, or "see ## Rough scope"}
### Uncommitted at pause
{list of modified/staged files; "(clean tracked tree)" if none}
### Untracked at pause
{list of untracked files; "(none)" if empty; this section omitted if no
untracked files existed}
If no active todo file was identified, skip this step. The pause commit will still happen with the user's note in its body.
Show git status to the user. Two questions:
Stage modified and deleted tracked files for the pause commit? [Y/n]
Default yes — these are usually the in-flight work the user wants preserved. If 'n', skip staging entirely (the pause commit will only include the todo file update, if any).
If 'y' or enter:
git add -u # modified + deleted, no untracked
git add todo/{slug}.md 2>/dev/null # the pause section we just appended
If untracked files exist, ask separately:
Untracked files:
scratch/notes.md
experiments/poc.py
Include any of these in the pause commit? [N/y/select]
git add all untracked.Default no on untracked because they're usually scratch / personal / .env-style files that shouldn't be committed without thought.
Construct a structured commit message:
wip: pause {change-id-or-branch} — {one-line summary derived from user note}
State at pause:
{user-provided state note, wrapped at 72 chars}
Achieved so far:
- {last [x] tasks, up to 5}
{or "- No tasks completed yet" if none}
Next on resume:
- {next [ ] task and any subsequent unchecked items, up to 3}
{or "- See ## Rough scope in todo file" if no tasks.md}
Pause point committed via /spwf:pause.
Show the message and ask:
Commit with this message? [Y/n/edit]
$EDITOR for the user to refine, then
commit.git commit -m "{message}"
If commit fails (pre-commit hook, etc.): halt with the error. The user can
fix the hook issue and re-run. Per CLAUDE.md, do not pass --no-verify.
if git rev-parse --abbrev-ref @{u} >/dev/null 2>&1; then
git push
else
git push --set-upstream origin {BRANCH}
fi
If push fails (diverged, force-pushed remote, no permission): halt with the error and surface the remediation. Pause is only "done" when the work is on the remote — without that, switching to main risks losing context if the local clone is lost.
git checkout {DEFAULT_BASE}
git pull --ff-only
If checkout fails (it shouldn't, the working tree is now clean): halt.
If pull fails (diverged, conflicts on the base branch — rare but possible): warn but proceed. The user is on the base branch, just not at its latest. Note this in the report.
✓ Paused branch `{BRANCH}`
✓ Updated todo/{slug}.md with pause section | — No todo file matched
✓ Pushed pause commit to origin/{BRANCH}
✓ Now on `{DEFAULT_BASE}` (latest) | ⚠ Now on `{DEFAULT_BASE}` ({M} commits behind origin/{DEFAULT_BASE} — pull failed: {reason})
To resume `{BRANCH}` later:
git checkout {BRANCH}
/spwf:wfstatus
Ready for next capture:
/spwf:capture {arg} ← if $ARGUMENTS was provided
/spwf:capture ← otherwise
If $ARGUMENTS was provided (e.g. /spwf:pause ACAD-99), the report's
"Ready for next capture" line shows the ready-made command with that
reference.
/spwf:build (or
the user manually) marks tasks [x].git checkout {branch} + /spwf:wfstatus. A
dedicated /spwf:resume skill is deferred — most resume needs are
covered by wfstatus reading the pause section in the todo file.## Pause — section to the todo file; the most recent one is the
current state. Older pause sections are journal entries.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub simon-potter/spwf --plugin spwf38 skills in this plugin
/address-reviewPhase 6.5 — Address Review. Turn review feedback into action. Sources feedback from either a local report file (e.g. {branch}-review.md from /spwf:pr-review or {branch}-self-review.md from /spwf:simplify) or fetched human comments on an open PR/MR. For each item runs READ → VERIFY → EVALUATE → implement-or-push-back, in priority order (blocking → important → nit). Forbids performative agreement ("you're absolutely right"). Use after pr-review, or whenever a reviewer leaves comments./agent-optimiseCross-cutting — Audit both the project .claude/ and personal ~/.claude/ for quality issues. Covers CLAUDE.md scope and length, agent descriptions, skill frontmatter, and settings.json conflicts. Always audits both scopes. Produces a prioritised P1/P2/P3 fix list./approve-planPhase 2 — Approve plan. Reviews the task list from spec for quality (atomicity, testability, clarity), then applies four adversarial lenses (Skeptic, Architect, Minimalist, Security) as advisory input for the human reviewer. Quality issues are blocking; adversarial findings are advisory. Security lens identifies tasks touching auth, billing, user input, or secrets so the builder has explicit awareness before writing those tasks. Presents everything for explicit human go/no-go before building starts./branch-rescueRecovery skill — moves commits that landed on the base branch onto a proper feature branch and resets local base, without touching origin. Resolves the active OpenSpec change, detects the pre-spec base commit (subject-line grep with manual-confirm fallback), performs three local-only safe git operations, and surfaces the force-push command for the user to run manually. Run standalone; pr-create's rescue offer runs the same procedure inline (_shared/branch-management.md §4), because this skill is user-only./briefPhase 1.5 — Explain a planned change before it is built. Runs between spec and approve-plan, so a mismatch costs a conversation rather than a change. Five sections, expanding then summarising — what will be built, why this way, the choices you didn't make, what it touches, and a short summary. Never blocks: it prints, offers one skippable prompt, and returns. Calibrated via .spwf/learner.md. Companion to recap and understand, which teach after the fact; this teaches before. Runs on changes, not bug fixes./buildPhase 3 orchestrator — Full Red-Green-Refactor cycle. For each pending task: invokes write-tests (Red: write failing tests), then opsx:apply (Green: implement via OpenSpec), then run-tests (Verify: confirm green before moving on). Loops until all tasks complete. After all tasks complete, runs opsx:verify (spec sign-off), then recommends simplify (Refactor).