/projector:cleanupfrom Projector
Check that a session finished everything it was asked to do, ask what to do with anything left (do it now, open an issue for it, or leave it), release what the session holds, such as its subscriptions, inbox items, reviews, worktrees, and background processes, and confirm that the session is safe to shut down. Use when the user asks to clean up, wrap up, or shut down a session.
Ships in Projector. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
End a session without losing work or leaving anything running. First check that the session did everything it was asked to do. Then ask the user what to do with each thing that is left, release what the session holds, and confirm that the session can be shut down.
Run this skill from the conversation the user talks to, never from a subagent: a subagent cannot stop its siblings, and its processes end when it returns. Release only what this session created or holds. Never touch the user's own checkout, another session's worktree, subscription, or inbox item, or a branch or pull request the session did not create.
Projector's project watch and project inbox commands file what a session
holds under its id. Claude Code sets the id in CLAUDE_CODE_SESSION_ID. On
another host, it is the id the conversation chose when it first subscribed or
posted to the inbox, which PROJECTOR_SESSION may hold. Pass the id to every
project watch and project inbox command as --session <id>. On a host
that sets neither variable, project watch list without it lists every
session's subscriptions, and project inbox reads only PROJECTOR_SESSION
in any case. When the session never subscribed or posted, it has no id and
holds nothing under Projector's state directory.
Read the repository instructions.
Reread the conversation and list each thing the user asked for. Add each thing you said you would do later, each suggestion you deferred, each follow-up still owed on a pull request that merged, and each question you left for the user. For each item, find the evidence that it was delivered: a pull request URL, a commit on the remote, an answer you gave, or a command's output.
List what the session holds:
project watch list --session <id> --json
project inbox list --session <id> --json
git worktree list --porcelain
git stash list --format='%H %gd %gs'
project watch list prints each pull request and repository the session
fixes or reviews. project inbox list prints each question, notice, and
request still open in the inbox. From git worktree list, keep only the
worktrees this session created. From git stash list, keep only the
entries it pushed, and note each one's SHA. Add each subagent,
background command, monitor, project watch stream, and scheduled
wakeup or job that the session started, and each temporary file it wrote
outside its scratch directory.
For each worktree the session created, run git status --porcelain and
git log HEAD --not --remotes --oneline in it. For each local branch the
session created, run git log <branch> --not --remotes --oneline. Output
from any of them means changes that exist nowhere else. Name HEAD or the
branch rather than passing --branches, which walks every local branch in
the repository, the user's and other sessions' included, and misses
commits on a detached HEAD. A branch whose pull request was
squash-merged still prints its commits once its remote branch is
deleted, because the squash put different commits on the base. Such a
branch is delivered only up to the head its pull request merged at:
gh pr list --head <branch> --state merged --json number,headRefOid
git merge-base --is-ancestor <headRefOid> <branch>
git log <headRefOid>..<branch> --oneline
The commits up to headRefOid are delivered. Each commit that
git log <headRefOid>..<branch> prints, such as a follow-up made after
the merge, is a change that exists nowhere else. When the lookup finds no
merged pull request, or git merge-base --is-ancestor fails, as it does
when the merged pull request came from an unrelated branch of the same
name or its head is not in the local repository, the branch's unpushed
commits are all changes that exist nowhere else.
For each open pull request the session opened, pushed to, or reviews, run these commands:
project review status <number> --repo <owner>/<repo> --json
gh pr view <number> --repo <owner>/<repo> --json mergeable,statusCheckRollup
project review status reports the verdict on the current head, the
open finding threads, whether the head is signed off, and the Projector
labels on the pull request.
gh pr view reports whether the pull request conflicts with its base,
as mergeable reading CONFLICTING, and the result of each check, as a
check run's conclusion or a commit status's state. When
mergeable reads UNKNOWN, GitHub has not computed it yet, so ask again
after a few seconds.
When the session worked on a project, run project show <name> --json
and project check.
A gap is work the session owes that it has not delivered. Each of these is a gap:
## Testing section or ticket key its instructions require.fix-pr does this work.project review hold, which says a change is still being built, or kept
a draft while a request asks the user to test the change or to review
its plan.status or priority no longer matches the work, a project
the work completed that is not marked completed, or a warning from
project check. finish does this work.These are not gaps, because the session has no more work to do on them:
When there is no gap, go on to Release what the session holds.
Otherwise, ask one question for each gap. Say in a line what is left, and put the evidence in the detail: what the user asked for, what exists now, and where it lives, such as a branch, a pull request, or a worktree path. Offer these three answers, and recommend the one that fits:
When Projector's ask tool is available, ask there, one question per gap,
with the recommendation as its first answer. Otherwise, use the host's
question tool, or list the gaps in the chat and ask the user to answer each.
Release nothing that a gap depends on, such as the worktree that holds its
changes, until the gap's answer arrives.
When a gap is a change that exists nowhere else, say in its detail that leaving it keeps the worktree or stash and the changes in it. Discard them only when the user's answer says to.
implement for a
change, fix-pr for review work, finish for a plan, and write or
rewrite for prose. Hand the work over as that skill describes. The work
can open pull requests and add subscriptions, so start again from
Take stock of the session once it is done.gh issue create when they name none. First search the
tracker for an issue that already covers the work, such as with
gh issue list --search "<words>", and add to that issue instead of
opening a second one. Write the issue for someone who never saw this
conversation, as the writing guide in ../writing.md describes: what is
left, why it matters, where the work stands, and how to tell it is done.
Before you post, check the repository's visibility with
gh repo view <owner>/<repo> --json visibility, and follow the
repository instructions on what an issue may name. Put nothing from a
private repository into an issue in a public one. Keep each issue's URL
for the report.When a gap is a pull request the session held and the user chose an issue or
to leave it, mark it ready with
project review ready <number> --repo <owner>/<repo> once nothing more will
be pushed for it. A held pull request that no session marks ready stays a
draft, which GitHub refuses to merge however clean its review. Run the
command as a tool call of its own, not after cd and joined to no other
command, and never as a bare gh pr ready, as ../fix-pr/SKILL.md
describes under "Hold the pull request while changes are built".
Release each kind of resource in this order, so that nothing still running recreates what you released.
Steps 6 and 7 remove worktrees and branches without asking, on the strength of step 4 of Take stock of the session. That step ran before step 2 here stopped the subagents, and a subagent can commit or leave edits in a worktree in between. So run step 4's checks again on each worktree and branch just before you remove it. When they find a change that exists nowhere else, keep the worktree or branch and treat it as a gap: ask about it as Ask what to do with each gap describes, and remove it only when the answer says to discard the change.
Subscriptions. For each line project watch list printed, run
project watch remove <target> --role <role> --session <id>, adding
--model <model> for a review line. Another live session that
subscribes to the same pull request then owns its role at once. Skip each
line that project watch list marks excluded: true, a ! line that
keeps a pull request the user dismissed out of the session.
project watch remove leaves those lines, and they deliver nothing.
Remove the subscriptions first, because a live one can announce a new
head and start another review or fix after you stop the subagents.
Subagents and background work. Stop each subagent, background
command, monitor, project watch stream, and scheduled wakeup or job the
session started. A fixing subagent subscribes again after each push, so
once they have stopped, run project watch list --session <id> --json
again and remove any line a subagent added.
Reviews. For each pull request the session reviews, finish its review
so another session can take it over at once, as
../review-repo/SKILL.md describes under "Stop reviewing the repository".
project review finish removes the review's scratch worktrees, so they
need no step of their own.
Inbox items. Withdraw each item the session still has open, with
Projector's withdraw tool or with
project inbox withdraw <number> --session <id>. No session will read
the answer once this one shuts down. Name each withdrawn question or
request in the report, so nothing the user meant to answer is lost.
Agent registration. Run project agent unregister --session <id>,
so the user's other sessions stop listing and messaging this one and the
relay deletes its refs. It succeeds, and says so, when the session was
never registered, so run it whether or not the session registered or
subscribed. Say in the report whether it unregistered the session.
Worktrees. Remove each worktree the session created that the checks
above find holds no change that exists nowhere else. The user's request
to clean up is their consent, so remove these without asking. Leave a
worktree first when the session's working directory is inside it.
Remove it with the host tool that created it, such as Claude Code's
ExitWorktree for a worktree that EnterWorktree made, or otherwise
with git worktree remove <path> and then git worktree prune. A host
tool can refuse because the worktree's commits are missing from a local
branch, such as a stale local copy of the default branch, and tell you to
confirm with the user. The checks already compared those commits with
the remotes and the merged pull request, so pass the tool's override,
such as ExitWorktree's discard_changes: true, instead of asking
again. A refusal that names an uncommitted file makes the worktree a gap
like any other change the checks find. Pass an override or
--force for a worktree that holds a change that exists nowhere else
only when the user's answer to its gap said to discard the change.
Branches. Delete a local branch the session created only when its
pull request has merged or closed and the checks above find no change on
it that exists nowhere else, or when the user said to discard it. Delete
it with git branch -D, without asking: git branch -d refuses a
squash-merged branch once its remote branch is gone, because the squash
put different commits on the base, and the checks already proved its
commits delivered. Keep the branch of an open pull request.
Stashes and temporary files. Drop each stash entry the session
pushed and no gap kept. Another session can shift an entry's
stash@{n} position, and git stash drop refuses a SHA, so find the
entry's current reference by its SHA just before you drop it:
git stash list --format='%H %gd'
git stash drop 'stash@{<n>}'
A push between the two commands still shifts the reference, so compare
the SHA in the Dropped stash@{<n>} (<sha>) line that git stash drop
prints with the entry's SHA. When they differ, you dropped another
session's entry: put it back with
git stash store -m '<its message>' <dropped-sha>, then find your entry
again. Delete each temporary file the session wrote outside its scratch
directory.
Run the commands from
Take stock of the session again. Expect no
line from project watch list but those marked excluded: true, no open
item from project inbox list, and no worktree, stash entry, or running
process the session started, except what a gap's answer kept.
Then report, as a list with one entry per thing:
fix-pr on it from another session.End with one line that says the session is safe to shut down, such as "Everything is wrapped up, and you can shut this session down." Say it only when the check above passed. When something could not be released, say what and why instead, and do not say that the session is safe to shut down.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ninjudd/projector --plugin projectorOther plugins' skills for the same job
14 skills in this plugin
/artifactCreate or revise a static interactive page, visual explanation, chart, diagram, or small tool, with saved versions on the repository's Projector site. Use when the user asks to make an artifact or edit a published one. Do not use for backend applications or ordinary source-code changes./finishVerify a Projector project's acceptance criteria, record its outcome, and mark it done in the completing change. Use when implementation appears complete or the user ends a project as shipped, abandoned, or superseded./fix-prFix one pull request's outstanding review work once. Merge its base when the branch conflicts, verify each finding, fix and push the valid ones, reply to and resolve their threads, decline the rest with evidence, and implement or defer each suggestion, holding the pull request in draft while a change is built. Once it merges, take the suggestions and follow-ups still owed on it into a follow-up pull request without asking. Each push subscribes the session to fix the pull request, so later review work arrives as an event that runs this skill again in one subagent per pull request. Use when the user asks to fix, address, or answer review feedback on a pull request, or to resolve its merge conflicts.