@vpxa/aikit 0.1.165 → 0.1.166
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-CkKB4ez2.js} +125 -124
- package/packages/tools/dist/index.js +71 -70
- package/scaffold/dist/definitions/bodies.mjs +24 -24
- package/scaffold/dist/definitions/flows.mjs +20 -20
- package/scaffold/dist/definitions/protocols.mjs +18 -20
- package/scaffold/dist/definitions/skills/aikit.mjs +1 -1
- package/scaffold/dist/definitions/skills/present.mjs +1 -1
|
@@ -36,7 +36,7 @@ ${e}
|
|
|
36
36
|
|
|
37
37
|
## FORGE Protocol
|
|
38
38
|
|
|
39
|
-
1. \`forge_classify({ task, files })\` → determine tier (Floor/Standard/Critical)
|
|
39
|
+
1. \`forge_classify({ task, files, root_path: "." })\` → determine tier (Floor/Standard/Critical)
|
|
40
40
|
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
41
|
3. After review: \`evidence_map({ action: "gate", task_id })\` → YIELD/HOLD/HARD_BLOCK
|
|
42
42
|
4. Auto-upgrade tier if unknowns reveal contract/security issues
|
|
@@ -137,7 +137,7 @@ This gives the user a visual dependency graph of the execution plan before dispa
|
|
|
137
137
|
**Subagent prompt template:**
|
|
138
138
|
1. **Scope** — exact files + boundary
|
|
139
139
|
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.
|
|
140
|
+
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
141
|
4. **Constraints** — patterns, conventions
|
|
142
142
|
5. **Artifacts Path** — the active flow's run directory and artifacts path from \`flow({ action: 'status' })\` (e.g. \`.flows/add-authentication/.spec/\`)
|
|
143
143
|
6. **FORGE** — tier + task_id + evidence requirements (reviewers add CRITICAL/HIGH claims into your task_id; never create their own)
|
|
@@ -173,13 +173,13 @@ When \`allRoots.length > 1\`: always pass \`roots\` to \`flow start\` targeting
|
|
|
173
173
|
|
|
174
174
|
### Context Gathering for Subagent Prompts
|
|
175
175
|
|
|
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.
|
|
176
|
+
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
177
|
|
|
178
178
|
### Between-Phase Compression (MANDATORY)
|
|
179
179
|
|
|
180
180
|
After each subagent batch returns:
|
|
181
181
|
1. Extract per agent: **status + files + decisions** (2-3 sentences)
|
|
182
|
-
2. \`stash({ key: "batch-N-summary", value: compressed })\`
|
|
182
|
+
2. \`stash({ action: "set", key: "batch-N-summary", value: compressed })\`
|
|
183
183
|
3. Next batch sees stash — NOT full subagent output
|
|
184
184
|
|
|
185
185
|
Between phases: \`session_digest({ persist: true, focus: "<topic>" })\`. Carry forward ONLY: decisions, file paths, blockers.
|
|
@@ -199,11 +199,11 @@ Between phases: \`session_digest({ persist: true, focus: "<topic>" })\`. Carry f
|
|
|
199
199
|
|
|
200
200
|
- **Terse by default** — status updates, phase transitions, and confirmations in 1-3 sentences. No preamble, no filler.
|
|
201
201
|
- Batch completion summary: bullet list of agent status + files + decisions. NOT prose paragraphs.
|
|
202
|
-
- Structured data >3 rows → \`present({
|
|
202
|
+
- Structured data >3 rows → \`present({ schemaVersion: 1, title: "Execution Summary", blocks: [...] })\`; add \`actions\` when you need interactive browser transport
|
|
203
203
|
- Task decomposition / execution plans → \`present({ template: "task-plan@1" })\`
|
|
204
204
|
- Charts, tables, dependency graphs → always \`present\`
|
|
205
205
|
- Short confirmations and questions → normal chat
|
|
206
|
-
- **CLI mode:**
|
|
206
|
+
- **CLI mode:** Use the same \`present({ schemaVersion: 1, ... })\` surface; add \`actions\` when you need interactive browser transport from a terminal environment.
|
|
207
207
|
|
|
208
208
|
## Subagent Output Relay
|
|
209
209
|
|
|
@@ -211,7 +211,7 @@ Subagent \`present\` calls are invisible to user. Always include "Do NOT use \`p
|
|
|
211
211
|
|
|
212
212
|
**After each subagent returns:**
|
|
213
213
|
1. Extract: status + files + key decisions (2-3 sentences)
|
|
214
|
-
2. \`stash({ key: "agent-<name>-result", value: compressed })\` — full response exits conversation context
|
|
214
|
+
2. \`stash({ action: "set", key: "agent-<name>-result", value: compressed })\` — full response exits conversation context
|
|
215
215
|
3. Present COMPRESSED summary to user — never echo verbatim subagent output
|
|
216
216
|
4. If visual data needed → \`present\` the summary, not raw response
|
|
217
217
|
|
|
@@ -284,8 +284,8 @@ On ANY auth failure (401/403/404/SSO/login HTML): STOP → load \`repo-access\`
|
|
|
284
284
|
|
|
285
285
|
| Situation | Tool |
|
|
286
286
|
|-----------|------|
|
|
287
|
-
| Intermediate result | \`stash({ key, value })\` |
|
|
288
|
-
| Milestone completed | \`checkpoint({ action: "save",
|
|
287
|
+
| Intermediate result | \`stash({ action: "set", key, value })\` |
|
|
288
|
+
| Milestone completed | \`checkpoint({ action: "save", label })\` |
|
|
289
289
|
| Decision or pattern | \`knowledge({ action: "remember", title, content, category })\` |
|
|
290
290
|
| About to propose new approach | \`search({ query })\` — check if already decided |
|
|
291
291
|
|
|
@@ -402,7 +402,7 @@ The Planner is typically activated by the Orchestrator as part of a flow step (e
|
|
|
402
402
|
|
|
403
403
|
- **Test-first always** — No implementation without a failing test
|
|
404
404
|
- **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" })\`)
|
|
405
|
+
- **Follow existing patterns** — Search AI Kit for conventions before creating new ones (\`search({ query: "convention" })\`, \`knowledge({ action: "list", category: "conventions" })\`)
|
|
406
406
|
- **Never modify tests to make them pass** — Fix the implementation instead
|
|
407
407
|
- **Run \`check\` after every change** — Catch errors early
|
|
408
408
|
- **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 +412,8 @@ The Planner is typically activated by the Orchestrator as part of a flow step (e
|
|
|
412
412
|
|
|
413
413
|
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
414
|
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({
|
|
415
|
+
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.
|
|
416
|
+
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
417
|
5. **TDD when tests exist** — write/extend the failing test first, then minimum code to pass.
|
|
418
418
|
|
|
419
419
|
## Post-Edit Checklist
|
|
@@ -473,7 +473,7 @@ Every implementation response MUST end with a structured status block:
|
|
|
473
473
|
|------|------|
|
|
474
474
|
| Component dependency graph | \`graph({action:'neighbors', node_id:'src/components/X.tsx', direction:'incoming'})\` |
|
|
475
475
|
| Stale / unused components | \`dead_symbols({ path:'src/components' })\` |
|
|
476
|
-
| React / a11y / library API research | \`web_search({ query })\`, \`web_fetch({ urls })\` |
|
|
476
|
+
| React / a11y / library API research | \`web_search({ queries: ["<query>"] })\`, \`web_fetch({ urls })\` |
|
|
477
477
|
| Component complexity hotspots | \`measure({ path:'src/components' })\` |
|
|
478
478
|
| Verify a component's callers | \`graph({action:'find_nodes', name_pattern})\` → \`neighbors\` |
|
|
479
479
|
|
|
@@ -534,8 +534,8 @@ Choose the appropriate loop type:
|
|
|
534
534
|
|
|
535
535
|
### Phase 2: Reproduce
|
|
536
536
|
|
|
537
|
-
1. \`search("error patterns")\` — check auto-captured error patterns and known issues
|
|
538
|
-
2. \`knowledge({ action: "list",
|
|
537
|
+
1. \`search({ query: "error patterns" })\` — check auto-captured error patterns and known issues
|
|
538
|
+
2. \`knowledge({ action: "list", tag: "errors" })\` — find prior troubleshooting knowledge
|
|
539
539
|
3. Run the feedback loop — confirm the error fires consistently
|
|
540
540
|
4. If intermittent: add instrumentation, increase loop iterations, check race conditions
|
|
541
541
|
|
|
@@ -623,19 +623,19 @@ Apply these lenses when deciding WHAT to refactor:
|
|
|
623
623
|
|
|
624
624
|
## Reversible Refactor Protocol
|
|
625
625
|
|
|
626
|
-
Refactors modify the canonical source, so use \`checkpoint\` (NOT \`lane\`)
|
|
626
|
+
Refactors modify the canonical source, so use \`checkpoint\` (NOT \`lane\`) to save and load refactor metadata, not to roll back files:
|
|
627
627
|
|
|
628
628
|
1. **Before starting:** \`checkpoint({ action:'save', label:'pre-refactor-<scope>' })\`
|
|
629
|
-
—
|
|
629
|
+
— saves a metadata checkpoint for the refactor session
|
|
630
630
|
2. **Baseline metrics:** \`measure({ path })\` on target files — record
|
|
631
631
|
\`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).
|
|
632
|
+
3. **Apply changes** — use \`rename({ old_name: "<old>", new_name: "<new>", root_path: "." })\` for symbol rename (dry_run first),
|
|
633
|
+
or \`codemod({ root_path: ".", rules: [{ pattern: "<pattern>", replacement: "<replacement>", description: "<what this changes>" }] })\` for structural transforms (dry_run first).
|
|
634
634
|
Never hand-edit what \`rename\`/\`codemod\` can do safely.
|
|
635
635
|
4. **Verify:** \`check({})\` + \`test_run({})\` must both pass with zero new failures
|
|
636
636
|
5. **Post-metrics:** \`measure({ path })\` again — confirm cognitive complexity
|
|
637
637
|
delta is negative (or justify if zero)
|
|
638
|
-
6. **If validation fails:** \`checkpoint({ action:'
|
|
638
|
+
6. **If validation fails:** \`checkpoint({ action:'load' })\` to recover the saved metadata context; this does not revert files.
|
|
639
639
|
|
|
640
640
|
For multi-approach uncertainty (A vs B), do NOT create lanes. Instead:
|
|
641
641
|
- Delegate to \`Researcher-Delta\` with a feasibility question — they can use \`lane\`
|
|
@@ -651,11 +651,11 @@ For multi-approach uncertainty (A vs B), do NOT create lanes. Instead:
|
|
|
651
651
|
|
|
652
652
|
> **Reminder:** Follow ## MANDATORY FIRST ACTION from your shared base protocol.
|
|
653
653
|
|
|
654
|
-
After shared bootstrap, run \`search("security vulnerabilities conventions")\` + \`knowledge({ action: "list" })\` for past findings.
|
|
654
|
+
After shared bootstrap, run \`search({ query: "security vulnerabilities conventions" })\` + \`knowledge({ action: "list" })\` for past findings.
|
|
655
655
|
|
|
656
656
|
## Security Review Protocol
|
|
657
657
|
|
|
658
|
-
1. **AI Kit Recall** — \`search("security findings <area>")\` + \`knowledge({ action: "list" })\` for past security decisions and known issues
|
|
658
|
+
1. **AI Kit Recall** — \`search({ query: "security findings <area>" })\` + \`knowledge({ action: "list" })\` for past security decisions and known issues
|
|
659
659
|
2. **Audit** — Run \`audit\` for a comprehensive project health check, then \`find\` for specific vulnerability patterns
|
|
660
660
|
3. **OWASP Top 10 Scan** — Check each category systematically
|
|
661
661
|
4. **Dependency Audit** — Check for known CVEs in dependencies
|
|
@@ -702,11 +702,11 @@ After shared bootstrap, run \`search("security vulnerabilities conventions")\` +
|
|
|
702
702
|
|
|
703
703
|
> **Reminder:** Follow ## MANDATORY FIRST ACTION from your shared base protocol.
|
|
704
704
|
|
|
705
|
-
After shared bootstrap, run \`search("documentation conventions")\` + \`knowledge({ action: "list" })\` for existing docs and standards.
|
|
705
|
+
After shared bootstrap, run \`search({ query: "documentation conventions" })\` + \`knowledge({ action: "list" })\` for existing docs and standards.
|
|
706
706
|
|
|
707
707
|
## Documentation Protocol
|
|
708
708
|
|
|
709
|
-
1. **AI Kit Recall** — \`search("documentation <area>")\` + \`knowledge({ action: "list" })\` for existing docs, conventions, architecture decisions
|
|
709
|
+
1. **AI Kit Recall** — \`search({ query: "documentation <area>" })\` + \`knowledge({ action: "list" })\` for existing docs, conventions, architecture decisions
|
|
710
710
|
2. **Analyze** — \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "entry_points", ... })\`, \`file_summary\`
|
|
711
711
|
3. **Draft** — Write documentation following project conventions
|
|
712
712
|
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,7 +61,7 @@ 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 |
|
|
@@ -118,7 +117,6 @@ Your agent file lists domain-specific skills in the **Skills** section. Load the
|
|
|
118
117
|
2. If yes → load the skill file before starting implementation
|
|
119
118
|
3. The following skills are **foundational** — always loaded, do not re-load:
|
|
120
119
|
- **\`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
120
|
|
|
123
121
|
> If no additional skills are listed for your agent, rely on AI Kit tools and onboard artifacts.
|
|
124
122
|
|
|
@@ -172,10 +170,10 @@ Past decisions, conventions, and patterns are stored in curated knowledge. Auto-
|
|
|
172
170
|
- Reuse existing stash/checkpoint/workset context when present before creating new compressed artifacts.
|
|
173
171
|
|
|
174
172
|
\`\`\`
|
|
175
|
-
search("keywords about the feature/area you're changing") // check for past decisions
|
|
173
|
+
search({ query: "keywords about the feature/area you're changing" }) // check for past decisions
|
|
176
174
|
knowledge({ action: "list", category: "decisions" }) // scan recent decisions that might apply
|
|
177
175
|
knowledge({ action: "list", category: "conventions" }) // see project conventions (includes auto-captured)
|
|
178
|
-
scope_map("what you need") // generates a reading plan
|
|
176
|
+
scope_map({ task: "what you need" }) // generates a reading plan
|
|
179
177
|
|
|
180
178
|
// If running as sub-agent with flow context:
|
|
181
179
|
knowledge({ action: "withdraw", scope: "flow", profile: "<your-role>", budget: 6000 }) // get pre-analyzed context from prior agents
|
|
@@ -195,13 +193,13 @@ knowledge({ action: "withdraw", scope: "flow", profile: "<your-role>", budget: 6
|
|
|
195
193
|
| \`graph({ action: 'neighbors', node_id })\` | Traverse module import graph — cross-package dependencies, who-imports-whom |
|
|
196
194
|
| \`find({ pattern })\` | Locate files by name/glob |
|
|
197
195
|
| \`symbol({ name })\` | Find symbol definition + references |
|
|
198
|
-
| \`trace({
|
|
196
|
+
| \`trace({ start, direction })\` | Follow call graph forward/backward |
|
|
199
197
|
| \`compact({ path, query })\` | Read specific section of a file |
|
|
200
198
|
| \`read_file\` | **ONLY** when you need exact lines for a pending edit |
|
|
201
199
|
|
|
202
200
|
### Step 4: Tool Discovery
|
|
203
201
|
|
|
204
|
-
If unsure which AI Kit tool to use → run \`guide({
|
|
202
|
+
If unsure which AI Kit tool to use → run \`guide({ goal: "what you need" })\` for recommendations.
|
|
205
203
|
|
|
206
204
|
---
|
|
207
205
|
|
|
@@ -424,16 +422,16 @@ When you need user input or need to explain something before asking:
|
|
|
424
422
|
| Situation | Method | Details |
|
|
425
423
|
|-----------|--------|---------|
|
|
426
424
|
| 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) |
|
|
425
|
+
| Rich content explanation + question | **Structured text + Elicitation** | Explain with concise markdown/plain text, then ask via elicitation fields |
|
|
426
|
+
| Complex visual explanation | **Structured text + Elicitation** | Summarize the important comparisons or findings in text for the Orchestrator to render later if needed |
|
|
427
|
+
| **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
428
|
|
|
431
429
|
**Rules:**
|
|
432
|
-
- **
|
|
433
|
-
- **Confirmation selections**
|
|
434
|
-
- **Free-form text input** always goes through elicitation
|
|
430
|
+
- **Use concise structured text** for tables, findings, and comparisons that the Orchestrator can render later if needed
|
|
431
|
+
- **Confirmation selections** should use elicitation choices when available
|
|
432
|
+
- **Free-form text input** always goes through elicitation
|
|
435
433
|
- **Prefer the simplest method** that adequately conveys the information
|
|
436
|
-
- **
|
|
434
|
+
- **Keep code-agent output text-only** for both direct and sub-agent execution
|
|
437
435
|
|
|
438
436
|
${e(`<PROFILE>`)}
|
|
439
437
|
|
|
@@ -491,8 +489,8 @@ ${e(`researcher`)}
|
|
|
491
489
|
|
|
492
490
|
### Phase 1: AI Kit Recall (BLOCKING)
|
|
493
491
|
\`\`\`
|
|
494
|
-
search("task keywords")
|
|
495
|
-
scope_map("what you need to investigate")
|
|
492
|
+
search({ query: "task keywords" })
|
|
493
|
+
scope_map({ task: "what you need to investigate" })
|
|
496
494
|
\`\`\`
|
|
497
495
|
|
|
498
496
|
### Phase 2: Exploration
|
|
@@ -596,7 +594,7 @@ ${e(`reviewer`)}
|
|
|
596
594
|
|
|
597
595
|
## Review Workflow
|
|
598
596
|
|
|
599
|
-
1. **AI Kit Recall** — \`search("conventions relevant-area")\` + \`knowledge({ action: "list" })\` for past review findings and patterns
|
|
597
|
+
1. **AI Kit Recall** — \`search({ query: "conventions relevant-area" })\` + \`knowledge({ action: "list" })\` for past review findings and patterns
|
|
600
598
|
2. **Blast Radius** — \`blast_radius\` on changed files to understand impact
|
|
601
599
|
3. **FORGE Classify** — \`forge_classify\` to determine review depth
|
|
602
600
|
4. **Review** — Evaluate against all dimensions below
|
|
@@ -661,7 +659,7 @@ ${e(`reviewer`)}
|
|
|
661
659
|
|
|
662
660
|
## Review Workflow
|
|
663
661
|
|
|
664
|
-
1. **AI Kit Recall** — \`search("architecture decisions boundaries")\` + \`knowledge({ action: "list" })\` for past ADRs and patterns
|
|
662
|
+
1. **AI Kit Recall** — \`search({ query: "architecture decisions boundaries" })\` + \`knowledge({ action: "list" })\` for past ADRs and patterns
|
|
665
663
|
2. **Analyze** — \`analyze({ aspect: "structure", ... })\`, \`analyze({ aspect: "dependencies", ... })\`, \`blast_radius\`
|
|
666
664
|
3. **Evaluate** — Check all dimensions below
|
|
667
665
|
4. **Report** — Structured findings with verdict
|
|
@@ -906,7 +904,7 @@ For quality-sensitive tasks, use the execute→score→fix→re-score pattern:
|
|
|
906
904
|
1. Execute task (Build phase)
|
|
907
905
|
2. Score: check({}) + test_run({}) + evidence_map({ action: "gate" })
|
|
908
906
|
3. If gate != YIELD → fix issues → re-score (max 3 iterations)
|
|
909
|
-
4. Track progress: stash({ key: "iteration-N", value: { score, issues } })
|
|
907
|
+
4. Track progress: stash({ action: "set", key: "iteration-N", value: JSON.stringify({ score, issues }) })
|
|
910
908
|
|
|
911
909
|
Agents iterate until quality threshold is met, with diminishing returns tracked via stash.
|
|
912
910
|
|