{"id":"07b338d6-f648-4e55-9df6-7ab29b481595","shortId":"g5yhDm","kind":"skill","title":"bundled-skill-file-extraction","tagline":"Lazily extract referenced files for bundled skills so large prompts stay offline until needed.","description":"# SKILL: Bundled Skill File Extraction\n**Domain:** command-surfaces  \n**Trigger:** Use whenever a bundled skill needs reference files extracted on demand while keeping startup fast.\n**Source Pattern:** Distilled from reviewed command-surface and listing-control patterns.\n\n## Core Method\nWhen a bundled skill defines `files`, memoize an extraction promise and write each file under a secure directory (with O_NOFOLLOW / 0o700+ permissions). Cache the extraction path so the same directory can be reused across invocations, and wrap the skill prompt with `Base directory for this skill: <dir>` so the agent can Read/Grep as needed without bloating the inline instructions.\n\n## Key Rules\n- Group requested files by parent directory when writing so mkdir/disk writes happen per subtree.\n- Allocate per-process directories under the locked `getBundledSkillsRoot()` and avoid overwriting by using `O_EXCL`/`SAFE_WRITE_FLAGS`.\n- Memoize the extraction promise (not just the result) so concurrent invocations await a single write.\n- Prepend `Base directory ...` to the skill prompt only when the extraction succeeded; otherwise continue without the prefix to keep the skill usable.\n\n## Example Application\nWhen packaging a bundled “project review” skill with large README snippets, add `files` entries for the README, let this method extract them lazily, and cite the base directory in the prompt so the agent can `Read` the files only when it actually runs the skill.\n\n## Anti-Patterns (What NOT to do)\n- Don’t write the files directly during startup—delay until the first invocation, using memoized promises to avoid race conditions.\n- Don’t forget to guard against traversal (`resolveSkillFilePath`) so bad relpaths cannot escape the extraction dir.","tags":["bundled","skill","file","extraction","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-bundled-skill-file-extraction","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/bundled-skill-file-extraction","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 (1,745 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-22T06:56:45.956Z","embedding":null,"createdAt":"2026-04-18T22:19:54.565Z","updatedAt":"2026-04-22T06:56:45.956Z","lastSeenAt":"2026-04-22T06:56:45.956Z","tsv":"'0o700':81 'across':94 'actual':234 'add':204 'agent':109,226 'alloc':135 'anti':239 'anti-pattern':238 'applic':192 'avoid':145,262 'await':165 'bad':274 'base':102,170,219 'bloat':115 'bundl':2,11,21,33,62,196 'bundled-skill-file-extract':1 'cach':83 'cannot':276 'cite':217 'command':27,51 'command-surfac':26,50 'concurr':163 'condit':264 'continu':182 'control':56 'core':58 'defin':64 'delay':253 'demand':40 'dir':280 'direct':250 'directori':77,90,103,126,139,171,220 'distil':47 'domain':25 'entri':206 'escap':277 'exampl':191 'excl':150 'extract':5,7,24,38,68,85,156,179,213,279 'fast':44 'file':4,9,23,37,65,73,123,205,230,249 'first':256 'flag':153 'forget':267 'getbundledskillsroot':143 'group':121 'guard':269 'happen':132 'inlin':117 'instruct':118 'invoc':95,164,257 'keep':42,187 'key':119 'larg':14,201 'lazili':6,215 'let':210 'list':55 'listing-control':54 'lock':142 'memoiz':66,154,259 'method':59,212 'mkdir/disk':130 'need':19,35,113 'nofollow':80 'o':79,149 'offlin':17 'otherwis':181 'overwrit':146 'packag':194 'parent':125 'path':86 'pattern':46,57,240 'per':133,137 'per-process':136 'permiss':82 'prefix':185 'prepend':169 'process':138 'project':197 'promis':69,157,260 'prompt':15,100,175,223 'race':263 'read':228 'read/grep':111 'readm':202,209 'refer':36 'referenc':8 'relpath':275 'request':122 'resolveskillfilepath':272 'result':161 'reus':93 'review':49,198 'rule':120 'run':235 'safe':151 'secur':76 'singl':167 'skill':3,12,20,22,34,63,99,106,174,189,199,237 'skill-bundled-skill-file-extraction' 'snippet':203 'sourc':45 'source-ychampion' 'startup':43,252 'stay':16 'subtre':134 'succeed':180 'surfac':28,52 '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' 'travers':271 'trigger':29 'usabl':190 'use':30,148,258 'whenev':31 'without':114,183 'wrap':97 'write':71,128,131,152,168,247","prices":[{"id":"1f425d30-e882-4071-ae54-c54da152d9e7","listingId":"07b338d6-f648-4e55-9df6-7ab29b481595","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:19:54.565Z"}],"sources":[{"listingId":"07b338d6-f648-4e55-9df6-7ab29b481595","source":"github","sourceId":"ychampion/cskill-agents/bundled-skill-file-extraction","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/bundled-skill-file-extraction","isPrimary":false,"firstSeenAt":"2026-04-18T22:19:54.565Z","lastSeenAt":"2026-04-22T06:56:45.956Z"}],"details":{"listingId":"07b338d6-f648-4e55-9df6-7ab29b481595","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"bundled-skill-file-extraction","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":"0f9cda90a967f332282fd23e6c4ed49169f728b6","skill_md_path":"skills/bundled-skill-file-extraction/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/bundled-skill-file-extraction"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"bundled-skill-file-extraction","description":"Lazily extract referenced files for bundled skills so large prompts stay offline until needed."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/bundled-skill-file-extraction"},"updatedAt":"2026-04-22T06:56:45.956Z"}}