aiwg 2026.2.2 → 2026.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +14 -1
- package/README.md +9 -0
- package/agentic/code/addons/aiwg-utils/rules/context-budget.md +230 -0
- package/agentic/code/addons/aiwg-utils/rules/subagent-scoping.md +508 -0
- package/agentic/code/addons/rlm/README.md +386 -0
- package/agentic/code/addons/rlm/agents/rlm-agent.md +853 -0
- package/agentic/code/addons/rlm/commands/rlm-batch.md +657 -0
- package/agentic/code/addons/rlm/commands/rlm-query.md +465 -0
- package/agentic/code/addons/rlm/commands/rlm-status.md +568 -0
- package/agentic/code/addons/rlm/docs/deployment-guide.md +729 -0
- package/agentic/code/addons/rlm/docs/messaging-events.md +1141 -0
- package/agentic/code/addons/rlm/docs/multi-provider-guide.md +741 -0
- package/agentic/code/addons/rlm/docs/ralph-integration.md +1009 -0
- package/agentic/code/addons/rlm/docs/supervisor-integration.md +803 -0
- package/agentic/code/addons/rlm/docs/taskstore-persistence.md +959 -0
- package/agentic/code/addons/rlm/manifest.json +75 -0
- package/agentic/code/addons/rlm/rules/rlm-context-management.md +664 -0
- package/agentic/code/addons/rlm/schemas/rlm-cost.yaml +841 -0
- package/agentic/code/addons/rlm/schemas/rlm-state.yaml +601 -0
- package/agentic/code/addons/rlm/schemas/rlm-task-tree.yaml +641 -0
- package/agentic/code/addons/rlm/schemas/rlm-trajectory.yaml +805 -0
- package/agentic/code/addons/rlm/skills/rlm-mode/SKILL.md +496 -0
- package/agentic/code/addons/rlm/templates/cost-report.md +151 -0
- package/agentic/code/frameworks/sdlc-complete/commands/address-issues.md +324 -0
- package/agentic/code/frameworks/sdlc-complete/skills/issue-driven-ralph/SKILL.md +186 -0
- package/docs/_manifest.json +16 -0
- package/docs/cli-reference.md +17 -4
- package/docs/daemon-guide.md +797 -0
- package/docs/messaging-guide.md +385 -0
- package/docs/ralph-guide.md +52 -1
- package/docs/releases/v2026.2.3-announcement.md +140 -0
- package/docs/releases/v2026.2.4-announcement.md +123 -0
- package/docs/simple-language-translations.md +19 -0
- package/package.json +1 -1
- package/src/cli/handlers/use.ts +69 -4
- package/src/extensions/commands/definitions.ts +3 -3
- package/tools/daemon/README.md +368 -0
- package/tools/daemon/agent-supervisor.mjs +297 -0
- package/tools/daemon/automation-engine.mjs +310 -0
- package/tools/daemon/config.mjs +137 -0
- package/tools/daemon/cron-scheduler.mjs +103 -0
- package/tools/daemon/daemon-main.mjs +518 -0
- package/tools/daemon/event-router.mjs +62 -0
- package/tools/daemon/file-watcher.mjs +141 -0
- package/tools/daemon/index.mjs +598 -0
- package/tools/daemon/ipc-client.mjs +197 -0
- package/tools/daemon/ipc-server.mjs +275 -0
- package/tools/daemon/repl-chat.mjs +357 -0
- package/tools/daemon/task-store.mjs +273 -0
- package/tools/daemon/tmux-manager.mjs +327 -0
- package/tools/messaging/adapter-registry.mjs +228 -0
- package/tools/messaging/adapters/base.mjs +230 -0
- package/tools/messaging/adapters/discord.mjs +414 -0
- package/tools/messaging/adapters/slack.mjs +398 -0
- package/tools/messaging/adapters/telegram.mjs +516 -0
- package/tools/messaging/chat-handler.mjs +292 -0
- package/tools/messaging/command-router.mjs +269 -0
- package/tools/messaging/event-bus.mjs +199 -0
- package/tools/messaging/index.mjs +386 -0
- package/tools/messaging/message-formatter.mjs +320 -0
- package/tools/messaging/types.mjs +89 -0
- package/tools/ralph-external/index.mjs +2 -1
package/CLAUDE.md
CHANGED
|
@@ -207,8 +207,9 @@ aiwg version # Show version and channel
|
|
|
207
207
|
aiwg doctor # Check installation health
|
|
208
208
|
aiwg update # Check for updates
|
|
209
209
|
|
|
210
|
-
# Framework management
|
|
210
|
+
# Framework and addon management
|
|
211
211
|
aiwg use sdlc # Deploy SDLC framework
|
|
212
|
+
aiwg use rlm # Deploy RLM addon
|
|
212
213
|
aiwg use sdlc --provider copilot # Deploy to GitHub Copilot
|
|
213
214
|
aiwg list # List installed frameworks
|
|
214
215
|
aiwg remove sdlc # Remove framework
|
|
@@ -259,6 +260,9 @@ aiwg reproducibility-validate # Validate workflow reproducibility
|
|
|
259
260
|
| **Creating Extensions** | `@docs/extensions/creating-extensions.md` |
|
|
260
261
|
| **Extension Types** | `@docs/extensions/extension-types.md` |
|
|
261
262
|
| **SDLC Framework** | `@agentic/code/frameworks/sdlc-complete/README.md` |
|
|
263
|
+
| **RLM Addon** | `@agentic/code/addons/rlm/README.md` |
|
|
264
|
+
| **Daemon Mode** | `@docs/daemon-guide.md` |
|
|
265
|
+
| **Messaging Integration** | `@docs/messaging-guide.md` |
|
|
262
266
|
| **Voice Profiles** | `@agentic/code/addons/voice-framework/voices/templates/` |
|
|
263
267
|
| **Natural Language Patterns** | `@docs/simple-language-translations.md` |
|
|
264
268
|
| **Agent Catalog** | `@agentic/code/frameworks/sdlc-complete/agents/` |
|
|
@@ -340,6 +344,15 @@ aiwg doctor
|
|
|
340
344
|
|
|
341
345
|
<!-- TEAM DIRECTIVES: Add project-specific guidance below this line -->
|
|
342
346
|
|
|
347
|
+
## Context Window Configuration (Optional)
|
|
348
|
+
|
|
349
|
+
<!-- Uncomment and set if running on a local/GPU system with limited context.
|
|
350
|
+
This guides parallel subagent limits and compaction aggressiveness.
|
|
351
|
+
Leave commented out for Anthropic cloud systems (1M+ context).
|
|
352
|
+
See @.claude/rules/context-budget.md for the full lookup table. -->
|
|
353
|
+
|
|
354
|
+
<!-- AIWG_CONTEXT_WINDOW: 100000 -->
|
|
355
|
+
|
|
343
356
|
## What AIWG Is
|
|
344
357
|
|
|
345
358
|
**AI Writing Guide (AIWG)** is a framework that provides AI coding assistants with structured workflows, specialized agents, and artifact management. It's not just documentation - it's an operational system that:
|
package/README.md
CHANGED
|
@@ -95,6 +95,7 @@ npm install -g aiwg
|
|
|
95
95
|
cd your-project
|
|
96
96
|
aiwg use sdlc # Full SDLC framework
|
|
97
97
|
aiwg use marketing # Marketing framework
|
|
98
|
+
aiwg use rlm # RLM addon (recursive context decomposition)
|
|
98
99
|
aiwg use all # All frameworks
|
|
99
100
|
|
|
100
101
|
# Or scaffold a new project
|
|
@@ -125,6 +126,7 @@ aiwg new my-project
|
|
|
125
126
|
|
|
126
127
|
| Addon | What it does |
|
|
127
128
|
|-------|--------------|
|
|
129
|
+
| **[RLM](agentic/code/addons/rlm/)** | Recursive context decomposition for processing 10M+ tokens via sub-agent delegation |
|
|
128
130
|
| **[Writing Quality](agentic/code/addons/writing-quality/)** | Content validation, AI pattern detection, voice profiles |
|
|
129
131
|
| **[Testing Quality](agentic/code/addons/testing-quality/)** | TDD enforcement, mutation testing, flaky test detection |
|
|
130
132
|
| **[Voice Framework](agentic/code/addons/voice-framework/)** | 4 built-in voice profiles with create/blend/apply skills |
|
|
@@ -153,6 +155,10 @@ aiwg new my-project
|
|
|
153
155
|
# Long-running tasks with crash recovery (6-8 hours)
|
|
154
156
|
/ralph-external "Migrate to TypeScript" --completion "npx tsc --noEmit exits 0"
|
|
155
157
|
|
|
158
|
+
# Process massive codebases with recursive decomposition
|
|
159
|
+
/rlm-query "src/**/*.ts" "Extract all exported interfaces" --model haiku
|
|
160
|
+
/rlm-batch "src/components/*.tsx" "Add TypeScript types" --parallel 4
|
|
161
|
+
|
|
156
162
|
# Deploy to production
|
|
157
163
|
/flow-deploy-to-production
|
|
158
164
|
```
|
|
@@ -244,6 +250,9 @@ AIWG's unified extension system enables dynamic discovery, semantic search, and
|
|
|
244
250
|
### Advanced Topics
|
|
245
251
|
|
|
246
252
|
- **[Ralph Loop](docs/ralph-guide.md)** — Iterative task execution with crash recovery
|
|
253
|
+
- **[RLM Addon](agentic/code/addons/rlm/README.md)** — Recursive context decomposition for 10M+ token processing
|
|
254
|
+
- **[Daemon Mode](docs/daemon-guide.md)** — Background file watching, cron scheduling, IPC
|
|
255
|
+
- **[Messaging Integration](docs/messaging-guide.md)** — Bidirectional Slack, Discord, and Telegram bots
|
|
247
256
|
- **[Workspace Architecture](docs/architecture/workspace-architecture.md)** — Multi-framework isolation
|
|
248
257
|
- **[Multi-Agent Orchestration](agentic/code/frameworks/sdlc-complete/docs/orchestrator-architecture.md)** — Parallel reviews and synthesis
|
|
249
258
|
- **[MCP Server](docs/mcp/)** — Model Context Protocol integration
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
# Context Window Budget Rules
|
|
2
|
+
|
|
3
|
+
**Enforcement Level**: MEDIUM
|
|
4
|
+
**Scope**: All parallel subagent spawning and task scheduling
|
|
5
|
+
**Addon**: aiwg-utils (core, universal)
|
|
6
|
+
|
|
7
|
+
## Overview
|
|
8
|
+
|
|
9
|
+
When `AIWG_CONTEXT_WINDOW` is set in CLAUDE.md (or equivalent platform context file), agents MUST respect the declared context budget when deciding how many parallel subagents to spawn and how aggressively to compact context.
|
|
10
|
+
|
|
11
|
+
This directive is **opt-in**. When unset, behavior is unchanged and the platform decides parallelism limits. When set, it provides guidance for systems with smaller context windows (e.g., local GPU inference with 100k-256k context) where unconstrained parallel spawning causes client crashes.
|
|
12
|
+
|
|
13
|
+
## How to Configure
|
|
14
|
+
|
|
15
|
+
Users add the following directive to their CLAUDE.md team directives section (or equivalent for their platform):
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
<!-- AIWG_CONTEXT_WINDOW: 100000 -->
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The value is the total context window size in tokens. Common values:
|
|
22
|
+
|
|
23
|
+
| System | Typical Context Window |
|
|
24
|
+
|--------|----------------------|
|
|
25
|
+
| Local GPU (small) | 32,000-64,000 |
|
|
26
|
+
| Local GPU (medium) | 100,000-128,000 |
|
|
27
|
+
| Local GPU (large) | 200,000-256,000 |
|
|
28
|
+
| Cloud API (standard) | 200,000-500,000 |
|
|
29
|
+
| Anthropic cloud | 1,000,000+ |
|
|
30
|
+
|
|
31
|
+
## Mandatory Rules
|
|
32
|
+
|
|
33
|
+
### Rule 1: Check for AIWG_CONTEXT_WINDOW Before Parallel Spawning
|
|
34
|
+
|
|
35
|
+
Before spawning multiple subagents in parallel, check whether `AIWG_CONTEXT_WINDOW` is declared in the project's context file.
|
|
36
|
+
|
|
37
|
+
**If unset**: No change to default behavior. Spawn as many parallel subagents as the task decomposition requires.
|
|
38
|
+
|
|
39
|
+
**If set**: Use the lookup table below to determine the maximum number of concurrent parallel subagents.
|
|
40
|
+
|
|
41
|
+
### Rule 2: Parallel Subagent Limits
|
|
42
|
+
|
|
43
|
+
When `AIWG_CONTEXT_WINDOW` is set, respect these limits:
|
|
44
|
+
|
|
45
|
+
| Context Window | Max Parallel Subagents | Compaction Behavior |
|
|
46
|
+
|----------------|----------------------|---------------------|
|
|
47
|
+
| Unset (default) | No limit (platform decides) | Normal |
|
|
48
|
+
| ≤64k | 1-2 | Aggressive — prefer sequential |
|
|
49
|
+
| 65k-128k | 2-4 | Moderate — batch in groups of 2-3 |
|
|
50
|
+
| 129k-256k | 4-8 | Standard |
|
|
51
|
+
| 257k-512k | 8-12 | Relaxed |
|
|
52
|
+
| >512k | 12-20 | Normal (cloud default) |
|
|
53
|
+
|
|
54
|
+
**Formula**: `max_parallel = max(1, floor(context_window / 50000))` capped at 20.
|
|
55
|
+
|
|
56
|
+
**Important**: This limits how many subagents run *concurrently*, not the total number of subagents an orchestrator can spawn. If a task decomposes into 20 atomic subtasks but the budget allows only 3 parallel, run them in waves of 3.
|
|
57
|
+
|
|
58
|
+
### Rule 3: Prefer Sequential Batching When Budget Is Tight
|
|
59
|
+
|
|
60
|
+
When context budget is ≤128k tokens:
|
|
61
|
+
|
|
62
|
+
**FORBIDDEN**:
|
|
63
|
+
```
|
|
64
|
+
Task decomposes into 10 subtasks.
|
|
65
|
+
Spawn all 10 subagents simultaneously.
|
|
66
|
+
→ Client crashes or context overflow
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**REQUIRED**:
|
|
70
|
+
```
|
|
71
|
+
Task decomposes into 10 subtasks.
|
|
72
|
+
Context budget allows 2-3 parallel.
|
|
73
|
+
|
|
74
|
+
Wave 1: Subagents 1, 2, 3 (parallel)
|
|
75
|
+
→ Wait for completion
|
|
76
|
+
Wave 2: Subagents 4, 5, 6 (parallel)
|
|
77
|
+
→ Wait for completion
|
|
78
|
+
Wave 3: Subagents 7, 8, 9 (parallel)
|
|
79
|
+
→ Wait for completion
|
|
80
|
+
Wave 4: Subagent 10
|
|
81
|
+
→ Done
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Rule 4: Keep Individual Subagent Tasks Smaller Under Tight Budgets
|
|
85
|
+
|
|
86
|
+
When context budget is constrained, each subagent should produce less output to avoid accumulating too much context in the parent agent's window.
|
|
87
|
+
|
|
88
|
+
| Context Window | Target Output Per Subagent |
|
|
89
|
+
|----------------|--------------------------|
|
|
90
|
+
| ≤64k | <3k tokens |
|
|
91
|
+
| 65k-128k | <5k tokens |
|
|
92
|
+
| 129k-256k | <10k tokens |
|
|
93
|
+
| >256k | Normal (no specific limit) |
|
|
94
|
+
|
|
95
|
+
### Rule 5: This Is Guidance, Not Programmatic Enforcement
|
|
96
|
+
|
|
97
|
+
These rules operate at the prompt/convention level. There is no runtime system that enforces them. Agents are expected to read the directive and adjust their behavior accordingly. The rules provide clear lookup tables so the agent can make the right decision without complex reasoning.
|
|
98
|
+
|
|
99
|
+
## Compaction Guidance
|
|
100
|
+
|
|
101
|
+
### Aggressive Compaction (≤64k)
|
|
102
|
+
|
|
103
|
+
- Run subagents sequentially or in pairs
|
|
104
|
+
- Summarize subagent results before spawning the next batch
|
|
105
|
+
- Prefer returning concise structured data (JSON, tables) over prose
|
|
106
|
+
- Each subagent task should be self-contained with minimal context
|
|
107
|
+
|
|
108
|
+
### Moderate Compaction (65k-128k)
|
|
109
|
+
|
|
110
|
+
- Batch subagents in groups of 2-3
|
|
111
|
+
- Wait for each batch to complete before starting the next
|
|
112
|
+
- Keep subagent output focused — specify word/token limits in the task description
|
|
113
|
+
- Summarize intermediate results when aggregating across batches
|
|
114
|
+
|
|
115
|
+
### Standard Operation (129k-256k)
|
|
116
|
+
|
|
117
|
+
- Parallel fan-out up to 4-8 subagents
|
|
118
|
+
- Normal output expectations
|
|
119
|
+
- Standard context management
|
|
120
|
+
|
|
121
|
+
### Relaxed/Normal (>256k)
|
|
122
|
+
|
|
123
|
+
- Full parallel fan-out as task decomposition dictates
|
|
124
|
+
- No special compaction needed
|
|
125
|
+
- Standard behavior as if directive is unset
|
|
126
|
+
|
|
127
|
+
## Integration
|
|
128
|
+
|
|
129
|
+
### With Subagent Scoping Rules
|
|
130
|
+
|
|
131
|
+
This rule extends `@.claude/rules/subagent-scoping.md` Rule 7 (Context Budget Estimation). When `AIWG_CONTEXT_WINDOW` is set, the context budget formula uses the declared value instead of assuming a default window size.
|
|
132
|
+
|
|
133
|
+
### With Ralph Loops
|
|
134
|
+
|
|
135
|
+
Ralph loops that spawn parallel subagents (e.g., via `rlm-batch` or `parallel-dispatch`) should batch subagent waves according to the context budget table. A Ralph loop on a 100k system should run 2-3 subagents per wave, not 10.
|
|
136
|
+
|
|
137
|
+
### With Orchestrator Fan-Out
|
|
138
|
+
|
|
139
|
+
Orchestrator patterns that decompose tickets into N subtasks should cap concurrent fan-out to the budget limit. All N subtasks still execute — just in sequential waves rather than all at once.
|
|
140
|
+
|
|
141
|
+
## Examples
|
|
142
|
+
|
|
143
|
+
### Example 1: Local GPU System (100k Context)
|
|
144
|
+
|
|
145
|
+
```markdown
|
|
146
|
+
<!-- In CLAUDE.md team directives -->
|
|
147
|
+
<!-- AIWG_CONTEXT_WINDOW: 100000 -->
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
Agent receives task requiring 8 parallel subagents:
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
Context budget: 100k → max_parallel = max(1, floor(100000/50000)) = 2
|
|
154
|
+
Compaction: Moderate
|
|
155
|
+
|
|
156
|
+
Wave 1: Subagents 1, 2 (parallel)
|
|
157
|
+
Wave 2: Subagents 3, 4 (parallel)
|
|
158
|
+
Wave 3: Subagents 5, 6 (parallel)
|
|
159
|
+
Wave 4: Subagents 7, 8 (parallel)
|
|
160
|
+
|
|
161
|
+
Each subagent targets <5k output tokens.
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Example 2: Cloud System (No Directive)
|
|
165
|
+
|
|
166
|
+
```markdown
|
|
167
|
+
<!-- No AIWG_CONTEXT_WINDOW set -->
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Agent receives task requiring 8 parallel subagents:
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
No budget constraint. Spawn all 8 in parallel.
|
|
174
|
+
Normal output expectations.
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Example 3: Small Local Model (32k Context)
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
<!-- AIWG_CONTEXT_WINDOW: 32000 -->
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Agent receives task requiring 5 parallel subagents:
|
|
184
|
+
|
|
185
|
+
```
|
|
186
|
+
Context budget: 32k → max_parallel = max(1, floor(32000/50000)) = 1
|
|
187
|
+
Compaction: Aggressive — fully sequential
|
|
188
|
+
|
|
189
|
+
Run subagents 1 through 5 sequentially.
|
|
190
|
+
Each subagent targets <3k output tokens.
|
|
191
|
+
Summarize each result before proceeding to next.
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Platform Applicability
|
|
195
|
+
|
|
196
|
+
This directive works across all AIWG-supported platforms:
|
|
197
|
+
|
|
198
|
+
| Platform | Where to Set |
|
|
199
|
+
|----------|-------------|
|
|
200
|
+
| Claude Code | `CLAUDE.md` team directives |
|
|
201
|
+
| GitHub Copilot | `.github/copilot-instructions.md` |
|
|
202
|
+
| OpenAI Codex | `~/.codex/instructions.md` or `AGENTS.md` |
|
|
203
|
+
| Cursor | `.cursor/rules/` |
|
|
204
|
+
| Warp | `WARP.md` |
|
|
205
|
+
| Factory AI | `.factory/` context |
|
|
206
|
+
| OpenCode | `.opencode/` context |
|
|
207
|
+
| Windsurf | `AGENTS.md` or `.windsurf/rules/` |
|
|
208
|
+
|
|
209
|
+
The `aiwg use` and `aiwg regenerate` commands will include the directive (commented out) in generated context files when scaffolding new projects.
|
|
210
|
+
|
|
211
|
+
## Checklist
|
|
212
|
+
|
|
213
|
+
Before spawning parallel subagents:
|
|
214
|
+
|
|
215
|
+
- [ ] Check if `AIWG_CONTEXT_WINDOW` is declared in the project context
|
|
216
|
+
- [ ] If set, look up the max parallel count from the table
|
|
217
|
+
- [ ] If parallel count exceeds budget, batch into sequential waves
|
|
218
|
+
- [ ] Adjust subagent output expectations based on budget tier
|
|
219
|
+
- [ ] If unset, proceed with normal parallel behavior
|
|
220
|
+
|
|
221
|
+
## References
|
|
222
|
+
|
|
223
|
+
- @.claude/rules/subagent-scoping.md - Subagent scoping and delegation rules
|
|
224
|
+
- @.claude/rules/subagent-scoping.md#rule-7 - Context budget estimation
|
|
225
|
+
- @.claude/rules/instruction-comprehension.md - Understanding user constraints
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
**Rule Status**: ACTIVE
|
|
230
|
+
**Last Updated**: 2026-02-09
|