@vpxa/aikit 0.1.347 → 0.1.349

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.
Files changed (53) hide show
  1. package/package.json +2 -1
  2. package/packages/cli/dist/index.js +19 -19
  3. package/packages/cli/dist/{init-BZHwK5rv.js → init-D5TsG2R6.js} +1 -1
  4. package/packages/cli/dist/{templates-DxyYPlMl.js → templates-CztsaGb2.js} +25 -25
  5. package/packages/core/dist/index.d.ts +17 -1
  6. package/packages/core/dist/index.js +1 -1
  7. package/packages/server/dist/bin.js +6 -6
  8. package/packages/server/dist/config-4M54ZAT8.js +2 -0
  9. package/packages/server/dist/config-BXd38nVn.js +1 -0
  10. package/packages/server/dist/index.js +2 -2
  11. package/packages/server/dist/prelude-DpX0QnqF.js +2 -0
  12. package/packages/server/dist/prelude-pJPHXvnQ.js +1 -0
  13. package/packages/server/dist/proxy.js +7 -7
  14. package/packages/server/dist/routes-9KnBpwfe.js +6 -0
  15. package/packages/server/dist/routes-B8hTXXR8.js +5 -0
  16. package/packages/server/dist/sampling-9GcILoHr.js +2 -0
  17. package/packages/server/dist/sampling-DuXB6-rK.js +1 -0
  18. package/packages/server/dist/{server-Bme4eBy1.js → server-BYZo2XjK.js} +158 -163
  19. package/packages/server/dist/{server-B9PIl5SY.js → server-BtRv0mbH.js} +158 -163
  20. package/packages/server/dist/{server-http-rK25FoUm.js → server-http-CatdRS-N.js} +1 -1
  21. package/packages/server/dist/{server-http-C7PO0D_V.js → server-http-L_WQ9v_b.js} +1 -1
  22. package/packages/server/dist/{server-stdio-BVxXXgvL.js → server-stdio-CZuGZR4e.js} +1 -1
  23. package/packages/server/dist/{server-stdio-OQL2grn7.js → server-stdio-avLmmdEi.js} +1 -1
  24. package/packages/server/dist/version-check-B6bui-YI.js +1 -0
  25. package/packages/server/dist/version-check-CZ5hY6R2.js +2 -0
  26. package/packages/server/dist/workspace-bootstrap-B57Oz40_.js +1 -0
  27. package/packages/tools/dist/index.d.ts +64 -27
  28. package/packages/tools/dist/index.js +95 -97
  29. package/scaffold/dist/adapters/hermes-agent.mjs +1 -1
  30. package/scaffold/dist/adapters/hermes.mjs +1 -1
  31. package/scaffold/dist/definitions/agents.mjs +1 -1
  32. package/scaffold/dist/definitions/bodies.mjs +39 -35
  33. package/scaffold/dist/definitions/flows.mjs +7 -7
  34. package/scaffold/dist/definitions/prompts.mjs +7 -7
  35. package/scaffold/dist/definitions/protocols.mjs +9 -9
  36. package/scaffold/dist/definitions/skills/aikit.mjs +22 -21
  37. package/scaffold/dist/definitions/skills/c4-architecture.mjs +1 -1
  38. package/scaffold/dist/definitions/skills/docs.mjs +5 -5
  39. package/scaffold/dist/definitions/skills/multi-agents-development.mjs +9 -9
  40. package/scaffold/dist/definitions/tools.mjs +1 -1
  41. package/scaffold/general/hooks/scripts/subagent-context.mjs +1 -1
  42. package/packages/server/dist/config-BsS-77rp.js +0 -2
  43. package/packages/server/dist/config-Ds28Hvip.js +0 -1
  44. package/packages/server/dist/prelude-B58MO48q.js +0 -1
  45. package/packages/server/dist/prelude-HRPwDugi.js +0 -2
  46. package/packages/server/dist/routes-C7bDyCOW.js +0 -5
  47. package/packages/server/dist/routes-CfG5gdSR.js +0 -6
  48. package/packages/server/dist/sampling-DvrIzeWt.js +0 -1
  49. package/packages/server/dist/sampling-lH0Mam1_.js +0 -2
  50. package/packages/server/dist/version-check-BjFqR01r.js +0 -1
  51. package/packages/server/dist/version-check-_2wmedTl.js +0 -2
  52. package/packages/server/dist/workspace-bootstrap-BJloolzr.js +0 -1
  53. package/scaffold/INSTRUCTIONS.md +0 -273
@@ -1,273 +0,0 @@
1
- # Scaffold Instruction Authoring Guide
2
-
3
- This folder is the source of truth for generated agent, skill, prompt, hook, and flow instructions. Future edits must improve instruction adherence, platform parity, and token efficiency without removing behavior that makes agents safer or smarter.
4
-
5
- Use this guide when changing source instructions in `scaffold/definitions/`, adapters in `scaffold/adapters/`, or generated previews from `node scaffold/generate.mjs`.
6
-
7
- ## Source Of Truth Map
8
-
9
- | Need | Edit |
10
- | --- | --- |
11
- | Agent roster, routing metadata, models, skills | [definitions/agents.mjs](definitions/agents.mjs) |
12
- | Agent body text and mode behavior | [definitions/bodies.mjs](definitions/bodies.mjs) |
13
- | Shared agent kernels and long protocols | [definitions/protocols.mjs](definitions/protocols.mjs) |
14
- | Global policies and generated instruction sections | [definitions/policies.mjs](definitions/policies.mjs) |
15
- | Skill `SKILL.md`, refs, assets, scripts | [definitions/skills/](definitions/skills/) |
16
- | Prompt templates | [definitions/prompts.mjs](definitions/prompts.mjs) |
17
- | Platform-specific output shape | [adapters/](adapters/) |
18
- | Generated preview/output | [_preview/](_preview/) and generated platform folders |
19
-
20
- Never treat generated platform files as source. Change definitions/adapters, then regenerate.
21
-
22
- ## Prime Rules
23
-
24
- 1. Optimize for adherence, not raw brevity. Short text that loses a gate, protocol, or routing cue is worse.
25
- 2. Compress protocols; do not amputate them. Replace repeated prose with one canonical kernel, coverage map, or progressive reference.
26
- 3. Keep one source of truth per concept. Metadata routes agents/skills; bodies describe behavior; protocols hold reusable operating rules.
27
- 4. Preserve cross-platform parity. Copilot, Codex, Claude Code, Gemini, OpenCode, Zed, IntelliJ, Hermes, and Hermes-agent may format differently, but must carry equivalent semantics.
28
- 5. Make subagents robust with fresh context. Every subagent must know scope, boundaries, output shape, validation duty, and whether it can edit files.
29
- 6. Prefer progressive disclosure. Put hot-path rules in `SKILL.md` or agent body; put deep procedures in refs/scripts/assets.
30
- 7. Reduce `HARD`, `MUST`, and repeated warnings. Use priority only for true gates. Too many absolute rules blur attention.
31
- 8. Preserve exact technical terms. Do not shorten tool names, protocol names, file paths, model names, or error strings.
32
-
33
- ## Agent Authoring
34
-
35
- ### Orchestrator
36
-
37
- Orchestrator is usually the main agent. It plans, decomposes, dispatches, gates quality, coordinates review, presents outcomes, and protects user intent.
38
-
39
- Keep Orchestrator strong on:
40
-
41
- - No direct implementation unless explicitly scoped as trivial.
42
- - Task decomposition with clear ownership, success criteria, and validation.
43
- - Subagent dispatch envelopes that include task id, scope, constraints, expected output, tool/skill needs, and communication style.
44
- - Protocol coverage for conversation compression, decision protocol, FORGE quality gates, thinking principles, multi-agent development, presentation, session handoff, and lesson capture.
45
- - User style propagation. If user activates terse/caveman style or another response style, Orchestrator must embed it in subagent instructions and tell subagents to follow it unless safety clarity needs full prose.
46
-
47
- Do not remove Orchestrator protocols only because they cost tokens. If a long protocol is not on the hot path, replace it with a compact coverage map plus reference, not deletion.
48
-
49
- ### Planner
50
-
51
- Planner may run as main agent or subagent. It produces plans, tests, specs, and sequencing. It should not implement unless an explicit flow step says so.
52
-
53
- Keep Planner aligned with Orchestrator:
54
-
55
- - Accept Orchestrator handoff fields and preserve task id/evidence.
56
- - Produce actionable steps, validation gates, dependencies, and risk notes.
57
- - Avoid flow advancement when acting as a subagent unless explicitly authorized.
58
-
59
- ### Implementation Agents
60
-
61
- Implementer, Frontend, Refactor, Debugger, Security, and Documenter often run as subagents. They still need direct-run behavior for users who invoke them alone.
62
-
63
- Each implementation agent should state:
64
-
65
- - Primary job and non-goals.
66
- - Whether it may edit files.
67
- - Which skills to load from metadata.
68
- - Validation expected before final response.
69
- - Output shape for main-agent mode and subagent mode.
70
- - Stop condition when scope is unclear or unsafe.
71
-
72
- Do not duplicate full skill tables inside bodies. `definitions/agents.mjs` owns skill routing. Body text may mention critical skill categories only when behavior depends on them.
73
-
74
- ### Research And Review Agents
75
-
76
- Researchers and reviewers must be independent enough to disagree with plans.
77
-
78
- Keep:
79
-
80
- - Evidence-first output.
81
- - Assumptions separated from verified claims.
82
- - No implementation unless explicitly requested.
83
- - Clear severity/risk ranking for review agents.
84
- - Complementary lenses across Alpha/Beta variants.
85
-
86
- ## Skill Authoring
87
-
88
- Skills are progressive instructions. `SKILL.md` should be concise enough to load often, but complete enough to route work safely.
89
-
90
- Each skill should include:
91
-
92
- - When to use it and when not to use it.
93
- - Required setup or tool preference.
94
- - Minimal workflow.
95
- - Output or handoff shape.
96
- - Validation or quality bar.
97
- - References/scripts/assets to load only when needed.
98
-
99
- Use refs/assets/scripts for detail. Do not delete them for token savings if they support rare but important paths. Token efficiency comes from loading them conditionally.
100
-
101
- When adding or renaming a skill:
102
-
103
- 1. Add or update the module under [definitions/skills/](definitions/skills/).
104
- 2. Export it from [definitions/skills/index.mjs](definitions/skills/index.mjs).
105
- 3. Add metadata references in [definitions/agents.mjs](definitions/agents.mjs) only for agents that should actually load it.
106
- 4. Regenerate and verify generated skill files across relevant platforms.
107
-
108
- ## Prompt Authoring
109
-
110
- Prompts should launch work, not duplicate entire agents.
111
-
112
- Good prompts include:
113
-
114
- - Goal.
115
- - Scope and constraints.
116
- - Required agent/skill/tool path.
117
- - Acceptance criteria.
118
- - Validation command or evidence requirement.
119
- - Output shape.
120
-
121
- Avoid:
122
-
123
- - Repeating full Orchestrator or protocol bodies.
124
- - Platform-specific assumptions unless prompt is platform-specific.
125
- - Open-ended "do your best" wording without success criteria.
126
-
127
- ## Skill Reference Pattern
128
-
129
- Skills follow the [Anthropic skills specification](https://github.com/anthropics/skills/tree/main/skills/skill-creator):
130
-
131
- ```
132
- skill-name/
133
- SKILL.md ← main skill body (hot-path instructions)
134
- references/ ← deep-dive details, examples, schemas (loaded conditionally)
135
- scripts/ ← executable scripts
136
- assets/ ← templates, images, static files
137
- ```
138
-
139
- In the scaffold system, each skill is a `.mjs` file that exports an array of `{ file, content }` objects:
140
-
141
- ```js
142
- export default [
143
- { file: 'SKILL.md', content: '...main body...' },
144
- { file: 'references/deep-dive.md', content: '...detailed reference...' },
145
- { file: 'scripts/helper.mjs', content: '...executable...' },
146
- ];
147
- ```
148
-
149
- The `file` field is relative to the skill's output directory. The scaffold `generateSkills` adapter reads these arrays and writes the actual files.
150
-
151
- ### When to put content in references vs SKILL.md
152
-
153
- | Content type | Where | Why |
154
- |---|---|---|
155
- | Trigger rules, core workflow, quality bar, output shape | `SKILL.md` | Hot-path — loaded every time the skill is activated |
156
- | Full examples, detailed step-by-step, format catalogs, schemas | `references/*.md` | Progressive disclosure — loaded only when needed |
157
- | Executable helpers, transforms, generators | `scripts/*.mjs` | Run, not read |
158
- | Templates, images, static data | `assets/` | Referenced, not inlined |
159
-
160
- ### Rules
161
-
162
- - `SKILL.md` should be concise enough to load often, complete enough to route work safely.
163
- - Move deep procedures to refs; do not delete them. Token efficiency comes from loading them conditionally.
164
- - Protocol refs in `scaffold/definitions/refs/` may use dual exports: a named `const` for inlining into `protocols.mjs` + a `default` array for file generation.
165
- - Never create hand-written `.md` reference files — `.mjs` is the source of truth.
166
-
167
- ## Protocol And Kernel Authoring
168
-
169
- Shared protocols exist because repeated body text drifts. Keep reusable behavior in [definitions/protocols.mjs](definitions/protocols.mjs).
170
-
171
- Use:
172
-
173
- - Shared base kernels for generic subagent behavior.
174
- - Compact role kernels for code, research, review, architecture, docs, and diagnostics.
175
- - Coverage maps for long protocols that must remain active but do not need full in-body repetition.
176
- - Full protocol text where generated platform root docs or adapters need it.
177
-
178
- Before removing any `sharedProtocols` entry, prove one of these:
179
-
180
- - Same protocol is still included by platform-level instructions.
181
- - Same behavior is represented in a compact coverage map and tested.
182
- - Protocol is obsolete and no agent relies on it.
183
-
184
- If proof is missing, do not remove it.
185
-
186
- ## Platform Adapter Rules
187
-
188
- Adapters may emit different file layouts, but semantic coverage must match.
189
-
190
- Watch these risks:
191
-
192
- - Copilot may inline shared protocols and generated agent files.
193
- - Zed, IntelliJ, Hermes, and prompt-style adapters can under-generate bodies if they skip `AGENT_BODIES`.
194
- - Hermes-agent and Copilot should not emit unused `_shared` files unless generated files reference them.
195
- - Skill assets may be embedded or copied depending on platform; verify final `SKILL.md` still points to working refs/assets/scripts.
196
-
197
- Adapter changes need cross-platform checks, not only Copilot checks.
198
-
199
- ## Verification Checklist
200
-
201
- Run only the commands needed for the change size, but do not skip parity checks after instruction architecture changes.
202
-
203
- ```bash
204
- node scaffold/generate.mjs
205
- ```
206
-
207
- For instruction source syntax:
208
-
209
- ```bash
210
- node -e "import('./scaffold/definitions/agents.mjs')"
211
- node -e "import('./scaffold/definitions/bodies.mjs')"
212
- node -e "import('./scaffold/definitions/protocols.mjs')"
213
- node -e "import('./scaffold/definitions/prompts.mjs')"
214
- ```
215
-
216
- For project validation:
217
-
218
- ```bash
219
- node scripts/build.mjs
220
- npx tsc --noEmit
221
- npx biome check .
222
- ```
223
-
224
- Prefer AI Kit wrappers when available:
225
-
226
- - `check({})` for typecheck and lint.
227
- - `test_run({})` for tests.
228
- - `blast_radius({ changed_files })` for impact.
229
- - `reindex({})` after source changes that affect indexed knowledge.
230
-
231
- Note: root Vitest config may exclude `scaffold/__tests__`. If scaffold tests do not run through `test_run`, use direct Node assertions or update test config intentionally.
232
-
233
- ## Quality Review Questions
234
-
235
- Ask these before finalizing:
236
-
237
- - Does each agent know what to do, when to stop, and what output to return?
238
- - Can each subagent complete its task with only a dispatch envelope and local instructions?
239
- - Did optimization remove duplication without removing protocol coverage?
240
- - Are skills routed through metadata instead of duplicated in prose?
241
- - Are long details progressively disclosed through refs/assets/scripts?
242
- - Do all platform outputs carry equivalent agent bodies, protocols, skills, and prompts?
243
- - Did generated files change only because definitions/adapters changed?
244
- - Is every changed line tied to user value?
245
-
246
- ## Common Failure Modes
247
-
248
- - Optimizing Copilot only and forgetting other platforms.
249
- - Removing `sharedProtocols` because body text got shorter, then losing FORGE/decision/compression behavior.
250
- - Adding local skill tables to agent bodies instead of updating metadata.
251
- - Creating many `HARD RULE` lines until none stand out.
252
- - Editing generated output and losing changes on next generate.
253
- - Forgetting to regenerate after changing definitions.
254
- - Deleting refs/assets/scripts that are rarely loaded but important when triggered.
255
- - Letting subagent templates grow into long checklists that lose tail instructions.
256
-
257
- ## Terse Style Propagation
258
-
259
- When user requests terse/caveman communication, preserve technical substance and remove filler. Orchestrator must pass the style rule to subagents and require final outputs to follow it.
260
-
261
- Safe compression:
262
-
263
- - Drop filler, pleasantries, hedging, articles, and repeated setup.
264
- - Use fragments and short synonyms where meaning is clear.
265
- - Keep code blocks, tool names, protocol names, file paths, errors, security warnings, irreversible confirmations, and multi-step safety sequences exact.
266
-
267
- Pattern:
268
-
269
- ```text
270
- [thing] [action] [reason]. [next step].
271
- ```
272
-
273
- Do not apply style compression where ambiguity could cause unsafe action or incorrect implementation.