@vpxa/aikit 0.1.98 → 0.1.100
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/README.md +29 -33
- package/package.json +1 -2
- package/packages/aikit-client/dist/index.d.ts +27 -27
- package/packages/aikit-client/dist/index.js +2 -2
- package/packages/analyzers/dist/index.js +2 -2
- package/packages/cli/dist/index.js +2 -2
- package/packages/cli/dist/init-DlY4IHCF.js +7 -0
- package/packages/cli/dist/{templates-DrkDLz-X.js → templates-Dz2d2veK.js} +35 -73
- package/packages/cli/dist/{user-Bb40VUaT.js → user-DfEC00FY.js} +1 -1
- package/packages/core/dist/index.d.ts +8 -8
- package/packages/core/dist/index.js +1 -1
- package/packages/dashboard/dist/assets/{index-C6D-PCp0.js → index-CxrC6OtB.js} +3 -3
- package/packages/dashboard/dist/index.html +1 -1
- package/packages/enterprise-bridge/dist/index.d.ts +1 -1
- package/packages/enterprise-bridge/dist/index.js +1 -1
- package/packages/indexer/dist/index.d.ts +6 -6
- package/packages/server/dist/index.d.ts +1 -1
- package/packages/server/dist/index.js +1 -1
- package/packages/server/dist/server-DfCR_Bix.js +1282 -0
- package/packages/server/dist/{version-check-AMfxaZUw.js → version-check-Bj07vc5x.js} +1 -1
- package/packages/store/dist/index.d.ts +9 -22
- package/packages/store/dist/index.js +6 -6
- package/packages/tools/dist/index.d.ts +16 -15
- package/packages/tools/dist/index.js +6 -6
- package/scaffold/dist/adapters/intellij.mjs +3 -0
- package/scaffold/dist/adapters/zed.mjs +4 -0
- package/scaffold/dist/definitions/agents.mjs +1 -1
- package/scaffold/dist/definitions/bodies.mjs +158 -15
- package/scaffold/dist/definitions/flows.mjs +32 -32
- package/scaffold/dist/definitions/hooks.mjs +1 -1
- package/scaffold/dist/definitions/prompts.mjs +7 -7
- package/scaffold/dist/definitions/protocols.mjs +423 -134
- package/scaffold/dist/definitions/skills.mjs +107 -67
- package/scaffold/dist/definitions/tools.mjs +1 -1
- package/packages/cli/dist/init-DtjuyGpD.js +0 -7
- package/packages/server/dist/server-DZ1V42_x.js +0 -1282
|
@@ -91,22 +91,32 @@ Always follow this order when you need to understand something. **Never skip to
|
|
|
91
91
|
| C4 architecture diagram | \`diagram.md\` |
|
|
92
92
|
| Module graph with key symbols | \`code-map.md\` |
|
|
93
93
|
|
|
94
|
-
### Step 2:
|
|
94
|
+
### Step 2: Knowledge Recall (MANDATORY before implementation)
|
|
95
95
|
|
|
96
|
-
|
|
97
|
-
|
|
96
|
+
**STOP. Before writing any code, check what has already been decided.**
|
|
97
|
+
|
|
98
|
+
Past decisions, conventions, and patterns are stored in curated knowledge. Auto-knowledge also captures facts automatically from tool outputs (conventions, errors, test results, research). You MUST search before implementing:
|
|
98
99
|
|
|
99
100
|
\`\`\`
|
|
100
|
-
search("
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
scope_map("what you need")
|
|
104
|
-
list() // see all stored knowledge entries
|
|
101
|
+
search("keywords about the feature/area you're changing") // check for past decisions
|
|
102
|
+
knowledge({ action: "list", category: "decisions" }) // scan recent decisions that might apply
|
|
103
|
+
knowledge({ action: "list", category: "conventions" }) // see project conventions (includes auto-captured)
|
|
104
|
+
scope_map("what you need") // generates a reading plan
|
|
105
105
|
\`\`\`
|
|
106
106
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
**Rules:**
|
|
108
|
+
- If results exist → **READ them and FOLLOW** established patterns. Do not silently override.
|
|
109
|
+
- If results conflict with the current task → **surface the conflict** to the user/orchestrator.
|
|
110
|
+
- If no results → proceed, but **persist your decisions with \`knowledge({ action: "remember", ... })\`** afterward for future recall.
|
|
111
|
+
- Never assume "there's nothing stored" — always search first.
|
|
112
|
+
|
|
113
|
+
### Step 3: Real-time Exploration (only
|
|
114
|
+
if steps 1-2
|
|
115
|
+
don;
|
|
116
|
+
't cover it)
|
|
117
|
+
|
|
118
|
+
| Tool | Use
|
|
119
|
+
for |
|
|
110
120
|
|---|---|
|
|
111
121
|
| \`graph({ action: 'neighbors', node_id })\` | Traverse module import graph — cross-package dependencies, who-imports-whom |
|
|
112
122
|
| \`find({ pattern })\` | Locate files by name/glob |
|
|
@@ -189,7 +199,7 @@ Before making changes, establish expected scope. Flag deviations early.
|
|
|
189
199
|
|
|
190
200
|
## MANDATORY: Memory Persistence Before Completing
|
|
191
201
|
|
|
192
|
-
**Before finishing ANY task**, you MUST call \`remember
|
|
202
|
+
**Before finishing ANY task**, you MUST call \`knowledge({ action: "remember", ... })\` if ANY of these apply:
|
|
193
203
|
|
|
194
204
|
- ✅ You discovered how something works that wasn't in onboard artifacts
|
|
195
205
|
- ✅ You made an architecture or design decision
|
|
@@ -197,9 +207,10 @@ Before making changes, establish expected scope. Flag deviations early.
|
|
|
197
207
|
- ✅ You identified a pattern, convention, or project-specific gotcha
|
|
198
208
|
- ✅ You encountered and resolved an error that others might hit
|
|
199
209
|
|
|
200
|
-
**How to
|
|
210
|
+
**How to persist knowledge:**
|
|
201
211
|
\`\`\`
|
|
202
|
-
|
|
212
|
+
knowledge({
|
|
213
|
+
action: "remember",
|
|
203
214
|
title: "Short descriptive title",
|
|
204
215
|
content: "Detailed finding with context",
|
|
205
216
|
category: "patterns" | "conventions" | "decisions" | "troubleshooting"
|
|
@@ -207,13 +218,13 @@ remember({
|
|
|
207
218
|
\`\`\`
|
|
208
219
|
|
|
209
220
|
**Examples:**
|
|
210
|
-
- \`
|
|
211
|
-
- \`
|
|
212
|
-
- \`
|
|
221
|
+
- \`knowledge({ action: "remember", title: "Auth uses JWT refresh tokens with 15min expiry", content: "Access tokens expire in 15 min, refresh in 7 days. Middleware at src/auth/guard.ts validates.", category: "patterns" })\`
|
|
222
|
+
- \`knowledge({ action: "remember", title: "Build requires Node 20+", content: "Uses Web Crypto API — Node 18 fails silently on crypto.subtle calls.", category: "conventions" })\`
|
|
223
|
+
- \`knowledge({ action: "remember", title: "Decision: LanceDB over Chroma for vector store", content: "LanceDB is embedded (no Docker), supports WASM, better for user-level MCP.", category: "decisions" })\`
|
|
213
224
|
|
|
214
225
|
**If you complete a task without remembering anything, you likely missed something.** Review what you learned.
|
|
215
226
|
|
|
216
|
-
For outdated AI Kit entries → \`update
|
|
227
|
+
For outdated AI Kit entries → \`knowledge({ action: "update", path, content, reason })\`
|
|
217
228
|
|
|
218
229
|
---
|
|
219
230
|
|
|
@@ -229,31 +240,84 @@ For outdated AI Kit entries → \`update(path, content, reason)\`
|
|
|
229
240
|
|
|
230
241
|
| Phase | What to do | Compress after? |
|
|
231
242
|
|-------|-----------|----------------|
|
|
232
|
-
| **Understand** | Search
|
|
243
|
+
| **Understand** | Search AI Kit, read summaries, trace symbols | Yes — \`digest\` findings before planning |
|
|
233
244
|
| **Plan** | Design approach, identify files to change | Yes — \`stash\` the plan, compact analysis |
|
|
234
245
|
| **Execute** | Make changes, one sub-task at a time | Yes — compact between independent sub-tasks |
|
|
235
246
|
| **Verify** | \`check\` + \`test_run\` + \`blast_radius\` | — |
|
|
236
247
|
|
|
237
248
|
**Rules:**
|
|
238
249
|
- **Never compact mid-operation** — finish the current sub-task first
|
|
239
|
-
- **Recycle context to files** — save analysis results via \`stash\` or \`remember\`, not just in conversation
|
|
250
|
+
- **Recycle context to files** — save analysis results via \`stash\` or \`knowledge({ action: "remember", ... })\`, not just in conversation
|
|
240
251
|
- **Decompose monolithic work** — break into independent chunks, pass results via artifact files between sub-tasks
|
|
241
252
|
- **One-shot sub-tasks** — for self-contained changes, provide all context upfront to avoid back-and-forth
|
|
242
253
|
|
|
243
254
|
---
|
|
244
255
|
|
|
245
|
-
##
|
|
256
|
+
## Guidelines
|
|
257
|
+
|
|
258
|
+
Behavioral guidelines to reduce common LLM coding mistakes. Apply when writing, reviewing, or refactoring code.
|
|
259
|
+
|
|
260
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.
|
|
261
|
+
|
|
262
|
+
### 1. Think Before Coding
|
|
263
|
+
|
|
264
|
+
**Don't assume. Don't hide confusion. Surface tradeoffs.**
|
|
265
|
+
|
|
266
|
+
- State assumptions explicitly. If uncertain, ask.
|
|
267
|
+
- If multiple interpretations exist, present them — don't pick silently.
|
|
268
|
+
- If a simpler approach exists, say so. Push back when warranted.
|
|
269
|
+
- If something is unclear, stop. Name what's confusing. Ask.
|
|
270
|
+
- Read existing code patterns in the area you're changing before designing your approach.
|
|
271
|
+
|
|
272
|
+
### 2. Simplicity First
|
|
273
|
+
|
|
274
|
+
**Minimum code that solves the problem. Nothing speculative.**
|
|
275
|
+
|
|
276
|
+
- No features beyond what was asked.
|
|
277
|
+
- No abstractions for single-use code.
|
|
278
|
+
- No "flexibility" or "configurability" that wasn't requested.
|
|
279
|
+
- No error handling for impossible scenarios.
|
|
280
|
+
- If you write 200 lines and it could be 50, rewrite it.
|
|
281
|
+
|
|
282
|
+
Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.
|
|
283
|
+
|
|
284
|
+
### 3. Surgical Changes
|
|
285
|
+
|
|
286
|
+
**Touch only what you must. Clean up only your own mess.**
|
|
287
|
+
|
|
288
|
+
When editing existing code:
|
|
289
|
+
- Don't "improve" adjacent code, comments, or formatting.
|
|
290
|
+
- Don't refactor things that aren't broken.
|
|
291
|
+
- Match existing style, even if you'd do it differently.
|
|
292
|
+
- If you notice unrelated dead code, mention it — don't delete it.
|
|
293
|
+
|
|
294
|
+
When your changes create orphans:
|
|
295
|
+
- Remove imports/variables/functions that YOUR changes made unused.
|
|
296
|
+
- Don't remove pre-existing dead code unless asked.
|
|
297
|
+
|
|
298
|
+
The test: Every changed line should trace directly to the user's request.
|
|
299
|
+
|
|
300
|
+
### 4. Goal-Driven Execution
|
|
301
|
+
|
|
302
|
+
**Define success criteria. Loop until verified.**
|
|
303
|
+
|
|
304
|
+
Transform tasks into verifiable goals:
|
|
305
|
+
- "Add validation" → "Write tests for invalid inputs, then make them pass"
|
|
306
|
+
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
|
|
307
|
+
- "Refactor X" → "Ensure tests pass before and after"
|
|
246
308
|
|
|
247
|
-
For
|
|
309
|
+
For multi-step tasks, state a brief plan:
|
|
310
|
+
\`\`\`
|
|
311
|
+
1. [Step] → verify: [check]
|
|
312
|
+
2. [Step] → verify: [check]
|
|
313
|
+
3. [Step] → verify: [check]
|
|
314
|
+
\`\`\`
|
|
315
|
+
|
|
316
|
+
Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.
|
|
248
317
|
|
|
249
|
-
|
|
250
|
-
1. Read existing code patterns in the area you're changing
|
|
251
|
-
2. Design your approach (outline, pseudo-code, or mental model) before writing code
|
|
252
|
-
3. Check: does your design match existing conventions? Use \`search\` for patterns
|
|
253
|
-
4. Implement
|
|
254
|
-
5. Verify: \`check\` + \`test_run\`
|
|
318
|
+
### 5. Quality Dimensions
|
|
255
319
|
|
|
256
|
-
|
|
320
|
+
Verify each before returning handoff:
|
|
257
321
|
|
|
258
322
|
| Dimension | Check |
|
|
259
323
|
|-----------|-------|
|
|
@@ -263,10 +327,14 @@ For non-trivial tasks, **think before you implement**.
|
|
|
263
327
|
| **Robustness** | Handles edge cases? No obvious failure modes? |
|
|
264
328
|
| **Maintainability** | Clear naming? Minimal complexity? Would another developer understand it? |
|
|
265
329
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
330
|
+
### 6. Test-Driven Development
|
|
331
|
+
|
|
332
|
+
**Vertical slices, NOT horizontal layers.**
|
|
333
|
+
|
|
334
|
+
- Write ONE test → make it pass → repeat. Never write a batch of tests then implement all at once.
|
|
335
|
+
- **Tracer bullet first** — get one thin slice working end-to-end before broadening. Proves architecture before investing in breadth.
|
|
336
|
+
- Tests verify **behavior through public interfaces**, not implementation details. If refactoring internals breaks tests, those tests are wrong.
|
|
337
|
+
- When adding a feature: write the test for the simplest case FIRST, get green, then add the next case.
|
|
270
338
|
|
|
271
339
|
---
|
|
272
340
|
|
|
@@ -309,33 +377,66 @@ Always return this structure when invoked as a sub-agent:
|
|
|
309
377
|
\`\`\`
|
|
310
378
|
`,"researcher-base":`# Researcher — Shared Base Instructions
|
|
311
379
|
|
|
312
|
-
> Shared methodology
|
|
380
|
+
> Shared methodology
|
|
381
|
+
for all Researcher variants. Each variant
|
|
382
|
+
's definition contains only its unique identity and model assignment. **Do not duplicate.**
|
|
313
383
|
|
|
314
384
|
|
|
315
385
|
## MANDATORY FIRST ACTION
|
|
316
386
|
|
|
317
387
|
Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-agent-base:
|
|
318
|
-
1. Run \`status(
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
388
|
+
1. Run \`status(
|
|
389
|
+
{
|
|
390
|
+
}
|
|
391
|
+
)\` — check Onboard Status and note the **Onboard Directory** path
|
|
392
|
+
2. If onboard shows ❌ → Run \`onboard(
|
|
393
|
+
{
|
|
394
|
+
path: '.';
|
|
395
|
+
}
|
|
396
|
+
)\` and wait
|
|
397
|
+
for completion
|
|
398
|
+
3. If onboard
|
|
399
|
+
shows;
|
|
400
|
+
✅ → Read relevant onboard artifacts
|
|
401
|
+
using;
|
|
402
|
+
\`compact(
|
|
403
|
+
{
|
|
404
|
+
path: '<Onboard Directory>/<file>';
|
|
405
|
+
}
|
|
406
|
+
)\` before exploring
|
|
407
|
+
|
|
408
|
+
**Start
|
|
409
|
+
with pre-analyzed artifacts.** They
|
|
410
|
+
cover;
|
|
411
|
+
80 % +of;
|
|
412
|
+
common;
|
|
413
|
+
research;
|
|
414
|
+
needs.
|
|
323
415
|
|
|
324
416
|
---
|
|
325
417
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
418
|
+
#
|
|
419
|
+
#
|
|
420
|
+
Research;
|
|
421
|
+
Methodology;
|
|
422
|
+
|
|
423
|
+
#
|
|
424
|
+
#
|
|
425
|
+
#
|
|
426
|
+
Phase;
|
|
427
|
+
1;
|
|
428
|
+
: AI Kit Recall (BLOCKING)
|
|
329
429
|
\`\`\`
|
|
330
430
|
search("task keywords")
|
|
331
431
|
scope_map("what you need to investigate")
|
|
332
432
|
\`\`\`
|
|
333
433
|
|
|
334
434
|
### Phase 2: Exploration
|
|
335
|
-
- Use \`graph\`, \`symbol\`, \`trace\`, \`find\`
|
|
435
|
+
- Use \`graph\`, \`symbol\`, \`trace\`, \`find\`
|
|
436
|
+
for code exploration (graph FIRST for module relationships)
|
|
336
437
|
- Use \`graph({ action: 'neighbors' })\` to understand cross-module dependencies before diving into symbol details
|
|
337
438
|
- Use \`file_summary\`, \`compact\` for efficient file reading
|
|
338
|
-
- Use \`
|
|
439
|
+
- Use \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "dependencies", ... })\` for package-level understanding
|
|
339
440
|
- Use \`web_search\`, \`web_fetch\` for external documentation
|
|
340
441
|
|
|
341
442
|
### Phase 3: Synthesis
|
|
@@ -354,21 +455,22 @@ Return structured findings. Always include:
|
|
|
354
455
|
|
|
355
456
|
### Phase 5: MANDATORY — Persist Discoveries
|
|
356
457
|
|
|
357
|
-
**Before returning your report**, you MUST call \`remember
|
|
458
|
+
**Before returning your report**, you MUST call \`knowledge({ action: "remember", ... })\` for:
|
|
358
459
|
- ✅ Architecture insights not already in onboard artifacts
|
|
359
460
|
- ✅ Non-obvious findings, gotchas, or edge cases
|
|
360
461
|
- ✅ Trade-off analysis and recommendations made
|
|
361
462
|
- ✅ External knowledge gathered from web_search/web_fetch
|
|
362
463
|
|
|
363
464
|
\`\`\`
|
|
364
|
-
|
|
465
|
+
knowledge({
|
|
466
|
+
action: "remember",
|
|
365
467
|
title: "Short descriptive title",
|
|
366
468
|
content: "Detailed finding with context",
|
|
367
469
|
category: "patterns" | "conventions" | "decisions" | "troubleshooting"
|
|
368
470
|
})
|
|
369
471
|
\`\`\`
|
|
370
472
|
|
|
371
|
-
**If you complete research without
|
|
473
|
+
**If you complete research without persisting anything, you wasted tokens.** Your research should enrich the AI Kit knowledge store for future sessions.
|
|
372
474
|
|
|
373
475
|
---
|
|
374
476
|
|
|
@@ -422,52 +524,128 @@ For questions that require trying approach A vs approach B in isolation:
|
|
|
422
524
|
6. Include the diff summary in your output; do NOT merge lanes back (read-only role)
|
|
423
525
|
`,"code-reviewer-base":`# Code-Reviewer — Shared Base Instructions
|
|
424
526
|
|
|
425
|
-
> Shared methodology
|
|
527
|
+
> Shared methodology
|
|
528
|
+
for all Code-Reviewer variants. Each variant
|
|
529
|
+
's definition contains only identity and model. **Do not duplicate.**
|
|
426
530
|
|
|
427
531
|
|
|
428
532
|
## MANDATORY FIRST ACTION
|
|
429
533
|
|
|
430
534
|
Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-agent-base:
|
|
431
|
-
1. Run \`status(
|
|
432
|
-
|
|
433
|
-
|
|
535
|
+
1. Run \`status(
|
|
536
|
+
{
|
|
537
|
+
}
|
|
538
|
+
)\` — check Onboard Status and note the **Onboard Directory** path
|
|
539
|
+
2. If onboard shows ❌ → Run \`onboard(
|
|
540
|
+
{
|
|
541
|
+
path: '.';
|
|
542
|
+
}
|
|
543
|
+
)\` and wait
|
|
544
|
+
for completion
|
|
545
|
+
3. If onboard
|
|
546
|
+
shows;
|
|
547
|
+
✅ → Read relevant onboard artifacts
|
|
548
|
+
using;
|
|
549
|
+
\`compact(
|
|
550
|
+
{
|
|
551
|
+
path: '<Onboard Directory>/<file>';
|
|
552
|
+
}
|
|
553
|
+
)\` — especially \`patterns.md\` and \`api-surface.md\`
|
|
554
|
+
for review context
|
|
434
555
|
|
|
435
556
|
---
|
|
436
557
|
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
558
|
+
#
|
|
559
|
+
#
|
|
560
|
+
Review;
|
|
561
|
+
Workflow;
|
|
562
|
+
|
|
563
|
+
1 ** AI;
|
|
564
|
+
Kit;
|
|
565
|
+
Recall** —
|
|
566
|
+
\`search("conventions relevant-area")\` + \`knowledge({ action: "list" })\`
|
|
567
|
+
for past review findings, patterns
|
|
568
|
+
2. **Blast
|
|
569
|
+
Radius** —
|
|
570
|
+
\`blast_radius\` on changed files to understand impact
|
|
441
571
|
3. **FORGE Classify** — \`forge_classify\` to determine review depth
|
|
442
572
|
4. **Review** — Evaluate against all dimensions below
|
|
443
573
|
5. **Validate** — Run \`check\` (typecheck + lint) and \`test_run\`
|
|
444
|
-
6. **Report** — Structured findings
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
574
|
+
6. **Report** — Structured findings
|
|
575
|
+
with verdict
|
|
576
|
+
7. **Persist** —
|
|
577
|
+
\`knowledge(
|
|
578
|
+
{
|
|
579
|
+
action: "remember",
|
|
580
|
+
title: 'Review: <finding>', content;
|
|
581
|
+
: "<details>", category: "patterns"
|
|
582
|
+
}
|
|
583
|
+
)\`
|
|
584
|
+
for any new patterns, anti-patterns, or recurring issues
|
|
585
|
+
found;
|
|
586
|
+
|
|
587
|
+
#
|
|
588
|
+
#
|
|
589
|
+
Review;
|
|
590
|
+
Dimensions | Dimension | What;
|
|
591
|
+
to;
|
|
592
|
+
Check |
|
|
450
593
|
|-----------|---------------|
|
|
451
|
-
| **Correctness** | Logic
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
| **
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
594
|
+
| **Correctness** | Logic
|
|
595
|
+
errors, off - by - one, null;
|
|
596
|
+
handling, async/await |
|
|
597
|
+
| **Security** | OWASP
|
|
598
|
+
Top;
|
|
599
|
+
10, input;
|
|
600
|
+
validation, secrets;
|
|
601
|
+
exposure |
|
|
602
|
+
| **Performance** | N+1
|
|
603
|
+
queries, unnecessary;
|
|
604
|
+
allocations, missing;
|
|
605
|
+
caching |
|
|
606
|
+
| **Maintainability** | Naming, complexity, DRY, single
|
|
607
|
+
responsibility |
|
|
608
|
+
| **Testing** | Coverage
|
|
609
|
+
for new/changed logic, edge cases |
|
|
610
|
+
| **Patterns** | Consistency with existing codebase
|
|
611
|
+
conventions |
|
|
612
|
+
| **Types** | Proper
|
|
613
|
+
typing, no;
|
|
614
|
+
\`any\`, generics where useful |
|
|
458
615
|
|
|
459
616
|
## Output Format
|
|
460
617
|
|
|
461
618
|
\`\`\`markdown
|
|
462
|
-
## Code Review:
|
|
619
|
+
## Code Review:
|
|
620
|
+
{
|
|
621
|
+
scope;
|
|
622
|
+
}
|
|
463
623
|
**Verdict: APPROVED | NEEDS_REVISION | FAILED**
|
|
464
|
-
**Severity:
|
|
624
|
+
**Severity:
|
|
625
|
+
{
|
|
626
|
+
count;
|
|
627
|
+
by;
|
|
628
|
+
level;
|
|
629
|
+
}
|
|
630
|
+
**
|
|
465
631
|
|
|
466
632
|
### Findings
|
|
467
|
-
1. **[SEVERITY]**
|
|
633
|
+
1. **[SEVERITY]**
|
|
634
|
+
{
|
|
635
|
+
file;
|
|
636
|
+
}
|
|
637
|
+
:
|
|
638
|
+
{
|
|
639
|
+
line;
|
|
640
|
+
}
|
|
641
|
+
— Description and fix
|
|
468
642
|
|
|
469
643
|
### Summary
|
|
470
|
-
{
|
|
644
|
+
{
|
|
645
|
+
Overall;
|
|
646
|
+
assessment, key;
|
|
647
|
+
concerns;
|
|
648
|
+
}
|
|
471
649
|
\`\`\`
|
|
472
650
|
|
|
473
651
|
## Severity Levels
|
|
@@ -480,19 +658,33 @@ Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code
|
|
|
480
658
|
## Rules
|
|
481
659
|
|
|
482
660
|
- **APPROVED** requires zero CRITICAL/HIGH findings
|
|
483
|
-
- **NEEDS_REVISION**
|
|
661
|
+
- **NEEDS_REVISION**
|
|
662
|
+
for any HIGH finding
|
|
484
663
|
- **FAILED** for any CRITICAL finding
|
|
485
|
-
- Always check
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
664
|
+
- Always check
|
|
665
|
+
for **test coverage** on new/changed code
|
|
666
|
+
|
|
667
|
+
#
|
|
668
|
+
#
|
|
669
|
+
Evidence;
|
|
670
|
+
Citation;
|
|
671
|
+
Protocol(tier - aware);
|
|
672
|
+
|
|
673
|
+
The;
|
|
674
|
+
Orchestrator;
|
|
675
|
+
runs;
|
|
676
|
+
\`forge_classify\` before dispatching you, and runs the final
|
|
677
|
+
\`evidence_map(
|
|
678
|
+
{
|
|
679
|
+
action: 'gate', task_id;
|
|
680
|
+
}
|
|
681
|
+
)\` after you respond. **Do not create your own
|
|
491
682
|
task_id or run the gate** — feed into the Orchestrator's existing evidence map.
|
|
492
683
|
|
|
493
684
|
| Tier | Your responsibility |
|
|
494
685
|
|------|---------------------|
|
|
495
|
-
| Floor | Free-form findings
|
|
686
|
+
| Floor | Free-form findings
|
|
687
|
+
with \`file.ts#Lxx\` citations. No \`evidence_map\` calls required. |
|
|
496
688
|
| Standard | For every CRITICAL or HIGH finding: \`evidence_map({action:'add', task_id, claim, status:'V', receipt:'file.ts#Lxx'})\`. Max 2-4 adds to keep signal high. |
|
|
497
689
|
| Critical | Structured claims for all CRITICAL/HIGH findings (2-4 Verified + receipts) AND tag contract/security claims with \`safety_gate:'commitment'\` or \`safety_gate:'provenance'\`. |
|
|
498
690
|
|
|
@@ -508,55 +700,135 @@ Do NOT:
|
|
|
508
700
|
- Duplicate findings into the map that weren't CRITICAL/HIGH
|
|
509
701
|
`,"architect-reviewer-base":`# Architect-Reviewer — Shared Base Instructions
|
|
510
702
|
|
|
511
|
-
> Shared methodology
|
|
703
|
+
> Shared methodology
|
|
704
|
+
for all Architect-Reviewer variants. Each variant
|
|
705
|
+
's definition contains only identity and model. **Do not duplicate.**
|
|
512
706
|
|
|
513
707
|
|
|
514
708
|
## MANDATORY FIRST ACTION
|
|
515
709
|
|
|
516
710
|
Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code-agent-base:
|
|
517
|
-
1. Run \`status(
|
|
518
|
-
|
|
519
|
-
|
|
711
|
+
1. Run \`status(
|
|
712
|
+
{
|
|
713
|
+
}
|
|
714
|
+
)\` — check Onboard Status and note the **Onboard Directory** path
|
|
715
|
+
2. If onboard shows ❌ → Run \`onboard(
|
|
716
|
+
{
|
|
717
|
+
path: '.';
|
|
718
|
+
}
|
|
719
|
+
)\` and wait
|
|
720
|
+
for completion
|
|
721
|
+
3. If onboard
|
|
722
|
+
shows;
|
|
723
|
+
✅ → Read relevant onboard artifacts
|
|
724
|
+
using;
|
|
725
|
+
\`compact(
|
|
726
|
+
{
|
|
727
|
+
path: '<Onboard Directory>/<file>';
|
|
728
|
+
}
|
|
729
|
+
)\` — especially \`structure.md\`, \`dependencies.md\`, and \`diagram.md\`
|
|
730
|
+
for architecture context
|
|
520
731
|
|
|
521
732
|
---
|
|
522
733
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
734
|
+
#
|
|
735
|
+
#
|
|
736
|
+
Review;
|
|
737
|
+
Workflow;
|
|
738
|
+
|
|
739
|
+
1 ** AI;
|
|
740
|
+
Kit;
|
|
741
|
+
Recall** —
|
|
742
|
+
\`search("architecture decisions boundaries")\` + \`knowledge({ action: "list" })\`
|
|
743
|
+
for past ADRs, patterns
|
|
744
|
+
2. **Analyze** —
|
|
745
|
+
\`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "dependencies", ... })\`, \`blast_radius\`
|
|
527
746
|
3. **Evaluate** — Check all dimensions below
|
|
528
|
-
4. **Report** — Structured findings
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
747
|
+
4. **Report** — Structured findings
|
|
748
|
+
with verdict
|
|
749
|
+
5. **Persist** —
|
|
750
|
+
\`knowledge(
|
|
751
|
+
{
|
|
752
|
+
action: "remember",
|
|
753
|
+
title: 'Architecture: <finding>', content;
|
|
754
|
+
: "<details>", category: "decisions"
|
|
755
|
+
}
|
|
756
|
+
)\`
|
|
757
|
+
for any structural findings, boundary violations, or
|
|
758
|
+
design;
|
|
759
|
+
insights;
|
|
760
|
+
|
|
761
|
+
#
|
|
762
|
+
#
|
|
763
|
+
Review;
|
|
764
|
+
Dimensions | Dimension | What;
|
|
765
|
+
to;
|
|
766
|
+
Check |
|
|
534
767
|
|-----------|---------------|
|
|
535
|
-
| **Dependency
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
| **
|
|
768
|
+
| **Dependency
|
|
769
|
+
Direction** | Dependencies
|
|
770
|
+
flow;
|
|
771
|
+
inward (domain ← services ← infra) |
|
|
772
|
+
| **Boundary
|
|
773
|
+
Respect** | No
|
|
774
|
+
cross - cutting;
|
|
775
|
+
between;
|
|
776
|
+
unrelated;
|
|
777
|
+
packages |
|
|
778
|
+
| **SOLID
|
|
779
|
+
Compliance** | Single
|
|
780
|
+
responsibility, dependency;
|
|
781
|
+
inversion |
|
|
782
|
+
| **Pattern
|
|
783
|
+
Adherence** | Consistent
|
|
784
|
+
with established patterns in codebase |
|
|
785
|
+
| **Interface
|
|
786
|
+
Stability** | Public
|
|
787
|
+
APIs;
|
|
788
|
+
don;
|
|
789
|
+
't break existing consumers |
|
|
540
790
|
| **Scalability** | Design handles growth (more data, more users, more features) |
|
|
541
791
|
| **Testability** | Dependencies injectable, side effects isolated |
|
|
542
792
|
|
|
543
793
|
## Output Format
|
|
544
794
|
|
|
545
795
|
\`\`\`markdown
|
|
546
|
-
## Architecture Review:
|
|
796
|
+
## Architecture Review:
|
|
797
|
+
{
|
|
798
|
+
scope;
|
|
799
|
+
}
|
|
547
800
|
**Verdict: APPROVED | NEEDS_CHANGES | BLOCKED**
|
|
548
801
|
|
|
549
802
|
### Boundary Analysis
|
|
550
|
-
{
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
803
|
+
{
|
|
804
|
+
dependency;
|
|
805
|
+
direction, package;
|
|
806
|
+
boundaries;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
#
|
|
810
|
+
#
|
|
811
|
+
#
|
|
812
|
+
Pattern;
|
|
813
|
+
Compliance;
|
|
814
|
+
{
|
|
815
|
+
consistency;
|
|
816
|
+
with existing patterns
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
#
|
|
820
|
+
#
|
|
821
|
+
#
|
|
822
|
+
Findings;
|
|
823
|
+
1 ** ([SEVERITY] ** { description });
|
|
824
|
+
— Impact and recommendation
|
|
557
825
|
|
|
558
826
|
### Summary
|
|
559
|
-
{
|
|
827
|
+
{
|
|
828
|
+
Overall;
|
|
829
|
+
structural;
|
|
830
|
+
assessment;
|
|
831
|
+
}
|
|
560
832
|
\`\`\`
|
|
561
833
|
|
|
562
834
|
## Rules
|
|
@@ -569,12 +841,17 @@ Follow the **MANDATORY FIRST ACTION** and **Information Lookup Order** from code
|
|
|
569
841
|
## Evidence Citation Protocol (tier-aware)
|
|
570
842
|
|
|
571
843
|
The Orchestrator runs \`forge_classify\` before dispatching you, and runs the final
|
|
572
|
-
\`evidence_map(
|
|
844
|
+
\`evidence_map(
|
|
845
|
+
{
|
|
846
|
+
action: 'gate', task_id;
|
|
847
|
+
}
|
|
848
|
+
)\` after you respond. **Do not create your own
|
|
573
849
|
task_id or run the gate** — feed into the Orchestrator's existing evidence map.
|
|
574
850
|
|
|
575
851
|
| Tier | Your responsibility |
|
|
576
852
|
|------|---------------------|
|
|
577
|
-
| Floor | Free-form findings
|
|
853
|
+
| Floor | Free-form findings
|
|
854
|
+
with \`file.ts#Lxx\` citations. No \`evidence_map\` calls required. |
|
|
578
855
|
| Standard | For every CRITICAL or HIGH finding: \`evidence_map({action:'add', task_id, claim, status:'V', receipt:'file.ts#Lxx'})\`. Max 2-4 adds to keep signal high. |
|
|
579
856
|
| Critical | Structured claims for all CRITICAL/HIGH findings (2-4 Verified + receipts) AND tag contract/security claims with \`safety_gate:'commitment'\` or \`safety_gate:'provenance'\`. |
|
|
580
857
|
|
|
@@ -617,7 +894,16 @@ The Orchestrator uses **multi-model decision analysis** to resolve non-trivial t
|
|
|
617
894
|
|
|
618
895
|
### Phase 1 — Independent Research (parallel)
|
|
619
896
|
|
|
620
|
-
Launch ALL available Researcher variants **in parallel**
|
|
897
|
+
Launch ALL available Researcher variants **in parallel**
|
|
898
|
+
with the same
|
|
899
|
+
question.Each;
|
|
900
|
+
returns;
|
|
901
|
+
an;
|
|
902
|
+
independent;
|
|
903
|
+
recommendation;
|
|
904
|
+
grounded in their;
|
|
905
|
+
thinking;
|
|
906
|
+
style:
|
|
621
907
|
|
|
622
908
|
| Variant | Thinking Style | Lens |
|
|
623
909
|
|---------|---------------|------|
|
|
@@ -628,7 +914,18 @@ Launch ALL available Researcher variants **in parallel** with the same question.
|
|
|
628
914
|
|
|
629
915
|
### Phase 2 — Peer Review (parallel)
|
|
630
916
|
|
|
631
|
-
After all researchers
|
|
917
|
+
After all researchers
|
|
918
|
+
return, **anonymize** their
|
|
919
|
+
responses as Perspective
|
|
920
|
+
A / B / C / D (strip agent names). Then
|
|
921
|
+
launch;
|
|
922
|
+
a ** second;
|
|
923
|
+
parallel;
|
|
924
|
+
batch ** of;
|
|
925
|
+
4;
|
|
926
|
+
review;
|
|
927
|
+
sub - agents;
|
|
928
|
+
:
|
|
632
929
|
|
|
633
930
|
**Peer Review Prompt Template:**
|
|
634
931
|
\`\`\`
|
|
@@ -638,14 +935,11 @@ Each perspective was produced independently — they have NOT seen each other's
|
|
|
638
935
|
[Perspective A]
|
|
639
936
|
{Alpha's full response}
|
|
640
937
|
|
|
641
|
-
[Perspective B]
|
|
642
|
-
{Beta's full response}
|
|
938
|
+
[Perspective B]Beta's full response}
|
|
643
939
|
|
|
644
|
-
[Perspective C]
|
|
645
|
-
{Gamma's full response}
|
|
940
|
+
[Perspective C]Gamma's full response}
|
|
646
941
|
|
|
647
|
-
[Perspective D]
|
|
648
|
-
{Delta's full response}
|
|
942
|
+
[Perspective D]Delta's full response}
|
|
649
943
|
|
|
650
944
|
Evaluate ALL perspectives. Your review MUST include:
|
|
651
945
|
1. **Strongest argument** — which perspective and why (cite specific evidence)
|
|
@@ -663,30 +957,25 @@ The Orchestrator synthesizes BOTH layers (original research + peer reviews) into
|
|
|
663
957
|
**Verdict Format (MANDATORY):**
|
|
664
958
|
|
|
665
959
|
\`\`\`markdown
|
|
666
|
-
## Decision Verdict:
|
|
960
|
+
## Decision Verdict: title
|
|
667
961
|
|
|
668
|
-
### Where They
|
|
669
|
-
{Points of consensus across researchers — high confidence items}
|
|
962
|
+
### Where They AgreePoints of consensus across researchers — high confidence items
|
|
670
963
|
|
|
671
|
-
### Where They
|
|
672
|
-
{Key disagreements with the strongest argument for each side}
|
|
964
|
+
### Where They ClashKey disagreements with the strongest argument for each side
|
|
673
965
|
|
|
674
|
-
### Blind Spots Caught (by peer review)
|
|
675
|
-
{Issues found in Phase 2 that no researcher identified in Phase 1}
|
|
966
|
+
### Blind Spots Caught (by peer review)Issues found in Phase 2 that no researcher identified in Phase 1
|
|
676
967
|
|
|
677
|
-
###
|
|
678
|
-
{The chosen approach — may combine elements from multiple perspectives}
|
|
968
|
+
### RecommendationThe chosen approach — may combine elements from multiple perspectives
|
|
679
969
|
**Confidence:** HIGH / MEDIUM / LOW
|
|
680
|
-
**Rationale:**
|
|
970
|
+
**Rationale:** one paragraph
|
|
681
971
|
|
|
682
|
-
### First
|
|
683
|
-
{The single most concrete next action to begin implementation}
|
|
972
|
+
### First StepThe single most concrete next action to begin implementation
|
|
684
973
|
\`\`\`
|
|
685
974
|
|
|
686
975
|
Then:
|
|
687
|
-
1. **Present** the verdict using \`present(
|
|
976
|
+
1. **Present** the verdict using \`present(format: "html" )\` with comparison blocks
|
|
688
977
|
2. **Produce an ADR** via the \`adr-skill\`
|
|
689
|
-
3. **\`remember\`** the decision for future recall
|
|
978
|
+
3. **\`knowledge({ action: "remember", ... })\`** the decision for future recall
|
|
690
979
|
|
|
691
980
|
## When to Use (Auto-Trigger Rules)
|
|
692
981
|
|
|
@@ -708,14 +997,14 @@ Trigger the decision protocol when there is an **unresolved non-trivial technica
|
|
|
708
997
|
- Never make a non-trivial technical decision without multi-model analysis
|
|
709
998
|
- Always present the verdict visually using \`present\`
|
|
710
999
|
- **Produce an ADR** after every decision resolution
|
|
711
|
-
- \`remember\` the decision for future recall
|
|
1000
|
+
- \`knowledge({ action: "remember", ... })\` the decision for future recall
|
|
712
1001
|
|
|
713
1002
|
## Shortcut: Floor-Tier Decisions
|
|
714
1003
|
|
|
715
1004
|
For decisions classified as **Floor tier** (blast_radius ≤ 2, single concern):
|
|
716
1005
|
- Skip Phase 2 (peer review) — synthesis directly from Phase 1
|
|
717
1006
|
- Verdict format still required but can be abbreviated
|
|
718
|
-
- ADR is optional (use \`remember\` at minimum)
|
|
1007
|
+
- ADR is optional (use \`knowledge({ action: "remember", ... })\` at minimum)
|
|
719
1008
|
`,"forge-protocol":`# FORGE Protocol — Quality Overlay
|
|
720
1009
|
|
|
721
1010
|
> Follow the FORGE (Fact-Oriented Reasoning with Graduated Evidence) protocol for all code generation and modification tasks.
|