ychampion/cskill-agents/empty-repo-bundle-preflight

Claude Code and agent skill by ychampion/cskill-agents

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Fail fast when the repository has no refs so downstream bundling never triggers empty Git bundles.

Install

npx vskill@latest install ychampion/cskill-agents/empty-repo-bundle-preflight

SKILL.md

SKILL: Empty Repo Bundle Preflight

Domain: safety-worktrees Trigger: Apply before running git bundle create to ensure the repository actually has refs, avoiding the 128 exit code and providing a clearer error path. Source Pattern: Distilled from reviewed repo-safety, packaging, and worktree-management patterns.

Core Method

Run git for-each-ref --count=1 refs/ from the repository root; if the output is empty, report that the repo has no commits, record an analytics metric with the empty_repo outcome, and abort with a helpful message instead of invoking git bundle create, which would exit 128 on an empty repo. Sweep stale temporary refs first so the check reflects the true repo state, and treat the empty case as a known failure reason with a dedicated fail reason identifier that consumers can react to.

Key Rules

  • Always clean up refs/seed/stash and refs/seed/root before testing for refs so old placeholders cannot make an empty repo appear populated.
  • Capture the empty_repo outcome via analytics or logs so you can audit why bundling never ran.
  • Return a structured error with a fail reason (empty_repo) so callers can distinguish it from git failures or oversized bundles.
  • When the repo has refs, proceed to bundle creation without repeating the check unnecessarily.

Example Application

When building a git bundle upload helper, call this skill before _bundleWithFallback; if it signals an empty repo, stop and surface “Repository has no commits yet” to the UI and telemetry instead of letting git bundle create crash.

Anti-Patterns (What NOT to do)

  • Do not rely on the git bundle exit code alone to detect emptiness; it produces a cryptic message and leaves temporary files behind.
  • Do not skip the cleanup step—stale refs from prior runs can mask an empty repo and let you bundle garbage.
  • Do not proceed to bundle creation when the guard reports no refs; the upload would stall and return a generic failure reason.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
36
Repository forks
7
7-day trend score
18

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/ychampion/cskill-agents/empty-repo-bundle-preflight/badge)](https://verified-skill.com/skills/ychampion/cskill-agents/empty-repo-bundle-preflight)

Something wrong with this skill or its page? Tell us.