Agent skill

Cleanup

by yvanvds in yvanvds/yse-soundengine

Use after an issue's PR has been merged to wrap up the issue branch — close the issue, switch back to dev, fast-forward, and delete the local and remote feature branches.

MITAuto-check passed

Install Cleanup

skills CLI
$ npx skills add yvanvds/yse-soundengine --skill cleanup -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install yvanvds/yse-soundengine cleanup --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/yvanvds/yse-soundengine.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/cleanup .claude/skills/cleanup && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
cleanup
GitHub stars
238
Token cost
~2k tokens
SKILL.md length
1,049 words
Files
1
Skills in repo
4
Repo updated
First seen
Licence
MIT

At a glance

Use after an issue's PR has been merged to wrap up the issue branch — close the issue, switch back to dev, fast-forward, and delete the local and remote feature branches.

  • Works in 9 steps: Resolve target → Pre-flight checks → Verify branch is no longer needed → …
  • Phrases like cleanup
  • SKILL.md covers When to invoke this skill, Invocation, Procedure and Don'ts, plus 2 more sections
  • Calls git and gh

What it does

Cleanup is an agent skill from yvanvds/yse-soundengine. Use after an issue's PR has been merged to wrap up the issue branch — close the issue, switch back to dev, fast-forward, and delete the local and remote feature branches. Triggers on phrases like "cleanup", "cleanup issue N", "wrap up <branch", "post-merge cleanup", "I just merged the PR, clean up". Do NOT trigger before the PR is merged, on the dev or master branches themselves, or for cleanup of branches that were never linked to an issue (release-prep, sync PRs, etc.).

Its SKILL.md is about 2k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It works with GitHub. The repository describes itself as: advanced 3D sound engine. The licence is MIT.

When your agent uses it

  • Phrases like cleanup
  • Cleanup issue N
  • Wrap up <branch
  • Post-merge cleanup

Example prompts

  • “cleanup”
  • “cleanup issue N”
  • “wrap up <branch”
  • “/cleanup”

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Resolve target
  2. Pre-flight checks
  3. Verify branch is no longer needed
  4. Close the issue
  5. Switch to dev and pull
  6. Delete the local feature branch
  7. Delete the remote feature branch
  8. Prune stale remote-tracking refs
  9. Report

What it can do on your machine

Read from SKILL.md and the folder at commit 911ea2d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • git
    • gh

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use git and gh, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Cleanup loads about 2k tokens when it runs. Until then it costs about 122 tokens; SKILL.md has 1,049 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~122
When it runs · the whole SKILL.md, loaded when a task matches
~2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from yvanvds/yse-soundengine at commit 911ea2d, republished under its MIT licence (© yvanvds). 1,049 words, ~1,996 tokens.

Download SKILL.mdSave it as .claude/skills/cleanup/SKILL.md (or your agent's skills folder).
name
cleanup
description
Use after an issue's PR has been merged to wrap up the issue branch — close the issue, switch back to dev, fast-forward, and delete the local and remote feature branches. Triggers on phrases like "cleanup", "cleanup issue N", "wrap up <branch>", "post-merge cleanup", "I just merged the PR, clean up". Do NOT trigger before the PR is merged, on the `dev` or `master` branches themselves, or for cleanup of branches that were never linked to an issue (release-prep, sync PRs, etc.).

Post-merge cleanup for an issue branch

CLAUDE.md establishes the project's branch flow: every change starts as a GitHub issue, gets a branch named <issue-number>-<short-slug> from dev, and PRs back to dev. Once the PR is merged, four loose ends remain:

  1. The GitHub issue is still open (PRs merged to dev don't trigger GitHub's Closes #N auto-close — that only fires on the default branch master).
  2. The local feature branch still exists.
  3. The remote feature branch still exists (deleteBranchOnMerge is false on this repo).
  4. Local dev is behind the merged PR.

This skill handles all four in one pass and leaves the workspace on a fresh dev ready for the next issue.

When to invoke this skill

Yes:

  • The user says "cleanup", "cleanup issue N", "wrap up", or similar after confirming a PR merged.
  • The user is on a feature branch whose PR is already merged.

No:

  • The PR has not merged yet — the skill refuses by design (step 3 below).
  • The current branch is dev, master, or a release branch — pass the feature branch name as an argument instead.
  • The branch is a release-prep, dev→master sync, or other non-issue branch. The skill keys on the <issue-number>-<slug> naming pattern; branches that don't match need manual cleanup.

Invocation

Two forms:

/cleanup            # infer the target from the current branch
/cleanup 110        # by issue number
/cleanup 110-sphinx-cdecl-warnings  # by branch name

When no argument is given, git branch --show-current is the target. The issue number is the leading integer of the branch name, matched as ^(\d+)-. If the current branch doesn't match the pattern, bail with a message telling the user to pass an explicit argument.

Procedure

1. Resolve target
  • If an argument was given:
    • All digits → treat as issue number; resolve the branch via git branch --list "<n>-*" (local) or gh pr list --search "<n> in:title" --json headRefName (remote, if local already gone).
    • Otherwise → treat as the branch name; extract issue number with the ^(\d+)- regex.
  • If no argument: use git branch --show-current; extract issue number the same way.
  • Refuse if current branch is dev or master and no argument was given — there's nothing to infer.
2. Pre-flight checks

All four must hold or the skill bails with a clear error:

  • git status --porcelain is empty (clean working tree). Otherwise switching branches would silently carry changes across or refuse.
  • gh pr list --head <branch> --state merged --json number,mergedAt returns at least one merged PR. Capture the PR number for the close comment. If zero results, surface: "No merged PR found for <branch>; did you mean to wait until after merge?"
  • gh issue view <n> --json state succeeds. If the issue is already closed, skip step 4 silently and continue.
  • The feature branch is not currently dev or master.
3. Verify branch is no longer needed

git log dev..<branch> --oneline — if non-empty, the local branch carries commits that aren't on dev. That usually means the PR was squash- or rebase-merged and the local branch's commit SHAs differ from what landed. This is normal and expected for squash merges. Note it; do not refuse. Step 6's git branch -d will refuse on unsafe deletes anyway.

4. Close the issue

If the issue is open:

sh
gh issue close <n> --comment "Resolved by #<pr> (merged to dev)."

Use --reason completed. Skip if already closed.

5. Switch to dev and pull
sh
git checkout dev
git pull --ff-only origin dev

--ff-only prevents the skill from creating a merge commit if dev has diverged locally (which would itself be a flag that something is off — surface and stop).

6. Delete the local feature branch
sh
git branch -d <branch>

Use -d, not -D. If git refuses because the branch isn't fully merged (common with squash merges), surface the actual git error and ask the user whether to force-delete:

Local branch <branch> has commits not on dev (likely a squash merge — the change is on dev under a different SHA). Force-delete with git branch -D <branch>?

Wait for the user's reply before running -D. Don't quietly upgrade.

Show full SKILL.md (423 more words)Show less
7. Delete the remote feature branch
sh
git push origin --delete <branch>

If the remote branch is already gone (e.g., someone else deleted it via the GitHub UI), git push will exit non-zero with a "remote ref does not exist" message. Treat that specific error as success and continue.

8. Prune stale remote-tracking refs
sh
git fetch --prune

Cleans up origin/<branch> so git branch -a reflects reality.

9. Report
Cleaned up #<n>:
  Issue:           closed (Resolved by #<pr>)
  Local branch:    deleted (<branch>)
  Remote branch:   deleted (origin/<branch>)
  Current branch:  dev (up to date with origin/dev)

If any step was skipped (issue already closed, branch already deleted), note it explicitly rather than silently.

Don'ts

  • Don't force-delete the local branch (git branch -D) without asking. Squash-merge mismatch is the common reason -d refuses, but there's also the bad reason: the user forgot to push commits. Always surface and confirm.
  • Don't run on a dirty working tree. Step 2 catches this; don't attempt to stash, commit, or discard on the user's behalf.
  • Don't run git pull without --ff-only. A divergent local dev means something is off — surface it, don't auto-merge.
  • Don't close the issue with a generic "done" comment. The "Resolved by #<pr> (merged to dev)" format matches the manual closes already in the history and gives readers a one-click hop to the PR.
  • Don't chase other issues mentioned in the PR body (fixes #X, also closes #Y). The skill targets one issue — the one named by the branch. Multiple referenced issues are rare here; let the user handle them explicitly.
  • Don't delete a remote branch that the merged PR doesn't own. Step 2's gh pr list --head <branch> is the authorization check.
  • Don't run this skill on release-*, release/*, or any branch not matching ^\d+-. Those are managed by the release skill or by hand.

Example interaction

User: "/cleanup"

You:

  1. git branch --show-current → 110-sphinx-cdecl-warnings. Issue number 110.
  2. git status --porcelain → empty.
  3. gh pr list --head 110-sphinx-cdecl-warnings --state merged → PR #111, merged.
  4. gh issue view 110 --json state → OPEN.
  5. gh issue close 110 --comment "Resolved by #111 (merged to dev)." → closed.
  6. git checkout dev && git pull --ff-only origin dev → fast-forwarded.
  7. git branch -d 110-sphinx-cdecl-warnings → deleted.
  8. git push origin --delete 110-sphinx-cdecl-warnings → deleted.
  9. git fetch --prune → pruned origin/110-sphinx-cdecl-warnings.
  10. Report.

File / branch invariants this skill assumes

  • Branches matching the issue convention are named <n>-<slug> where <n> is the GitHub issue number. CLAUDE.md §1.
  • The gh CLI is authenticated.
  • dev is the integration branch; merged PRs target dev.
  • deleteBranchOnMerge is false on this repo (verified via gh repo view --json deleteBranchOnMerge). Remote-branch deletion is this skill's responsibility, not GitHub's. If that setting is ever flipped to true, step 7's "already gone" handling becomes the common path.

© yvanvds, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/cleanup of yvanvds/yse-soundengine.

Open the folder on GitHubat commit 911ea2d

Compare with similar skills

Cleanup next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Cleanup compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Cleanup this skillyvanvds/yse-soundengine238—~2kAutomated safety check: PassMIT
PR Babysitteropeninterpreter/openinterpreter69k3 repos~4.2kAutomated safety check: PassApache-2.0
Diagnosing Superpowers Sessionsobra/superpowers296k3 repos~1.7kAutomated safety check: PassMIT
GitHub Deep Researchbytedance/deer-flow83k5 repos~1.3kAutomated safety check: PassMIT
Greplooponyx-dot-app/onyx32k4 repos~3.3kAutomated safety check: PassMIT
Update V8 Versionopeninterpreter/openinterpreter69k2 repos~845Automated safety check: PassApache-2.0

Similar skills

  • PR Babysitter

    openinterpreter/openinterpreter

    Watches an open GitHub pull request until it merges, handling review comments, diagnosing CI failures and retrying flaky checks along the way.

    69k GitHub starsUsed in 3 repos~4.2k tokens
    DevelopmentAuto-check passed
  • Investigates a session where Superpowers went wrong, reads the transcripts on disk and produces an evidence-cited report, optionally prepared as a bug report for the maintainers.

    296k GitHub starsUsed in 3 repos~1.7k tokens
    Agent WorkflowsAuto-check passed
  • GitHub Deep Research

    bytedance/deer-flow

    Researches a GitHub repository over four rounds using the GitHub API and web search, then writes a structured markdown report with timeline, metrics and Mermaid diagrams.

    83k GitHub starsUsed in 5 repos~1.3k tokens
    Research & ScienceAuto-check passed
  • Greploop

    onyx-dot-app/onyx

    Iteratively improves a PR (GitHub), MR (GitLab), or shelved changelist (Perforce) until Greptile gives it a 5/5 confidence score with zero unresolved comments.

    32k GitHub starsUsed in 4 repos~3.3k tokens
    DevelopmentAuto-check passed
  • Update V8 Version

    openinterpreter/openinterpreter

    Bumps the pinned v8 and rusty_v8 versions in Codex, validates the release-candidate path with the v8-canary check, and traces failures to upstream build changes.

    69k GitHub starsUsed in 2 repos~845 tokens
    DevOps & CloudAuto-check passed
  • Last30days

    mvanhorn/last30days-skill

    Research what people actually say about any topic in the last 30 days.

    64k GitHub stars~7.8k tokensUpdated today
    Research & ScienceAuto-check: notes

More from yvanvds/yse-soundengine

  • C API Extend

    yvanvds/yse-soundengine

    A skill your agent uses when extending the C API at YseEngine/capi/ — wrapping a new engine class, method, enum, or callback — or when auditing the C API for drift from the engine's public surface.

    238 GitHub stars~4.4k tokensUpdated 8 days ago
    Auto-check passed
  • Fix Issues

    yvanvds/yse-soundengine

    A skill your agent uses when fixing compiler warnings, static analyzer findings (clang-tidy, etc.), or runtime errors/crashes in the libYSE codebase.

    238 GitHub stars~3k tokensUpdated 8 days ago
    Auto-check passed
  • Release

    yvanvds/yse-soundengine

    A skill your agent uses when the user asks to cut a new release of libYSE — phrases like "release a new version", "cut a patch/minor/major release", "publish a new release", "ship X.Y.Z".

    238 GitHub stars~3.8k tokensUpdated 8 days ago
    Auto-check passed

Works with

Questions about Cleanup

What does Cleanup do?

Use after an issue's PR has been merged to wrap up the issue branch — close the issue, switch back to dev, fast-forward, and delete the local and remote feature branches. Cleanup is an agent skill from yvanvds/yse-soundengine. Use after an issue's PR has been merged to wrap up the issue branch — close the issue, switch back to dev, fast-forward, and delete the local and remote feature branches.

When should I use Cleanup?

Cleanup fits situations like: phrases like cleanup; cleanup issue N; wrap up <branch; post-merge cleanup.

How do I install Cleanup in Claude Code?

Run `npx skills add yvanvds/yse-soundengine --skill cleanup -a claude-code`. Or copy the skill folder (.claude/skills/cleanup in yvanvds/yse-soundengine) into .claude/skills/cleanup in your project. Claude Code loads it when a task matches its description.

How do I install Cleanup in Codex?

Run `npx skills add yvanvds/yse-soundengine --skill cleanup -a codex`. Or copy the skill folder (.claude/skills/cleanup in yvanvds/yse-soundengine) into .agents/skills/cleanup in your project. Codex loads it when a task matches its description.

Can I use Cleanup in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add yvanvds/yse-soundengine --skill cleanup -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/cleanup, .gemini/skills/cleanup, .github/skills/cleanup and .opencode/skills/cleanup in your project.

What does Cleanup need to run?

Going by SKILL.md and its folder, Cleanup needs the command-line tools its instructions call (git and gh).

Does Cleanup access the network?

SKILL.md contains no URLs. Its commands use git and gh, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Cleanup safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Cleanup use?

Cleanup is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Cleanup use?

About 2k tokens (SKILL.md is roughly 8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Cleanup?

Skills that share tags, products or a category with Cleanup: PR Babysitter (openinterpreter/openinterpreter, 69k stars), Diagnosing Superpowers Sessions (obra/superpowers, 296k stars), GitHub Deep Research (bytedance/deer-flow, 83k stars) and Greploop (onyx-dot-app/onyx, 32k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Cleanup?

yvanvds (a GitHub user) maintains it in yvanvds/yse-soundengine, which has 238 GitHub stars. The repository holds 4 skills in this directory. The repository was last updated on September 29, 2026.

Source: yvanvds/yse-soundengine on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.