skills/maintenance/maintenance-cleanup/SKILL.md
Branch cleanup, GitHub Actions runs, tmp/ hygiene after merge. Use when cleaning up after PR merge, deleting local branches, removing worktrees, or pruning stale workflow runs.
npx skillsauth add pkuppens/pkuppens maintenance-cleanupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Post-merge hygiene: branch cleanup, worktree removal, GitHub Actions runs, tmp/ hygiene.
git branch -D fails because branch is used by a worktreetmp/ or other scratch directoriesFor a full PR-merge checklist (merge, squash, rebase, gone remotes), see branch-cleanup-after-pr.
git checkout main, git pullgit fetch --prune to remove stale remote-tracking refsgit branch -d <branch>-d fails with "not fully merged", run git cherry -v main <branch>:
- => functionally merged (safe to delete with git branch -D <branch>)+ => not merged, keep branchIf git branch -D <branch> fails with "cannot delete branch used by worktree", follow the remove/clean procedure in git-worktrees.
You can treat “obsolete” workflow runs as follows:
head_branch no longer exists in the repository.workflow_id is not present in the current workflow set.conclusion: success run, and delete other completed runs older than that latest success (superseded).on_prem_rag (automated): After Python CI succeeds on main, the Repository Cleanup workflow runs scripts/cleanup-github-actions.sh. This implements (3) “superseded by later success” plus additional retention rules for debugging.
Do not assume all failed runs are kept forever; only failures after the latest pass are retained.
Other repos (manual): you may still delete very old completed runs by age, for example:
# Delete completed runs older than 30 days for a workflow
gh run list --workflow ci.yml --status completed --limit 100 --json databaseId,createdAt \
| jq '[.[] | select(.createdAt < (now - 2592000 | todate))] | .[].databaseId' \
| xargs -I {} gh run delete {}
Ensure tmp/ is gitignored. Remove obsolete drafts, planning notes, and debug artifacts. Per-repo tmp/ layout: see workspace CLAUDE.md scratch directory section.
tools
Creates, queries, updates, and links Azure Boards work items via az boards CLI. Use when filing ADO work items, running WIQL queries, or setting area path, iteration, tags, and assignee.
tools
Creates, reviews, and completes Azure Repos pull requests and branch policies via az repos CLI. Use when opening ADO PRs, setting required reviewers, or configuring build validation policies.
development
Guides Azure Pipelines YAML structure, build validation on PRs, and staged deployment with environments and approvals. Use when authoring azure-pipelines.yml or configuring CI/CD on Azure DevOps.
tools
Orchestrates Azure DevOps work item, repo, and pipeline workflows using az CLI. Use when working with Azure DevOps, Azure Repos, Azure Boards, Azure Pipelines, or az devops commands.