{"id":"338ca259-b97b-4eb3-87ec-24c17ff7a1a4","shortId":"dQf6LR","kind":"skill","title":"exact-rendered-decision-journaling","tagline":"Journal each per-message tool result replacement so resume logic replays the exact preview the model saw.","description":"# SKILL: Exact Rendered Decision Journaling\n**Domain:** tool-orchestration  \n**Trigger:** Apply whenever per-message budgeting rewrites tool_result content so transcripts capture the preview string and resume logic can reapply the same decisions.\n**Source Pattern:** Distilled from reviewed tool-loop and result-shaping patterns.\n\n## Core Method\nAfter `enforceToolResultBudget` persists a candidate, produce a `ToolResultReplacementRecord` (`kind: 'tool-result'`, `toolUseId`, `replacement`) that stores the literal preview returned by `buildLargeToolResultMessage`. Pass `newlyReplaced` to the `writeToTranscript` callback so every replacement is serialized in the conversation transcript; later, `reconstructContentReplacementState(messages, records, inheritedReplacements)` can rebuild the same `seenIds`/`replacements` map, and `provisionContentReplacementState` gates the feature flag (`tengu_hawthorn_steeple`) so journaling stays optional.\n\n## Key Rules\n- Persist the exact preview string the model consumed—the replacement record must not approximate or trim the visible content, or prompt-cache alignment breaks.\n- Include `toolUseId` with each record so resume enforcement can quickly look up replacements without re-running persistence.\n- Forward `parentState.replacements` into `reconstructForSubagentResume` when resuming forks so inherited decisions reapply exactly.\n- Guard `writeToTranscript`; it may be undefined in ephemeral contexts, so only call it when provided.\n- When the flag is disabled, `provisionContentReplacementState` should return `undefined` and journaling remains inert.\n\n## Example Application\nIn the query loop pass the transcript writer to `applyToolResultBudget`; the callback serializes `newlyReplaced` records, which are later replayed by `provisionContentReplacementState(initialMessages, records)` during resume so the budget enforces the same replacements it originally made.\n\n## Anti-Patterns (What NOT to do)\n- Do not journal before `persistToolResult` succeeds and the preview is built—the replacement string must exist before you write it down.\n- Do not drop `kind: 'tool-result'` or the `toolUseId` fields; `reconstructContentReplacementState` relies on them to filter and lookup.\n- Avoid journaling duplicates (e.g., from re-applied replacements); only persist what is new so transcripts stay minimal.","tags":["exact","rendered","decision","journaling","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-exact-rendered-decision-journaling","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/exact-rendered-decision-journaling","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,349 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:48.630Z","embedding":null,"createdAt":"2026-04-18T22:20:21.042Z","updatedAt":"2026-04-22T06:56:48.630Z","lastSeenAt":"2026-04-22T06:56:48.630Z","tsv":"'align':160 'anti':258 'anti-pattern':257 'appli':34,311 'applic':221 'applytoolresultbudget':231 'approxim':150 'avoid':304 'break':161 'budget':39,249 'buildlargetoolresultmessag':94 'built':274 'cach':159 'call':203 'callback':100,233 'candid':77 'captur':46 'consum':144 'content':43,155 'context':200 'convers':108 'core':71 'decis':4,27,57,189 'disabl':211 'distil':60 'domain':29 'drop':287 'duplic':306 'e.g':307 'enforc':169,250 'enforcetoolresultbudget':74 'ephemer':199 'everi':102 'exact':2,19,25,139,191 'exact-rendered-decision-journ':1 'exampl':220 'exist':279 'featur':126 'field':295 'filter':301 'flag':127,209 'fork':186 'forward':180 'gate':124 'guard':192 'hawthorn':129 'includ':162 'inert':219 'inherit':188 'inheritedreplac':114 'initialmessag':243 'journal':5,6,28,132,217,266,305 'key':135 'kind':81,288 'later':110,239 'liter':90 'logic':16,52 'look':172 'lookup':303 'loop':65,225 'made':256 'map':121 'may':195 'messag':10,38,112 'method':72 'minim':321 'model':22,143 'must':148,278 'new':317 'newlyreplac':96,235 'option':134 'orchestr':32 'origin':255 'parentstate.replacements':181 'pass':95,226 'pattern':59,70,259 'per':9,37 'per-messag':8,36 'persist':75,137,179,314 'persisttoolresult':268 'preview':20,48,91,140,272 'produc':78 'prompt':158 'prompt-cach':157 'provid':206 'provisioncontentreplacementst':123,212,242 'queri':224 'quick':171 're':177,310 're-appli':309 're-run':176 'reappli':54,190 'rebuild':116 'reconstructcontentreplacementst':111,296 'reconstructforsubagentresum':183 'record':113,147,166,236,244 'reli':297 'remain':218 'render':3,26 'replac':13,86,103,120,146,174,253,276,312 'replay':17,240 'result':12,42,68,84,291 'result-shap':67 'resum':15,51,168,185,246 'return':92,214 'review':62 'rewrit':40 'rule':136 'run':178 'saw':23 'seenid':119 'serial':105,234 'shape':69 'skill':24 'skill-exact-rendered-decision-journaling' 'sourc':58 'source-ychampion' 'stay':133,320 'steepl':130 'store':88 'string':49,141,277 'succeed':269 'tengu':128 'tool':11,31,41,64,83,290 'tool-loop':63 'tool-orchestr':30 'tool-result':82,289 'toolresultreplacementrecord':80 'tooluseid':85,163,294 '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' 'transcript':45,109,228,319 'trigger':33 'trim':152 'undefin':197,215 'visibl':154 'whenev':35 'without':175 'write':282 'writer':229 'writetotranscript':99,193","prices":[{"id":"7a9cd61d-eba0-4217-89f3-3bee01a8e999","listingId":"338ca259-b97b-4eb3-87ec-24c17ff7a1a4","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:20:21.042Z"}],"sources":[{"listingId":"338ca259-b97b-4eb3-87ec-24c17ff7a1a4","source":"github","sourceId":"ychampion/cskill-agents/exact-rendered-decision-journaling","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/exact-rendered-decision-journaling","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:21.042Z","lastSeenAt":"2026-04-22T06:56:48.630Z"}],"details":{"listingId":"338ca259-b97b-4eb3-87ec-24c17ff7a1a4","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"exact-rendered-decision-journaling","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":"1eabed0250e31408ef1de7f719ca5b5edc378d92","skill_md_path":"skills/exact-rendered-decision-journaling/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/exact-rendered-decision-journaling"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"exact-rendered-decision-journaling","description":"Journal each per-message tool result replacement so resume logic replays the exact preview the model saw."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/exact-rendered-decision-journaling"},"updatedAt":"2026-04-22T06:56:48.630Z"}}