Skip to content
Agent Orchestration
Command

/repo-clean-up

Remove failed/canceled GitHub Actions runs and stale remote branches

From plugin
vmark
4987 skills9 agents7 commands2 MCP
Install
$ npx -y skills add xiaolai/vmark --agent claude-code

How it fires

How this command gets triggered: by you, by Claude, or both.

  • Fires itselfClaude auto-loads it when your prompt matches the work.
  • You can call itInvoke it directly when you want it.
  • Slash command/repo-clean-up

Context preview

What this command does when you run it.

Remove failed/canceled GitHub Actions runs and stale remote branches

Command definition

repo-clean-up.md
description: Remove failed/canceled GitHub Actions runs and stale remote branches

Repository Cleanup

Clean up the remote repository by removing failed CI artifacts and stale branches.

Step 1: Delete Failed GitHub Actions Runs

gh run list --status failure --limit 100 --json databaseId --jq '.[].databaseId'

Delete each run with `gh run delete <id>`.

Report: `Deleted N failed runs.`

Step 2: Delete Canceled GitHub Actions Runs

gh run list --status cancelled --limit 100 --json databaseId --jq '.[].databaseId'

Delete each run with `gh run delete <id>`.

Report: `Deleted N canceled runs.`

Step 3: Delete Stale Remote Branches

List all remote branches except `main`:

git fetch --prune
gh api repos/{owner}/{repo}/branches --paginate --jq '.[].name' | grep -v '^main$'

Delete each branch with `gh api -X DELETE repos/{owner}/{repo}/git/refs/heads/{branch}`.

Report: `Deleted N remote branches.`

Step 4: Prune Local Tracking References

git fetch --prune

Summary

Report total cleanup: `Cleanup complete: N failed runs, N canceled runs, N branches removed.`

Ships withvmark

The Plain-Text Workspace Where Humans and AI Collaborate Free. Local-first. Format-aware. VMark is the plain-text workspace where humans and AI collaborate.

Get the whole plugin