agentleFS
nearmapnearmap/shipyard/skills/shutdown/SKILL.md

shutdown

Skill1 starsChanged 21 days agoMITView on GitHub

Wind down one ticket's footprint on the user's request: stop lingering background tasks, remove its recoverable worktrees and branches, close the ticket. Anything unrecoverable or ambiguous is kept and asked about. For an MVP ticket, also release its environment hold and close it as decomposed. Use when asked to clean up or close out a ticket. Main session only; never from a `/sy:ship` worker or other subagent.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. mathruffian-dot/cross-device-agent-skills★ 27same name
    2. MarvinJWendt/skills★ 1same name
    3. Chadlenberg/chief-of-staff★ 0same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository15 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Only when a ticket is named or inferred from the current branch, run the tracker preflight …

    line 18
  2. Very specific:

    Stop lingering background tasks this session started and no longer uses: TaskStop, CronDelete, ending a /loop, killing the dev servers and …

    line 35

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Clean up after one ticket without losing work. The user's request is the approval: act directly on everything recoverable, and ask only about what is ambiguous or unrecoverable, which is listed as kept by default.

$ARGUMENTS

1. Preflight

Only when a ticket is named or inferred from the current branch, run the tracker preflight (${CLAUDE_PLUGIN_ROOT}/skills/shared/references/preflight.md); a failure stops here with its single ## Action needed block. With no ticket there is no tracker work and no preflight.

2. Inspect — read-only, scoped

  • Scope. The ticket's <ticket>/ branches and worktrees (with or without a worktree), the detached worktrees whose directory name starts with <ticket>- under the resolved worktree.root (get_config {"key": "worktree.root"}, per ${CLAUDE_PLUGIN_ROOT}/skills/shared/references/config-values.md). With no ticket: the current worktree only. Never touch pre-existing untracked files, user files in /tmp, already-modified lockfiles, other sessions' worktrees, or branches with an open PR; the one allowed touch is retargeting a PR stacked on a branch being deleted (§ 4 step 4).
  • Worktrees. git worktree list, and git status --porcelain --ignored in each. For a detached worktree also git branch -r --contains HEAD: empty means its HEAD is on no remote branch.
  • Branches. For each <ticket>/ branch, gh pr list --head <branch> --state all --json state,headRefOid; its tip is recoverable only if it equals a merged PR's headRefOid, or is an ancestor of origin/main or of the MVP ledger's newest harvest SHA (git merge-base --is-ancestor <branch> <ref>).
  • In-flight /sy:ship. ship-state.yaml exists in the ticket's scratch dir and its pr: is unset or not yet merged (gh pr view <pr> --json state).
  • MVP ticket. get-issue it: the newest # MVP ledger entry's whole agent_detail, its open hold and harvest SHA included, and whether a # MVP coverage manifest exists. A Task carrying a # MVP reference comment brings its MVP ticket into scope the same way, for the MVP branch alone.
  • MVP branch. When a manifest exists, get-issue every Task named by any manifest: the MVP branch is retired only when each of them has reached delivered closure, following replacement links per ${CLAUDE_PLUGIN_ROOT}/skills/tracker/SKILL.md § Closure is not delivery, no manifest row is owned by a named group, a manifest is newer than the newest harvest ledger entry, and its remote head equals the newest harvest SHA.

3. Kept, never deleted

Listed as kept, with the reason and the files named: a branch not judged recoverable and its worktree; a worktree with uncommitted changes; a worktree holding ignored files other than caches (__pycache__, .pytest_cache, .ruff_cache, .mypy_cache, node_modules, .pixi, .venv, target); a detached worktree on no remote branch; the worktrees and scratch directory of an in-flight /sy:ship, unless the user named that worktree or directory. Ask about these only if the user wants one gone, and ask through AskUserQuestion (${CLAUDE_PLUGIN_ROOT}/skills/shared/references/user-interaction.md).

4. Execute, in this order

  1. Stop lingering background tasks this session started and no longer uses: TaskStop, CronDelete, ending a /loop, killing the dev servers and ci_poll.sh pollers it started. A task still doing work the user asked for is kept.
  2. Primary checkout, as one Bash call (a lone cd outside the session's directories does not persist): cd <primary> && test -z "$(git status --porcelain)" && git switch main && git pull --ff-only.
  3. Worktrees, except the one this session runs in: git worktree remove without --force, then git worktree prune. The session's own worktree and its local branch are listed as kept, for the user to remove after /exit.
  4. Branches. Skip the local branch checked out in this session's worktree, which git refuses to delete. A local branch whose tip equals a merged PR's headRefOid: git branch -D (-d fails on squash merges). Any other recoverable branch: git branch -d, else keep it. A remote branch is deleted only when it still exists (git ls-remote --heads origin <branch>), its PR is merged, and the remote head equals that headRefOid. Before deleting it, retarget each open PR based on it (gh pr list --base <branch> --state open) to that merged PR's own base with gh pr edit <n> --base <base>, since the delete auto-closes them, and list each retarget in the closing report. The one other remote branch deleted is a retired MVP branch; nothing else remote.
  5. Scratch: remove this session's scratchpad. Keep the ticket's shipyard scratch_dir — it is the run record — unless the user asks.
  6. Tracker. A merged non-MVP ticket: set-status done if it is not already. An MVP ticket not already done: post the hold-release # MVP ledger entry per ${CLAUDE_PLUGIN_ROOT}/skills/mvp/references/loop.md § The ledger entry, only when the newest entry's hold is open, carrying the newest entry's snapshot forward with change: hold and hold: none; then, only when a # MVP coverage manifest exists, the canonical decomposition closure, steps 3-5 of ${CLAUDE_PLUGIN_ROOT}/skills/tracker/SKILL.md § Canonical decomposition, with the reference SHA beside the replacement IDs in agent_detail. With no manifest, ask through AskUserQuestion: keep the ticket open, or close it as abandoned (post-comment the reason, then set-status done).
  7. Offer a memory write if the session taught a lesson; optionally name the next ready ticket.

5. A denied action stays denied

Apply the denied-write boundary in ${CLAUDE_PLUGIN_ROOT}/skills/shared/references/write-integrity.md: never retry a denied action another way. Finish everything else, then end with one ## Action needed block listing each denied action as an exact ! <command> line the user can run.

6. Summary

Re-read git worktree list and — for a ticket — get-issue; confirm no stopped task is still running (pgrep -f '[c]i_poll.sh poll <PR>', CronList) and git branch --list '<ticket>/*'. End with what is left and why, and "type /exit".

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.