recursive-decomposition

Solid

Decompose dense codebase-wide, multi-document, PDF, and aggregation work even when the input fits the context window, following Recursive Language Models (Zhang, Kraska, Khattab, 2025). Use when the user asks to analyse all files, a whole repo, all docs, large PDFs, or to aggregate or multi-hop across scattered sources. Skip one file, one function, a single needle, or a one-page PDF conversion. Triggers: long context, context rot, large codebase, many files, all files, big document, multi-document, PDF, aggregate, summarize everything, codebase-wide, multi-hop, recursive, sub-agents, map-reduce.

AI & Automation 47 stars 2 forks Updated today MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
56
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Recursive Decomposition Long inputs rot. Details get missed, distant parts get glued together by guesswork, and the reasoning drifts. The RLM paper calls it context rot. Do not load the whole input into the window. Treat it as an environment you query: size it, narrow it, split it, hand independent parts to sub-agents, verify on a small window, synthesise in code. Based on [Recursive Language Models](https://arxiv.org/abs/2512.24601) (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 Fit is not the test. Dense work can rot inside a million-token window. In the paper, OOLONG-Pairs is 32k tokens and GPT-5 scores 0.1% F1; RLM(depth=1) reaches 58.0% (arXiv:2512.24601, Table 1). 30k and 50k below are harness caps. | Situation | Approach | |-----------|----------| | One file, one function, or a single needle | Read directly | | Linear aggregate or list-everything, and completeness matters | Decompose (this skill) | | Pairwise, quadratic, or multi-hop across scattered sources | Decompose, even under 30k tokens | | 10+ files or 50k+ tokens | Decompose | | Under 30k tokens and a localised answer | Read directly | ## Protocol 1. **Size the input** before reading anything: count files (glob, `find`), lines (`wc -l`), bytes (`ls -lh`), pages for PDFs. 2. **Filter** the search space with sea...

Details

Author
massimodeluisa
Repository
massimodeluisa/recursive-decomposition-skill
Created
7 months ago
Last Updated
today
Language
HTML
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

rlm

Context-as-environment decomposition (Layer B of the RLM integration). Treat a large artifact (file / dir / log) as a REPL/filesystem the root agent greps and slices instead of ingesting — partition it into addressable chunks via query-context.mjs --map, RECURSE sub-agent calls over the relevant chunks under a bounded depth/children/step budget, AGGREGATE (piping competing per-chunk answers through /weigh), then PERSIST the recursion trace. The anti-context-rot move: ADDRESS context, don't dump the whole artifact into the window. Reuses .oh/scripts/ralph.sh (the recursion loop) and .oh/worktrees/ (isolated branches) BY REFERENCE — never edits either. Manual-invoke (spawns agents, burns tokens). TRIGGER when: /rlm invoked, or asked to "answer a question over a huge file/log", "decompose a large artifact", "recurse over chunks", "address context instead of ingesting it", "beat context rot on a long input", "RLM <file> <query>".

38 Updated today
mifunedev
AI & Automation Listed

recursive-development

Core principles for recursive multi-agent development -- nesting, scope ownership, TDD, context flow, token economics.

2 Updated 3 days ago
Jartan-LLC
AI & Automation Listed

decomposition

Decompose a file that has grown over the size ceiling into focused sibling files — extracting at cognitive seams (hooks, sub-components, pure helpers, types), in the right order, behind a user-approved plan, with post-extraction verification. Invoke when a file-size check warns or a file has become too large to navigate. Refuses on auto-generated, snapshot, and fixture files.

1 Updated 3 days ago
vindm