@vpxa/aikit 0.1.165 → 0.1.167
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/packages/server/dist/index.js +1 -1
- package/packages/server/dist/{server-BXHUbkn9.js → server-D1MJ6SiP.js} +131 -129
- package/packages/store/dist/index.d.ts +7 -0
- package/packages/store/dist/index.js +12 -12
- package/packages/tools/dist/index.js +71 -70
- package/scaffold/dist/definitions/bodies.mjs +26 -24
- package/scaffold/dist/definitions/flows.mjs +20 -20
- package/scaffold/dist/definitions/protocols.mjs +20 -20
- package/scaffold/dist/definitions/skills/aikit.mjs +1 -1
- package/scaffold/dist/definitions/skills/present.mjs +1 -1
|
@@ -2,6 +2,8 @@ const e=()=>"**`AGENTS.md` is already in your context** — do NOT re-read it. J
|
|
|
2
2
|
|
|
3
3
|
## Bootstrap (before any work)
|
|
4
4
|
|
|
5
|
+
> **HARD RULE:** Your FIRST ACTION in EVERY session MUST be \`status({})\`. No exceptions. This ensures tool availability, workspace awareness, and index state before any other operation. Skipping this causes tool avoidance and degraded performance.
|
|
6
|
+
|
|
5
7
|
1. \`status({})\` — if onboard ❌ → \`onboard({ path: "." })\`, wait for completion, note **Onboard Directory**
|
|
6
8
|
2. Read onboard artifacts: \`compact({ path: "<Onboard Dir>/synthesis-guide.md" })\`, \`structure.md\`, \`code-map.md\`
|
|
7
9
|
3. Read \`aikit\` skill, check \`AGENTS.md\` (decision protocol and FORGE protocol are inlined below)
|
|
@@ -36,7 +38,7 @@ ${e}
|
|
|
36
38
|
|
|
37
39
|
## FORGE Protocol
|
|
38
40
|
|
|
39
|
-
1. \`forge_classify({ task, files })\` → determine tier (Floor/Standard/Critical)
|
|
41
|
+
1. \`forge_classify({ task, files, root_path: "." })\` → determine tier (Floor/Standard/Critical)
|
|
40
42
|
2. Pass tier + task_id to subagents: \`FORGE Context: Tier = {tier}. Task ID = {task_id}. Evidence: {requirements}. Reviewers add CRITICAL/HIGH claims into your task_id; never create their own.\`
|
|
41
43
|
3. After review: \`evidence_map({ action: "gate", task_id })\` → YIELD/HOLD/HARD_BLOCK
|
|
42
44
|
4. Auto-upgrade tier if unknowns reveal contract/security issues
|
|
@@ -137,7 +139,7 @@ This gives the user a visual dependency graph of the execution plan before dispa
|
|
|
137
139
|
**Subagent prompt template:**
|
|
138
140
|
1. **Scope** — exact files + boundary
|
|
139
141
|
2. **Goal** — acceptance criteria, testable
|
|
140
|
-
3. **Arch Context** — varies by \`config.tokenBudget\`: efficient → \`stratum_card({tier:'T1'})\`, normal → \`compact({path, query})\`, full → \`digest({sources})\`. Default to efficient unless task complexity requires more.
|
|
142
|
+
3. **Arch Context** — varies by \`config.tokenBudget\`: efficient → \`stratum_card({ files: ['<path>'], query: '<what matters>', tier: 'T1' })\`, normal → \`compact({path, query})\`, full → \`digest({ sources: [...], query: '<what matters>' })\`. Default to efficient unless task complexity requires more.
|
|
141
143
|
4. **Constraints** — patterns, conventions
|
|
142
144
|
5. **Artifacts Path** — the active flow's run directory and artifacts path from \`flow({ action: 'status' })\` (e.g. \`.flows/add-authentication/.spec/\`)
|
|
143
145
|
6. **FORGE** — tier + task_id + evidence requirements (reviewers add CRITICAL/HIGH claims into your task_id; never create their own)
|
|
@@ -173,13 +175,13 @@ When \`allRoots.length > 1\`: always pass \`roots\` to \`flow start\` targeting
|
|
|
173
175
|
|
|
174
176
|
### Context Gathering for Subagent Prompts
|
|
175
177
|
|
|
176
|
-
Default to \`stratum_card({tier:'T1'})\` (~100 tok/file). Upgrade: \`compact\` (~300 tok/file) for semantic need, \`digest\` for multi-file synthesis, \`read_file\` only for exact edit lines.
|
|
178
|
+
Default to \`stratum_card({ files: ['<path>'], query: '<what matters>', tier: 'T1' })\` (~100 tok/file). Upgrade: \`compact\` (~300 tok/file) for semantic need, \`digest\` for multi-file synthesis, \`read_file\` only for exact edit lines.
|
|
177
179
|
|
|
178
180
|
### Between-Phase Compression (MANDATORY)
|
|
179
181
|
|
|
180
182
|
After each subagent batch returns:
|
|
181
183
|
1. Extract per agent: **status + files + decisions** (2-3 sentences)
|
|
182
|
-
2. \`stash({ key: "batch-N-summary", value: compressed })\`
|
|
184
|
+
2. \`stash({ action: "set", key: "batch-N-summary", value: compressed })\`
|
|
183
185
|
3. Next batch sees stash — NOT full subagent output
|
|
184
186
|
|
|
185
187
|
Between phases: \`session_digest({ persist: true, focus: "<topic>" })\`. Carry forward ONLY: decisions, file paths, blockers.
|
|
@@ -199,11 +201,11 @@ Between phases: \`session_digest({ persist: true, focus: "<topic>" })\`. Carry f
|
|
|
199
201
|
|
|
200
202
|
- **Terse by default** — status updates, phase transitions, and confirmations in 1-3 sentences. No preamble, no filler.
|
|
201
203
|
- Batch completion summary: bullet list of agent status + files + decisions. NOT prose paragraphs.
|
|
202
|
-
- Structured data >3 rows → \`present({
|
|
204
|
+
- Structured data >3 rows → \`present({ schemaVersion: 1, title: "Execution Summary", blocks: [...] })\`; add \`actions\` when you need interactive browser transport
|
|
203
205
|
- Task decomposition / execution plans → \`present({ template: "task-plan@1" })\`
|
|
204
206
|
- Charts, tables, dependency graphs → always \`present\`
|
|
205
207
|
- Short confirmations and questions → normal chat
|
|
206
|
-
- **CLI mode:**
|
|
208
|
+
- **CLI mode:** Use the same \`present({ schemaVersion: 1, ... })\` surface; add \`actions\` when you need interactive browser transport from a terminal environment.
|
|
207
209
|
|
|
208
210
|
## Subagent Output Relay
|
|
209
211
|
|
|
@@ -211,7 +213,7 @@ Subagent \`present\` calls are invisible to user. Always include "Do NOT use \`p
|
|
|
211
213
|
|
|
212
214
|
**After each subagent returns:**
|
|
213
215
|
1. Extract: status + files + key decisions (2-3 sentences)
|
|
214
|
-
2. \`stash({ key: "agent-<name>-result", value: compressed })\` — full response exits conversation context
|
|
216
|
+
2. \`stash({ action: "set", key: "agent-<name>-result", value: compressed })\` — full response exits conversation context
|
|
215
217
|
3. Present COMPRESSED summary to user — never echo verbatim subagent output
|
|
216
218
|
4. If visual data needed → \`present\` the summary, not raw response
|
|
217
219
|
|
|
@@ -284,8 +286,8 @@ On ANY auth failure (401/403/404/SSO/login HTML): STOP → load \`repo-access\`
|
|
|
284
286
|
|
|
285
287
|
| Situation | Tool |
|
|
286
288
|
|-----------|------|
|
|
287
|
-
| Intermediate result | \`stash({ key, value })\` |
|
|
288
|
-
| Milestone completed | \`checkpoint({ action: "save",
|
|
289
|
+
| Intermediate result | \`stash({ action: "set", key, value })\` |
|
|
290
|
+
| Milestone completed | \`checkpoint({ action: "save", label })\` |
|
|
289
291
|
| Decision or pattern | \`knowledge({ action: "remember", title, content, category })\` |
|
|
290
292
|
| About to propose new approach | \`search({ query })\` — check if already decided |
|
|
291
293
|
|
|
@@ -402,7 +404,7 @@ The Planner is typically activated by the Orchestrator as part of a flow step (e
|
|
|
402
404
|
|
|
403
405
|
- **Test-first always** — No implementation without a failing test
|
|
404
406
|
- **Minimal code** — Don't build what isn't asked for
|
|
405
|
-
- **Follow existing patterns** — Search AI Kit for conventions before creating new ones (\`search("convention")\`, \`knowledge({ action: "list", category: "conventions" })\`)
|
|
407
|
+
- **Follow existing patterns** — Search AI Kit for conventions before creating new ones (\`search({ query: "convention" })\`, \`knowledge({ action: "list", category: "conventions" })\`)
|
|
406
408
|
- **Never modify tests to make them pass** — Fix the implementation instead
|
|
407
409
|
- **Run \`check\` after every change** — Catch errors early
|
|
408
410
|
- **Loop-break** — If the same test still fails with the same error after 2 retries, STOP. Re-read the error from scratch, check your assumptions with \`trace\` or \`symbol\`, and try a fundamentally different approach. Do not attempt a 3rd retry in the same direction
|
|
@@ -412,8 +414,8 @@ The Planner is typically activated by the Orchestrator as part of a flow step (e
|
|
|
412
414
|
|
|
413
415
|
1. **Understand consumers** — \`graph({action:'find_nodes', name_pattern:'<target>'})\` → \`graph({action:'neighbors', node_id, direction:'incoming'})\`. See who calls/imports before changing a contract.
|
|
414
416
|
2. **Compress, don't raw-read** — \`file_summary\` then \`compact({path, query})\` for the specific area. Only \`read_file\` when you need exact lines for \`replace_string_in_file\`.
|
|
415
|
-
3. **Snapshot risky edits** — \`checkpoint({action:'save', label:'pre-<scope>'})\` before cross-cutting changes. \`checkpoint({action:'
|
|
416
|
-
4. **Estimate blast radius** — \`blast_radius({
|
|
417
|
+
3. **Snapshot risky edits** — \`checkpoint({action:'save', label:'pre-<scope>'})\` before cross-cutting changes to save task metadata. If validation fails, \`checkpoint({ action:'load' })\` restores that saved metadata context only; it does not revert files.
|
|
418
|
+
4. **Estimate blast radius** — \`blast_radius({ path: ".", files: [...] })\` BEFORE editing when changing a public/shared symbol; re-run AFTER to confirm actual impact matches.
|
|
417
419
|
5. **TDD when tests exist** — write/extend the failing test first, then minimum code to pass.
|
|
418
420
|
|
|
419
421
|
## Post-Edit Checklist
|
|
@@ -473,7 +475,7 @@ Every implementation response MUST end with a structured status block:
|
|
|
473
475
|
|------|------|
|
|
474
476
|
| Component dependency graph | \`graph({action:'neighbors', node_id:'src/components/X.tsx', direction:'incoming'})\` |
|
|
475
477
|
| Stale / unused components | \`dead_symbols({ path:'src/components' })\` |
|
|
476
|
-
| React / a11y / library API research | \`web_search({ query })\`, \`web_fetch({ urls })\` |
|
|
478
|
+
| React / a11y / library API research | \`web_search({ queries: ["<query>"] })\`, \`web_fetch({ urls })\` |
|
|
477
479
|
| Component complexity hotspots | \`measure({ path:'src/components' })\` |
|
|
478
480
|
| Verify a component's callers | \`graph({action:'find_nodes', name_pattern})\` → \`neighbors\` |
|
|
479
481
|
|
|
@@ -534,8 +536,8 @@ Choose the appropriate loop type:
|
|
|
534
536
|
|
|
535
537
|
### Phase 2: Reproduce
|
|
536
538
|
|
|
537
|
-
1. \`search("error patterns")\` — check auto-captured error patterns and known issues
|
|
538
|
-
2. \`knowledge({ action: "list",
|
|
539
|
+
1. \`search({ query: "error patterns" })\` — check auto-captured error patterns and known issues
|
|
540
|
+
2. \`knowledge({ action: "list", tag: "errors" })\` — find prior troubleshooting knowledge
|
|
539
541
|
3. Run the feedback loop — confirm the error fires consistently
|
|
540
542
|
4. If intermittent: add instrumentation, increase loop iterations, check race conditions
|
|
541
543
|
|
|
@@ -623,19 +625,19 @@ Apply these lenses when deciding WHAT to refactor:
|
|
|
623
625
|
|
|
624
626
|
## Reversible Refactor Protocol
|
|
625
627
|
|
|
626
|
-
Refactors modify the canonical source, so use \`checkpoint\` (NOT \`lane\`)
|
|
628
|
+
Refactors modify the canonical source, so use \`checkpoint\` (NOT \`lane\`) to save and load refactor metadata, not to roll back files:
|
|
627
629
|
|
|
628
630
|
1. **Before starting:** \`checkpoint({ action:'save', label:'pre-refactor-<scope>' })\`
|
|
629
|
-
—
|
|
631
|
+
— saves a metadata checkpoint for the refactor session
|
|
630
632
|
2. **Baseline metrics:** \`measure({ path })\` on target files — record
|
|
631
633
|
\`cognitiveComplexity\` values BEFORE refactor
|
|
632
|
-
3. **Apply changes** — use \`rename({ old, new })\` for symbol rename (dry_run first),
|
|
633
|
-
or \`codemod({ pattern, replacement })\` for structural transforms (dry_run first).
|
|
634
|
+
3. **Apply changes** — use \`rename({ old_name: "<old>", new_name: "<new>", root_path: "." })\` for symbol rename (dry_run first),
|
|
635
|
+
or \`codemod({ root_path: ".", rules: [{ pattern: "<pattern>", replacement: "<replacement>", description: "<what this changes>" }] })\` for structural transforms (dry_run first).
|
|
634
636
|
Never hand-edit what \`rename\`/\`codemod\` can do safely.
|
|
635
637
|
4. **Verify:** \`check({})\` + \`test_run({})\` must both pass with zero new failures
|
|
636
638
|
5. **Post-metrics:** \`measure({ path })\` again — confirm cognitive complexity
|
|
637
639
|
delta is negative (or justify if zero)
|
|
638
|
-
6. **If validation fails:** \`checkpoint({ action:'
|
|
640
|
+
6. **If validation fails:** \`checkpoint({ action:'load' })\` to recover the saved metadata context; this does not revert files.
|
|
639
641
|
|
|
640
642
|
For multi-approach uncertainty (A vs B), do NOT create lanes. Instead:
|
|
641
643
|
- Delegate to \`Researcher-Delta\` with a feasibility question — they can use \`lane\`
|
|
@@ -651,11 +653,11 @@ For multi-approach uncertainty (A vs B), do NOT create lanes. Instead:
|
|
|
651
653
|
|
|
652
654
|
> **Reminder:** Follow ## MANDATORY FIRST ACTION from your shared base protocol.
|
|
653
655
|
|
|
654
|
-
After shared bootstrap, run \`search("security vulnerabilities conventions")\` + \`knowledge({ action: "list" })\` for past findings.
|
|
656
|
+
After shared bootstrap, run \`search({ query: "security vulnerabilities conventions" })\` + \`knowledge({ action: "list" })\` for past findings.
|
|
655
657
|
|
|
656
658
|
## Security Review Protocol
|
|
657
659
|
|
|
658
|
-
1. **AI Kit Recall** — \`search("security findings <area>")\` + \`knowledge({ action: "list" })\` for past security decisions and known issues
|
|
660
|
+
1. **AI Kit Recall** — \`search({ query: "security findings <area>" })\` + \`knowledge({ action: "list" })\` for past security decisions and known issues
|
|
659
661
|
2. **Audit** — Run \`audit\` for a comprehensive project health check, then \`find\` for specific vulnerability patterns
|
|
660
662
|
3. **OWASP Top 10 Scan** — Check each category systematically
|
|
661
663
|
4. **Dependency Audit** — Check for known CVEs in dependencies
|
|
@@ -702,11 +704,11 @@ After shared bootstrap, run \`search("security vulnerabilities conventions")\` +
|
|
|
702
704
|
|
|
703
705
|
> **Reminder:** Follow ## MANDATORY FIRST ACTION from your shared base protocol.
|
|
704
706
|
|
|
705
|
-
After shared bootstrap, run \`search("documentation conventions")\` + \`knowledge({ action: "list" })\` for existing docs and standards.
|
|
707
|
+
After shared bootstrap, run \`search({ query: "documentation conventions" })\` + \`knowledge({ action: "list" })\` for existing docs and standards.
|
|
706
708
|
|
|
707
709
|
## Documentation Protocol
|
|
708
710
|
|
|
709
|
-
1. **AI Kit Recall** — \`search("documentation <area>")\` + \`knowledge({ action: "list" })\` for existing docs, conventions, architecture decisions
|
|
711
|
+
1. **AI Kit Recall** — \`search({ query: "documentation <area>" })\` + \`knowledge({ action: "list" })\` for existing docs, conventions, architecture decisions
|
|
710
712
|
2. **Analyze** — \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "entry_points", ... })\`, \`file_summary\`
|
|
711
713
|
3. **Draft** — Write documentation following project conventions
|
|
712
714
|
4. **Cross-reference** — Link to related docs, ensure consistency
|
|
@@ -18,7 +18,7 @@ Read all artifacts produced during this flow — they contain design decisions,
|
|
|
18
18
|
|
|
19
19
|
\`\`\`
|
|
20
20
|
flow({ action: 'status' }) # Get artifactsPath
|
|
21
|
-
find({
|
|
21
|
+
find({ glob: "{{artifacts_path}}/**/*.md" }) # Discover all flow artifacts
|
|
22
22
|
digest({ sources: [ # Compress artifacts for context
|
|
23
23
|
{ path: "<found-artifact-1>" },
|
|
24
24
|
{ path: "<found-artifact-2>" },
|
|
@@ -34,7 +34,7 @@ If no artifacts exist, proceed to Step 1 in source-only mode.
|
|
|
34
34
|
|
|
35
35
|
\`\`\`
|
|
36
36
|
git_context({}) # What changed in this flow
|
|
37
|
-
blast_radius({
|
|
37
|
+
blast_radius({ path: ".", files: ["<changed-files>"] }) # Impact analysis — which modules affected
|
|
38
38
|
\`\`\`
|
|
39
39
|
|
|
40
40
|
Use the output to classify changes:
|
|
@@ -57,7 +57,7 @@ If \`docs/\` doesn't exist, run the **Architecture Blueprint Workflow** from the
|
|
|
57
57
|
|
|
58
58
|
\`\`\`
|
|
59
59
|
# Step 1: Generate content with AI Kit tools
|
|
60
|
-
produce_knowledge({
|
|
60
|
+
produce_knowledge({ scope: "." }) # → Foundation for docs/README.md
|
|
61
61
|
analyze({ aspect: "structure", path: "." }) # → docs/architecture/overview.md structure
|
|
62
62
|
analyze({ aspect: "diagram", path: "." }) # → docs/architecture/ Mermaid diagrams
|
|
63
63
|
analyze({ aspect: "dependencies", path: "." }) # → docs/architecture/overview.md deps section
|
|
@@ -86,7 +86,7 @@ When \`docs/\` already exists:
|
|
|
86
86
|
|
|
87
87
|
\`\`\`
|
|
88
88
|
compact({ path: "docs/architecture/overview.md", query: "section to update" }) # Read target section
|
|
89
|
-
blast_radius({
|
|
89
|
+
blast_radius({ path: ".", files: ["<files>"] }) # What's affected
|
|
90
90
|
\`\`\`
|
|
91
91
|
|
|
92
92
|
- **Don't rewrite** — update the relevant sections of existing docs
|
|
@@ -203,7 +203,7 @@ Classify the task:
|
|
|
203
203
|
|
|
204
204
|
### 2. FORGE Classification
|
|
205
205
|
|
|
206
|
-
Run \`forge_classify({ task: "<task description>", files: [<relevant files>] })\` to determine the complexity tier.
|
|
206
|
+
Run \`forge_classify({ task: "<task description>", files: [<relevant files>], root_path: "." })\` to determine the complexity tier.
|
|
207
207
|
|
|
208
208
|
| Tier | Meaning | Design Depth |
|
|
209
209
|
|------|---------|-------------|
|
|
@@ -244,7 +244,7 @@ When technical decisions need resolution, follow the **3-phase multi-model decis
|
|
|
244
244
|
|
|
245
245
|
### 5. FORGE Ground (Standard & Critical tiers)
|
|
246
246
|
|
|
247
|
-
Run \`forge_ground({ task, root_path: "." })\` to:
|
|
247
|
+
Run \`forge_ground({ task, files: [<relevant files>], root_path: "." })\` to:
|
|
248
248
|
- Scope the affected files and modules
|
|
249
249
|
- Identify unknowns and risks
|
|
250
250
|
- Load existing constraints and conventions
|
|
@@ -253,7 +253,7 @@ Run \`forge_ground({ task, root_path: "." })\` to:
|
|
|
253
253
|
|
|
254
254
|
### 6. Write \`{{artifacts_path}}/design-decisions.md\` to disk
|
|
255
255
|
|
|
256
|
-
**You MUST create this file on disk** using
|
|
256
|
+
**You MUST create this file on disk** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
257
257
|
|
|
258
258
|
\`\`\`markdown
|
|
259
259
|
## Design Decisions
|
|
@@ -312,7 +312,7 @@ After user approves:
|
|
|
312
312
|
|
|
313
313
|
## Outputs
|
|
314
314
|
|
|
315
|
-
Write \`{{artifacts_path}}/design-decisions.md\` to disk. **You MUST create this file** using
|
|
315
|
+
Write \`{{artifacts_path}}/design-decisions.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat. This file is a prerequisite for the next step.
|
|
316
316
|
|
|
317
317
|
## Produces
|
|
318
318
|
|
|
@@ -414,7 +414,7 @@ Tasks with \`dependsOn\` are blocked until their dependencies complete. This ens
|
|
|
414
414
|
|
|
415
415
|
## Outputs
|
|
416
416
|
|
|
417
|
-
Write \`{{artifacts_path}}/progress.md\` to disk. **You MUST create this file** using
|
|
417
|
+
Write \`{{artifacts_path}}/progress.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
418
418
|
|
|
419
419
|
Template:
|
|
420
420
|
|
|
@@ -566,7 +566,7 @@ Before implementation, verify alignment with requirements:
|
|
|
566
566
|
|
|
567
567
|
## Outputs
|
|
568
568
|
|
|
569
|
-
Write \`{{artifacts_path}}/plan.md\` to disk. **You MUST create this file** using
|
|
569
|
+
Write \`{{artifacts_path}}/plan.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
570
570
|
|
|
571
571
|
Template:
|
|
572
572
|
|
|
@@ -723,7 +723,7 @@ This gate ensures we don't design solutions for misunderstood problems.
|
|
|
723
723
|
|
|
724
724
|
## Outputs
|
|
725
725
|
|
|
726
|
-
Write \`{{artifacts_path}}/spec.md\` to disk. **You MUST create this file** using
|
|
726
|
+
Write \`{{artifacts_path}}/spec.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
727
727
|
|
|
728
728
|
Template:
|
|
729
729
|
|
|
@@ -846,7 +846,7 @@ Decompose the implementation plan into small, atomic tasks that agents can execu
|
|
|
846
846
|
|
|
847
847
|
## Outputs
|
|
848
848
|
|
|
849
|
-
Write \`{{artifacts_path}}/tasks.md\` to disk. **You MUST create this file** using
|
|
849
|
+
Write \`{{artifacts_path}}/tasks.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
850
850
|
|
|
851
851
|
Template:
|
|
852
852
|
|
|
@@ -980,7 +980,7 @@ Perform thorough multi-perspective validation of all changes through parallel du
|
|
|
980
980
|
4. **Security review**:
|
|
981
981
|
- Security agent: OWASP Top 10, auth/authz, input validation, secrets
|
|
982
982
|
5. **Quality gates** — \`check({})\` + \`test_run({})\` must pass
|
|
983
|
-
6. **Blast radius** — \`blast_radius({
|
|
983
|
+
6. **Blast radius** — \`blast_radius({ path: ".", files: [...] })\` on all modified files
|
|
984
984
|
7. **Acceptance criteria** — Verify each spec acceptance criterion is met
|
|
985
985
|
8. **FORGE gate** — \`evidence_map({ action: "gate" })\` for final quality assessment
|
|
986
986
|
9. **Synthesize report** — Merge all reviewer findings into unified verdict
|
|
@@ -997,7 +997,7 @@ Never declare verification complete without a YIELD gate result.
|
|
|
997
997
|
|
|
998
998
|
## Outputs
|
|
999
999
|
|
|
1000
|
-
Write \`{{artifacts_path}}/verify-report.md\` to disk. **You MUST create this file** using
|
|
1000
|
+
Write \`{{artifacts_path}}/verify-report.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
1001
1001
|
|
|
1002
1002
|
Template:
|
|
1003
1003
|
|
|
@@ -1145,7 +1145,7 @@ If no requirements.md exists (Design Gate was auto-skipped for bug fix/refactor)
|
|
|
1145
1145
|
|
|
1146
1146
|
## Outputs
|
|
1147
1147
|
|
|
1148
|
-
Write \`{{artifacts_path}}/assessment.md\` to disk. **You MUST create this file** using
|
|
1148
|
+
Write \`{{artifacts_path}}/assessment.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
1149
1149
|
|
|
1150
1150
|
Template:
|
|
1151
1151
|
|
|
@@ -1257,7 +1257,7 @@ For small features that need minimal design:
|
|
|
1257
1257
|
2. **If requirements are clear** (single concern, obvious scope, clear acceptance):
|
|
1258
1258
|
- Skip requirements-clarity, proceed to Quick Design directly
|
|
1259
1259
|
|
|
1260
|
-
1. **FORGE Classify** — Run \`forge_classify({ task: "<task description>", files: [<relevant files>] })\` to determine complexity tier
|
|
1260
|
+
1. **FORGE Classify** — Run \`forge_classify({ task: "<task description>", files: [<relevant files>], root_path: "." })\` to determine complexity tier
|
|
1261
1261
|
2. **Brainstorming** (if tier ≥ Standard) — Load the \`brainstorming\` skill and run a focused brainstorming session:
|
|
1262
1262
|
- What is the user trying to achieve?
|
|
1263
1263
|
- What are the constraints?
|
|
@@ -1296,7 +1296,7 @@ When complete, report status:
|
|
|
1296
1296
|
|
|
1297
1297
|
## Outputs
|
|
1298
1298
|
|
|
1299
|
-
Write \`{{artifacts_path}}/design-decisions.md\` to disk. **You MUST create this file** using
|
|
1299
|
+
Write \`{{artifacts_path}}/design-decisions.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat. This file is a prerequisite for the next step.
|
|
1300
1300
|
|
|
1301
1301
|
## Produces
|
|
1302
1302
|
|
|
@@ -1396,7 +1396,7 @@ If either fails:
|
|
|
1396
1396
|
|
|
1397
1397
|
## Outputs
|
|
1398
1398
|
|
|
1399
|
-
Write \`{{artifacts_path}}/progress.md\` to disk. **You MUST create this file** using
|
|
1399
|
+
Write \`{{artifacts_path}}/progress.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
1400
1400
|
|
|
1401
1401
|
Template:
|
|
1402
1402
|
|
|
@@ -1524,13 +1524,13 @@ If any prerequisites are missing or incomplete:
|
|
|
1524
1524
|
- Error handling and edge cases
|
|
1525
1525
|
- No unnecessary changes (scope creep)
|
|
1526
1526
|
3. **Run quality gates** — \`check({})\` + \`test_run({})\` must pass
|
|
1527
|
-
4. **Blast radius** — \`blast_radius({
|
|
1527
|
+
4. **Blast radius** — \`blast_radius({ path: ".", files: [...] })\` to assess impact
|
|
1528
1528
|
5. **Security scan** — Check for OWASP Top 10 issues in changed code
|
|
1529
1529
|
6. **Write report** — Document findings with PASS/FAIL verdict
|
|
1530
1530
|
|
|
1531
1531
|
## Outputs
|
|
1532
1532
|
|
|
1533
|
-
Write \`{{artifacts_path}}/verify-report.md\` to disk. **You MUST create this file** using
|
|
1533
|
+
Write \`{{artifacts_path}}/verify-report.md\` to disk. **You MUST create this file** using the IDE's native file creation capability or equivalent — do not just present content in chat.
|
|
1534
1534
|
|
|
1535
1535
|
Template:
|
|
1536
1536
|
|
|
@@ -29,8 +29,7 @@ You may be invoked in two modes:
|
|
|
29
29
|
2. **Sub-agent** (via Orchestrator) — you may have limited MCP tool access.
|
|
30
30
|
The Orchestrator provides context under "## Prior AI Kit Context" or "### Current Code Context" in your prompt.
|
|
31
31
|
If present, skip AI Kit Recall and use the provided context instead.
|
|
32
|
-
**Visual Output:** When running as a sub-agent,
|
|
33
|
-
Instead, include structured data (tables, findings, metrics) as formatted text in your final response.
|
|
32
|
+
**Visual Output:** When running as a sub-agent, return structured data (tables, findings, metrics) as formatted text in your final response.
|
|
34
33
|
The Orchestrator will re-present relevant content to the user.
|
|
35
34
|
|
|
36
35
|
**Detection:** If your prompt contains "## Prior AI Kit Context" OR "### Current Code Context" OR was dispatched via \`runSubagent\`, you are in sub-agent mode. When in sub-agent mode, use provided context — do NOT re-read files already given in your prompt.
|
|
@@ -62,13 +61,15 @@ Use AI Kit retrieval and compression tools first. Prefer reusable compressed con
|
|
|
62
61
|
|---|---|---|
|
|
63
62
|
| \`read_file\` to understand a file | \`file_summary({ path })\` | Structure, exports, imports — 10x fewer tokens |
|
|
64
63
|
| \`read_file\` to find specific code | \`compact({ path, query })\` | Server-side read + semantic extract — 5-20x reduction |
|
|
65
|
-
| Multiple \`read_file\` calls | \`digest({ sources })\` | Compresses multiple files into token-budgeted summary |
|
|
64
|
+
| Multiple \`read_file\` calls | \`digest({ sources, query: "<task description>" })\` | Compresses multiple files into token-budgeted summary |
|
|
66
65
|
| \`grep_search\` / \`semantic_search\` | \`search({ query })\` | Hybrid search across all indexed + curated content |
|
|
67
66
|
| \`grep_search\` for a symbol name | \`symbol({ name })\` | Definition + references with scope and call context |
|
|
68
67
|
| \`run_in_terminal\` for tsc/lint | \`check({})\` | Typecheck + lint combined, summary output |
|
|
69
68
|
| \`run_in_terminal\` for test | \`test_run({})\` | Run tests with structured output |
|
|
70
69
|
| Editing without reading | \`file_summary\` then targeted \`read_file\` | Prevents wrong-position edits |
|
|
71
70
|
|
|
71
|
+
> **Path Note:** \`compact({path})\` and \`file_summary({path})\` accept ANY absolute path — not just indexed workspace files. They read the file directly from disk. Use them freely for cross-workspace and cross-repository file access without needing to index the target workspace first.
|
|
72
|
+
|
|
72
73
|
**\`read_file\` is ONLY acceptable when you need exact line content FOR EDITING (before \`replace_string_in_file\`).**
|
|
73
74
|
|
|
74
75
|
For edits, first understand structure with \`file_summary\` or \`compact\`, then use targeted \`read_file\` only for the exact region.
|
|
@@ -118,7 +119,6 @@ Your agent file lists domain-specific skills in the **Skills** section. Load the
|
|
|
118
119
|
2. If yes → load the skill file before starting implementation
|
|
119
120
|
3. The following skills are **foundational** — always loaded, do not re-load:
|
|
120
121
|
- **\`aikit\`** — AI Kit MCP tool reference, search strategies, compression workflows, session protocol. **Required for all tool usage.**
|
|
121
|
-
- **\`present\`** — Rich content rendering (dashboards, tables, charts, timelines). **Required when producing visual output for the user.**
|
|
122
122
|
|
|
123
123
|
> If no additional skills are listed for your agent, rely on AI Kit tools and onboard artifacts.
|
|
124
124
|
|
|
@@ -172,10 +172,10 @@ Past decisions, conventions, and patterns are stored in curated knowledge. Auto-
|
|
|
172
172
|
- Reuse existing stash/checkpoint/workset context when present before creating new compressed artifacts.
|
|
173
173
|
|
|
174
174
|
\`\`\`
|
|
175
|
-
search("keywords about the feature/area you're changing") // check for past decisions
|
|
175
|
+
search({ query: "keywords about the feature/area you're changing" }) // check for past decisions
|
|
176
176
|
knowledge({ action: "list", category: "decisions" }) // scan recent decisions that might apply
|
|
177
177
|
knowledge({ action: "list", category: "conventions" }) // see project conventions (includes auto-captured)
|
|
178
|
-
scope_map("what you need") // generates a reading plan
|
|
178
|
+
scope_map({ task: "what you need" }) // generates a reading plan
|
|
179
179
|
|
|
180
180
|
// If running as sub-agent with flow context:
|
|
181
181
|
knowledge({ action: "withdraw", scope: "flow", profile: "<your-role>", budget: 6000 }) // get pre-analyzed context from prior agents
|
|
@@ -195,13 +195,13 @@ knowledge({ action: "withdraw", scope: "flow", profile: "<your-role>", budget: 6
|
|
|
195
195
|
| \`graph({ action: 'neighbors', node_id })\` | Traverse module import graph — cross-package dependencies, who-imports-whom |
|
|
196
196
|
| \`find({ pattern })\` | Locate files by name/glob |
|
|
197
197
|
| \`symbol({ name })\` | Find symbol definition + references |
|
|
198
|
-
| \`trace({
|
|
198
|
+
| \`trace({ start, direction })\` | Follow call graph forward/backward |
|
|
199
199
|
| \`compact({ path, query })\` | Read specific section of a file |
|
|
200
200
|
| \`read_file\` | **ONLY** when you need exact lines for a pending edit |
|
|
201
201
|
|
|
202
202
|
### Step 4: Tool Discovery
|
|
203
203
|
|
|
204
|
-
If unsure which AI Kit tool to use → run \`guide({
|
|
204
|
+
If unsure which AI Kit tool to use → run \`guide({ goal: "what you need" })\` for recommendations.
|
|
205
205
|
|
|
206
206
|
---
|
|
207
207
|
|
|
@@ -424,16 +424,16 @@ When you need user input or need to explain something before asking:
|
|
|
424
424
|
| Situation | Method | Details |
|
|
425
425
|
|-----------|--------|---------|
|
|
426
426
|
| Simple explanation + question | **Elicitation** | Text-only explanation, then ask via elicitation fields |
|
|
427
|
-
| Rich content explanation + question |
|
|
428
|
-
| Complex visual explanation |
|
|
429
|
-
| **CLI mode** (any rich content) |
|
|
427
|
+
| Rich content explanation + question | **Structured text + Elicitation** | Explain with concise markdown/plain text, then ask via elicitation fields |
|
|
428
|
+
| Complex visual explanation | **Structured text + Elicitation** | Summarize the important comparisons or findings in text for the Orchestrator to render later if needed |
|
|
429
|
+
| **CLI mode** (any rich content) | **Structured text + Elicitation** | Keep output text-only; user-facing rendering belongs to the Orchestrator or another non-code agent |
|
|
430
430
|
|
|
431
431
|
**Rules:**
|
|
432
|
-
- **
|
|
433
|
-
- **Confirmation selections**
|
|
434
|
-
- **Free-form text input** always goes through elicitation
|
|
432
|
+
- **Use concise structured text** for tables, findings, and comparisons that the Orchestrator can render later if needed
|
|
433
|
+
- **Confirmation selections** should use elicitation choices when available
|
|
434
|
+
- **Free-form text input** always goes through elicitation
|
|
435
435
|
- **Prefer the simplest method** that adequately conveys the information
|
|
436
|
-
- **
|
|
436
|
+
- **Keep code-agent output text-only** for both direct and sub-agent execution
|
|
437
437
|
|
|
438
438
|
${e(`<PROFILE>`)}
|
|
439
439
|
|
|
@@ -491,8 +491,8 @@ ${e(`researcher`)}
|
|
|
491
491
|
|
|
492
492
|
### Phase 1: AI Kit Recall (BLOCKING)
|
|
493
493
|
\`\`\`
|
|
494
|
-
search("task keywords")
|
|
495
|
-
scope_map("what you need to investigate")
|
|
494
|
+
search({ query: "task keywords" })
|
|
495
|
+
scope_map({ task: "what you need to investigate" })
|
|
496
496
|
\`\`\`
|
|
497
497
|
|
|
498
498
|
### Phase 2: Exploration
|
|
@@ -596,7 +596,7 @@ ${e(`reviewer`)}
|
|
|
596
596
|
|
|
597
597
|
## Review Workflow
|
|
598
598
|
|
|
599
|
-
1. **AI Kit Recall** — \`search("conventions relevant-area")\` + \`knowledge({ action: "list" })\` for past review findings and patterns
|
|
599
|
+
1. **AI Kit Recall** — \`search({ query: "conventions relevant-area" })\` + \`knowledge({ action: "list" })\` for past review findings and patterns
|
|
600
600
|
2. **Blast Radius** — \`blast_radius\` on changed files to understand impact
|
|
601
601
|
3. **FORGE Classify** — \`forge_classify\` to determine review depth
|
|
602
602
|
4. **Review** — Evaluate against all dimensions below
|
|
@@ -661,7 +661,7 @@ ${e(`reviewer`)}
|
|
|
661
661
|
|
|
662
662
|
## Review Workflow
|
|
663
663
|
|
|
664
|
-
1. **AI Kit Recall** — \`search("architecture decisions boundaries")\` + \`knowledge({ action: "list" })\` for past ADRs and patterns
|
|
664
|
+
1. **AI Kit Recall** — \`search({ query: "architecture decisions boundaries" })\` + \`knowledge({ action: "list" })\` for past ADRs and patterns
|
|
665
665
|
2. **Analyze** — \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "dependencies", ... })\`, \`blast_radius\`
|
|
666
666
|
3. **Evaluate** — Check all dimensions below
|
|
667
667
|
4. **Report** — Structured findings with verdict
|
|
@@ -906,7 +906,7 @@ For quality-sensitive tasks, use the execute→score→fix→re-score pattern:
|
|
|
906
906
|
1. Execute task (Build phase)
|
|
907
907
|
2. Score: check({}) + test_run({}) + evidence_map({ action: "gate" })
|
|
908
908
|
3. If gate != YIELD → fix issues → re-score (max 3 iterations)
|
|
909
|
-
4. Track progress: stash({ key: "iteration-N", value: { score, issues } })
|
|
909
|
+
4. Track progress: stash({ action: "set", key: "iteration-N", value: JSON.stringify({ score, issues }) })
|
|
910
910
|
|
|
911
911
|
Agents iterate until quality threshold is met, with diminishing returns tracked via stash.
|
|
912
912
|
|