一键导入
bundled-skill-file-extraction
Lazily extract referenced files for bundled skills so large prompts stay offline until needed.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Lazily extract referenced files for bundled skills so large prompts stay offline until needed.
用 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.
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.
Warm the authoritative cache path first, then fan out cache-only readers in parallel so derived loaders never race stale state.
| name | bundled-skill-file-extraction |
| description | Lazily extract referenced files for bundled skills so large prompts stay offline until needed. |
| metadata | {"author":"ychampion"} |
Domain: command-surfaces
Trigger: Use whenever a bundled skill needs reference files extracted on demand while keeping startup fast.
Source Pattern: Distilled from reviewed command-surface and listing-control patterns.
When 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.
getBundledSkillsRoot() and avoid overwriting by using O_EXCL/SAFE_WRITE_FLAGS.Base directory ... to the skill prompt only when the extraction succeeded; otherwise continue without the prefix to keep the skill usable.When 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.
resolveSkillFilePath) so bad relpaths cannot escape the extraction dir.