Exact rendered decision journaling

From ychampion/cskill-agents · View interactive version

Exact rendered decision journaling is an AI agent skill from the GitHub repository ychampion/cskill-agents. Journal each per-message tool result replacement so resume logic replays the exact preview the model saw.

How to use this skill

Skill file

SKILL: Exact Rendered Decision Journaling

Domain: tool-orchestration

Trigger: Apply whenever per-message budgeting rewrites tool_result content so transcripts capture the preview string and resume logic can reapply the same decisions.

Source Pattern: Distilled from reviewed tool-loop and result-shaping patterns.

Core Method

After 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.

Key Rules

Example Application

In 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.

Anti-Patterns (What NOT to do)

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.