Command Palette

Search for a command to run...

Назад к скиллам
скилл № 58636

cleanup

Post-merge harness cleanup. Verifies that the PRs merged with the agent's own tools, removes the worktrees of the workflow and syncs the merged branches…

БесплатноБез исполняемых скриптов
lvlup-swот lvlup-sw★ 19 звёзд на GitHub

Установить cleanup в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Cleanup Skill

Overview

Cleanup is harness work after the merge. It makes no Remit call.

The settle that judged the synthesis boundary moved the workflow to completed before the PRs opened. Remit has no cleanup action, no worktree action and no merge record. Cleanup removes what the harness made: the worktrees of the tasks and the merged local branches.

VCS Provider

Remit reads no PR, CI or review state, and it does no VCS write. Read the merge state of each PR with your own tools: gh or the GitHub MCP server for GitHub, glab for GitLab, az repos for Azure DevOps. If your tools cannot do a read or a write, stop and report. There is no Remit fallback.

Triggers

Activate this skill when:

  • User runs cleanup command
  • User says "cleanup", "mark as done"
  • The PRs of a completed workflow have merged

Prerequisites

  • The PRs of the workflow are merged
  • The worktrees of the workflow are clean, or their work is committed

Process

1. Identify the workflow

Read the workflow, to confirm that it is completed and to list its tasks:

remit describe -f <featureId> --json

If the phase is not completed, the boundary is open. Do not remove the worktrees: a correction needs them. Go back to the delegate skill or the review skill.

2. Verify the merge

For each PR of the workflow, verify that it merged. Read each PR with your own tools:

gh pr view <number> --json number,url,state,mergedAt,headRefName

Collect the head branch names of the merged PRs (mergedBranches). Safety check: if ANY PR is not merged, stop with a clear message. A read that fails is never "merged". See references/merge-verification.md.

3. Post-merge regression check (advisory)

Run the test command of the project once on main after the merge, with the project tools. A failure is a finding to report to the user. It does not block the cleanup, and it is not a Remit record.

4. Remove the worktrees

Remove the worktrees of this workflow with git:

  • Subjects. Remove only the worktrees of this workflow: the worktreePath of each claim that the settle requests of this workflow named. Never remove a directory that a glob or a listing finds.
  • Skip and resolve first. Skip a worktree that is in use, that is dirty (untracked files count), or whose HEAD is not an ancestor of the merged branch. Resolve the reason before you remove it. The merged branch is the local tip of the head branch of the merged PR, not the base, because a squash merge leaves no ancestry to the base.
  • Never force. Never force-remove a worktree, and never remove one with uncommitted work.
git worktree remove <worktreePath>

Handle a worktree that is already removed as done.

5. Branch sync

Remove the merged local branches:

git fetch --prune
git branch -d <merged-branch-1> <merged-branch-2> ...

6. Report completion

## Cleanup Complete

**Feature:** <featureId>
**Phase in Remit:** completed (set by the boundary settle)
**PRs merged:** <count>
**Worktrees removed:** <count>
**Branches synced:** ✓

Error Handling

Problem Cause Resolution
The phase is not completed The boundary settle did not happen Settle until the boundary holds, then synthesize
A PR is not merged Cleanup ran too early Wait for the merge
git worktree remove refuses The worktree is dirty or locked Commit or discard the work first, then remove it

Anti-Patterns

Don't Do Instead
Skip merge verification Always verify the merge with your own tools first
Remove worktrees before the boundary settle Keep them until the workflow is completed and merged
Force-remove a dirty worktree Resolve the work first
Call Remit to mark the workflow done Nothing to call: the settle already completed it
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/merge-verification.md

FAQ

Что делает скилл cleanup?

Post-merge harness cleanup. Verifies that the PRs merged with the agent's own tools, removes the worktrees of the workflow and syncs the merged branches. Makes no Remit call: the boundary settle already moved the workflow to completed. Use when the user says 'cleanup', 'mark as done', or runs /cleanup. Do NOT use before PRs are merged.

Как установить скилл cleanup?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл cleanup запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить cleanup с