agentsclimarketplace

Media block compaction prep

Skill ychampion/cskill-agents/agents/codex/skills/media-block-compaction-prep

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!

Install
npx -y skills add ychampion/cskill-agents --skill media-block-compaction-prep

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

What its author says it does

Copied from the file, not written here

Sanitize user messages by replacing images, documents, and other heavy media blocks with lightweight placeholders before compaction.

SKILL.md

1.6 KB, as published. Nobody here has run it

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

  • Replace heavy media with explicit placeholders instead of silently dropping it.
  • Preserve message order and all non-media text so downstream heuristics still see the same conversation structure.
  • Apply the sanitization before the compaction request so the token savings affect the summary call itself.

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)

  • Do not delete media with no placeholder.
  • Do not rewrite assistant message structure during this prep step.
  • Do not leave nested media blocks inside heavy tool results unsanitized.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.