一键导入
empty-repo-bundle-preflight
Fail fast when the repository has no refs so downstream bundling never triggers empty Git bundles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Fail fast when the repository has no refs so downstream bundling never triggers empty Git bundles.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Collapse multiple change sources into one caller-facing boolean so headless bootstraps know whether a downstream refresh is necessary.
After awaiting persistence work, update the shared budget state for each `tool_use_id` exactly once so no concurrent reader ever sees a half-committed decision.
Issue continuation nudges while the turn stays under budget, then halt once diminishing returns or the budget cap justify stopping.
Lazily extract referenced files for bundled skills so large prompts stay offline until needed.
Persist a cache-safe stop-hook context snapshot only for main session queries so later helpers can resume from stable state without fork pollution.
Sweep stale extension caches before activation, then fall back to a sticky manual-refresh flag if the live refresh fails.
| name | empty-repo-bundle-preflight |
| description | Fail fast when the repository has no refs so downstream bundling never triggers empty Git bundles. |
| metadata | {"author":"ychampion"} |
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.
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.
refs/seed/stash and refs/seed/root before testing for refs so old placeholders cannot make an empty repo appear populated.empty_repo outcome via analytics or logs so you can audit why bundling never ran.empty_repo) so callers can distinguish it from git failures or oversized bundles.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.