etl-handler

A Go pattern for adding file-type handlers to a corpus pipeline, a system that extracts and transforms collected files. It supports nested formats, such as an email containing a ZIP file containing another email or PDF.

In plain words
What is it for?
Use it when implementing handlers, extractors, decoders, or transforms for new file formats in a Go corpus pipeline. The pattern covers matching files, extracting content, and processing attachments.
Why use it?
It gives each file type one handler while a central registry manages recursion through nested files. Typed results preserve extracted text, metadata, and child attachments in a structured tree.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/eslider/2dph/etl-handler
Any agent
npx skills add eSlider/2dph --skill etl-handler
Clone the repo
git clone --depth 1 https://github.com/eSlider/2dph

Made for: Claude Code, Codex.

Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,101 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.01101
Opus 5 $0.00000 $0.00550
Sonnet 5 $0.00000 $0.00220
Haiku 4.5 $0.00000 $0.00110

Measured 2d ago against content hash 237341fec475, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

etl-handler scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/etl-handler/SKILL.md · 114 lines

How it starts

The opening of the file, as written. The whole thing — 114 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: etl-handler — canonical Go ETL extraction pattern

Use when implementing file-type handlers, extractors, decoders or transforms for the corpus pipeline. Mandatory before writing such code (AGENTS.md, code standards #8–#11).

Core idea: any format may nest any other format (.eml → zip → .eml → pdf). One handler per type; a central registry recurses; results are typed trees of URL-addressable nodes.

Contracts

// Blob is an addressable unit of content flowing through the pipeline.
type Blob struct {
	SHA256 string        // integrity + idempotency key
	Name   string        // sanitized filename
	MIME   string        // declared × sniffed (mismatch wins for safety)
	Size   int64
	Open   func(ctx context.Context) (io.ReadCloser, error) // lazy
}

type Attachment = Blob // child inside a Result

type Result struct {
	MIME     string      // resolved type of this node
	Meta     Meta        // typed per-handler metadata (struct, not map)
	Text     []byte      // extracted text/markdown when applicable
	Children []Attachment // nested parts — recurse via Registry
}

type Handler interface {
	Match(declaredMIME string, sniff []byte) bool
	Handle(ctx context.Context, src Blob) (*Result, error) // sync, ctx-first
}
  • Node identity: URL scheme://platform/thread/msg/path-segments[#anchor] (e.g. mail://gmail/T42/M17/body/p[3]/table[0]#r2,c5); node ID = sha256(URL)[:16]; separate sha256(body) for integrity.
  • Parts reference each other only via URLs; href/src become LINKS_TO edges.
  • Content splits granularly BEFORE insertion: html/md/pdf yield mime-typed blocks (paragraph / table / image / link / page).

Walker safety (hard limits)

  • Max depth 10; per-item size cap; total-size and file-count caps;
  • zip-ratio guard: uncompressed/compressed > N → refuse;
  • reject names with .., absolute paths, null bytes, control chars, length > 255; collisions get -<hash8> suffix;
  • large payloads spool to var/tmp (cleaned after processing); Body []byte only under the small-size threshold (~1 MB);
  • per-child errors are collected — never fatal to the whole tree.

Read the full file on GitHub · 114 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 114 lines · 0 tokens per session scan A 237341fec475

Subscribe to this mod's changes

etl-handler is a skill published in the GitHub repository eSlider/2dph (2 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,101 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

potpie-source-ingestion

Use when the user explicitly asks to ingest, refresh, or deeply understand a repository, PR, issue, ticket, runbook, incident report, document, or web link into Potpie. The harness performs todo-driven discovery, uses local/GitHub/integration tools and read-only subagents when available, builds evidence-backed…

potpie-ai/potpie · 82 tokens

moss-search

Sub-10ms semantic search for Zo via Moss. Create indexes, add documents, and query them with semantic and keyword search. Use when users want to search through documents, knowledge bases, or any text content.

usemoss/moss · 48 tokens

open-ontologies

AI-native ontology engineering using 50+ MCP tools backed by an in-memory Oxigraph triple store. Build, validate, query, and govern RDF/OWL ontologies with a generate-validate-iterate loop. Use when building ontologies, knowledge graphs, RDF data, SPARQL queries, BORO/4D modeling, SHACL validation, clinical…

fabio-rovai/open-ontologies · 110 tokens

mcp-local-rag

Searches, saves, and maintains a local document index through a local RAG MCP server. Use when user says "search my docs", "save this page", "read around that chunk", "sync my index", or invokes npx mcp-local-rag.

shinpr/mcp-local-rag · 61 tokens

ontology-engineering

Build, validate, and govern RDF/OWL ontologies using the Open Ontologies MCP server. Use when the user asks to create, modify, query, or manage ontologies, knowledge graphs, or RDF data.

fabio-rovai/open-ontologies · 47 tokens

ontology-bootstrap

Build a trustworthy first ontology from an empty or near-empty ontology-atlas vault using only Atlas MCP evidence. Use when the user asks to analyze a codebase, bootstrap/fill its ontology, extract product meaning from a repository, or when a requested ontology task finds only starter nodes. Separate observed…

wlsdks/ontology-atlas · 129 tokens