Media block compaction prep

From ychampion/cskill-agents · View interactive version

Media block compaction prep is an AI agent skill from the GitHub repository ychampion/cskill-agents. Sanitize user messages by replacing images, documents, and other heavy media blocks with lightweight placeholders before compaction.

How to use this skill

Skill file

SKILL: Media-Block Compaction Prep

Domain: context-management

Trigger: Use when compaction must summarize a session that contains embedded media or document-heavy user messages.

Source Pattern: Distilled from reviewed compaction-time media stripping strategies.

Core Method

Walk user messages before compaction and replace heavy media blocks with lightweight placeholders that preserve the fact that the media existed. Keep non-media text and message order intact so the summarizer still sees the conversational structure without paying the full token cost of embedded media. Track whether media was stripped so the summary can note that omitted content existed if needed.

Key Rules

Example Application

If a user uploads screenshots and a PDF before a long debugging exchange, replace those media blocks with markers such as [image] or [document] before sending the transcript to the compactor.

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.