Preview first large output messages

From ychampion/cskill-agents · View interactive version

Preview first large output messages is an AI agent skill from the GitHub repository ychampion/cskill-agents. Annotate persisted tool results with a preview-first header that leads with the saved artifact reference and shows the first slice before truncation.

How to use this skill

Skill file

SKILL: Preview-First Large Output Messages

Domain: messaging

Trigger: Apply whenever a persisted tool result response must include a preview so the model sees the start of the output along with the saved artifact reference.

Source Pattern: Distilled from reviewed large-result persistence and preview UX implementations.

Core Method

When tool output is too large to show inline, persist the full artifact first and then render a response that leads with the saved-file reference plus a short preview from the beginning of the content. Build the preview from the stored artifact rather than regenerating it from a second formatting path, so what the user sees matches what was actually saved. Include enough metadata to show that the preview is partial and that the full artifact remains available for later reading.

Key Rules

Example Application

When a tool returns a 200 KB JSON dump, store it as tool-results/<id>.json, then emit a message that points to that file and shows the first couple kilobytes as a preview so the user immediately understands what was returned.

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.