원클릭으로
prompt-cache-worker
Prompt assembler optimization — sorting, memoization, cache-break detection, integration tests
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Prompt assembler optimization — sorting, memoization, cache-break detection, integration tests
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Agent frontmatter enhancements — disallowedTools, mcpServers scoping, fork_eligible field
Context management — pre-compact persistence, threshold alignment, microcompact/circuit breaker detection
Hook enhancements — updatedInput for bash safety prefixes, suppressOutput for verbose blocks, denial-based routing feedback
Hook system optimization — async conversion, consolidation, deduplication, new hook events
Memory index discipline — cap enforcement, pruning, archival, health reporting
Compresses and merges CLAUDE.md and rules files to fit under the 40K character cap
| name | prompt-cache-worker |
| description | Prompt assembler optimization — sorting, memoization, cache-break detection, integration tests |
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
Features that modify the prompt assembler pipeline (.claude/lib/spawn/), add caching/memoization layers, or create cache-break detection modules.
Read the feature description carefully. Understand which prompt assembler files to modify and what the expected behavior is.
Read existing code. Before any changes, read ALL files in .claude/lib/spawn/ to understand the full assembly pipeline. Pay special attention to:
prompt-assembler.cjs — main entry (assembleSpawnPrompt, buildBasePrompt)prompt-assembler-sections.cjs — section builders (buildToolsSection, buildSkillsSection, injectSections)prompt-assembler-data.cjs — data loading (filterAndDescribeTools, getSkillsByAgent, caches)Write tests first (red). Create test files. Tests should use mocks for tool-manifest.json and skill-index.json to avoid dependency on disk state. Use node:test and node:assert. Tests should verify:
Implement changes. Key patterns:
.sort((a, b) => a.name.localeCompare(b.name)) after filteringMap<string, string> with JSON.stringify key or custom hashcrypto.createHash('sha256').update(content).digest('hex')require('../monitoring/flight-recorder.cjs').record()Run tests (green). All tests pass.
Verify no regressions. Run any existing spawn-related tests.
Lint and format.
pnpm lint
pnpm format:check
{
"salientSummary": "Added alphabetical sorting to filterAndDescribeTools() and getSkillsByAgent(). Eliminated duplicate TaskUpdate contract from buildBasePrompt() (kept in buildToolsSection()). Created tests/lib/spawn/prompt-sorting.test.cjs with 12 tests verifying deterministic ordering and single contract.",
"whatWasImplemented": "In prompt-assembler-data.cjs: added .sort((a,b) => a.name.localeCompare(b.name)) after tool filtering and after skill tier grouping. In prompt-assembler.cjs: removed TaskUpdate contract block from Patch 4 (agent protocol injection) since it already exists in buildToolsSection(). Created test file with mocked tool-manifest and skill-index.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{ "command": "node --test tests/lib/spawn/prompt-sorting.test.cjs", "exitCode": 0, "observation": "12 tests passing" },
{ "command": "pnpm lint", "exitCode": 0, "observation": "0 errors" }
]
},
"tests": {
"added": [{ "file": "tests/lib/spawn/prompt-sorting.test.cjs", "cases": [
{ "name": "tools sorted alphabetically", "verifies": "VAL-PC-001" },
{ "name": "skills sorted within tiers", "verifies": "VAL-PC-002" },
{ "name": "TaskUpdate contract appears once", "verifies": "VAL-PC-005" }
]}]
},
"discoveredIssues": []
}