plugins/recursive-decomposition/skills/recursive-decomposition/SKILL.md
Based on the Recursive Language Models (RLM) research by Zhang, Kraska, and Khattab (2025), this skill provides strategies for handling tasks that exceed comfortable context limits through programmatic decomposition and recursive self-invocation. Triggers on phrases like "analyze all files", "process this large document", "aggregate information from", "search across the codebase", or tasks involving 10+ files or 50k+ tokens.
npx skillsauth add massimodeluisa/recursive-decomposition-skill recursive-decompositionInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Consult these resources as needed:
CRITICAL: Treat inputs as environmental variables, not immediate context.
Most tasks fail when context is overloaded. Instead of loading entire contexts into the processing window, treat inputs as environmental variables accessible through code execution. Decompose problems recursively, process segments independently, and aggregate results programmatically.
Progressive Disclosure: Load information only when necessary. Start high-level to map the territory, then dive deep into specific areas.
grep or glob before view_file on directories.CRITICAL: Do NOT read large files directly into context.
wc -l (lines) or ls -lh (size) before view_file.view_file with start_line/end_line or head/tail.grep -n "function" ...) then read specific bodies.grep / glob not ls -R (unless mapping structure).view_file with line ranges (offset/limit) not full file reads for huge files.wc -l / ls -lh before reading unknown files.run_command (grep) not read_file for searching.task tool for sub-agents (recurse).To maximize effectiveness:
Balance thoroughness against computational cost. For time-sensitive tasks, apply aggressive filtering. For comprehensive analysis, prefer exhaustive decomposition.
Narrow the search space before detailed processing:
# Instead of reading all files into context:
1. Use Grep/Glob to identify candidate files by pattern
2. Filter candidates using domain-specific keywords
3. Only deeply analyze the filtered subset
Apply model priors about domain terminology to construct effective filters. For code tasks, filter by function names, imports, or error patterns before full file analysis.
Partition inputs for parallel or sequential sub-processing:
Process each chunk independently, then synthesize results.
For generating long outputs:
1. Break output into logical sections
2. Generate each section independently
3. Store intermediate results (in memory or files)
4. Stitch sections together with coherence checks
Invoke sub-agents (via Task tool) for independent segments:
For large analysis:
1. Partition the problem into independent sub-problems
2. Launch parallel agents for each partition
3. Collect and synthesize sub-agent results
4. Verify synthesized answer if needed
Mitigate context degradation by verifying answers on smaller windows:
1. Generate candidate answer from full analysis
2. Extract minimal evidence needed for verification
3. Re-verify answer against focused evidence subset
4. Resolve discrepancies through targeted re-analysis
Task: "Find all error handling patterns in the codebase"
Approach:
*.ts, *.py, etc.)catch, except, Error, throw)Task: "What features are mentioned across all PRD documents?"
Approach:
*.md, *.txt in /docs)Task: "Summarize all TODO comments in the project"
Approach:
TODO/FIXME/HACK patternsdevelopment
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.