From zucca-skills
Use when CI is failing because Neon's create-branch action returns HTTP 422 (rate-limited at concurrent branch creation, or near a project quota) or when stale preview / CI / dev-local branches have piled up in a Neon project. The skill lists branches, filters by age + creation source + protection state, shows the user the deletion candidates for confirmation, and deletes in batches via the Neon MCP. Triggers on "prune Neon branches", "clean up Neon", "delete old previews on Neon", "Neon is at quota", or any "CI is failing on create-branch" investigation.
How this skill is triggered — by the user, by Claude, or both
Slash command
/zucca-skills:neon-pruneThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
The Neon Vercel integration auto-creates a preview branch per Vercel deployment. With multiple PRs open and active dev work, these accumulate fast — both `ready` and `archived` states still count against quota and contribute to concurrent-branch-create rate limits. CI's `db-data-integrity` / `db-schema-integrity` jobs also create short-lived `ci/*` branches; if these fail to clean up, they orphan.
The Neon Vercel integration auto-creates a preview branch per Vercel deployment. With multiple PRs open and active dev work, these accumulate fast — both ready and archived states still count against quota and contribute to concurrent-branch-create rate limits. CI's db-data-integrity / db-schema-integrity jobs also create short-lived ci/* branches; if these fail to clean up, they orphan.
This skill identifies safe-to-delete branches and removes them. Defaults are conservative — only branches that match clear stale-preview / orphaned-CI patterns are queued. Production snapshots, dev-named branches that look intentional, and branches with children are excluded.
Announce at start: "I'm using the neon-prune skill to clean up ."
create-branch-action (rate limit or quota).Do not use when:
mcp__neon__delete_branch directly.# Use mcp__neon__list_projects with search="<org>" to find candidates
If multiple projects are returned (e.g., Zucca has Zucca, Zucca A, Zucca Agents, zucca-dev), confirm with the user which one to prune. For Zucca specifically, the main app database is jolly-haze-38017780 (project Zucca).
Call mcp__neon__describe_project for the chosen project. The result includes all branches; jq-extract them to a working file:
jq -r '.[1].text' <describe-result> | sed 's/^It contains the following branches[^[]*//' > /tmp/branches.json
Print a summary the user can scan:
Project: <name> (<id>)
Total branches: <N>
By state: archived=<X>, ready=<Y>
By source: vercel=<A>, console=<B>, github=<C>
Filter rules — a branch is a candidate only if all apply:
protected == falsedefault == falseprimary == falsecreated_at < <cutoff> (default: 14 days ago; user can override)preview/ — Vercel-created preview branchesci/ — CI-created integrity-check branches.id does not appear as any other branch's parent_idExplicitly exclude (even if old):
^(staging|develop|production|test|test-1|test-2|main|master)$production_old_, prod-backup-, test-migration_old_ (intentional snapshots)spencer/staging, theo/local) — these look intentional; user must explicitly opt-inImplement with jq:
([.[] | .parent_id // empty] | unique) as $parents |
[.[] | select(
.protected == false and
.default == false and
.primary == false and
.created_at < $cutoff and
(.name | test("^(preview/|ci/)")) and
(.name | test("^(staging|develop|production|test|test-1|test-2|main|master)$") | not) and
(.id as $id | $parents | index($id) | not)
)]
Print the queue (or a sample if it's huge) with created_at, current_state, creation_source, and name:
Deletion candidates: 142
Oldest:
br-XXX 2025-07-02 archived vercel preview/...
br-YYY 2025-07-15 archived vercel preview/...
Newest:
br-AAA 2026-04-25 ready vercel preview/...
By source: vercel=128, ci=14
Proceed? (yes / show-all / refine-filter / abort)
If the queue exceeds ~150 branches, also ask whether to batch in chunks (typical Neon throughput: ~20 deletes per parallel call is fine; the MCP handles concurrency).
Use mcp__neon__delete_branch per branch. Issue calls in batches of 20 (parallel within one tool-call message) for throughput. Print one line per success or failure.
After each batch, the user should be able to interrupt cleanly — don't loop autonomously through hundreds without check-ins. Aim for 1–3 batches per turn, then summarize and ask.
🎉 Deleted <N> stale branches from <project>.
Remaining: <M> branches (was <M+N>).
If CI is still flaking, the issue isn't quota — investigate Neon API rate
limits or the create-branch retry behavior in the workflow.
production_old_*, prod-backup-*, test-migration_old_* are intentional backups; the rewrite-team relies on them.parent_id set referencing it means deleting it would orphan or break downstream branches. Skip./neon-prune
Defaults: Zucca main project, 14-day cutoff, preview/ + ci/ only.
/neon-prune --aggressive
Same project, 3-day cutoff (the user must confirm — aggressive means deleting active-recent previews). Adds: even ready-state preview branches if their corresponding PR is closed/merged.
/neon-prune --project=<name-or-id>
E.g., --project="Zucca A" to clean up the secondary app's previews.
npx claudepluginhub gozucca/zucca-skills --plugin zucca-skillsCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.