/rlm-mode
Detect requests for recursive decomposition and large-scale operations that benefit from RLM processing
$ npx -y skills add jmagly/aiwg --skill rlm-mode --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/rlm-mode
Context preview
The summary Claude sees to decide when to auto-load this skill.
Detect requests for recursive decomposition and large-scale operations that benefit from RLM processing
SKILL.md
rlm-mode.SKILL.mdnamespace: aiwg
name: rlm-mode
description: Detect requests for recursive decomposition and large-scale operations that benefit from RLM processing
version: 1.1.0
platforms: [all]
RLM Mode Skill
You detect when users need large-scale operations that would benefit from recursive decomposition and route to RLM commands instead of attempting to load everything into context.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "RLM" / "recursive language model" → explicit RLM mode activation
- "process in chunks" → chunk-based decomposition request
- "decompose and process" → explicit decomposition shorthand
- "fan out" → parallel fan-out processing across files or modules
Core Problem
Loading entire codebases or directory trees into context causes:
- **Context window overflow**: Exceeding model limits
- **Degraded quality**: Agent struggles with too much information
- **Poor performance**: Slow processing, truncated responses
- **Memory exhaustion**: System crashes on large repos
**RLM solution**: Decompose → Process in chunks → Aggregate results
Trigger Patterns Reference
| Pattern | Example | Why RLM? | |---------|---------|----------| | `analyze all files` | "analyze all TypeScript files for security issues" | Scope exceeds context window | | `search the entire codebase` | "search the entire codebase for authentication logic" | Need to traverse full tree | | `review every module` | "review every module for proper error handling" | Many independent reviews | | `find all instances` | "find all instances of deprecated API usage" | Requires exhaustive search | | `summarize the whole repository` | "summarize the whole repository structure" | Hierarchical decomposition | | `check every file` | "check every file for missing tests" | File-by-file evaluation | | `scan all directories` | "scan all directories for outdated dependencies" | Directory tree traversal | | `across the entire project` | "find TODOs across the entire project" | Project-wide aggregation | | `throughout the repository` | "identify duplicated code throughout the repository" | Cross-file comparison | | `recursively process` | "recursively process src/ and generate docs" | Explicit recursion request | | `batch process` | "batch process all markdown files for formatting" | Parallel batch operation | | `apply to all` | "apply linting rules to all JavaScript files" | Bulk transformation | | `update every` | "update every component to use new API" | Mass refactoring | | `generate for each` | "generate tests for each module in lib/" | Templated generation |
Detection Logic
High Confidence (Auto-Suggest)
**Patterns that almost always need RLM**:
1. **Quantifiers**: "all", "every", "entire", "whole", "throughout" 2. **Scope words**: "codebase", "repository", "project-wide" 3. **Recursive terms**: "recursively", "nested", "hierarchical", "tree" 4. **Batch terms**: "batch", "bulk", "mass", "apply to multiple"
**Heuristics**:
- User mentions directory paths (`src/`, `lib/`, `test/`)
- User wants aggregated output ("list all", "summarize", "generate report")
- Task involves file count estimation >20 files
- User explicitly says "this might be a lot" or "there are many files"
Medium Confidence (Suggest with Alternatives)
**Patterns that might need RLM**:
1. User asks about "multiple files" without quantity 2. User wants to "find patterns" without specifying scope 3. Task could be done with grep but user phrases it as analysis
**In these cases**: Ask user to clarify scope before recommending RLM
Low Confidence (Don't Suggest)
**Patterns that DON'T need RLM**:
1. Single file operations: "analyze this file", "refactor login.ts" 2. Specific file list: "check auth.ts, user.ts, and session.ts" 3. Interactive exploration: "show me the auth module" 4. Already scoped: "in this directory" (with small directory)
Decomposition Strategies
When RLM is appropriate, suggest the right strategy:
Strategy 1: Recursive Query (`rlm-query`)
**Use when**: User wants to find, list, or aggregate information
**Example triggers**:
- "find all functions that use deprecated API"
- "list all files missing tests"
- "identify all TODO comments"
- "show me all error handling patterns"
**Suggested command**:
/rlm-query "{context-source}" "{query}" --depth {N}The first positional argument is the context source — a single file path or glob pattern. The second is the sub-prompt for the spawned sub-agent.
**Example**:
User: "find all TODO comments across the entire codebase"
Decomposition:
Context source: "**/*.{js,ts,jsx,tsx}" (all code files)
Query: "Extract TODO comments with file:line locations"
Suggested: /rlm-query "**/*.{js,ts,jsx,tsx}" "Extract TODO comments with file:line locations"Strategy 2: Batch Processing (`rlm-batch`)
**Use when**: User wants to transform, update, or generate for multiple files
**Example triggers**:
- "update every component to use new prop types"
- "add JSDoc comments to all functions"
- "refactor all API calls to use new client"
- "generate tests for each module"
**Suggested command**:
/rlm-batch "{glob-pattern}" "{operation}" --max-parallel {N}The first positional argument is the glob pattern that selects target files. The second is the operation applied to each file (use `{file}` as the placeholder for the current file path).
**Example**:
User: "add TypeScript types to every JavaScript file in src/"
Decomposition:
Glob pattern: "src/**/*.js"
Operation: "Add TypeScript type annotations to {file}"
Max parallel: 4 (concurrent workers)
Suggested: /rlm-batch "src/**/*.js" "Add TypeScript type annotations to {file}" --max-parallel 4Strategy 3: Hierarchical Summary (`rlm-batch` with summarize aggregation)
**Use when**: User wants to understand large-scale structure or relationships
**Example triggers**:
- "summarize the entire reposi
Read more
namespace: aiwg name: rlm-mode description: Detect requests for recursive decomposition and large-scale operations that benefit from RLM processing version: 1.1.0 platforms: [all]
RLM Mode Skill
You detect when users need large-scale operations that would benefit from recursive decomposition and route to RLM commands instead of attempting to load everything into context.
Triggers
Alternate expressions and non-obvious activations (primary phrases are matched automatically from the skill description):
- "RLM" / "recursive language model" → explicit RLM mode activation
- "process in chunks" → chunk-based decomposition request
- "decompose and process" → explicit decomposition shorthand
- "fan out" → parallel fan-out processing across files or modules
Core Problem
Loading entire codebases or directory trees into context causes:
- **Context window overflow**: Exceeding model limits
- **Degraded quality**: Agent struggles with too much information
- **Poor performance**: Slow processing, truncated responses
- **Memory exhaustion**: System crashes on large repos
**RLM solution**: Decompose → Process in chunks → Aggregate results
Trigger Patterns Reference
| Pattern | Example | Why RLM? | |---------|---------|----------| | `analyze all files` | "analyze all TypeScript files for security issues" | Scope exceeds context window | | `search the entire codebase` | "search the entire codebase for authentication logic" | Need to traverse full tree | | `review every module` | "review every module for proper error handling" | Many independent reviews | | `find all instances` | "find all instances of deprecated API usage" | Requires exhaustive search | | `summarize the whole repository` | "summarize the whole repository structure" | Hierarchical decomposition | | `check every file` | "check every file for missing tests" | File-by-file evaluation | | `scan all directories` | "scan all directories for outdated dependencies" | Directory tree traversal | | `across the entire project` | "find TODOs across the entire project" | Project-wide aggregation | | `throughout the repository` | "identify duplicated code throughout the repository" | Cross-file comparison | | `recursively process` | "recursively process src/ and generate docs" | Explicit recursion request | | `batch process` | "batch process all markdown files for formatting" | Parallel batch operation | | `apply to all` | "apply linting rules to all JavaScript files" | Bulk transformation | | `update every` | "update every component to use new API" | Mass refactoring | | `generate for each` | "generate tests for each module in lib/" | Templated generation |
Detection Logic
High Confidence (Auto-Suggest)
**Patterns that almost always need RLM**:
1. **Quantifiers**: "all", "every", "entire", "whole", "throughout" 2. **Scope words**: "codebase", "repository", "project-wide" 3. **Recursive terms**: "recursively", "nested", "hierarchical", "tree" 4. **Batch terms**: "batch", "bulk", "mass", "apply to multiple"
**Heuristics**:
- User mentions directory paths (`src/`, `lib/`, `test/`)
- User wants aggregated output ("list all", "summarize", "generate report")
- Task involves file count estimation >20 files
- User explicitly says "this might be a lot" or "there are many files"
Medium Confidence (Suggest with Alternatives)
**Patterns that might need RLM**:
1. User asks about "multiple files" without quantity 2. User wants to "find patterns" without specifying scope 3. Task could be done with grep but user phrases it as analysis
**In these cases**: Ask user to clarify scope before recommending RLM
Low Confidence (Don't Suggest)
**Patterns that DON'T need RLM**:
1. Single file operations: "analyze this file", "refactor login.ts" 2. Specific file list: "check auth.ts, user.ts, and session.ts" 3. Interactive exploration: "show me the auth module" 4. Already scoped: "in this directory" (with small directory)
Decomposition Strategies
When RLM is appropriate, suggest the right strategy:
Strategy 1: Recursive Query (`rlm-query`)
**Use when**: User wants to find, list, or aggregate information
**Example triggers**:
- "find all functions that use deprecated API"
- "list all files missing tests"
- "identify all TODO comments"
- "show me all error handling patterns"
**Suggested command**:
/rlm-query "{context-source}" "{query}" --depth {N}The first positional argument is the context source — a single file path or glob pattern. The second is the sub-prompt for the spawned sub-agent.
**Example**:
User: "find all TODO comments across the entire codebase"
Decomposition:
Context source: "**/*.{js,ts,jsx,tsx}" (all code files)
Query: "Extract TODO comments with file:line locations"
Suggested: /rlm-query "**/*.{js,ts,jsx,tsx}" "Extract TODO comments with file:line locations"Strategy 2: Batch Processing (`rlm-batch`)
**Use when**: User wants to transform, update, or generate for multiple files
**Example triggers**:
- "update every component to use new prop types"
- "add JSDoc comments to all functions"
- "refactor all API calls to use new client"
- "generate tests for each module"
**Suggested command**:
/rlm-batch "{glob-pattern}" "{operation}" --max-parallel {N}The first positional argument is the glob pattern that selects target files. The second is the operation applied to each file (use `{file}` as the placeholder for the current file path).
**Example**:
User: "add TypeScript types to every JavaScript file in src/"
Decomposition:
Glob pattern: "src/**/*.js"
Operation: "Add TypeScript type annotations to {file}"
Max parallel: 4 (concurrent workers)
Suggested: /rlm-batch "src/**/*.js" "Add TypeScript type annotations to {file}" --max-parallel 4Strategy 3: Hierarchical Summary (`rlm-batch` with summarize aggregation)
**Use when**: User wants to understand large-scale structure or relationships
**Example triggers**:
- "summarize the entire reposi
Multi-agent AI framework for Claude Code, Copilot, Cursor, Warp, and 6 more platforms 200+ agents, 109+ CLI commands, 400+ deployable agent/skill/command/rule artifacts, 8 core frameworks, 32 addons, and a 40-plugin Claude Code marketplace.
Repo: jmagly/aiwg
Other skills on aiwg.
- /agent-loop-ext
Crash-resilient external agent loop with state persistence and CI/CD integration
Open skill - /agent-loop
Detect requests for iterative autonomous agent loops and route to the appropriate loop executor
Open skill - /auto-test-execution
Automatically execute tests when code-generating agents modify source files, enforcing the execute-before-return pattern
Open skill - /cross-task-learner
Enable agent loops to learn from similar past tasks and share patterns across loops
Open skill - /debug-memory
Query and manage the executable feedback debug memory
Open skill - /execute-feedback
Execute tests on generated code and iterate until passing
Open skill

