git-workflows/skills/wrap-up/SKILL.md
End-of-session handler that first checks whether the current session's plan is actually complete. If complete: refresh repo, run quick retrospective, clean gone branches, and emit a forward-looking follow-up prompt. If incomplete: skip cleanup and emit one or more `cd`-into-worktree blocks paired with ready-to-paste resume prompts so the unfinished work can be picked up cold in a new session.
npx skillsauth add jacobpevans/claude-code-plugins wrap-upInstall 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.
State warning: Branch state, remote tracking, TaskList contents, and plan checklist state all change between invocations. Re-run every git/gh command and re-call
TaskListfrom Step 0; never trust prior outputs from this conversation.
/wrap-up has two paths. Step 0 decides which one runs.
| Step 0 outcome | Path | | ------------------------ | ----------------------------------------------------------------- | | Plan complete OR no plan | Path A — refresh repo, retrospective, clean branches, follow-up prompt | | Plan incomplete | Path B — emit resume blocks; skip Path A cleanup entirely |
The purge-pr focused mode (bottom of this file) bypasses Step 0 entirely.
There are two distinct things to keep straight here:
<HOME>/.claude/plans/<slug>.md. Plan mode writes it; the assistant reads
and edits it during implementation; it persists on disk after the session
ends. The file is the canonical store of the plan's content — the
checklist items, the context, the files to change. Step 0b reads it.~/.claude/plans/ is the one this session is working against.
That binding is the hard problem under parallelism, because many sessions
may be writing files into the same directory concurrently. Filesystem
heuristics (mtime, ctime, filename slug) all race. Step 0a resolves the
binding using the only signal that is scoped to one session: the
conversation transcript.When a session enters plan mode, the harness injects a <system-reminder> into
the conversation containing a literal ## Plan File Info: block that names the
plan file's absolute path (shape: <HOME>/.claude/plans/<slug>.md). That
reminder is session-local — it appears only in this session's transcript — and
it persists in conversation context after plan mode exits. So scanning the
conversation for that reminder is the deterministic way to find the plan path
for this session, no matter how many other sessions are running.
To resolve:
<system-reminder> blocks whose
body contains a path matching the regex
[^[:space:]]+/\.claude/plans/[^[:space:]]+\.md — any absolute path ending
under .claude/plans/, not just one specific user's home directory.Never search ~/.claude/plans/ by mtime, ctime, or filename pattern. Never
guess which plan belongs to this session.
If 0a returned a path, Read that exact file. Extract:
- [ ] / - [x]) with their line numbersCall TaskList. It is intrinsically session-scoped by the harness — no
disambiguation needed. Inspect status per task.
For checklist items without an explicit [x], decide based on this session's
actual evidence: file edits the assistant performed, command output, test
results visible in this conversation. Be conservative: if in doubt, treat as
incomplete. Never consult other sessions' transcripts.
The plan is complete iff:
TaskList task has status == "completed" (or the list is empty), ANDIf either set has unfinished items → Path B. Otherwise → Path A.
Run Steps A1 and A2 in parallel (they are independent). Step A3 starts as soon as Step A1 completes (depends on its remote prune). Step A4 runs after all prior steps finish. Provide a summary of actions taken.
Invoke /refresh-repo to:
[gone] remote branches)Invoke /retrospecting quick to capture a brief session retrospective:
Requires: claude-retrospective plugin (external). If not installed, skip this step and note it was skipped.
Invoke /clean_gone to remove any local branches whose remote tracking branch has been deleted:
[gone]Requires: commit-commands plugin (external). If not installed, skip this step and note it was skipped.
After the retrospective completes (or is skipped), generate a follow-up prompt for the next session.
Scan the conversation history in reverse chronological order, stopping when no new items appear for ~10 consecutive messages. Most unfinished forward-looking work surfaces near the end of a session.
Scan simultaneously for both categories:
Unfinished work (A4a):
Session issues (A4b):
Split the gathered items into two buckets:
gh issue list --state open --json number,title,url
for duplicates. Capture the url field — every issue or PR referenced in the
output below must be a full URL the user can click, never a bare #123.URL rule (applies to every section that mentions a PR or issue): always
emit the full https://github.com/<owner>/<repo>/(issues|pull)/<n> URL on
first reference. Bare #123 or PR 123 references are forbidden because they
force the reader to guess the repo from context. If the same number appears
again in the same block, a bare #123 is acceptable as a short reference
after the URL has been shown once.
Present the results in this format:
Follow-Up Session Prompt
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Recommended prompt for next session:
──────────────────────────────
<A ready-to-paste prompt covering the 1–3 quick-win tasks identified above. Be specific: reference file paths, function names, error messages, etc.>
──────────────────────────────
Recommended GitHub Issues:
──────────────────────────────
1. <Title> — <one-line summary> [new | update https://github.com/<owner>/<repo>/issues/123]
2. <Title> — <one-line summary> [new | update https://github.com/<owner>/<repo>/pull/456]
...
──────────────────────────────
Session Issues Log:
──────────────────────────────
- <error/warning/issue encountered, with context>
- ...
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
If no follow-up items are found, state that explicitly — do not fabricate work.
Wrap-Up Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Plan: <path or "none">
Plan status: complete
Refresh: done or skipped
Retrospective: done or skipped
Branch cleanup: done or skipped
Follow-up prompt: done or skipped
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Skip Path A entirely. Skipping is intentional: /refresh-repo prunes stale
worktrees, which would delete the in-flight worktree the user needs to resume
in.
Collect every unfinished item from Step 0 (plan checklist items still
unchecked + TaskList tasks with status != "completed") and group them with
judgement, not by repo alone:
For each block, resolve the working directory:
git -C <path> rev-parse --show-toplevel).Print blocks in dependency order. Each block must be copy-pasteable into a fresh terminal + new Claude session and runnable cold — the new session sees none of this conversation.
Resume Block N of M — <short label>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Working dir:
cd <absolute worktree path>
Resume prompt:
──────────────────────────────
<Self-contained prompt for this block. Must include:
- Plan file path so the new session can re-enter plan mode against it:
~/.claude/plans/<slug>.md (use the resolved absolute path emitted by the
plan-mode system reminder, not this literal example)
- Exact remaining checklist items with plan-file line numbers
- Any TaskList task IDs still pending and their subjects
- Relevant file paths from the plan
- Full URLs for any referenced PR or issue (e.g.
https://github.com/<owner>/<repo>/pull/123) — never a bare #123
- One-line "already done this session" so the new session does not redo work>
──────────────────────────────
Depends on: <block id, or "none">
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The resume prompt restates the goal explicitly. It must never say "continue what you were doing" or reference "this session" — the new session has no memory of it.
After all resume blocks, print:
Wrap-Up Summary (incomplete)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Plan: <plan-file path or "none">
Plan status: incomplete (<n> open checklist items, <m> open TaskList items)
Refresh: skipped — plan incomplete
Retrospective: skipped — plan incomplete
Branch cleanup: skipped — plan incomplete
Resume blocks: <count>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Invoke as /wrap-up purge-pr <PR_NUMBER> to close one PR and atomically
purge all local state for its branch. Bypasses Step 0 and both paths above.
Use when you know a PR should be closed (obsolete duplicate, workaround
anti-pattern, abandoned work) and you want the local trace gone in one
operation.
Sequence:
gh pr view <PR_NUMBER> --repo <owner>/<repo> --json headRefName --jq '.headRefName'.gh pr close <PR_NUMBER> --repo <owner>/<repo> --comment "<reason>" --delete-branch.git switch main
first so step 4 can remove it.git worktree list matching the captured
branch, then git worktree remove <path> --force if present, and
git branch -D <branch>.Closes the gap where gh pr close --delete-branch removes only the remote
branch and leaves the local branch + worktree behind. Reuses the
worktree-removal command shape from /troubleshoot-worktree and aligns with
/clean_gone's post-removal state.
--sweep and
--prune-stale modespurge-pr modepurge-pr is the right actiondocumentation
Use when editing GitHub Actions workflow files (.github/workflows/*.yml) in JacobPEvans repos. Documents when to target self-hosted RunsOn runners vs GitHub-hosted runners, the v3 label catalog used across the org, the required github.run_id segment, and the GitHub App allowlist prereq.
testing
Check PR merge readiness, sync local repo, cleanup stale worktrees; optional cross-repo sweep and stale-branch prune modes
tools
Local rebase-merge workflow for pull requests with signed commits
tools
Canonical reference for all gh CLI command shapes used by skills in this plugin. Defines the placeholder convention, allowed --json fields, GraphQL fallback rules, -f/-F/--raw-field flag semantics, the PR-readiness gate, code-scanning alert query, review-thread fetch/count/resolve mutations, and heredoc bodies. Prevents Unknown JSON field errors and divergent query shapes.