← ClaudeAtlas

compose-the-payloadlisted

Use WHEN assembling the MATERIAL for a stateless dispatch — file contents, large corpora, or structured data — so the source never enters the orchestrator context. Do NOT use for writing the instructions about that material, verifying output, guarding runtime, or isolating work.
haiggoh/local-agents · ★ 1 · Data & Documents · score 74
Install: claude install-skill haiggoh/local-agents
# compose-the-payload — build self-contained dispatch inputs A stateless dispatch inherits nothing. The payload must contain all necessary context, sourced from disk, not from the orchestrator’s memory. ## Build from files on disk — and never read them yourself The point is not merely that the payload comes from disk. It is that **you never load the source into your own context**: a script reads the files, serializes them, and hands them to the delegate. Reading a 60 KB corpus to "prepare" it spends exactly what offloading was supposed to save. 1. **Concatenate on disk:** assemble the corpus with shell redirection, not by reading files into your context. 2. **Serialize with a JSON-aware tool.** Never build JSON by interpolating file contents into `echo` — any quote, backslash, newline, tab, or control character in the source produces invalid JSON, so the failure is silent and total on almost any real file. ```bash # assemble the corpus without ever reading it { cat header.md; cat body/*.md; } > /tmp/corpus.txt # serialize it safely — python does the escaping python3 - <<'PY' import json corpus = open('/tmp/corpus.txt', errors='ignore').read() body = {"messages": [{"role": "user", "content": "INSTRUCTIONS HERE\n\n" + corpus}], "max_tokens": 2000, "temperature": 0} json.dump(body, open('/tmp/body.json', 'w')) PY ``` ## Size the corpus 1. **Trim irrelevant content:** Remove headers, footers, or unrelated sections — on disk,