Skip to content
Back to skills

Modality Preserving Binary Offload

ASecurity

Persist binary output with a mime-derived extension and a matching saved-file message so downstream tools keep the right modality.

  • 4 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 12, 2026
ai-agents

Works with

  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 12, 2026

npx -y skills add aibot88/sec_skill_store --skill modality-preserving-binary-offload --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Modality Preserving Binary Offload?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Modality Preserving Binary Offload
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aibot88-modality-preserving-binary-offload/badge)](https://www.skillsdirectory.com/skills/aibot88-modality-preserving-binary-offload)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: modality-preserving-binary-offload
description: "Persist binary output with a mime-derived extension and a matching saved-file message so downstream tools keep the right modality."
metadata:
  author: ychampion
---

# SKILL: Modality-Preserving Binary Offload
**Domain:** tool-result-storage
**Trigger:** Apply when a tool emits binary content that must be saved out of band without losing the file type or downstream usability.
**Source Pattern:** Distilled from reviewed tool execution, streaming, persistence, and output-budget implementations.

## Core Method
Preserve modality by deriving the output extension from MIME type, writing the raw bytes unchanged, and returning a saved-file message that names the type, size, and location. This ensures the resulting file can be opened by the correct downstream tool chain instead of being flattened into an opaque blob with the wrong extension. The offload path remains generic while still honoring modality-specific dispatch.

## Key Rules
- Strip MIME parameters before extension lookup so content types like application pdf; charset binary still resolve correctly.
- Use conservative extension mapping: known types get their proper extension and unknown types fall back to `bin`.
- Write bytes as-is rather than stringifying them, or the saved artifact will no longer be usable by native readers.
- Return a human-readable saved-file message with MIME, size, and path so downstream agents know what was persisted.

## Example Application
If an MCP server returns a PDF or spreadsheet, derive `pdf` or `xlsx` from the MIME type, persist the raw bytes into the tool-results directory, and emit a saved-file message so later steps can hand the file to a PDF reader or spreadsheet parser without guessing the format.

## Anti-Patterns (What NOT to do)
- Do not save binary content with a generic text extension; downstream tooling dispatch often depends on the suffix.
- Do not stringify binary bytes before writing; that destroys the original modality and makes the file unusable.

Files in this skill

  • SKILL.md2 KB
  • source.json719 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.