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.
npx skills add massimodeluisa/recursive-decomposition-skill --skill recursive-decompositiongit clone --depth 1 https://github.com/massimodeluisa/recursive-decomposition-skillWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition)<a href="https://agentmods.dev/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition"><img src="https://agentmods.dev/badge/skills/massimodeluisa/recursive-decomposition-skill/recursive-decomposition.svg" alt="Measured on agentmods" height="20"></a>- NVIDIA SkillSpector warn
SkillSpector: 2 findings, up to high
These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →
- high Data Exfiltration · line 73 Code or instructions that leak agent conversation context to external services, potentially exposing sensitive user interactions.Fix: Remove any code that sends prompts, responses, or session data externally. Preserve user privacy; never exfiltrate conversation content.
- medium Memory Poisoning · line 3 Skill attempts to fill the context window with filler content, displacing legitimate instructions and safety constraints. This can degrade agent performance or bypass safety boundaries.Fix: Implement context-window management that detects and rejects padding or stuffing attempts. Prioritize system instructions over user-injected content.
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00151 | $0.01500 |
| Opus 5 | $0.00076 | $0.00750 |
| Sonnet 5 | $0.00030 | $0.00300 |
| Haiku 4.5 | $0.00015 | $0.00150 |
Grade A, and why
recursive-decomposition 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 8d 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.
How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Recursive Decomposition
Long inputs degrade model quality: details get missed, distant parts get linked by guesswork, reasoning drifts. The RLM paper calls it context rot. Instead of loading everything into the context window, treat the input as an environment you query with tools: size it, narrow it, split it, delegate independent parts to sub-agents, verify on small windows, and merge results programmatically. Based on Recursive Language Models (Zhang, Kraska, Khattab, 2025).
How to use
/recursive-decomposition: apply the protocol below to the current task./recursive-decomposition <path or question>: size that input first, then run the protocol on it.
When it applies
| Situation | Approach |
|---|---|
| 10+ files, 50k+ tokens, or a multi-hop question across scattered sources | Decompose (this skill) |
| 30k to 50k tokens | Decompose when completeness matters; otherwise read directly |
| Under 30k tokens, one file, or a localized answer | Read directly |
Protocol
- Size the input before reading anything: count files (glob,
find), lines (wc -l), bytes (ls -lh), pages for PDFs. - Filter the search space with searches (content search, file patterns, keywords, file types) before opening any file. Chain filters: file type, then keyword, then meaning.
- Chunk what remains: natural units (functions, classes, sections), line ranges, or keyword partitions. Batches of 5 to 10 files.
- Recurse: give each independent batch to a sub-agent with a self-contained brief (files, question, output schema); run batches in parallel.
- Verify the synthesised answer on a smaller window: extract the minimal evidence and re-check it; settle disagreements with a targeted re-read.
- Synthesise programmatically: aggregate the structured results, deduplicate, categorise, then write the answer with file and line references.
Rules
- MUST size the input before reading it
- MUST search before reading a directory; NEVER list a tree recursively as a substitute for search
- MUST read large files by line range: over 2,000 lines or 50 KB never in one read; PDFs over 100 pages or 30 MB by metadata or split
- NEVER load more than 5 files into the main context without a written batch plan
- MUST give every sub-agent its own context: the files, the question, the output schema
- MUST spot-check the synthesised result against the sources before answering
- SHOULD read definitions first (
grep -n "function") and bodies later; tables of contents and abstracts before full text - NEVER run the same query over the same content in several sub-agents; partition once into disjoint batches
What ships with it
4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 8d ago First seen · 100 lines · 151 tokens per session scan A 5b4cdc9babe2
recursive-decomposition is a skill published in the GitHub repository massimodeluisa/recursive-decomposition-skill (46 stars, last pushed 10d ago), licensed MIT. It adds 151 tokens to every session and 1,500 once invoked, about $0.0008 per session on Opus 5. 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-30.
Other skills, from other repositories
security-audit
Conduct a security-led audit of code, systems, APIs, infrastructure, dependencies, and AI workflows with threat modeling and exploitability-backed remediation. Use when security risk is the primary concern. Do not use for a generic code review, database design, or non-security debugging.
architecture-planning
Plan the future architecture of a new or materially changing system before implementation. Use for greenfield products, planned platform changes, and technical blueprints spanning components, data, APIs, deployment, and delivery trade-offs. Do not use to audit an existing repository, review a PR, or diagnose an…
code-review
Review a specific implementation, change set, PR, function, or service for broad correctness and production-readiness findings. Use when code-quality is the primary concern. Do not use when security, performance, architecture, dependencies, or tests are the exclusive requested discipline.
database-design
Design, review, or evolve a database schema and its data-integrity, tenancy, migration, indexing, and operational model. Use when the primary deliverable is a datastore or schema decision. Do not use for general system planning, query debugging, or generic dependency/security review.
debugging
Investigate and safely fix an active, observable software failure, error, regression, or unexpected behavior using reproduction and evidence. Use for the proximate technical cause and remediation. Do not use for a systemic incident postmortem or general performance tuning without a failure.
performance-optimization
Measure, diagnose, and improve a performance or capacity objective?latency, throughput, CPU, memory, scalability, or cost?without regressing correctness. Use when performance is the primary requested outcome. Do not use for generic code cleanup or an unmeasured incident postmortem.