@vpxa/aikit 0.1.213 → 0.1.215
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/package.json +1 -1
- package/scaffold/dist/adapters/copilot.mjs +4 -4
- package/scaffold/dist/definitions/agents.mjs +2 -2
- package/scaffold/dist/definitions/bodies.mjs +409 -506
- package/scaffold/dist/definitions/flows.mjs +303 -237
- package/scaffold/dist/definitions/protocols.mjs +235 -343
- package/scaffold/dist/definitions/skills/adr-skill.mjs +470 -1044
- package/scaffold/dist/definitions/skills/multi-agents-development.mjs +102 -214
- package/scaffold/dist/definitions/skills/session-handoff.mjs +541 -1314
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var e=[{file:`architecture-review-prompt.md`,content:`# Architecture Review Prompt Template
|
|
2
2
|
|
|
3
|
-
Use
|
|
3
|
+
Use when dispatching **Architect-Reviewer-Alpha** and **Architect-Reviewer-Beta** for boundary, pattern, infra, or public API changes.
|
|
4
4
|
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -75,15 +75,14 @@ You are performing an architecture review. Focus on structural decisions, not co
|
|
|
75
75
|
|
|
76
76
|
## Usage Notes
|
|
77
77
|
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
- If both reviewers flag the same concern, it's almost certainly a real issue
|
|
78
|
+
- Trigger for boundary, pattern, infra, or API-surface changes
|
|
79
|
+
- Run Alpha and Beta in parallel
|
|
80
|
+
- Shared blocker from both reviewers = likely real issue
|
|
82
81
|
`},{file:`code-quality-review-prompt.md`,content:`# Code Quality Review Prompt Template
|
|
83
82
|
|
|
84
|
-
Use
|
|
83
|
+
Use when dispatching **Code-Reviewer-Alpha** and **Code-Reviewer-Beta** for dual code review. Same prompt; different models catch different issues.
|
|
85
84
|
|
|
86
|
-
|
|
85
|
+
Runs in code review stage. Gather evidence first; FORGE gate runs after code review and any conditional reviews.
|
|
87
86
|
|
|
88
87
|
---
|
|
89
88
|
|
|
@@ -165,17 +164,13 @@ You are performing a code review. Your job is to evaluate HOW the implementation
|
|
|
165
164
|
|
|
166
165
|
## Usage Notes
|
|
167
166
|
|
|
168
|
-
- Run
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
- **Major** findings = usually REQUEST_CHANGES unless truly optional
|
|
173
|
-
- **Minor/Nit** = APPROVE_WITH_SUGGESTIONS (fix in follow-up or ignore)
|
|
167
|
+
- Run before architecture/security review and before FORGE gate
|
|
168
|
+
- Use for dual review or pair with spec-review prompt
|
|
169
|
+
- Blocker = REQUEST_CHANGES
|
|
170
|
+
- Minor/Nit = APPROVE_WITH_SUGGESTIONS
|
|
174
171
|
`},{file:`implementer-prompt.md`,content:`# Implementer Dispatch Prompt Template
|
|
175
172
|
|
|
176
|
-
Use
|
|
177
|
-
|
|
178
|
-
Fill in the bracketed sections with task-specific content. The Orchestrator provides ALL context — the subagent should NOT need to search/explore.
|
|
173
|
+
Use when dispatching **Implementer**, **Frontend**, or **Refactor**. Provide all needed context; subagent should not search beyond scope.
|
|
179
174
|
|
|
180
175
|
---
|
|
181
176
|
|
|
@@ -259,14 +254,13 @@ Hit a wall and cannot proceed:
|
|
|
259
254
|
|
|
260
255
|
## Usage Notes
|
|
261
256
|
|
|
262
|
-
-
|
|
263
|
-
-
|
|
264
|
-
-
|
|
265
|
-
-
|
|
266
|
-
- **For Refactor agent**: include before/after expectations, what specifically to clean up
|
|
257
|
+
- Paste actual code snippets in §3
|
|
258
|
+
- Keep scope to 1-3 files
|
|
259
|
+
- Include failing test output for bug fixes
|
|
260
|
+
- Add frontend or refactor-specific constraints when needed
|
|
267
261
|
`},{file:`parallel-dispatch-example.md`,content:`# Parallel Dispatch Worked Example
|
|
268
262
|
|
|
269
|
-
|
|
263
|
+
Shows parallel feature decomposition and review flow.
|
|
270
264
|
|
|
271
265
|
---
|
|
272
266
|
|
|
@@ -278,30 +272,18 @@ This example shows how the Orchestrator decomposes a feature into parallel tasks
|
|
|
278
272
|
|
|
279
273
|
## Step 1: Scope Map & Decomposition
|
|
280
274
|
|
|
281
|
-
Orchestrator runs \`scope_map({ task: "notification preferences" })
|
|
282
|
-
|
|
283
|
-
| Area | Files | Agent |
|
|
284
|
-
|------|-------|-------|
|
|
285
|
-
| Backend API | \`services/notification-prefs.service.ts\`, \`routes/notification-prefs.route.ts\` | Implementer |
|
|
286
|
-
| Database | \`migrations/add-notification-prefs.ts\`, \`models/notification-prefs.model.ts\` | Implementer |
|
|
287
|
-
| Frontend Page | \`pages/settings/notifications.tsx\`, \`components/NotificationToggle.tsx\` | Frontend |
|
|
288
|
-
| Tests | \`__tests__/notification-prefs.test.ts\` | Implementer |
|
|
275
|
+
Orchestrator runs \`scope_map({ task: "notification preferences" })\`:
|
|
276
|
+
Backend API + DB → Implementer. Frontend page → Frontend. Tests → Implementer.
|
|
289
277
|
|
|
290
278
|
## Step 2: Independence Check (5-Question Checklist)
|
|
291
279
|
|
|
292
|
-
|
|
293
|
-
|---|----------|-----------------|---------------|
|
|
294
|
-
| 1 | Same files? | \`services/\`, \`routes/\`, \`migrations/\`, \`models/\` | \`pages/\`, \`components/\` |
|
|
295
|
-
| 2 | Shared state? | No — backend defines API contract | No — consumes API contract |
|
|
296
|
-
| 3 | Execution order? | No — can define API while UI is built | No — can mock API response |
|
|
297
|
-
| 4 | Shared new types? | Exports \`NotificationPrefs\` type | Imports same type |
|
|
298
|
-
| 5 | Parallel-safe? | ✅ Yes — different directories | ✅ Yes — different directories |
|
|
280
|
+
Different files, no shared mutable state, no execution-order dependency. Shared type contract first.
|
|
299
281
|
|
|
300
|
-
**Decision: PARALLEL**
|
|
282
|
+
**Decision: PARALLEL**
|
|
301
283
|
|
|
302
284
|
## Step 3: Shared Context Prep
|
|
303
285
|
|
|
304
|
-
Before dispatching, Orchestrator creates
|
|
286
|
+
Before dispatching, Orchestrator creates shared contract:
|
|
305
287
|
|
|
306
288
|
\`\`\`typescript
|
|
307
289
|
// Type contract — paste into BOTH agent prompts
|
|
@@ -398,31 +380,22 @@ STATUS PROTOCOL: DONE / DONE_WITH_CONCERNS / NEEDS_CONTEXT / BLOCKED
|
|
|
398
380
|
|
|
399
381
|
## Step 5: Review Pipeline
|
|
400
382
|
|
|
401
|
-
Both agents return DONE. Orchestrator
|
|
402
|
-
|
|
403
|
-
1. **Code Review** (Alpha + Beta in parallel):
|
|
404
|
-
- Alpha: PASS_WITH_NOTES — acceptance criteria met; add keyboard accessibility on toggles
|
|
405
|
-
- Beta: APPROVE_WITH_SUGGESTIONS — extract validation schema to shared file
|
|
406
|
-
|
|
407
|
-
2. **Architecture Review** (not triggered — no boundary changes)
|
|
383
|
+
Both agents return DONE. Orchestrator reviews:
|
|
408
384
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
385
|
+
1. **Code Review** (Alpha + Beta): PASS_WITH_NOTES + APPROVE_WITH_SUGGESTIONS
|
|
386
|
+
2. **Architecture Review**: not triggered
|
|
387
|
+
3. **Security Review**: not triggered
|
|
388
|
+
4. **FORGE Gate**: \`evidence_map({ action: "gate" })\` → YIELD
|
|
412
389
|
|
|
413
390
|
## Step 6: Present Results
|
|
414
391
|
|
|
415
|
-
|
|
392
|
+
Present review findings and gate result before commit or merge.
|
|
416
393
|
|
|
417
394
|
---
|
|
418
395
|
|
|
419
396
|
## Key Takeaways
|
|
420
397
|
|
|
421
|
-
|
|
422
|
-
2. **Independence check takes 30 seconds** — prevents hours of merge conflicts
|
|
423
|
-
3. **Each agent gets ONLY its files** — focused context = better output
|
|
424
|
-
4. **Review happens before the gate** — code review first, then architecture/security (conditional), then FORGE
|
|
425
|
-
5. **FORGE gates at the end** — not between every step
|
|
398
|
+
Define contract first. Batch only independent work. Review before gate.
|
|
426
399
|
`},{file:`SKILL.md`,content:`---
|
|
427
400
|
name: multi-agents-development
|
|
428
401
|
description: "Comprehensive patterns for orchestrating multiple AI agents in parallel development workflows. Covers task decomposition, parallel dispatch, context crafting, status handling, review pipelines, and recovery."
|
|
@@ -438,11 +411,9 @@ metadata:
|
|
|
438
411
|
|
|
439
412
|
# Multi-Agent Development
|
|
440
413
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
**Core Principle**: Dispatch multiple agents for focused tasks. Each subagent gets fresh, focused context with explicit scope — never inherited session state.
|
|
414
|
+
Patterns for parallel multi-agent work: decomposition, dispatch, context, status, review, recovery.
|
|
444
415
|
|
|
445
|
-
|
|
416
|
+
**Core Principle**: Dispatch focused agents with fresh context and explicit scope.
|
|
446
417
|
|
|
447
418
|
---
|
|
448
419
|
|
|
@@ -452,25 +423,18 @@ Load this skill when orchestrating multi-agent work: planning parallel batches,
|
|
|
452
423
|
|
|
453
424
|
| Role | Agents | When to Use | Parallelizable |
|
|
454
425
|
|------|--------|-------------|----------------|
|
|
455
|
-
| **Orchestration** | Orchestrator, Planner |
|
|
456
|
-
| **Implementation** | Implementer, Frontend, Refactor | Code
|
|
457
|
-
| **
|
|
458
|
-
| **Review** | Code-Reviewer-Alpha/Beta, Architect-Reviewer-Alpha/Beta | Quality verification | Yes (always) |
|
|
459
|
-
| **Diagnostics** | Debugger, Security | Issue tracing, vulnerability analysis | Yes (read-only) |
|
|
460
|
-
| **Documentation** | Documenter | README, API docs, changelog | Yes (disjoint files) |
|
|
426
|
+
| **Orchestration** | Orchestrator, Planner | Plan/control | No |
|
|
427
|
+
| **Implementation** | Implementer, Frontend, Refactor | Code changes | Yes |
|
|
428
|
+
| **Review** | Code-Reviewer-Alpha/Beta, Architect-Reviewer-Alpha/Beta | Verify | Yes |
|
|
461
429
|
|
|
462
430
|
### Model Selection by Task Complexity
|
|
463
431
|
|
|
464
|
-
Choose the **least powerful model that can handle the role**:
|
|
465
|
-
|
|
466
432
|
| Complexity Signal | Model Tier | Example Agents |
|
|
467
433
|
|-------------------|-----------|----------------|
|
|
468
|
-
| Mechanical (rename, move, add field) | Fast model | Explorer
|
|
469
|
-
| Standard (implement spec, write tests) | Mid-tier | Implementer
|
|
470
|
-
| Judgment-heavy (architecture, security, debug) | Strongest | Debugger (Opus 4.6), Security (Opus 4.6) |
|
|
471
|
-
| Multi-model cross-validation | Mixed | Researcher-Alpha/Beta/Gamma/Delta (all different) |
|
|
434
|
+
| Mechanical (rename, move, add field) | Fast model | Explorer |
|
|
435
|
+
| Standard (implement spec, write tests) | Mid-tier | Implementer/Refactor |
|
|
472
436
|
|
|
473
|
-
**Upgrade signal**:
|
|
437
|
+
**Upgrade signal**: \`BLOCKED\` or \`DONE_WITH_CONCERNS\` on Standard task → re-dispatch to stronger model.
|
|
474
438
|
|
|
475
439
|
---
|
|
476
440
|
|
|
@@ -481,36 +445,31 @@ Choose the **least powerful model that can handle the role**:
|
|
|
481
445
|
|
|
482
446
|
### Decomposition Checklist
|
|
483
447
|
|
|
484
|
-
For each task, specify
|
|
485
|
-
- [ ] **Target files** — exact paths
|
|
486
|
-
- [ ] **Acceptance criteria** —
|
|
487
|
-
- [ ] **Agent assignment** —
|
|
488
|
-
- [ ] **Dependencies** —
|
|
448
|
+
For each task, specify:
|
|
449
|
+
- [ ] **Target files** — exact paths
|
|
450
|
+
- [ ] **Acceptance criteria** — testable done state
|
|
451
|
+
- [ ] **Agent assignment** — who owns task
|
|
452
|
+
- [ ] **Dependencies** — prerequisite tasks
|
|
489
453
|
|
|
490
454
|
### Sizing Guide
|
|
491
455
|
|
|
492
456
|
| Task Size | Files | Example | Agent |
|
|
493
457
|
|-----------|-------|---------|-------|
|
|
494
|
-
| **
|
|
495
|
-
| **Small** | 1-2 files | New endpoint + test | Implementer |
|
|
496
|
-
| **Standard** | 2-3 files | Feature with service + controller + test | Implementer |
|
|
497
|
-
| **Too big** | 4+ files | **SPLIT IT** — decompose further | — |
|
|
458
|
+
| **Standard** | 2-3 files | Service + controller + test | Implementer |
|
|
498
459
|
|
|
499
460
|
### Splitting Strategies
|
|
500
|
-
- **By layer**: Service
|
|
501
|
-
- **By feature boundary**: Auth endpoints (Implementer A) + Profile endpoints (Implementer B)
|
|
502
|
-
- **By concern**: Data model changes (Implementer) + API route changes (Implementer) + UI updates (Frontend)
|
|
461
|
+
- **By layer**: Service + UI + tests
|
|
503
462
|
|
|
504
463
|
---
|
|
505
464
|
|
|
506
465
|
## §3 Independence Decision Tree
|
|
507
466
|
|
|
508
|
-
Before marking tasks
|
|
467
|
+
Before marking tasks parallel, walk this tree:
|
|
509
468
|
|
|
510
469
|
\`\`\`
|
|
511
470
|
Task A and Task B — can they run in parallel?
|
|
512
471
|
│
|
|
513
|
-
├─ Do they share ANY files? (create, modify, or delete
|
|
472
|
+
├─ Do they share ANY files? (create, modify, or delete same file)
|
|
514
473
|
│ ├─ YES → SEQUENTIAL (or merge into one task)
|
|
515
474
|
│ └─ NO ↓
|
|
516
475
|
│
|
|
@@ -518,7 +477,7 @@ Task A and Task B — can they run in parallel?
|
|
|
518
477
|
│ ├─ YES → SEQUENTIAL
|
|
519
478
|
│ └─ NO ↓
|
|
520
479
|
│
|
|
521
|
-
├─ Does B need A's output? (B reads
|
|
480
|
+
├─ Does B need A's output? (B reads file A creates, B uses A's new export)
|
|
522
481
|
│ ├─ YES → SEQUENTIAL (A before B)
|
|
523
482
|
│ └─ NO ↓
|
|
524
483
|
│
|
|
@@ -537,19 +496,14 @@ Task A and Task B — can they run in parallel?
|
|
|
537
496
|
|
|
538
497
|
| Situation | Verdict | Why |
|
|
539
498
|
|-----------|---------|-----|
|
|
540
|
-
|
|
|
541
|
-
|
|
|
542
|
-
| A creates a type, B uses that type | ❌ Sequential | B depends on A's output |
|
|
543
|
-
| Both modify different test files | ✅ Parallel | Disjoint file sets |
|
|
544
|
-
| Both touch package.json | ❌ Sequential | Shared file |
|
|
545
|
-
| A adds a route, B adds middleware | ⚠️ Check | If B's middleware affects A's route → sequential |
|
|
499
|
+
| Same shared import only | ✅ Parallel | Read-only |
|
|
500
|
+
| Same index/package file | ❌ Sequential | Shared edit |
|
|
546
501
|
|
|
547
502
|
### Integration Verification (after parallel batch completes)
|
|
548
503
|
|
|
549
|
-
1. **Conflict check**:
|
|
550
|
-
2. **Import check**:
|
|
551
|
-
3. **Full suite**: \`check({})\` + \`test_run({})\`
|
|
552
|
-
4. **Spot check**: Manually verify at least one task's output matches acceptance criteria
|
|
504
|
+
1. **Conflict check**: unexpected overlap?
|
|
505
|
+
2. **Import check**: cross-references resolve?
|
|
506
|
+
3. **Full suite**: \`check({})\` + \`test_run({})\`
|
|
553
507
|
|
|
554
508
|
---
|
|
555
509
|
|
|
@@ -558,9 +512,9 @@ Task A and Task B — can they run in parallel?
|
|
|
558
512
|
### Dispatch Rules
|
|
559
513
|
|
|
560
514
|
1. **Max 4 concurrent file-modifying agents** per batch
|
|
561
|
-
2. **Read-only agents have no limit** — Explorer, Researcher*, Reviewer*, Security
|
|
562
|
-
3. **Build dependency graph first** — phases
|
|
563
|
-
4. **Never dispatch two implementers to
|
|
515
|
+
2. **Read-only agents have no limit** — Explorer, Researcher*, Reviewer*, Security
|
|
516
|
+
3. **Build dependency graph first** — dependency-free phases batch together
|
|
517
|
+
4. **Never dispatch two implementers to same file**
|
|
564
518
|
|
|
565
519
|
### Batch Strategy
|
|
566
520
|
|
|
@@ -580,21 +534,18 @@ Execution:
|
|
|
580
534
|
|
|
581
535
|
| ❌ Don't | ✅ Do Instead |
|
|
582
536
|
|----------|--------------|
|
|
583
|
-
| Dispatch 6 implementers at once | Max 4, queue
|
|
584
|
-
| Give one agent 10 files | Split
|
|
585
|
-
|
|
|
586
|
-
| Retry same prompt on failure | Diagnose first, then re-prompt with fix |
|
|
587
|
-
| Skip review after parallel batch | ALWAYS review + integration verify |
|
|
588
|
-
| Inherit session context to subagent | Build fresh, focused context per dispatch |
|
|
537
|
+
| Dispatch 6 implementers at once | Max 4, queue rest |
|
|
538
|
+
| Give one agent 10 files | Split tasks |
|
|
539
|
+
| Skip review after batch | ALWAYS review + integrate |
|
|
589
540
|
|
|
590
541
|
---
|
|
591
542
|
|
|
592
543
|
## §5 Context Crafting Guide
|
|
593
544
|
|
|
594
545
|
### The Controller Principle
|
|
595
|
-
> **The Orchestrator provides ALL context. Subagents never
|
|
546
|
+
> **The Orchestrator provides ALL context. Subagents never search for it.**
|
|
596
547
|
|
|
597
|
-
|
|
548
|
+
Fresh prompt only. No inherited session state.
|
|
598
549
|
|
|
599
550
|
### The 6-Point Prompt Template
|
|
600
551
|
|
|
@@ -635,21 +586,13 @@ End with status: DONE | DONE_WITH_CONCERNS | NEEDS_CONTEXT | BLOCKED
|
|
|
635
586
|
|
|
636
587
|
| ✅ Include | ❌ Omit |
|
|
637
588
|
|-----------|---------|
|
|
638
|
-
| Exact file paths and
|
|
639
|
-
| Acceptance criteria | Other agents' tasks |
|
|
640
|
-
| Relevant conventions (from KB) | Unrelated architecture context |
|
|
641
|
-
| Compact/digest of relevant files | Raw file contents of large files |
|
|
642
|
-
| Error messages (if fixing a bug) | Previous failed attempts (unless relevant) |
|
|
643
|
-
| FORGE tier and ceremony | Full FORGE protocol explanation |
|
|
589
|
+
| Exact file paths and snippets | Full session history |
|
|
644
590
|
|
|
645
591
|
### Context Size Budget
|
|
646
592
|
|
|
647
593
|
| Task Complexity | Context Target | Approach |
|
|
648
594
|
|-----------------|---------------|----------|
|
|
649
|
-
|
|
|
650
|
-
| Small (1-2 files) | ~1000 tokens | \`compact\` of target files + goal |
|
|
651
|
-
| Standard (2-3 files) | ~2000 tokens | \`digest\` of related files + architectural context |
|
|
652
|
-
| Complex (judgment-heavy) | ~3000 tokens | \`digest\` + relevant decisions from AI Kit |
|
|
595
|
+
| Standard (2-3 files) | ~2000 tokens | \`digest\` + architecture |
|
|
653
596
|
|
|
654
597
|
---
|
|
655
598
|
|
|
@@ -679,10 +622,9 @@ Orchestrator Subagent (fresh instance)
|
|
|
679
622
|
|
|
680
623
|
### Key Rules
|
|
681
624
|
|
|
682
|
-
1. **One subagent = one task
|
|
683
|
-
2. **Controller provides context
|
|
684
|
-
3. **
|
|
685
|
-
4. **Status is mandatory**. Every subagent response MUST end with exactly ONE status code.
|
|
625
|
+
1. **One subagent = one task**
|
|
626
|
+
2. **Controller provides context**
|
|
627
|
+
3. **Status is mandatory**
|
|
686
628
|
|
|
687
629
|
---
|
|
688
630
|
|
|
@@ -690,14 +632,14 @@ Orchestrator Subagent (fresh instance)
|
|
|
690
632
|
|
|
691
633
|
### Status Codes
|
|
692
634
|
|
|
693
|
-
Every implementer (Implementer, Frontend, Refactor) MUST end
|
|
635
|
+
Every implementer (Implementer, Frontend, Refactor) MUST end response with exactly ONE:
|
|
694
636
|
|
|
695
637
|
| Status | Meaning | Orchestrator Action |
|
|
696
638
|
|--------|---------|-------------------|
|
|
697
|
-
| **DONE** |
|
|
698
|
-
| **DONE_WITH_CONCERNS** | Complete
|
|
699
|
-
| **NEEDS_CONTEXT** |
|
|
700
|
-
| **BLOCKED** |
|
|
639
|
+
| **DONE** | Complete, self-review passed | → Review → arch/security if needed → \`evidence_map\` gate |
|
|
640
|
+
| **DONE_WITH_CONCERNS** | Complete, concerns raised | → Review + \`Assumed\` claims |
|
|
641
|
+
| **NEEDS_CONTEXT** | Missing info | → Add context → re-dispatch |
|
|
642
|
+
| **BLOCKED** | Cannot proceed | → Diagnose |
|
|
701
643
|
|
|
702
644
|
### BLOCKED Diagnosis Tree
|
|
703
645
|
|
|
@@ -722,10 +664,8 @@ Agent returned BLOCKED
|
|
|
722
664
|
|
|
723
665
|
### FORGE Composition
|
|
724
666
|
|
|
725
|
-
Status
|
|
726
|
-
|
|
727
|
-
- **Status** = subjective agent telemetry ("I think I'm done")
|
|
728
|
-
- **FORGE** = objective quality evidence ("the evidence says it's done")
|
|
667
|
+
- **Status** = agent telemetry
|
|
668
|
+
- **FORGE** = evidence-based quality gate
|
|
729
669
|
|
|
730
670
|
\`\`\`
|
|
731
671
|
DONE → proceed to code review → conditional architecture/security review → FORGE evidence_map → present results
|
|
@@ -736,7 +676,7 @@ BLOCKED → diagnose:
|
|
|
736
676
|
resource/scope issue → re-plan, no FORGE
|
|
737
677
|
\`\`\`
|
|
738
678
|
|
|
739
|
-
**Critical rule**: Every \`DONE\`
|
|
679
|
+
**Critical rule**: Every \`DONE\` must complete code review and any conditional architecture/security review BEFORE \`evidence_map({ action: "gate" })\`.
|
|
740
680
|
|
|
741
681
|
---
|
|
742
682
|
|
|
@@ -766,26 +706,17 @@ Stage 5: FORGE Gate — evidence_map({ action: "gate" })
|
|
|
766
706
|
└─ HARD_BLOCK → escalate to user
|
|
767
707
|
\`\`\`
|
|
768
708
|
|
|
769
|
-
Use \`check({})\` + \`test_run({})\`
|
|
709
|
+
Use \`check({})\` + \`test_run({})\` for reviewer evidence; not gate.
|
|
770
710
|
|
|
771
711
|
### Spec Alignment Dimension (for Code Reviewers)
|
|
772
712
|
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
1. Does the implementation match the acceptance criteria from the task?
|
|
776
|
-
2. Are there over-builds (features not requested)?
|
|
777
|
-
3. Are there under-builds (requirements missed)?
|
|
778
|
-
4. Does the output match the expected file changes?
|
|
779
|
-
|
|
780
|
-
This catches spec drift that automated tests might miss.
|
|
713
|
+
Check acceptance criteria, over-build, under-build, and expected file set.
|
|
781
714
|
|
|
782
715
|
### When to Skip Stages
|
|
783
716
|
|
|
784
717
|
| Stage | Skip When |
|
|
785
718
|
|-------|-----------|
|
|
786
|
-
| Architecture Review | No new modules
|
|
787
|
-
| Security Review | No auth, no crypto, no external input handling |
|
|
788
|
-
| FORGE Gate | Floor-tier tasks only (simple, mechanical changes) |
|
|
719
|
+
| Architecture Review | No new modules/boundary changes/patterns |
|
|
789
720
|
|
|
790
721
|
---
|
|
791
722
|
|
|
@@ -793,16 +724,14 @@ This catches spec drift that automated tests might miss.
|
|
|
793
724
|
|
|
794
725
|
### Retry Policy
|
|
795
726
|
|
|
796
|
-
|
|
797
|
-
- Each retry MUST include the specific failure reason in the new prompt
|
|
798
|
-
- Never retry with the same prompt — always add diagnostic context
|
|
727
|
+
**Max 2 retries** per task. Include failure reason. Never reuse same prompt.
|
|
799
728
|
|
|
800
729
|
### Loop Detection
|
|
801
730
|
|
|
802
731
|
If an agent returns the same error/status 2+ times:
|
|
803
|
-
1. **STOP**
|
|
804
|
-
2.
|
|
805
|
-
3.
|
|
732
|
+
1. **STOP**
|
|
733
|
+
2. Recheck approach
|
|
734
|
+
3. Change agent, model, decomposition, or escalate
|
|
806
735
|
|
|
807
736
|
### Emergency Procedures
|
|
808
737
|
|
|
@@ -823,9 +752,9 @@ DOCUMENT → remember what went wrong, update plan
|
|
|
823
752
|
|
|
824
753
|
| Signal | Action |
|
|
825
754
|
|--------|--------|
|
|
826
|
-
| Agent modified **2x more files** than planned | Pause, review
|
|
827
|
-
| Agent returns \`ESCALATE\` or \`BLOCKED\` repeatedly |
|
|
828
|
-
| Agent's output contradicts
|
|
755
|
+
| Agent modified **2x more files** than planned | Pause, review |
|
|
756
|
+
| Agent returns \`ESCALATE\` or \`BLOCKED\` repeatedly | Diagnose before re-delegating |
|
|
757
|
+
| Agent's output contradicts plan | Stop, compare, re-align |
|
|
829
758
|
| Tests that were passing now fail | Immediate rollback of that agent's changes |
|
|
830
759
|
|
|
831
760
|
---
|
|
@@ -836,41 +765,24 @@ DOCUMENT → remember what went wrong, update plan
|
|
|
836
765
|
|
|
837
766
|
| ❌ Mistake | Why It Fails | ✅ Fix |
|
|
838
767
|
|-----------|-------------|--------|
|
|
839
|
-
| **Too broad scope**
|
|
840
|
-
| **
|
|
841
|
-
| **Vague output** — "make it work" | No way to verify completion | Specific acceptance criteria: "endpoint returns 200 with {schema}" |
|
|
842
|
-
| **Session context inheritance** — "continue from where we left off" | Subagent has stale/polluted context | Fresh prompt with 6-point template every time |
|
|
843
|
-
| **Skipping reviews** — "it's a small change" | Small changes cause big regressions | ALWAYS run automated gate minimum |
|
|
844
|
-
| **Parallel on shared files** — "both agents edit config.ts" | Merge conflicts, lost changes | Sequential, or merge into one task |
|
|
845
|
-
| **Trusting the report** — "agent said DONE so it's done" | Agents are optimistic, miss edge cases | Automated gate + dual code review catches this |
|
|
846
|
-
| **Brute-force retries** — same prompt beyond **Max 2 retries** per task | Repeating without diagnosis will not change the outcome | Diagnose, change approach, then retry within the limit |
|
|
847
|
-
| **Orchestrator implements** — "just this one small fix" | Breaks the delegation contract, no review | ALWAYS delegate, no matter how small |
|
|
768
|
+
| **Too broad scope** | Sprawling changes | Split tasks |
|
|
769
|
+
| **Parallel on shared files** | Merge conflicts | Sequential or merge task |
|
|
848
770
|
|
|
849
771
|
### Red Flags in Agent Output
|
|
850
772
|
|
|
851
773
|
| Flag | What It Means | Action |
|
|
852
774
|
|------|--------------|--------|
|
|
853
|
-
|
|
|
854
|
-
| Agent added dependencies not in plan | Unauthorized architectural decision | Review necessity, likely rollback |
|
|
855
|
-
| Agent skipped self-review checklist | Rushing, likely incomplete | Bounce back with checklist requirement |
|
|
856
|
-
| Agent's DONE but tests fail | Didn't actually self-test | Bounce back with failing test output |
|
|
857
|
-
| Agent asks questions in output instead of using NEEDS_CONTEXT | Misunderstands status protocol | Treat as NEEDS_CONTEXT, educate in next prompt |
|
|
775
|
+
| Files outside scope | Scope creep | Roll back, re-delegate tighter |
|
|
858
776
|
|
|
859
777
|
---
|
|
860
778
|
|
|
861
779
|
## §11 Flow Context Sharing
|
|
862
780
|
|
|
863
|
-
###
|
|
864
|
-
Subagents start fresh — they don't know what the Orchestrator already analyzed. Without context sharing, each subagent redundantly re-reads and re-analyzes the same files, wasting tokens and time.
|
|
781
|
+
### Flow Context Broker
|
|
865
782
|
|
|
866
|
-
|
|
867
|
-
The \`knowledge\` tool has flow-scoped context actions that enable automatic context sharing between the Orchestrator and subagents during a flow.
|
|
783
|
+
The \`knowledge\` tool supports flow-scoped context sharing.
|
|
868
784
|
|
|
869
|
-
**How it works:**
|
|
870
|
-
1. **Auto-deposit** — The auto-knowledge interceptor captures results from \`search\`, \`file_summary\`, \`stratum_card\`, \`compact\`, \`blast_radius\`, and \`scope_map\` as flow-scoped context entries
|
|
871
|
-
2. **Role-filtered retrieval** — Before dispatching a subagent, the Orchestrator calls \`withdraw\` with a role profile to get relevant context
|
|
872
|
-
3. **Manual deposit** — Subagents deposit their own discoveries for later agents
|
|
873
|
-
4. **Cleanup** — On flow completion or reset, \`flush\` removes all flow context
|
|
785
|
+
**How it works:** auto-deposit captures tool output, Orchestrator calls \`withdraw\`, subagents can deposit findings, \`flush\` clears flow context.
|
|
874
786
|
|
|
875
787
|
### Orchestrator Workflow
|
|
876
788
|
|
|
@@ -882,7 +794,7 @@ knowledge({ action: 'withdraw', profile: '<role>', budget: 6000 })
|
|
|
882
794
|
// Profiles: implementer, documenter, reviewer, researcher, debugger
|
|
883
795
|
\`\`\`
|
|
884
796
|
|
|
885
|
-
|
|
797
|
+
Paste withdrawn context into "## 3. Architectural Context" from §5.
|
|
886
798
|
|
|
887
799
|
#### After All Work Completes
|
|
888
800
|
|
|
@@ -893,8 +805,6 @@ knowledge({ action: 'flush' })
|
|
|
893
805
|
|
|
894
806
|
### Subagent Deposit Pattern
|
|
895
807
|
|
|
896
|
-
Subagents can deposit discoveries for later agents:
|
|
897
|
-
|
|
898
808
|
\`\`\`
|
|
899
809
|
// Subagent deposits a finding for future agents
|
|
900
810
|
knowledge({ action: 'remember', scope: 'flow', title: 'API validation pattern', content: '...' })
|
|
@@ -902,26 +812,11 @@ knowledge({ action: 'remember', scope: 'flow', title: 'API validation pattern',
|
|
|
902
812
|
|
|
903
813
|
### Profile Filtering
|
|
904
814
|
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
| Profile | Priorities (highest first) | Use For |
|
|
908
|
-
|---------|---------------------------|---------|
|
|
909
|
-
| \`implementer\` | decisions, patterns, file-cards | Implementer, Frontend, Refactor |
|
|
910
|
-
| \`documenter\` | decisions, step-summaries, analysis | Documenter |
|
|
911
|
-
| \`reviewer\` | decisions, patterns, analysis | Code-Reviewer, Architect-Reviewer |
|
|
912
|
-
| \`researcher\` | search-results, analysis, decisions | Researcher-Alpha/Beta/Gamma/Delta |
|
|
913
|
-
| \`debugger\` | file-cards, analysis, search-results | Debugger |
|
|
815
|
+
Use \`implementer\` profile for Implementer/Frontend/Refactor tasks.
|
|
914
816
|
|
|
915
817
|
### Budget Management
|
|
916
818
|
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
| Task Type | Recommended Budget |
|
|
920
|
-
|-----------|--------------------|
|
|
921
|
-
| Micro (1 file fix) | 2000 |
|
|
922
|
-
| Standard implementation | 6000 |
|
|
923
|
-
| Complex multi-file | 10000 |
|
|
924
|
-
| Research/investigation | 8000 |
|
|
819
|
+
\`budget\` caps returned context. Standard implementation: 6000.
|
|
925
820
|
|
|
926
821
|
### Integration with 6-Point Template
|
|
927
822
|
|
|
@@ -935,28 +830,21 @@ Update the prompt template from §5 to include flow context:
|
|
|
935
830
|
|
|
936
831
|
### Key Rules
|
|
937
832
|
|
|
938
|
-
1. **Always withdraw before dispatch**
|
|
939
|
-
2. **Flush on completion**
|
|
940
|
-
3. **Profile matters**
|
|
941
|
-
4. **Budget caps prevent bloat** — large context confuses subagents, keep it focused
|
|
942
|
-
5. **Auto-deposit is passive** — it captures tool output automatically, no extra calls needed
|
|
833
|
+
1. **Always withdraw before dispatch**
|
|
834
|
+
2. **Flush on completion**
|
|
835
|
+
3. **Profile matters**
|
|
943
836
|
|
|
944
837
|
## Prompt Template Reference
|
|
945
838
|
|
|
946
|
-
Detailed prompt templates are provided as sidecar files:
|
|
947
|
-
|
|
948
839
|
| Template | File | Use When |
|
|
949
840
|
|----------|------|----------|
|
|
950
|
-
| Implementer dispatch | [\`implementer-prompt.md\`](implementer-prompt.md) |
|
|
951
|
-
|
|
|
952
|
-
| Code review (quality focus) | [\`code-quality-review-prompt.md\`](code-quality-review-prompt.md) | Bias one or both code reviewers toward maintainability, quality, and security within the same review stage |
|
|
953
|
-
| Architecture review | [\`architecture-review-prompt.md\`](architecture-review-prompt.md) | Boundary changes, pattern adherence review |
|
|
954
|
-
| Parallel dispatch example | [\`parallel-dispatch-example.md\`](parallel-dispatch-example.md) | Worked example of decomposing a feature into parallel tasks |
|
|
841
|
+
| Implementer dispatch | [\`implementer-prompt.md\`](implementer-prompt.md) | Implementer/Frontend/Refactor |
|
|
842
|
+
| Parallel dispatch example | [\`parallel-dispatch-example.md\`](parallel-dispatch-example.md) | Worked example |
|
|
955
843
|
`},{file:`spec-review-prompt.md`,content:`# Spec Alignment Review Prompt Template
|
|
956
844
|
|
|
957
|
-
Use
|
|
845
|
+
Use when dispatching a code reviewer who should emphasize spec alignment during code review.
|
|
958
846
|
|
|
959
|
-
**Mindset: "Don't trust the report."**
|
|
847
|
+
**Mindset: "Don't trust the report."** Verify independently.
|
|
960
848
|
|
|
961
849
|
---
|
|
962
850
|
|
|
@@ -1029,8 +917,8 @@ For EACH acceptance criterion in the task spec:
|
|
|
1029
917
|
|
|
1030
918
|
## Usage Notes
|
|
1031
919
|
|
|
1032
|
-
- Run
|
|
1033
|
-
- Paste
|
|
1034
|
-
-
|
|
1035
|
-
- PASS_WITH_NOTES can proceed
|
|
920
|
+
- Run during code review, before conditional architecture/security review and before FORGE gate
|
|
921
|
+
- Paste original task spec, not summary
|
|
922
|
+
- FAIL → bounce back with specific gaps
|
|
923
|
+
- PASS_WITH_NOTES can proceed, but track notes
|
|
1036
924
|
`}];export{e as default};
|