/github-ops:delete-repofrom github-ops
Delete one or more GitHub repos (and their clean local clones) over REST with an admin token: resolve renames first, confirm the exact list, verify 404 after. Never gh auth refresh.
Ships in github-ops. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Use for any repo deletion, one or a batch. Other skills that end in "delete the old repo"
hand off here. Auth: references/auth.md (admin token; gh repo delete needs delete_repo,
which the gh login usually lacks, and gh auth refresh is never the fix).
owner/name (bare name → owners.default).Token: T=$("$GO/scripts/gh-admin-token.sh") || exit 1 ($GO = ${CLAUDE_PLUGIN_ROOT},
else profile plugin_root). Fail fast without one.
Resolve every name. A renamed repo's old slug answers a redirect; a DELETE sent to it
answers 307 and deletes nothing.
api=https://api.github.com
for r in "${REPOS[@]}"; do
body=$(curl -sL -H "Authorization: Bearer $T" -H "Accept: application/vnd.github+json" "$api/repos/$r")
code=$(curl -sL -o /dev/null -w '%{http_code}' -H "Authorization: Bearer $T" "$api/repos/$r")
printf '%s\t%s\t%s\n' "$r" "$code" "$(jq -r '[.full_name,.visibility,.archived,.pushed_at,(.permissions.admin|tostring)]|@tsv' <<<"$body" 2>/dev/null)"
done
full_name ≠ asked: a redirect; show both, never delete the renamed repo on the strength
of its old name. 404: absent or invisible, drop and report. 403: policy, drop and
report. permissions.admin false: the delete will fail, report now.
Local clones whose origin is the canonical repo:
find <repos_root> -maxdepth 5 -name .git -prune 2>/dev/null | while read -r g; do
d=${g%/.git}; u=$(git -C "$d" remote get-url origin 2>/dev/null) || continue; echo "$d $u"
done | grep -iE "[:/]<owner>/<name>(\.git)?$"
Per hit: git status --porcelain (dirty), git fetch -q && git log --branches --not --remotes --oneline (unpushed), git stash list. Any of these: keep the clone unless
the user names that path. After the remote is gone, "unpushed" means "the only copy".
Confirm the exact list. One table: canonical name, asked-as, visibility, last push, archived, clone path and state. An earlier general "yes, clean up" does not confirm the resolved list; anything added later needs its own yes.
Delete by canonical name:
curl -s -o /dev/null -w '%{http_code}' -X DELETE -H "Authorization: Bearer $T" \
-H "Accept: application/vnd.github+json" "$api/repos/$full_name"
204 deleted, 403 policy (body says which), 404 gone or invisible, 307 redirected
name (back to step 2).
Verify: GET must now return 404. A 204 is the request's verdict, not the repo's state.
Remove only the clones confirmed in step 4 that are still clean. unset T.
[{"asked": "alex-dev/Old-Name", "canonical": "alex-dev/New-Name", "delete_status": 204,
"verify_status": 404, "local_clone": "~/code/New-Name", "local_action": "removed"}]
local_action: removed, kept-dirty, kept-unpushed, kept-by-request, none-found.
Irreversible from here (GitHub support can sometimes restore within 90 days; don't rely on
it). Name any marketplace, index or deployment that now points at nothing.
What SKILL.md sets; muted values are Claude Code's defaults
github-ops@danielrosehill is listed by danielrosehill/claude-code-plugins — review the source before installing
npx claudepluginhub danielrosehill/claude-code-plugins --plugin github-ops26 skills in this plugin
/breakaway-repoStart a new GitHub repo seeded from the current working directory (respecting .gitignore, no shared history) to try a radically different approach safely. Use on "break away from this repo"./bulk-apply-changeApply one file change to many GitHub repos with multi-gitter (script, dry run, push or PRs, verify). Use whenever the same edit is wanted in more than a few repos: "change this in all my repos", "update the footer/badge/workflow on every site", "add a LICENSE/CLAUDE.md to all of them", "bump X everywhere"./bulk-auditRead-only hygiene report across an owner's repos (missing description, topics, homepage, README, license; default-branch name; stale; forks/archived), as a table and JSON that feeds bulk-repo-ops. Use on "audit my repos", "which repos have no description", "repo hygiene report", "what's missing across my repos".Other plugins' skills for the same job