{"id":"0d69a0b1-b490-4dbd-9ee8-a0588d0be942","shortId":"TLufeu","kind":"skill","title":"staged-bundle-fallback-chain","tagline":"Retry Git bundle creation across decreasing scopes (all, HEAD, squashed) to stay under upload size limits while keeping relevant history.","description":"# SKILL: Staged Bundle Fallback Chain\n**Domain:** safety-worktrees  \n**Trigger:** Apply when you are creating a Git bundle for upload and you need a staged fallback chain from full history to a minimal seed that still fits the byte ceiling.\n**Source Pattern:** Distilled from reviewed repo-safety, packaging, and worktree-management patterns.\n\n## Core Method\nAttempt to bundle the full repo first (`git bundle create --all`), then inspect the resulting file size; if the artifact exceeds the configured limit, rerun the bundling command with a narrower base (`HEAD`). If HEAD still produces an oversized bundle, collapse to a squashed root commit (built from the stash tree when WIP exists) so you ship only the working tree snapshot without history. At every step log the rationale, and return the scope label (`all`, `head`, `squashed`) that succeeded so downstream uploaders know how much history is included.\n\n## Key Rules\n- Always check the generated bundle size immediately after each `git bundle create` call and only stop when the artifact fits within the configured max bytes.\n- When rerunning, overwrite the same bundle file so callers do not need to swap paths, and log a debug message summarizing the last size versus limit.\n- For the squashed fallback, create a parentless commit from the stash tree (if WIP was captured) or `HEAD^{tree}` and bundle that single root, then update `refs/seed/root` so downstream consumers can find it.\n- Surface the chosen scope (`all`, `head`, or `squashed`) in the upload metadata so receivers know whether history was preserved.\n- Respect abort signals throughout the fallback chain so the bundling command can stop cleanly when the parent process is cancelled.\n\n## Example Application\nIf building an \"export repository\" CLI that feeds upstream tooling, call this skill to drive the bundling logic: start with the feature-flagged `maxBytes`, attempt `--all`, check the file size, retry with HEAD, and finally fall back to squashed-root while reporting the scope and bytes to the telemetry system.\n\n## Anti-Patterns (What NOT to do)\n- Do not assume the first `git bundle create` succeeds; skipping the size check leads to uploads that exceed quotas and fail at the network layer.\n- Do not rerun all bundling scopes on separate files; leaving stale bundles confuses cleanup and telemetry.\n- Do not forget to include the final scope in the response metadata, because receivers won’t know if they need to fetch history-aware refs.","tags":["staged","bundle","fallback","chain","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-staged-bundle-fallback-chain","topic-agent-skills","topic-ai-agents","topic-cli","topic-coding-agents","topic-context-engineering","topic-developer-tools","topic-mcp","topic-multi-agent","topic-terminal-ui"],"categories":["cskill-agents"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/ychampion/cskill-agents/staged-bundle-fallback-chain","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add ychampion/cskill-agents","source_repo":"https://github.com/ychampion/cskill-agents","install_from":"skills.sh"}},"qualityScore":"0.467","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 34 github stars · SKILL.md body (2,474 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T00:56:56.964Z","embedding":null,"createdAt":"2026-04-18T22:21:23.180Z","updatedAt":"2026-04-22T00:56:56.964Z","lastSeenAt":"2026-04-22T00:56:56.964Z","tsv":"'abort':277 'across':10 'alway':173 'anti':351 'anti-pattern':350 'appli':36 'applic':297 'artifact':101,191 'assum':359 'attempt':82,323 'awar':422 'back':335 'base':113 'build':299 'built':128 'bundl':3,8,28,43,84,90,108,121,177,183,203,244,285,314,363,386,393 'byte':64,197,345 'call':185,308 'caller':206 'cancel':295 'captur':239 'ceil':65 'chain':5,30,52,282 'check':174,325,369 'chosen':259 'clean':289 'cleanup':395 'cli':303 'collaps':122 'command':109,286 'commit':127,231 'configur':104,195 'confus':394 'consum':253 'core':80 'creat':40,91,184,228,364 'creation':9 'debug':216 'decreas':11 'distil':68 'domain':31 'downstream':163,252 'drive':312 'everi':147 'exampl':296 'exceed':102,374 'exist':135 'export':301 'fail':377 'fall':334 'fallback':4,29,51,227,281 'featur':320 'feature-flag':319 'feed':305 'fetch':419 'file':97,204,327,390 'final':333,404 'find':255 'first':88,361 'fit':62,192 'flag':321 'forget':400 'full':54,86 'generat':176 'git':7,42,89,182,362 'head':14,114,116,158,241,262,331 'histori':25,55,145,168,273,421 'history-awar':420 'immedi':179 'includ':170,402 'inspect':94 'keep':23 'key':171 'know':165,271,414 'label':156 'last':220 'layer':381 'lead':370 'leav':391 'limit':21,105,223 'log':149,214 'logic':315 'manag':78 'max':196 'maxbyt':322 'messag':217 'metadata':268,409 'method':81 'minim':58 'much':167 'narrow':112 'need':48,209,417 'network':380 'overs':120 'overwrit':200 'packag':74 'parent':292 'parentless':230 'path':212 'pattern':67,79,352 'preserv':275 'process':293 'produc':118 'quota':375 'rational':151 'receiv':270,411 'ref':423 'refs/seed/root':250 'relev':24 'repo':72,87 'repo-safeti':71 'report':341 'repositori':302 'rerun':106,199,384 'respect':276 'respons':408 'result':96 'retri':6,329 'return':153 'review':70 'root':126,247,339 'rule':172 'safeti':33,73 'safety-worktre':32 'scope':12,155,260,343,387,405 'seed':59 'separ':389 'ship':138 'signal':278 'singl':246 'size':20,98,178,221,328,368 'skill':26,310 'skill-staged-bundle-fallback-chain' 'skip':366 'snapshot':143 'sourc':66 'source-ychampion' 'squash':15,125,159,226,264,338 'squashed-root':337 'stage':2,27,50 'staged-bundle-fallback-chain':1 'stale':392 'start':316 'stash':131,234 'stay':17 'step':148 'still':61,117 'stop':188,288 'succeed':161,365 'summar':218 'surfac':257 'swap':211 'system':349 'telemetri':348,397 'throughout':279 'tool':307 'topic-agent-skills' 'topic-ai-agents' 'topic-cli' 'topic-coding-agents' 'topic-context-engineering' 'topic-developer-tools' 'topic-mcp' 'topic-multi-agent' 'topic-terminal-ui' 'tree':132,142,235,242 'trigger':35 'updat':249 'upload':19,45,164,267,372 'upstream':306 'versus':222 'whether':272 'wip':134,237 'within':193 'without':144 'won':412 'work':141 'worktre':34,77 'worktree-manag':76","prices":[{"id":"79a2078e-b0df-4993-9208-f08e3df1ee88","listingId":"0d69a0b1-b490-4dbd-9ee8-a0588d0be942","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"ychampion","category":"cskill-agents","install_from":"skills.sh"},"createdAt":"2026-04-18T22:21:23.180Z"}],"sources":[{"listingId":"0d69a0b1-b490-4dbd-9ee8-a0588d0be942","source":"github","sourceId":"ychampion/cskill-agents/staged-bundle-fallback-chain","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/staged-bundle-fallback-chain","isPrimary":false,"firstSeenAt":"2026-04-18T22:21:23.180Z","lastSeenAt":"2026-04-22T00:56:56.964Z"}],"details":{"listingId":"0d69a0b1-b490-4dbd-9ee8-a0588d0be942","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"staged-bundle-fallback-chain","github":{"repo":"ychampion/cskill-agents","stars":34,"topics":["agent-skills","ai-agents","cli","coding-agents","context-engineering","developer-tools","mcp","multi-agent","terminal-ui"],"license":"mit","html_url":"https://github.com/ychampion/cskill-agents","pushed_at":"2026-04-04T14:13:23Z","description":"Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!","skill_md_sha":"101dfbf5f860951f364dca47e4cd28f00ae983c2","skill_md_path":"skills/staged-bundle-fallback-chain/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/staged-bundle-fallback-chain"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"staged-bundle-fallback-chain","description":"Retry Git bundle creation across decreasing scopes (all, HEAD, squashed) to stay under upload size limits while keeping relevant history."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/staged-bundle-fallback-chain"},"updatedAt":"2026-04-22T00:56:56.964Z"}}