@vpxa/aikit 0.1.16 → 0.1.17
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/structured-content-guard.d.ts +4 -2
- package/packages/server/dist/structured-content-guard.js +1 -1
- package/scaffold/definitions/agents.mjs +12 -5
- package/scaffold/definitions/bodies.mjs +3 -0
- package/scaffold/definitions/protocols.mjs +35 -10
- package/scaffold/general/agents/Architect-Reviewer-Alpha.agent.md +3 -2
- package/scaffold/general/agents/Architect-Reviewer-Beta.agent.md +3 -2
- package/scaffold/general/agents/Documenter.agent.md +8 -0
- package/scaffold/general/agents/Orchestrator.agent.md +1 -0
- package/scaffold/general/agents/Planner.agent.md +1 -0
- package/scaffold/general/agents/Refactor.agent.md +6 -0
- package/scaffold/general/agents/Researcher-Alpha.agent.md +4 -3
- package/scaffold/general/agents/Researcher-Beta.agent.md +4 -3
- package/scaffold/general/agents/Researcher-Delta.agent.md +4 -3
- package/scaffold/general/agents/Researcher-Gamma.agent.md +4 -3
- package/scaffold/general/agents/_shared/code-agent-base.md +29 -6
- package/scaffold/general/agents/_shared/researcher-base.md +6 -4
- package/scaffold/general/skills/aikit/SKILL.md +15 -8
package/package.json
CHANGED
|
@@ -14,8 +14,10 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
14
14
|
*
|
|
15
15
|
* UPDATE: The SDK uses passthrough-style validation which DOES reject
|
|
16
16
|
* unknown keys on strict schemas. Instead, we build a "zero-value"
|
|
17
|
-
* object from the registered outputSchema (
|
|
18
|
-
* passes validation.
|
|
17
|
+
* object from the registered outputSchema (Zod or JSON-Schema) so it
|
|
18
|
+
* always passes validation. Zod schemas expose `.shape` and `.type`
|
|
19
|
+
* differently from JSON-Schema's `.properties` and `.type` — the
|
|
20
|
+
* `buildZeroValue` function handles both formats.
|
|
19
21
|
*/
|
|
20
22
|
/**
|
|
21
23
|
* Wrap `server.registerTool` so that every handler result is guaranteed
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function e(e){let n=e.registerTool.bind(e);e.registerTool=(e,r,i)=>r?.outputSchema==null?n(e,r,i):n(e,r,async(e,n)=>{let a=await i(e,n);return a.structuredContent??=t(r.outputSchema),a})}function t(e){if(!e)return{};if(e.anyOf){let n=e.anyOf.find(e=>e.type!==`null`);return n?t(n):null}switch(e.type){case`object`:{let n={};if(
|
|
1
|
+
function e(e){let n=e.registerTool.bind(e);e.registerTool=(e,r,i)=>r?.outputSchema==null?n(e,r,i):n(e,r,async(e,n)=>{let a=await i(e,n);return a.structuredContent??=t(r.outputSchema),a})}function t(e){if(!e)return{};if(e.anyOf){let n=e.anyOf.find(e=>e.type!==`null`);return n?t(n):null}switch(e.type){case`object`:{let n={},r=e.properties??e.shape;if(r)for(let[e,i]of Object.entries(r))n[e]=t(i);return n}case`array`:return[];case`string`:return``;case`number`:case`integer`:return 0;case`boolean`:return!1;case`nullable`:return null;case`optional`:return;case`record`:return{};default:return{}}}export{e as installStructuredContentGuard};
|
|
@@ -75,6 +75,7 @@ export const AGENTS = {
|
|
|
75
75
|
toolRole: 'refactor',
|
|
76
76
|
sharedBase: 'code-agent-base',
|
|
77
77
|
category: 'implementation',
|
|
78
|
+
skills: [['aikit', '**Always** — AI Kit tool signatures, search, analysis']],
|
|
78
79
|
},
|
|
79
80
|
|
|
80
81
|
// ─── Diagnostics ──────────────────────────────────────────────────────
|
|
@@ -115,6 +116,10 @@ export const AGENTS = {
|
|
|
115
116
|
toolRole: 'documenter',
|
|
116
117
|
sharedBase: null,
|
|
117
118
|
category: 'documentation',
|
|
119
|
+
skills: [
|
|
120
|
+
['aikit', '**Always** — AI Kit tool signatures, search, analysis'],
|
|
121
|
+
['present', 'When presenting documentation previews or architecture visuals to the user'],
|
|
122
|
+
],
|
|
118
123
|
},
|
|
119
124
|
|
|
120
125
|
Explorer: {
|
|
@@ -139,9 +144,10 @@ export const AGENTS = {
|
|
|
139
144
|
sharedBase: 'researcher-base',
|
|
140
145
|
category: 'research',
|
|
141
146
|
skills: [
|
|
142
|
-
['
|
|
143
|
-
['
|
|
144
|
-
['
|
|
147
|
+
['aikit', '**Always** — AI Kit tool signatures, search, analysis'],
|
|
148
|
+
['lesson-learned', 'When analyzing past changes to extract engineering principles'],
|
|
149
|
+
['c4-architecture', 'When researching system architecture \u2014 produce C4 diagrams'],
|
|
150
|
+
['adr-skill', 'When the research involves a technical decision \u2014 draft an ADR'],
|
|
145
151
|
],
|
|
146
152
|
variants: {
|
|
147
153
|
Alpha: {
|
|
@@ -195,9 +201,10 @@ export const AGENTS = {
|
|
|
195
201
|
sharedBase: 'architect-reviewer-base',
|
|
196
202
|
category: 'review',
|
|
197
203
|
skills: [
|
|
198
|
-
['
|
|
204
|
+
['aikit', '**Always** — AI Kit tool signatures, search, analysis'],
|
|
205
|
+
['c4-architecture', 'When reviewing architectural diagrams or boundary changes'],
|
|
199
206
|
[
|
|
200
|
-
'
|
|
207
|
+
'adr-skill',
|
|
201
208
|
'When the review involves architecture decisions \u2014 reference or create ADRs',
|
|
202
209
|
],
|
|
203
210
|
],
|
|
@@ -167,6 +167,7 @@ Before every tool call, verify:
|
|
|
167
167
|
| Skill | When to load |
|
|
168
168
|
|-------|--------------|
|
|
169
169
|
| \`multi-agents-development\` | **Before any delegation** — task decomposition, dispatch templates, review pipeline, recovery patterns |
|
|
170
|
+
| \`present\` | When presenting plans, findings, or visual content to the user — dashboards, tables, charts, timelines |
|
|
170
171
|
| \`brainstorming\` | Before creative/design work (Phase 0) |
|
|
171
172
|
| \`session-handoff\` | Context filling up, session ending, or major milestone |
|
|
172
173
|
| \`lesson-learned\` | After completing work — extract engineering principles |
|
|
@@ -276,6 +277,7 @@ When subagents complete, their visual outputs (from \`present\`) are NOT visible
|
|
|
276
277
|
| Skill | When to load |
|
|
277
278
|
|-------|--------------|
|
|
278
279
|
| \`brainstorming\` | Before planning any new feature, component, or behavior change — use Visual Companion for architecture mockups |
|
|
280
|
+
| \`present\` | When presenting plans, dependency graphs, or complexity estimates to the user |
|
|
279
281
|
| \`requirements-clarity\` | When requirements are vague or complex (>2 days) — score 0-100 before committing to a plan |
|
|
280
282
|
| \`c4-architecture\` | When the plan involves architectural changes — generate C4 diagrams |
|
|
281
283
|
| \`adr-skill\` | When the plan involves non-trivial technical decisions — create executable ADRs |
|
|
@@ -459,6 +461,7 @@ When subagents complete, their visual outputs (from \`present\`) are NOT visible
|
|
|
459
461
|
|
|
460
462
|
| Skill | When to load |
|
|
461
463
|
|-------|--------------|
|
|
464
|
+
| \`present\` | When presenting documentation previews, API tables, or architecture visuals to the user |
|
|
462
465
|
| \`c4-architecture\` | When documenting system architecture — generate C4 Mermaid diagrams |
|
|
463
466
|
| \`adr-skill\` | When documenting architecture decisions — create or update ADRs |
|
|
464
467
|
| \`typescript\` | When documenting TypeScript APIs — type signatures, JSDoc patterns |`,
|
|
@@ -91,9 +91,11 @@ Your agent file lists domain-specific skills in the **Skills** section. Load the
|
|
|
91
91
|
|
|
92
92
|
1. Check if the current task matches a listed skill trigger
|
|
93
93
|
2. If yes → load the skill file before starting implementation
|
|
94
|
-
3. The
|
|
94
|
+
3. The following skills are **foundational** — always loaded, do not re-load:
|
|
95
|
+
- **\`aikit\`** — AI Kit MCP tool reference, search strategies, compression workflows, session protocol. **Required for all tool usage.**
|
|
96
|
+
- **\`present\`** — Rich content rendering (dashboards, tables, charts, timelines). **Required when producing visual output for the user.**
|
|
95
97
|
|
|
96
|
-
> If no skills are listed for your agent, rely on AI Kit tools and onboard artifacts.
|
|
98
|
+
> If no additional skills are listed for your agent, rely on AI Kit tools and onboard artifacts.
|
|
97
99
|
|
|
98
100
|
---
|
|
99
101
|
|
|
@@ -135,12 +137,32 @@ list() // see all stored knowledge entries
|
|
|
135
137
|
| \`symbol({ name })\` | Find symbol definition + references |
|
|
136
138
|
| \`trace({ symbol, direction })\` | Follow call graph forward/backward |
|
|
137
139
|
| \`compact({ path, query })\` | Read specific section of a file |
|
|
138
|
-
| \`read_file\` | **
|
|
140
|
+
| \`read_file\` | **ONLY** when you need exact lines for a pending edit |
|
|
139
141
|
|
|
140
142
|
### Step 4: Tool Discovery
|
|
141
143
|
|
|
142
144
|
If unsure which AI Kit tool to use → run \`guide({ topic: "what you need" })\` for recommendations.
|
|
143
145
|
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## PROHIBITED: Native File Reading Tools
|
|
149
|
+
|
|
150
|
+
**\`read_file\` / \`read_file_raw\` MUST NOT be used to understand code.** They waste tokens and miss structural information that AI Kit tools provide.
|
|
151
|
+
|
|
152
|
+
| ❌ NEVER do this | ✅ Do this instead | Why |
|
|
153
|
+
|---|---|---|
|
|
154
|
+
| \`read_file\` to understand a file | \`file_summary({ path })\` | Structure, exports, imports, call edges — **10x fewer tokens** |
|
|
155
|
+
| \`read_file\` to find specific code | \`compact({ path, query })\` | Server-side read + semantic extract — **5-20x reduction** |
|
|
156
|
+
| Multiple \`read_file\` calls | \`digest({ sources })\` | Compresses multiple files into token-budgeted summary |
|
|
157
|
+
| \`grep_search\` / \`textSearch\` | \`search({ query })\` | Hybrid search across all indexed + curated content |
|
|
158
|
+
| \`grep_search\` for a symbol | \`symbol({ name })\` | Definition + references with scope context |
|
|
159
|
+
| Manual code tracing | \`trace({ start, direction })\` | AST call-graph traversal |
|
|
160
|
+
| Line counting / \`wc\` | \`measure({ path })\` | Lines, functions, cognitive complexity |
|
|
161
|
+
| \`fetch_webpage\` | \`web_fetch({ urls })\` | Readability extract + token budget |
|
|
162
|
+
| Web research / browsing | \`web_search({ queries })\` | Structured web results without browser |
|
|
163
|
+
|
|
164
|
+
**The ONLY acceptable use of \`read_file\`:** Reading exact lines immediately before an edit operation (e.g., to verify the \`old_str\` for a replacement). Even then, use \`file_summary\` first to identify which lines to read.
|
|
165
|
+
|
|
144
166
|
## FORGE Protocol (Quality Gate)
|
|
145
167
|
|
|
146
168
|
**Quick reference:**
|
|
@@ -239,10 +261,11 @@ For outdated AI Kit entries → \`update(path, content, reason)\`
|
|
|
239
261
|
|
|
240
262
|
## Context Efficiency
|
|
241
263
|
|
|
242
|
-
|
|
243
|
-
- **\`
|
|
264
|
+
**NEVER use \`read_file\` to understand code.** Use the AI Kit compression tools:
|
|
265
|
+
- **\`file_summary({ path })\`** — Structure, exports, imports (~50 tokens vs ~1000+ for read_file)
|
|
266
|
+
- **\`compact({ path, query })\`** — Extract relevant sections from a single file (5-20x token reduction)
|
|
244
267
|
- **\`digest({ sources })\`** — Compress 3+ files into a single token-budgeted summary
|
|
245
|
-
- **\`stratum_card({
|
|
268
|
+
- **\`stratum_card({ files, query })\`** — Generate a reusable T1/T2 context card for files you'll reference repeatedly
|
|
246
269
|
|
|
247
270
|
**Session phases** — structure your work to minimize context bloat:
|
|
248
271
|
|
|
@@ -424,10 +447,12 @@ When invoked for a decision analysis, you receive a specific question. You MUST:
|
|
|
424
447
|
|
|
425
448
|
## Context Efficiency
|
|
426
449
|
|
|
427
|
-
- **
|
|
428
|
-
-
|
|
429
|
-
-
|
|
430
|
-
-
|
|
450
|
+
- **NEVER use \`read_file\` to understand code** — use AI Kit compression tools instead
|
|
451
|
+
- **\`file_summary\`** for structure (exports, imports, call edges — 10x fewer tokens)
|
|
452
|
+
- **\`compact\`** for specific sections (5-20x token reduction vs read_file)
|
|
453
|
+
- **\`digest\`** when synthesizing from 3+ sources
|
|
454
|
+
- **\`stratum_card\`** for files you'll reference repeatedly
|
|
455
|
+
- **\`read_file\` is ONLY acceptable** when you need exact lines for a pending edit operation
|
|
431
456
|
`,
|
|
432
457
|
|
|
433
458
|
'code-reviewer-base': `# Code-Reviewer — Shared Base Instructions
|
|
@@ -17,8 +17,9 @@ You are **not** the Code-Reviewer agent. Code-Reviewer handles correctness, test
|
|
|
17
17
|
|
|
18
18
|
| Skill | When to load |
|
|
19
19
|
|-------|--------------|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
20
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
21
|
+
| c4-architecture | When reviewing architectural diagrams or boundary changes |
|
|
22
|
+
| adr-skill | When the review involves architecture decisions — reference or create ADRs |
|
|
22
23
|
|
|
23
24
|
## Flows
|
|
24
25
|
|
|
@@ -17,8 +17,9 @@ You are **not** the Code-Reviewer agent. Code-Reviewer handles correctness, test
|
|
|
17
17
|
|
|
18
18
|
| Skill | When to load |
|
|
19
19
|
|-------|--------------|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
20
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
21
|
+
| c4-architecture | When reviewing architectural diagrams or boundary changes |
|
|
22
|
+
| adr-skill | When the review involves architecture decisions — reference or create ADRs |
|
|
22
23
|
|
|
23
24
|
## Flows
|
|
24
25
|
|
|
@@ -49,9 +49,17 @@ You are the **Documenter**, documentation specialist that creates and maintains
|
|
|
49
49
|
|
|
50
50
|
| Skill | When to load |
|
|
51
51
|
|-------|--------------|
|
|
52
|
+
| `present` | When presenting documentation previews, API tables, or architecture visuals to the user |
|
|
52
53
|
| `c4-architecture` | When documenting system architecture — generate C4 Mermaid diagrams |
|
|
53
54
|
| `adr-skill` | When documenting architecture decisions — create or update ADRs |
|
|
54
55
|
| `typescript` | When documenting TypeScript APIs — type signatures, JSDoc patterns |
|
|
56
|
+
## Skills (load on demand)
|
|
57
|
+
|
|
58
|
+
| Skill | When to load |
|
|
59
|
+
|-------|--------------|
|
|
60
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
61
|
+
| present | When presenting documentation previews or architecture visuals to the user |
|
|
62
|
+
|
|
55
63
|
|
|
56
64
|
## Flows
|
|
57
65
|
|
|
@@ -184,6 +184,7 @@ Before every tool call, verify:
|
|
|
184
184
|
| Skill | When to load |
|
|
185
185
|
|-------|--------------|
|
|
186
186
|
| `multi-agents-development` | **Before any delegation** — task decomposition, dispatch templates, review pipeline, recovery patterns |
|
|
187
|
+
| `present` | When presenting plans, findings, or visual content to the user — dashboards, tables, charts, timelines |
|
|
187
188
|
| `brainstorming` | Before creative/design work (Phase 0) |
|
|
188
189
|
| `session-handoff` | Context filling up, session ending, or major milestone |
|
|
189
190
|
| `lesson-learned` | After completing work — extract engineering principles |
|
|
@@ -87,6 +87,7 @@ When subagents complete, their visual outputs (from `present`) are NOT visible t
|
|
|
87
87
|
| Skill | When to load |
|
|
88
88
|
|-------|--------------|
|
|
89
89
|
| `brainstorming` | Before planning any new feature, component, or behavior change — use Visual Companion for architecture mockups |
|
|
90
|
+
| `present` | When presenting plans, dependency graphs, or complexity estimates to the user |
|
|
90
91
|
| `requirements-clarity` | When requirements are vague or complex (>2 days) — score 0-100 before committing to a plan |
|
|
91
92
|
| `c4-architecture` | When the plan involves architectural changes — generate C4 diagrams |
|
|
92
93
|
| `adr-skill` | When the plan involves non-trivial technical decisions — create executable ADRs |
|
|
@@ -35,6 +35,12 @@ You are the **Refactor**, code refactoring specialist that improves structure, r
|
|
|
35
35
|
|-------|--------------|
|
|
36
36
|
| `lesson-learned` | After completing a refactor — extract principles from the before/after diff |
|
|
37
37
|
| `typescript` | When refactoring TypeScript code — type patterns, generics, utility types |
|
|
38
|
+
## Skills (load on demand)
|
|
39
|
+
|
|
40
|
+
| Skill | When to load |
|
|
41
|
+
|-------|--------------|
|
|
42
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
43
|
+
|
|
38
44
|
|
|
39
45
|
## Flows
|
|
40
46
|
|
|
@@ -15,9 +15,10 @@ You are **Researcher-Alpha**, the primary deep research agent. During multi-mode
|
|
|
15
15
|
|
|
16
16
|
| Skill | When to load |
|
|
17
17
|
|-------|--------------|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
18
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
19
|
+
| lesson-learned | When analyzing past changes to extract engineering principles |
|
|
20
|
+
| c4-architecture | When researching system architecture — produce C4 diagrams |
|
|
21
|
+
| adr-skill | When the research involves a technical decision — draft an ADR |
|
|
21
22
|
|
|
22
23
|
## Flows
|
|
23
24
|
|
|
@@ -15,9 +15,10 @@ You are **Researcher-Beta**, a variant of the Researcher agent optimized for **p
|
|
|
15
15
|
|
|
16
16
|
| Skill | When to load |
|
|
17
17
|
|-------|--------------|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
18
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
19
|
+
| lesson-learned | When analyzing past changes to extract engineering principles |
|
|
20
|
+
| c4-architecture | When researching system architecture — produce C4 diagrams |
|
|
21
|
+
| adr-skill | When the research involves a technical decision — draft an ADR |
|
|
21
22
|
|
|
22
23
|
## Flows
|
|
23
24
|
|
|
@@ -15,9 +15,10 @@ You are **Researcher-Delta**, a variant of the Researcher agent optimized for **
|
|
|
15
15
|
|
|
16
16
|
| Skill | When to load |
|
|
17
17
|
|-------|--------------|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
18
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
19
|
+
| lesson-learned | When analyzing past changes to extract engineering principles |
|
|
20
|
+
| c4-architecture | When researching system architecture — produce C4 diagrams |
|
|
21
|
+
| adr-skill | When the research involves a technical decision — draft an ADR |
|
|
21
22
|
|
|
22
23
|
## Flows
|
|
23
24
|
|
|
@@ -15,9 +15,10 @@ You are **Researcher-Gamma**, a variant of the Researcher agent optimized for **
|
|
|
15
15
|
|
|
16
16
|
| Skill | When to load |
|
|
17
17
|
|-------|--------------|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
18
|
+
| aikit | **Always** — AI Kit tool signatures, search, analysis |
|
|
19
|
+
| lesson-learned | When analyzing past changes to extract engineering principles |
|
|
20
|
+
| c4-architecture | When researching system architecture — produce C4 diagrams |
|
|
21
|
+
| adr-skill | When the research involves a technical decision — draft an ADR |
|
|
21
22
|
|
|
22
23
|
## Flows
|
|
23
24
|
|
|
@@ -83,9 +83,11 @@ Your agent file lists domain-specific skills in the **Skills** section. Load the
|
|
|
83
83
|
|
|
84
84
|
1. Check if the current task matches a listed skill trigger
|
|
85
85
|
2. If yes → load the skill file before starting implementation
|
|
86
|
-
3. The
|
|
86
|
+
3. The following skills are **foundational** — always loaded, do not re-load:
|
|
87
|
+
- **`aikit`** — AI Kit MCP tool reference, search strategies, compression workflows, session protocol. **Required for all tool usage.**
|
|
88
|
+
- **`present`** — Rich content rendering (dashboards, tables, charts, timelines). **Required when producing visual output for the user.**
|
|
87
89
|
|
|
88
|
-
> If no skills are listed for your agent, rely on AI Kit tools and onboard artifacts.
|
|
90
|
+
> If no additional skills are listed for your agent, rely on AI Kit tools and onboard artifacts.
|
|
89
91
|
|
|
90
92
|
---
|
|
91
93
|
|
|
@@ -127,12 +129,32 @@ list() // see all stored knowledge entries
|
|
|
127
129
|
| `symbol({ name })` | Find symbol definition + references |
|
|
128
130
|
| `trace({ symbol, direction })` | Follow call graph forward/backward |
|
|
129
131
|
| `compact({ path, query })` | Read specific section of a file |
|
|
130
|
-
| `read_file` | **
|
|
132
|
+
| `read_file` | **ONLY** when you need exact lines for a pending edit |
|
|
131
133
|
|
|
132
134
|
### Step 4: Tool Discovery
|
|
133
135
|
|
|
134
136
|
If unsure which AI Kit tool to use → run `guide({ topic: "what you need" })` for recommendations.
|
|
135
137
|
|
|
138
|
+
---
|
|
139
|
+
|
|
140
|
+
## PROHIBITED: Native File Reading Tools
|
|
141
|
+
|
|
142
|
+
**`read_file` / `read_file_raw` MUST NOT be used to understand code.** They waste tokens and miss structural information that AI Kit tools provide.
|
|
143
|
+
|
|
144
|
+
| ❌ NEVER do this | ✅ Do this instead | Why |
|
|
145
|
+
|---|---|---|
|
|
146
|
+
| `read_file` to understand a file | `file_summary({ path })` | Structure, exports, imports, call edges — **10x fewer tokens** |
|
|
147
|
+
| `read_file` to find specific code | `compact({ path, query })` | Server-side read + semantic extract — **5-20x reduction** |
|
|
148
|
+
| Multiple `read_file` calls | `digest({ sources })` | Compresses multiple files into token-budgeted summary |
|
|
149
|
+
| `grep_search` / `textSearch` | `search({ query })` | Hybrid search across all indexed + curated content |
|
|
150
|
+
| `grep_search` for a symbol | `symbol({ name })` | Definition + references with scope context |
|
|
151
|
+
| Manual code tracing | `trace({ start, direction })` | AST call-graph traversal |
|
|
152
|
+
| Line counting / `wc` | `measure({ path })` | Lines, functions, cognitive complexity |
|
|
153
|
+
| `fetch_webpage` | `web_fetch({ urls })` | Readability extract + token budget |
|
|
154
|
+
| Web research / browsing | `web_search({ queries })` | Structured web results without browser |
|
|
155
|
+
|
|
156
|
+
**The ONLY acceptable use of `read_file`:** Reading exact lines immediately before an edit operation (e.g., to verify the `old_str` for a replacement). Even then, use `file_summary` first to identify which lines to read.
|
|
157
|
+
|
|
136
158
|
## FORGE Protocol (Quality Gate)
|
|
137
159
|
|
|
138
160
|
**Quick reference:**
|
|
@@ -231,10 +253,11 @@ For outdated AI Kit entries → `update(path, content, reason)`
|
|
|
231
253
|
|
|
232
254
|
## Context Efficiency
|
|
233
255
|
|
|
234
|
-
|
|
235
|
-
- **`
|
|
256
|
+
**NEVER use `read_file` to understand code.** Use the AI Kit compression tools:
|
|
257
|
+
- **`file_summary({ path })`** — Structure, exports, imports (~50 tokens vs ~1000+ for read_file)
|
|
258
|
+
- **`compact({ path, query })`** — Extract relevant sections from a single file (5-20x token reduction)
|
|
236
259
|
- **`digest({ sources })`** — Compress 3+ files into a single token-budgeted summary
|
|
237
|
-
- **`stratum_card({
|
|
260
|
+
- **`stratum_card({ files, query })`** — Generate a reusable T1/T2 context card for files you'll reference repeatedly
|
|
238
261
|
|
|
239
262
|
**Session phases** — structure your work to minimize context bloat:
|
|
240
263
|
|
|
@@ -94,8 +94,10 @@ When invoked for a decision analysis, you receive a specific question. You MUST:
|
|
|
94
94
|
|
|
95
95
|
## Context Efficiency
|
|
96
96
|
|
|
97
|
-
- **
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
-
|
|
97
|
+
- **NEVER use `read_file` to understand code** — use AI Kit compression tools instead
|
|
98
|
+
- **`file_summary`** for structure (exports, imports, call edges — 10x fewer tokens)
|
|
99
|
+
- **`compact`** for specific sections (5-20x token reduction vs read_file)
|
|
100
|
+
- **`digest`** when synthesizing from 3+ sources
|
|
101
|
+
- **`stratum_card`** for files you'll reference repeatedly
|
|
102
|
+
- **`read_file` is ONLY acceptable** when you need exact lines for a pending edit operation
|
|
101
103
|
|
|
@@ -278,12 +278,18 @@ install: []
|
|
|
278
278
|
|
|
279
279
|
## CRITICAL: Use AI Kit Tools Instead of Native IDE Tools
|
|
280
280
|
|
|
281
|
-
AI Kit tools provide **10x richer output** than native IDE tools — with AST-analyzed call graphs, scope context, import classification, and cognitive complexity. **
|
|
281
|
+
AI Kit tools provide **10x richer output** than native IDE tools — with AST-analyzed call graphs, scope context, import classification, and cognitive complexity. **You MUST use AI Kit tools instead of native read/search tools.**
|
|
282
|
+
|
|
283
|
+
### ⛔ PROHIBITED: Native File Reading
|
|
284
|
+
|
|
285
|
+
**`read_file` / `read_file_raw` MUST NOT be used to understand code.** They waste tokens and miss structural information.
|
|
286
|
+
|
|
287
|
+
The **ONLY** acceptable use of `read_file`: getting exact lines immediately before an edit (to verify the `old_str` for replacement). Even then, use `file_summary` first to identify which lines to read.
|
|
282
288
|
|
|
283
289
|
### Tool Replacement Table
|
|
284
290
|
|
|
285
|
-
|
|
|
286
|
-
|
|
291
|
+
| ❌ NEVER do this | ✅ Use AI Kit Tool | Why |
|
|
292
|
+
|---|---|---|
|
|
287
293
|
| `read_file` (full file) | `file_summary` | Exports, imports, call edges — **10x fewer tokens** |
|
|
288
294
|
| `read_file` (specific section) | `compact({ path, query })` | Server-side read + extract — **5-20x reduction** |
|
|
289
295
|
| `grep_search` / `textSearch` | `search` | Semantic + keyword hybrid across all indexed content |
|
|
@@ -301,11 +307,12 @@ AI Kit tools provide **10x richer output** than native IDE tools — with AST-an
|
|
|
301
307
|
|
|
302
308
|
```
|
|
303
309
|
Need to understand a file?
|
|
304
|
-
├─ Just structure?
|
|
305
|
-
├─ Specific section?
|
|
306
|
-
├─ Multiple files?
|
|
307
|
-
├─ Repeated reference?
|
|
308
|
-
|
|
310
|
+
├─ Just structure? → file_summary (exports, imports, call edges — ~50 tokens)
|
|
311
|
+
├─ Specific section? → compact({ path, query }) — 5-20x reduction
|
|
312
|
+
├─ Multiple files? → digest (multi-source compression — token-budgeted)
|
|
313
|
+
├─ Repeated reference? → stratum_card (T1/T2 card — 10-100x reduction)
|
|
314
|
+
├─ Need exact lines to EDIT? → read_file (the ONLY acceptable use)
|
|
315
|
+
└─ "I want to read the whole file" → ⛔ STOP. Use file_summary or compact instead.
|
|
309
316
|
```
|
|
310
317
|
|
|
311
318
|
### What AI Kit Tools Return (AST-Enhanced)
|