{"id":"be7c0b21-201d-4e78-8586-7d8010b56c37","shortId":"4knLQz","kind":"skill","title":"reachable-wip-via-temporary-refs","tagline":"Capture in-flight WIP via `git stash create`, make it reachable through temporary refs, and tear down the refs after bundling finishes.","description":"# SKILL: Reachable WIP Via Temporary Refs\n**Domain:** safety-worktrees  \n**Trigger:** Apply when bundling or seeding a repository and you want to include uncommitted work without disturbing the working tree or leaving dangling refs.\n**Source Pattern:** Distilled from reviewed repo-safety, packaging, and worktree-management patterns.\n\n## Core Method\nCall `git stash create` to materialize the working tree and index into a temporary commit while leaving the workspace untouched. If the command returns a SHA then advertise it via a short-lived ref such as `refs/seed/stash` so downstream tooling (bundle list-heads, receivers) can reach those objects; treat an empty response as “no WIP,” log both success and error cases, and clean up the temporary ref after the upload completes or earlier runs leave stale pointers.\n\n## Key Rules\n- Always run the ref cleanup loop (`refs/seed/stash`, `refs/seed/root`) before bundling so previous runs do not influence new bundles or leak stale WIP markers.\n- Accept that `git stash create` can fail non-fatally; log the stderr, skip ref creation, but continue bundling the committed tree.\n- Only call `git update-ref refs/seed/stash <sha>` when the stash SHA is non-empty; otherwise the ref would dereference to nothing.\n- Record a boolean flag (`hasWip`) when the temporary stash exists so telemetry and later steps can know whether to expect extra objects.\n- After the bundle (and after the `finally` block), delete the temporary refs even if the upstream run failed to keep the user repo clean.\n\n## Example Application\nWhen writing an upload helper for a CLI that seeds a remote CCR process, use this skill to wrap the `git stash create`/`git update-ref` pair, expose `hasWip`, and ensure the `finally` block always runs `git update-ref -d refs/seed/stash` before returning.\n\n## Anti-Patterns (What NOT to do)\n- Do not rely on the regular stash stack (refs/stash) because `git bundle` should not touch the user-visible stack; `git stash create` avoids a working-tree mutation.\n- Do not advertise an empty SHA: bundlers that list heads will fail to find objects.\n- Do not skip cleanup: leaving `refs/seed/stash` behind pollutes the repo and may cause future bundling runs to include WIP twice.","tags":["reachable","wip","via","temporary","refs","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents"],"capabilities":["skill","source-ychampion","skill-reachable-wip-via-temporary-refs","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/reachable-wip-via-temporary-refs","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,233 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:54.969Z","embedding":null,"createdAt":"2026-04-18T22:21:05.623Z","updatedAt":"2026-04-22T00:56:54.969Z","lastSeenAt":"2026-04-22T00:56:54.969Z","tsv":"'accept':184 'advertis':107,359 'alway':161,311 'anti':322 'anti-pattern':321 'appli':41 'applic':275 'avoid':351 'behind':378 'block':257,310 'boolean':230 'bundl':28,43,121,170,178,202,252,339,386 'bundler':363 'call':80,207 'captur':7 'case':142 'caus':384 'ccr':288 'clean':144,273 'cleanup':165,375 'cli':283 'command':102 'commit':94,204 'complet':152 'continu':201 'core':78 'creat':15,83,188,298,350 'creation':199 'd':317 'dangl':62 'delet':258 'derefer':225 'distil':66 'disturb':56 'domain':36 'downstream':119 'earlier':154 'empti':132,220,361 'ensur':307 'error':141 'even':262 'exampl':274 'exist':237 'expect':247 'expos':304 'extra':248 'fail':190,267,368 'fatal':193 'final':256,309 'find':370 'finish':29 'flag':231 'flight':10 'futur':385 'git':13,81,186,208,296,299,313,338,348 'haswip':232,305 'head':124,366 'helper':280 'in-flight':8 'includ':52,389 'index':90 'influenc':176 'keep':269 'key':159 'know':244 'later':241 'leak':180 'leav':61,96,156,376 'list':123,365 'list-head':122 'live':113 'log':137,194 'loop':166 'make':16 'manag':76 'marker':183 'materi':85 'may':383 'method':79 'mutat':356 'new':177 'non':192,219 'non-empti':218 'non-fat':191 'noth':227 'object':129,249,371 'otherwis':221 'packag':72 'pair':303 'pattern':65,77,323 'pointer':158 'pollut':379 'previous':172 'process':289 'reach':127 'reachabl':2,18,31 'reachable-wip-via-temporary-ref':1 'receiv':125 'record':228 'ref':6,21,26,35,63,114,148,164,198,211,223,261,302,316 'refs/seed/root':168 'refs/seed/stash':117,167,212,318,377 'refs/stash':336 'regular':333 'reli':330 'remot':287 'repo':70,272,381 'repo-safeti':69 'repositori':47 'respons':133 'return':103,320 'review':68 'rule':160 'run':155,162,173,266,312,387 'safeti':38,71 'safety-worktre':37 'seed':45,285 'sha':105,216,362 'short':112 'short-liv':111 'skill':30,292 'skill-reachable-wip-via-temporary-refs' 'skip':197,374 'sourc':64 'source-ychampion' 'stack':335,347 'stale':157,181 'stash':14,82,187,215,236,297,334,349 'stderr':196 'step':242 'success':139 'tear':23 'telemetri':239 'temporari':5,20,34,93,147,235,260 'tool':120 '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' 'touch':342 'treat':130 'tree':59,88,205,355 'trigger':40 'twice':391 'uncommit':53 'untouch':99 'updat':210,301,315 'update-ref':209,300,314 'upload':151,279 'upstream':265 'use':290 'user':271,345 'user-vis':344 'via':4,12,33,109 'visibl':346 'want':50 'whether':245 'wip':3,11,32,136,182,390 'without':55 'work':54,58,87,354 'working-tre':353 'workspac':98 'worktre':39,75 'worktree-manag':74 'would':224 'wrap':294 'write':277","prices":[{"id":"d4c8e89a-7e54-4c78-9123-2d7081ce95c3","listingId":"be7c0b21-201d-4e78-8586-7d8010b56c37","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:05.623Z"}],"sources":[{"listingId":"be7c0b21-201d-4e78-8586-7d8010b56c37","source":"github","sourceId":"ychampion/cskill-agents/reachable-wip-via-temporary-refs","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/reachable-wip-via-temporary-refs","isPrimary":false,"firstSeenAt":"2026-04-18T22:21:05.623Z","lastSeenAt":"2026-04-22T00:56:54.969Z"}],"details":{"listingId":"be7c0b21-201d-4e78-8586-7d8010b56c37","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"reachable-wip-via-temporary-refs","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":"3e739acb35bd0fcdc815fb08e195d288cab29c54","skill_md_path":"skills/reachable-wip-via-temporary-refs/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/reachable-wip-via-temporary-refs"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"reachable-wip-via-temporary-refs","description":"Capture in-flight WIP via `git stash create`, make it reachable through temporary refs, and tear down the refs after bundling finishes."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/reachable-wip-via-temporary-refs"},"updatedAt":"2026-04-22T00:56:54.969Z"}}