the-grid-cc 1.7.3 → 1.7.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.
@@ -0,0 +1,112 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 520">
2
+ <defs>
3
+ <!-- Terminal background gradient -->
4
+ <linearGradient id="termBg" x1="0%" y1="0%" x2="0%" y2="100%">
5
+ <stop offset="0%" style="stop-color:#2d2d2d"/>
6
+ <stop offset="100%" style="stop-color:#1a1a1a"/>
7
+ </linearGradient>
8
+
9
+ <!-- TRON Cyan Glow Filter -->
10
+ <filter id="tron-glow" x="-50%" y="-50%" width="200%" height="200%">
11
+ <feGaussianBlur in="SourceGraphic" stdDeviation="3" result="blur1"/>
12
+ <feGaussianBlur in="SourceGraphic" stdDeviation="6" result="blur2"/>
13
+ <feGaussianBlur in="SourceGraphic" stdDeviation="12" result="blur3"/>
14
+ <feMerge>
15
+ <feMergeNode in="blur3"/>
16
+ <feMergeNode in="blur2"/>
17
+ <feMergeNode in="blur1"/>
18
+ <feMergeNode in="SourceGraphic"/>
19
+ </feMerge>
20
+ </filter>
21
+
22
+ <!-- Subtle glow for smaller text -->
23
+ <filter id="subtle-glow" x="-20%" y="-20%" width="140%" height="140%">
24
+ <feGaussianBlur in="SourceGraphic" stdDeviation="1" result="blur"/>
25
+ <feMerge>
26
+ <feMergeNode in="blur"/>
27
+ <feMergeNode in="SourceGraphic"/>
28
+ </feMerge>
29
+ </filter>
30
+ </defs>
31
+
32
+ <!-- Terminal window -->
33
+ <rect width="800" height="520" rx="10" fill="url(#termBg)"/>
34
+
35
+ <!-- Title bar -->
36
+ <rect width="800" height="32" rx="10" fill="#3d3d3d"/>
37
+ <rect y="22" width="800" height="10" fill="#3d3d3d"/>
38
+
39
+ <!-- Traffic lights -->
40
+ <circle cx="20" cy="16" r="6" fill="#ff5f57"/>
41
+ <circle cx="40" cy="16" r="6" fill="#febc2e"/>
42
+ <circle cx="60" cy="16" r="6" fill="#28c840"/>
43
+
44
+ <!-- Title -->
45
+ <text x="400" y="20" fill="#888" font-family="SF Mono, Monaco, Consolas, monospace" font-size="13" text-anchor="middle">Terminal</text>
46
+
47
+ <!-- Prompt line 1 -->
48
+ <text x="20" y="65" font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
49
+ <tspan fill="#6cf">~</tspan>
50
+ <tspan fill="#888"> $ </tspan>
51
+ <tspan fill="#fff">npx the-grid-cc</tspan>
52
+ </text>
53
+
54
+ <!-- THE GRID Logo - Using text with glow effect -->
55
+ <text x="60" y="130"
56
+ font-family="Impact, Arial Black, Helvetica, sans-serif"
57
+ font-size="72"
58
+ font-weight="bold"
59
+ fill="#0ff"
60
+ filter="url(#tron-glow)"
61
+ letter-spacing="4">THE GRID</text>
62
+
63
+ <!-- Version and description -->
64
+ <text font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
65
+ <tspan x="60" y="170" fill="#fff">The Grid</tspan>
66
+ <tspan fill="#888"> v1.7.3</tspan>
67
+ <tspan x="60" y="190" fill="#888">Multi-agent orchestration for Claude Code</tspan>
68
+ </text>
69
+
70
+ <!-- Installation checkmarks -->
71
+ <text font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
72
+ <tspan x="60" y="230" fill="#28c840">✓</tspan>
73
+ <tspan fill="#ccc"> Installed commands/grid</tspan>
74
+ <tspan x="60" y="250" fill="#28c840">✓</tspan>
75
+ <tspan fill="#ccc"> Installed agents</tspan>
76
+ </text>
77
+
78
+ <!-- Done message -->
79
+ <text x="60" y="290" font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
80
+ <tspan fill="#28c840">Done!</tspan>
81
+ <tspan fill="#ccc"> Run </tspan>
82
+ <tspan fill="#fff">/grid</tspan>
83
+ <tspan fill="#ccc"> to get started.</tspan>
84
+ </text>
85
+
86
+ <!-- Second prompt - /grid session -->
87
+ <text x="20" y="340" font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
88
+ <tspan fill="#6cf">~</tspan>
89
+ <tspan fill="#888"> $ </tspan>
90
+ <tspan fill="#fff">/grid</tspan>
91
+ </text>
92
+
93
+ <!-- Master Control output with glow -->
94
+ <text x="60" y="390"
95
+ font-family="Impact, Arial Black, Helvetica, sans-serif"
96
+ font-size="28"
97
+ fill="#0ff"
98
+ filter="url(#subtle-glow)"
99
+ letter-spacing="2">THE GRID</text>
100
+
101
+ <text x="60" y="408" fill="#0ff" font-family="SF Mono, Monaco, Consolas, monospace" font-size="14" filter="url(#subtle-glow)">════════════</text>
102
+
103
+ <text font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
104
+ <tspan x="60" y="440" fill="#fff">Master Control online.</tspan>
105
+ <tspan x="60" y="475" fill="#ccc">What would you like to build?</tspan>
106
+ </text>
107
+
108
+ <!-- Blinking cursor -->
109
+ <rect x="60" y="490" width="8" height="14" fill="#fff" opacity="0.8">
110
+ <animate attributeName="opacity" values="0.8;0;0.8" dur="1s" repeatCount="indefinite"/>
111
+ </rect>
112
+ </svg>
@@ -1 +1 @@
1
- 1.7.3
1
+ 1.7.4
@@ -169,6 +169,78 @@ def spawn_count(plan):
169
169
 
170
170
  ---
171
171
 
172
+ ## QUICK MODE DETECTION
173
+
174
+ **For trivial builds, skip planning ceremony.**
175
+
176
+ Before spawning Planner, analyze the request for quick mode eligibility. If ALL conditions pass, auto-invoke `/grid:quick` instead.
177
+
178
+ ### Detection Heuristics
179
+
180
+ | Heuristic | Threshold | Rationale |
181
+ |-----------|-----------|-----------|
182
+ | **File count** | ≤ 5 files | Below spawn overhead threshold |
183
+ | **Block structure** | Single block only | No dependency coordination needed |
184
+ | **Checkpoints** | None required | Can run to completion |
185
+ | **Ambiguity** | Requirements clear | No discovery phase needed |
186
+ | **No architecture** | No schema/DB changes | Avoid risky auto-decisions |
187
+
188
+ ```python
189
+ def should_use_quick_mode(request: str, codebase_context: dict) -> tuple[bool, str]:
190
+ """Returns: (use_quick_mode, reason)"""
191
+
192
+ # RULE 1: File count threshold
193
+ estimated_files = infer_file_count(request, codebase_context)
194
+ if estimated_files > 5:
195
+ return False, f"Estimated {estimated_files} files (threshold: 5)"
196
+
197
+ # RULE 2: Single block structure
198
+ if any(kw in request.lower() for kw in ["then", "after", "once", "multi-step"]):
199
+ return False, "Multi-phase work detected"
200
+
201
+ # RULE 3: No checkpoints
202
+ checkpoint_keywords = ["deploy", "test manually", "verify in browser", "2FA", "email"]
203
+ if any(kw in request.lower() for kw in checkpoint_keywords):
204
+ return False, "Checkpoint likely required"
205
+
206
+ # RULE 4: Clear requirements (ambiguity < 0.6)
207
+ if measure_ambiguity(request) > 0.6:
208
+ return False, "Requirements too ambiguous"
209
+
210
+ # RULE 5: No architectural changes
211
+ architecture_keywords = ["database", "schema", "migration", "new table", "auth system"]
212
+ if any(kw in request.lower() for kw in architecture_keywords):
213
+ return False, "Architectural changes detected"
214
+
215
+ return True, f"Quick mode eligible: {estimated_files} files, clear scope"
216
+ ```
217
+
218
+ ### User Override
219
+
220
+ After detection, show decision:
221
+ ```
222
+ QUICK MODE DETECTED
223
+ ═══════════════════
224
+
225
+ Analysis: 2 files, single block, clear scope
226
+ Proceeding with /grid:quick for faster execution.
227
+
228
+ (Say "use full grid" if you want formal planning instead)
229
+ ```
230
+
231
+ If User says "use full grid", respect the override immediately.
232
+
233
+ ### Complexity Escalation
234
+
235
+ If quick mode executor discovers higher complexity during execution:
236
+ - More than 5 files actually need changes
237
+ - Architectural decisions required
238
+ - Checkpoints unavoidable
239
+
240
+ **STOP and escalate** back to MC with partial work. MC spawns Planner for remaining complexity.
241
+
242
+ ---
243
+
172
244
  ## PROGRAM SPAWNING PROTOCOL
173
245
 
174
246
  ### Available Programs
@@ -222,6 +294,74 @@ Task(
222
294
  )
223
295
  ```
224
296
 
297
+ ### Plan-Execute Direct Pipeline
298
+
299
+ **Planner returns structured plan data.** MC receives plans directly in memory, no re-reading from disk.
300
+
301
+ **Planner completion format:**
302
+ ```yaml
303
+ ## PLANNING COMPLETE
304
+
305
+ cluster: {name}
306
+ total_blocks: {N}
307
+ total_waves: {M}
308
+
309
+ plans:
310
+ - id: "01"
311
+ path: ".grid/phases/01-foundation/01-PLAN.md"
312
+ wave: 1
313
+ depends_on: []
314
+ autonomous: true
315
+ files_modified: [list]
316
+ objective: "{brief objective}"
317
+
318
+ frontmatter: {full YAML frontmatter}
319
+ content: |
320
+ <objective>...</objective>
321
+ <context>...</context>
322
+ <threads>...</threads>
323
+
324
+ wave_structure:
325
+ 1: ["01", "02"]
326
+ 2: ["03"]
327
+ ```
328
+
329
+ **MC workflow:**
330
+ ```python
331
+ # Step 1: Spawn Planner
332
+ planner_result = Task(prompt="...", ...)
333
+
334
+ # Step 2: Parse plan data (already in memory!)
335
+ plan_data = parse_yaml(planner_result)
336
+
337
+ # Step 3: Execute by wave (no file reads needed!)
338
+ for wave_num in sorted(plan_data['wave_structure'].keys()):
339
+ for plan_id in plan_data['wave_structure'][wave_num]:
340
+ plan = get_plan_by_id(plan_data['plans'], plan_id)
341
+
342
+ Task(
343
+ prompt=f"""
344
+ First, read ~/.claude/agents/grid-executor.md for your role.
345
+
346
+ <plan>
347
+ ---
348
+ {plan['frontmatter']}
349
+ ---
350
+ {plan['content']}
351
+ </plan>
352
+
353
+ Execute the plan.
354
+ """,
355
+ ...
356
+ )
357
+ ```
358
+
359
+ **Benefits:**
360
+ - Zero file reads between planning and execution
361
+ - MC has all plan metadata immediately
362
+ - Wave execution begins instantly after planning
363
+ - Files still written by Planner (for persistence/audit)
364
+
225
365
  ### Parallel Spawning (BatchTool Pattern)
226
366
 
227
367
  **To spawn Programs in parallel, issue multiple Task() calls in a SINGLE message.**
@@ -235,18 +375,37 @@ Task(prompt="...", subagent_type="general-purpose", description="Execute plan 03
235
375
 
236
376
  The Task tool blocks until ALL complete. No polling needed.
237
377
 
238
- ### Wave-Based Execution
378
+ ### Wave-Based Execution with Auto-Verification
239
379
 
240
- Plans are assigned **wave numbers** during planning (not execution). Execute waves sequentially, plans within each wave in parallel:
380
+ Plans are assigned **wave numbers** during planning. Execute waves sequentially, with **automatic verification** after each wave:
241
381
 
242
382
  ```
243
- WAVE 1: [plan-01, plan-02] → Spawn both in parallel
244
- (wait for completion)
245
- WAVE 2: [plan-03] → Spawn after Wave 1
246
- (wait for completion)
247
- WAVE 3: [plan-04, plan-05] → Spawn both in parallel
383
+ WAVE 1: [plan-01, plan-02]
384
+ ├─ Spawn Executors (parallel)
385
+ ├─ Wait for completion
386
+ ├─ Auto-spawn Recognizer (wave-level verification)
387
+ └─ If GAPS_FOUND → Spawn Planner --gaps
388
+
389
+ WAVE 2: [plan-03]
390
+ ├─ Spawn Executor
391
+ ├─ Wait for completion
392
+ ├─ Auto-spawn Recognizer
393
+ └─ If CLEAR → Proceed
394
+
395
+ WAVE 3: [plan-04, plan-05]
396
+ ├─ Spawn Executors (parallel)
397
+ ├─ Wait for completion
398
+ └─ Auto-spawn Recognizer
248
399
  ```
249
400
 
401
+ **Verification Timing:** Wave-level, not plan-level. This prevents redundant checks on interdependent plans.
402
+
403
+ **Verification Skipped When:**
404
+ - Executor returned CHECKPOINT (incomplete work)
405
+ - Executor returned FAILURE (broken state)
406
+ - Plan frontmatter has `verify: false`
407
+ - User said "skip verification"
408
+
250
409
  Read wave numbers from plan frontmatter:
251
410
  ```yaml
252
411
  ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "the-grid-cc",
3
- "version": "1.7.3",
3
+ "version": "1.7.4",
4
4
  "description": "Agent orchestration for Claude Code. You talk to Master Control. Master Control handles the rest.",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -1,120 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 520">
2
- <defs>
3
- <linearGradient id="termBg" x1="0%" y1="0%" x2="0%" y2="100%">
4
- <stop offset="0%" style="stop-color:#2d2d2d"/>
5
- <stop offset="100%" style="stop-color:#1a1a1a"/>
6
- </linearGradient>
7
- </defs>
8
-
9
- <!-- Terminal window -->
10
- <rect width="800" height="520" rx="10" fill="url(#termBg)"/>
11
-
12
- <!-- Title bar -->
13
- <rect width="800" height="32" rx="10" fill="#3d3d3d"/>
14
- <rect y="22" width="800" height="10" fill="#3d3d3d"/>
15
-
16
- <!-- Traffic lights -->
17
- <circle cx="20" cy="16" r="6" fill="#ff5f57"/>
18
- <circle cx="40" cy="16" r="6" fill="#febc2e"/>
19
- <circle cx="60" cy="16" r="6" fill="#28c840"/>
20
-
21
- <!-- Title -->
22
- <text x="400" y="20" fill="#888" font-family="SF Mono, Monaco, monospace" font-size="13" text-anchor="middle">Terminal</text>
23
-
24
- <!-- Prompt line -->
25
- <text x="20" y="60" font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
26
- <tspan fill="#6cf">~</tspan>
27
- <tspan fill="#888"> $ </tspan>
28
- <tspan fill="#fff">npx the-grid-cc</tspan>
29
- </text>
30
-
31
- <!-- TRON-style GRID logo using rectangles -->
32
- <g fill="#0ff" transform="translate(60, 85)">
33
- <!-- T -->
34
- <rect x="0" y="0" width="40" height="8"/>
35
- <rect x="16" y="8" width="8" height="32"/>
36
-
37
- <!-- H -->
38
- <rect x="50" y="0" width="8" height="40"/>
39
- <rect x="50" y="16" width="24" height="8"/>
40
- <rect x="66" y="0" width="8" height="40"/>
41
-
42
- <!-- E -->
43
- <rect x="84" y="0" width="24" height="8"/>
44
- <rect x="84" y="0" width="8" height="40"/>
45
- <rect x="84" y="16" width="20" height="8"/>
46
- <rect x="84" y="32" width="24" height="8"/>
47
-
48
- <!-- Space -->
49
-
50
- <!-- G -->
51
- <rect x="130" y="0" width="28" height="8"/>
52
- <rect x="130" y="0" width="8" height="40"/>
53
- <rect x="130" y="32" width="28" height="8"/>
54
- <rect x="150" y="20" width="8" height="20"/>
55
- <rect x="142" y="20" width="16" height="8"/>
56
-
57
- <!-- R - FIXED: proper R shape with diagonal leg -->
58
- <rect x="168" y="0" width="8" height="40"/>
59
- <rect x="168" y="0" width="28" height="8"/>
60
- <rect x="188" y="0" width="8" height="20"/>
61
- <rect x="168" y="16" width="28" height="8"/>
62
- <!-- diagonal leg of R - approximated with angled rectangles -->
63
- <rect x="180" y="24" width="8" height="8"/>
64
- <rect x="188" y="32" width="8" height="8"/>
65
-
66
- <!-- I -->
67
- <rect x="210" y="0" width="24" height="8"/>
68
- <rect x="218" y="8" width="8" height="24"/>
69
- <rect x="210" y="32" width="24" height="8"/>
70
-
71
- <!-- D -->
72
- <rect x="244" y="0" width="8" height="40"/>
73
- <rect x="244" y="0" width="20" height="8"/>
74
- <rect x="264" y="4" width="8" height="32"/>
75
- <rect x="244" y="32" width="20" height="8"/>
76
- </g>
77
-
78
- <!-- Version and description -->
79
- <text font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
80
- <tspan x="60" y="165" fill="#fff">The Grid</tspan>
81
- <tspan fill="#888"> v1.7.2</tspan>
82
- <tspan x="60" y="185" fill="#888">Multi-agent orchestration for Claude Code</tspan>
83
- </text>
84
-
85
- <!-- Installation checkmarks -->
86
- <text font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
87
- <tspan x="60" y="225" fill="#28c840">✓</tspan>
88
- <tspan fill="#ccc"> Installed commands/grid</tspan>
89
- <tspan x="60" y="245" fill="#28c840">✓</tspan>
90
- <tspan fill="#ccc"> Installed agents</tspan>
91
- </text>
92
-
93
- <!-- Done message -->
94
- <text x="60" y="285" font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
95
- <tspan fill="#28c840">Done!</tspan>
96
- <tspan fill="#ccc"> Run </tspan>
97
- <tspan fill="#fff">/grid</tspan>
98
- <tspan fill="#ccc"> to get started.</tspan>
99
- </text>
100
-
101
- <!-- Second prompt - /grid session -->
102
- <text x="20" y="330" font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
103
- <tspan fill="#6cf">~</tspan>
104
- <tspan fill="#888"> $ </tspan>
105
- <tspan fill="#fff">/grid</tspan>
106
- </text>
107
-
108
- <!-- Master Control output -->
109
- <text font-family="SF Mono, Monaco, Consolas, monospace" font-size="14">
110
- <tspan x="60" y="375" fill="#0ff" font-weight="bold">THE GRID</tspan>
111
- <tspan x="60" y="393" fill="#0ff">════════</tspan>
112
- <tspan x="60" y="430" fill="#fff">Master Control online.</tspan>
113
- <tspan x="60" y="465" fill="#ccc">What would you like to build?</tspan>
114
- </text>
115
-
116
- <!-- Blinking cursor -->
117
- <rect x="60" y="480" width="8" height="14" fill="#fff" opacity="0.8">
118
- <animate attributeName="opacity" values="0.8;0;0.8" dur="1s" repeatCount="indefinite"/>
119
- </rect>
120
- </svg>