@soleri/forge 5.5.0 → 5.7.0

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 (48) hide show
  1. package/dist/facades/forge.facade.js +4 -3
  2. package/dist/facades/forge.facade.js.map +1 -1
  3. package/dist/scaffolder.js +122 -8
  4. package/dist/scaffolder.js.map +1 -1
  5. package/dist/skills/skills/brain-debrief.md +214 -0
  6. package/dist/skills/skills/brainstorming.md +180 -0
  7. package/dist/skills/skills/code-patrol.md +178 -0
  8. package/dist/skills/skills/context-resume.md +146 -0
  9. package/dist/skills/skills/executing-plans.md +216 -0
  10. package/dist/skills/skills/fix-and-learn.md +167 -0
  11. package/dist/skills/skills/health-check.md +231 -0
  12. package/dist/skills/skills/knowledge-harvest.md +185 -0
  13. package/dist/skills/skills/onboard-me.md +198 -0
  14. package/dist/skills/skills/retrospective.md +205 -0
  15. package/dist/skills/skills/second-opinion.md +149 -0
  16. package/dist/skills/skills/systematic-debugging.md +241 -0
  17. package/dist/skills/skills/test-driven-development.md +281 -0
  18. package/dist/skills/skills/vault-capture.md +170 -0
  19. package/dist/skills/skills/vault-navigator.md +140 -0
  20. package/dist/skills/skills/verification-before-completion.md +182 -0
  21. package/dist/skills/skills/writing-plans.md +215 -0
  22. package/dist/templates/entry-point.js +8 -0
  23. package/dist/templates/entry-point.js.map +1 -1
  24. package/dist/templates/test-facades.js +35 -6
  25. package/dist/templates/test-facades.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/__tests__/scaffolder.test.ts +2 -2
  28. package/src/facades/forge.facade.ts +4 -3
  29. package/src/scaffolder.ts +120 -10
  30. package/src/skills/brain-debrief.md +47 -19
  31. package/src/skills/brainstorming.md +19 -9
  32. package/src/skills/code-patrol.md +21 -19
  33. package/src/skills/context-resume.md +14 -11
  34. package/src/skills/executing-plans.md +30 -15
  35. package/src/skills/fix-and-learn.md +17 -14
  36. package/src/skills/health-check.md +29 -23
  37. package/src/skills/knowledge-harvest.md +27 -20
  38. package/src/skills/onboard-me.md +16 -15
  39. package/src/skills/retrospective.md +34 -18
  40. package/src/skills/second-opinion.md +16 -9
  41. package/src/skills/systematic-debugging.md +40 -29
  42. package/src/skills/test-driven-development.md +45 -30
  43. package/src/skills/vault-capture.md +31 -15
  44. package/src/skills/vault-navigator.md +24 -13
  45. package/src/skills/verification-before-completion.md +38 -26
  46. package/src/skills/writing-plans.md +21 -13
  47. package/src/templates/entry-point.ts +8 -0
  48. package/src/templates/test-facades.ts +35 -6
@@ -19,6 +19,7 @@ import {
19
19
  createCoreOps,
20
20
  createDomainFacades,
21
21
  registerAllFacades,
22
+ seedDefaultPlaybooks,
22
23
  } from '@soleri/core';
23
24
  import type { OpDefinition } from '@soleri/core';
24
25
  import { z } from 'zod';
@@ -36,6 +37,13 @@ async function main(): Promise<void> {
36
37
  });
37
38
 
38
39
  const tag = PERSONA.name.toLowerCase();
40
+
41
+ // Seed built-in playbooks (idempotent)
42
+ const seedResult = seedDefaultPlaybooks(runtime.vault);
43
+ if (seedResult.seeded > 0) {
44
+ console.error(\`[\${tag}] Seeded \${seedResult.seeded} built-in playbooks\`);
45
+ }
46
+
39
47
  const stats = runtime.vault.stats();
40
48
  console.error(\`[\${tag}] Vault: \${stats.totalEntries} entries, Brain: \${runtime.brain.getVocabularySize()} terms\`);
41
49
 
@@ -1 +1 @@
1
- {"version":3,"file":"entry-point.js","sourceRoot":"","sources":["../../src/templates/entry-point.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAmB;IACpD,MAAM,cAAc,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAEtD,OAAO;;;;;;;;;;;;;;;;;;;;;;;;gBAwBO,MAAM,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gEA+BuC,MAAM,CAAC,EAAE;;;;;;;qGAO4B,MAAM,CAAC,IAAI;;;;;;;;;;;oDAW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ames).toContain('brain_feedback');
198
198
  expect(opNames).toContain('brain_feedback_stats');
199
199
  expect(opNames).toContain('brain_reset_extracted');
200
+ // Brain decay report (#89)
201
+ expect(opNames).toContain('brain_decay_report');
200
202
  // Agent-specific ops (5)
201
203
  expect(opNames).toContain('health');
202
204
  expect(opNames).toContain('identity');
@@ -227,7 +229,7 @@ ${domainDescribes}
227
229
  expect(opNames).toContain('governance_stats');
228
230
  expect(opNames).toContain('governance_expire');
229
231
  expect(opNames).toContain('governance_dashboard');
230
- // Planning Extra ops (9)
232
+ // Planning Extra ops (13)
231
233
  expect(opNames).toContain('plan_iterate');
232
234
  expect(opNames).toContain('plan_split');
233
235
  expect(opNames).toContain('plan_reconcile');
@@ -237,6 +239,10 @@ ${domainDescribes}
237
239
  expect(opNames).toContain('plan_archive');
238
240
  expect(opNames).toContain('plan_list_tasks');
239
241
  expect(opNames).toContain('plan_stats');
242
+ expect(opNames).toContain('plan_execution_metrics');
243
+ expect(opNames).toContain('plan_record_task_metrics');
244
+ expect(opNames).toContain('plan_submit_deliverable');
245
+ expect(opNames).toContain('plan_verify_deliverables');
240
246
  // Memory Extra ops (8)
241
247
  expect(opNames).toContain('memory_delete');
242
248
  expect(opNames).toContain('memory_stats');
@@ -259,6 +265,10 @@ ${domainDescribes}
259
265
  expect(opNames).toContain('vault_seed');
260
266
  expect(opNames).toContain('vault_backup');
261
267
  expect(opNames).toContain('vault_age_report');
268
+ // #89: Bi-temporal
269
+ expect(opNames).toContain('vault_set_temporal');
270
+ expect(opNames).toContain('vault_find_expiring');
271
+ expect(opNames).toContain('vault_find_expired');
262
272
  // Admin ops (8)
263
273
  expect(opNames).toContain('admin_health');
264
274
  expect(opNames).toContain('admin_tool_list');
@@ -268,7 +278,7 @@ ${domainDescribes}
268
278
  expect(opNames).toContain('admin_version');
269
279
  expect(opNames).toContain('admin_reset_cache');
270
280
  expect(opNames).toContain('admin_diagnostic');
271
- // Loop ops (7)
281
+ // Loop ops (8)
272
282
  expect(opNames).toContain('loop_start');
273
283
  expect(opNames).toContain('loop_iterate');
274
284
  expect(opNames).toContain('loop_status');
@@ -276,6 +286,7 @@ ${domainDescribes}
276
286
  expect(opNames).toContain('loop_history');
277
287
  expect(opNames).toContain('loop_is_active');
278
288
  expect(opNames).toContain('loop_complete');
289
+ expect(opNames).toContain('loop_anomaly_check');
279
290
  // Orchestrate ops (5)
280
291
  expect(opNames).toContain('orchestrate_plan');
281
292
  expect(opNames).toContain('orchestrate_execute');
@@ -293,7 +304,7 @@ ${domainDescribes}
293
304
  expect(opNames).toContain('plan_latest_check');
294
305
  expect(opNames).toContain('plan_meets_grade');
295
306
  expect(opNames).toContain('plan_auto_improve');
296
- // Admin Extra ops (10)
307
+ // Admin Extra ops (11)
297
308
  expect(opNames).toContain('admin_telemetry');
298
309
  expect(opNames).toContain('admin_telemetry_recent');
299
310
  expect(opNames).toContain('admin_telemetry_reset');
@@ -304,11 +315,14 @@ ${domainDescribes}
304
315
  expect(opNames).toContain('admin_env');
305
316
  expect(opNames).toContain('admin_gc');
306
317
  expect(opNames).toContain('admin_export_config');
307
- // Curator Extra ops (4)
318
+ expect(opNames).toContain('admin_hot_reload');
319
+ // Curator Extra ops (4 + 1 hybrid)
308
320
  expect(opNames).toContain('curator_entry_history');
309
321
  expect(opNames).toContain('curator_record_snapshot');
310
322
  expect(opNames).toContain('curator_queue_stats');
311
323
  expect(opNames).toContain('curator_enrich');
324
+ // #36: Hybrid contradiction detection
325
+ expect(opNames).toContain('curator_hybrid_contradictions');
312
326
  // Project ops (12)
313
327
  expect(opNames).toContain('project_get');
314
328
  expect(opNames).toContain('project_list');
@@ -326,8 +340,23 @@ ${domainDescribes}
326
340
  expect(opNames).toContain('memory_promote_to_global');
327
341
  expect(opNames).toContain('memory_configure');
328
342
  expect(opNames).toContain('memory_cross_project_search');
329
- // Total: 152 (147 core + 5 agent-specific)
330
- expect(facade.ops.length).toBe(152);
343
+ // Playbook ops (5)
344
+ expect(opNames).toContain('playbook_list');
345
+ expect(opNames).toContain('playbook_get');
346
+ expect(opNames).toContain('playbook_create');
347
+ expect(opNames).toContain('playbook_match');
348
+ expect(opNames).toContain('playbook_seed');
349
+ // Cognee Sync ops (3)
350
+ expect(opNames).toContain('cognee_sync_status');
351
+ expect(opNames).toContain('cognee_sync_drain');
352
+ expect(opNames).toContain('cognee_sync_reconcile');
353
+ // Intake ops (4)
354
+ expect(opNames).toContain('intake_ingest_book');
355
+ expect(opNames).toContain('intake_process');
356
+ expect(opNames).toContain('intake_status');
357
+ expect(opNames).toContain('intake_preview');
358
+ // Total: 208 (203 core + 5 agent-specific)
359
+ expect(facade.ops.length).toBe(208);
331
360
  });
332
361
 
333
362
  it('search should query across all domains with ranked results', async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"test-facades.js","sourceRoot":"","sources":["../../src/templates/test-facades.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACrD,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO;SACnC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SAChD,IAAI,CAAC,MAAM,CAAC,CAAC;IAEhB,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAmCS,MAAM,CAAC,EAAE;;;;;;;;;;;EAWzB,eAAe;;cAEH,MAAM,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCA6Fe,MAAM,CAAC,IAAI;;;;;;;;;;;;;;;;iBAgBhC,MAAM,CAAC,EAAE;;;;;;;;kCAQQ,MAAM,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2EhE,CAAC;AACF,CAAC;AAED,SAAS,sBAAsB,CAAC,OAAe,EAAE,MAAc;IAC7D,MAAM,UAAU,GAAG,GAAG,OAAO,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,CAAC;IAE7D,OAAO,eAAe,UAAU;;4CAEU,OAAO,OAAO,MAAM;;;;;kCAK9B,UAAU;;;;;;;;;iDASK,MAAM;;2BAE5B,MAAM,mBAAmB,MAAM;;;;;;kDAMR,MAAM;;;iCAGvB,MAAM;;2BAEZ,MAAM,kBAAkB,MAAM;;;;;;;wDAOD,MAAM;;;wCAGtB,MAAM;;;;eAI/B,MAAM;;;;;;;;yCAQoB,MAAM;;oCAEX,MAAM;;;;6CAIG,MAAM,mBAAmB,MAAM;;;gDAG5B,MAAM;gCACtB,MAAM;;;;6CAIO,MAAM,mBAAmB,MAAM;;;gDAG5B,MAAM;;kCAEpB,MAAM;;MAElC,CAAC;AACP,CAAC;AAED,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@soleri/forge",
3
- "version": "5.5.0",
3
+ "version": "5.7.0",
4
4
  "description": "Scaffold AI agents that learn, remember, and grow with you.",
5
5
  "keywords": [
6
6
  "agent",
@@ -59,9 +59,9 @@ describe('Scaffolder', () => {
59
59
  expect(preview.facades).toHaveLength(4); // 3 domains + core
60
60
  expect(preview.facades[0].name).toBe('atlas_data_pipelines');
61
61
 
62
- // Core facade should list all 152 ops (147 core + 5 agent-specific)
62
+ // Core facade should list all 208 ops (203 core + 5 agent-specific)
63
63
  const coreFacade = preview.facades.find((f) => f.name === 'atlas_core')!;
64
- expect(coreFacade.ops.length).toBe(152);
64
+ expect(coreFacade.ops.length).toBe(208);
65
65
  expect(coreFacade.ops).toContain('curator_status');
66
66
  expect(coreFacade.ops).toContain('health');
67
67
 
@@ -28,8 +28,9 @@ export const forgeOps: OpDef[] = [
28
28
  name: 'create',
29
29
  description:
30
30
  'Scaffold a complete MCP agent project with activation system. ' +
31
- 'This creates the full directory structure, source files, config, and activation module. ' +
32
- 'After creation: npm install && npm run build, then say "Hello, {Name}!" to activate.',
31
+ 'This creates the full directory structure, source files, config, and activation module, ' +
32
+ 'then auto-builds (npm install + npm run build) and registers the MCP server. ' +
33
+ 'After creation: restart Claude Code and say "Hello, {Name}!" to activate.',
33
34
  schema: AgentConfigSchema,
34
35
  handler: async (params) => {
35
36
  const config = AgentConfigSchema.parse(params);
@@ -111,7 +112,7 @@ export const forgeOps: OpDef[] = [
111
112
  {
112
113
  step: 6,
113
114
  action: 'Create the agent',
114
- ask: 'Call create with the confirmed config. Then guide the user through npm install and npm run build. The MCP server is automatically registered in ~/.claude.json.',
115
+ ask: 'Call create with the confirmed config. The agent is auto-built (npm install + build) and MCP server is registered in ~/.claude.json automatically.',
115
116
  },
116
117
  {
117
118
  step: 7,
package/src/scaffolder.ts CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  } from 'node:fs';
9
9
  import { join, dirname } from 'node:path';
10
10
  import { homedir } from 'node:os';
11
+ import { execFileSync } from 'node:child_process';
11
12
  import type { AgentConfig, ScaffoldResult, ScaffoldPreview, AgentInfo } from './types.js';
12
13
 
13
14
  import { generatePackageJson } from './templates/package-json.js';
@@ -98,7 +99,7 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
98
99
  {
99
100
  name: `${config.id}_core`,
100
101
  ops: [
101
- // From createCoreOps() — 144 generic ops
102
+ // From createCoreOps() — 150 generic ops
102
103
  'search',
103
104
  'vault_stats',
104
105
  'list_all',
@@ -131,6 +132,8 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
131
132
  'brain_promote_proposals',
132
133
  'brain_lifecycle',
133
134
  'brain_reset_extracted',
135
+ // Brain decay report (#89) — 1
136
+ 'brain_decay_report',
134
137
  // Cognee ops — 5
135
138
  'cognee_status',
136
139
  'cognee_search',
@@ -140,6 +143,9 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
140
143
  // LLM ops — 2
141
144
  'llm_rotate',
142
145
  'llm_call',
146
+ // Prompt ops — 2
147
+ 'render_prompt',
148
+ 'list_templates',
143
149
  'curator_status',
144
150
  'curator_detect_duplicates',
145
151
  'curator_contradictions',
@@ -162,7 +168,7 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
162
168
  'governance_stats',
163
169
  'governance_expire',
164
170
  'governance_dashboard',
165
- // Planning Extra ops — 9
171
+ // Planning Extra ops — 22
166
172
  'plan_iterate',
167
173
  'plan_split',
168
174
  'plan_reconcile',
@@ -172,6 +178,25 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
172
178
  'plan_archive',
173
179
  'plan_list_tasks',
174
180
  'plan_stats',
181
+ // Planning evidence (#148)
182
+ 'plan_submit_evidence',
183
+ 'plan_verify_task',
184
+ 'plan_verify_plan',
185
+ // Subagent dispatch (#149)
186
+ 'plan_review_spec',
187
+ 'plan_review_quality',
188
+ 'plan_review_outcome',
189
+ // Brainstorm (#150)
190
+ 'plan_brainstorm',
191
+ // Auto-reconcile (#151)
192
+ 'plan_auto_reconcile',
193
+ // Validate plan (#152)
194
+ 'plan_validate',
195
+ // Execution metrics + deliverables (#80, #83)
196
+ 'plan_execution_metrics',
197
+ 'plan_record_task_metrics',
198
+ 'plan_submit_deliverable',
199
+ 'plan_verify_deliverables',
175
200
  // Memory Extra ops — 8
176
201
  'memory_delete',
177
202
  'memory_stats',
@@ -194,6 +219,16 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
194
219
  'vault_seed',
195
220
  'vault_backup',
196
221
  'vault_age_report',
222
+ // Vault extra — seed canonical + knowledge lifecycle (5)
223
+ 'vault_seed_canonical',
224
+ 'knowledge_audit',
225
+ 'knowledge_health',
226
+ 'knowledge_merge',
227
+ 'knowledge_reorganize',
228
+ // Bi-temporal vault ops (#89) — 3
229
+ 'vault_set_temporal',
230
+ 'vault_find_expiring',
231
+ 'vault_find_expired',
197
232
  // Admin ops — 8
198
233
  'admin_health',
199
234
  'admin_tool_list',
@@ -203,14 +238,16 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
203
238
  'admin_version',
204
239
  'admin_reset_cache',
205
240
  'admin_diagnostic',
206
- // Loop ops — 7
241
+ // Loop ops — 9
207
242
  'loop_start',
208
243
  'loop_iterate',
244
+ 'loop_iterate_gate',
209
245
  'loop_status',
210
246
  'loop_cancel',
211
247
  'loop_history',
212
248
  'loop_is_active',
213
249
  'loop_complete',
250
+ 'loop_anomaly_check',
214
251
  // Orchestrate ops — 5
215
252
  'orchestrate_plan',
216
253
  'orchestrate_execute',
@@ -228,7 +265,22 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
228
265
  'capture_quick',
229
266
  'search_intelligent',
230
267
  'search_feedback',
231
- // Admin Extra ops10
268
+ // Enriched capture (#154)1
269
+ 'capture_enriched',
270
+ // Cognee graph (#156) — 3
271
+ 'cognee_get_node',
272
+ 'cognee_graph_stats',
273
+ 'cognee_export_status',
274
+ // Cognee Sync ops — 3
275
+ 'cognee_sync_status',
276
+ 'cognee_sync_drain',
277
+ 'cognee_sync_reconcile',
278
+ // Intake ops — 4
279
+ 'intake_ingest_book',
280
+ 'intake_process',
281
+ 'intake_status',
282
+ 'intake_preview',
283
+ // Admin Extra ops — 23
232
284
  'admin_telemetry',
233
285
  'admin_telemetry_recent',
234
286
  'admin_telemetry_reset',
@@ -239,11 +291,31 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
239
291
  'admin_env',
240
292
  'admin_gc',
241
293
  'admin_export_config',
242
- // Curator Extra ops — 4
294
+ // Admin key pool (#157)
295
+ 'admin_key_pool_status',
296
+ 'admin_create_token',
297
+ 'admin_revoke_token',
298
+ 'admin_list_tokens',
299
+ // Admin accounts (#158)
300
+ 'admin_add_account',
301
+ 'admin_remove_account',
302
+ 'admin_rotate_account',
303
+ 'admin_list_accounts',
304
+ 'admin_account_status',
305
+ // Admin plugins (#159)
306
+ 'admin_list_plugins',
307
+ 'admin_plugin_status',
308
+ // Admin instruction validation (#160)
309
+ 'admin_validate_instructions',
310
+ // Hot reload (#63)
311
+ 'admin_hot_reload',
312
+ // Curator Extra ops — 5
243
313
  'curator_entry_history',
244
314
  'curator_record_snapshot',
245
315
  'curator_queue_stats',
246
316
  'curator_enrich',
317
+ // Hybrid contradiction detection (#36) — 1
318
+ 'curator_hybrid_contradictions',
247
319
  // Project ops — 12
248
320
  'project_get',
249
321
  'project_list',
@@ -261,6 +333,12 @@ export function previewScaffold(config: AgentConfig): ScaffoldPreview {
261
333
  'memory_promote_to_global',
262
334
  'memory_configure',
263
335
  'memory_cross_project_search',
336
+ // Playbook ops — 5
337
+ 'playbook_list',
338
+ 'playbook_get',
339
+ 'playbook_create',
340
+ 'playbook_match',
341
+ 'playbook_seed',
264
342
  // Agent-specific ops — 5
265
343
  'health',
266
344
  'identity',
@@ -376,8 +454,36 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
376
454
 
377
455
  const totalOps = config.domains.length * 5 + 61; // 5 per domain + 56 core (from createCoreOps) + 5 agent-specific
378
456
 
379
- // Register the agent as an MCP server in ~/.claude.json
380
- const mcpReg = registerMcpServer(config.id, agentDir);
457
+ // Auto-build: install dependencies and compile before registering MCP
458
+ let buildSuccess = false;
459
+ let buildError: string | undefined;
460
+ try {
461
+ execFileSync('npm', ['install', '--no-fund', '--no-audit'], {
462
+ cwd: agentDir,
463
+ stdio: 'pipe',
464
+ timeout: 120_000,
465
+ });
466
+ execFileSync('npm', ['run', 'build'], {
467
+ cwd: agentDir,
468
+ stdio: 'pipe',
469
+ timeout: 60_000,
470
+ });
471
+ buildSuccess = true;
472
+ } catch (err) {
473
+ buildError = err instanceof Error ? err.message : String(err);
474
+ }
475
+
476
+ // Register the agent as an MCP server in ~/.claude.json (only if build succeeded)
477
+ let mcpReg: { registered: boolean; path: string; error?: string };
478
+ if (buildSuccess) {
479
+ mcpReg = registerMcpServer(config.id, agentDir);
480
+ } else {
481
+ mcpReg = {
482
+ registered: false,
483
+ path: join(homedir(), '.claude.json'),
484
+ error: 'Skipped — build failed',
485
+ };
486
+ }
381
487
 
382
488
  const summaryLines = [
383
489
  `Created ${config.name} agent at ${agentDir}`,
@@ -389,6 +495,13 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
389
495
  `${skillFiles.length} built-in skills (TDD, debugging, planning, vault, brain debrief)`,
390
496
  ];
391
497
 
498
+ if (buildSuccess) {
499
+ summaryLines.push('Built successfully (npm install + npm run build)');
500
+ } else {
501
+ summaryLines.push(`Warning: Auto-build failed: ${buildError}`);
502
+ summaryLines.push(` Run manually: cd ${agentDir} && npm install && npm run build`);
503
+ }
504
+
392
505
  if (config.hookPacks?.length) {
393
506
  summaryLines.push(`${config.hookPacks.length} hook pack(s) bundled in .claude/`);
394
507
  }
@@ -402,9 +515,6 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
402
515
  summaryLines.push(
403
516
  '',
404
517
  'Next steps:',
405
- ` cd ${agentDir}`,
406
- ' npm install && npm run build',
407
- ' npm test # verify all tests pass',
408
518
  ' Restart Claude Code',
409
519
  ` Say "Hello, ${config.name}!" to activate the persona`,
410
520
  );
@@ -16,33 +16,43 @@ When the user wants to understand what patterns have proven valuable, what anti-
16
16
  ### "What have I learned?" (General debrief)
17
17
 
18
18
  1. Get the big picture:
19
+
19
20
  ```
20
21
  YOUR_AGENT_core op:brain_stats
21
22
  ```
23
+
22
24
  Total sessions, patterns captured, quality scores, coverage gaps.
23
25
 
24
26
  2. Get patterns ranked by proven strength:
27
+
25
28
  ```
26
29
  YOUR_AGENT_core op:brain_strengths
27
30
  ```
31
+
28
32
  Focus on strength >= 70 and successRate >= 0.7.
29
33
 
30
34
  3. Check memory landscape:
35
+
31
36
  ```
32
37
  YOUR_AGENT_core op:memory_topics
33
38
  ```
39
+
34
40
  Shows how knowledge clusters by topic.
35
41
 
36
42
  4. Check for stale knowledge:
43
+
37
44
  ```
38
45
  YOUR_AGENT_core op:vault_age_report
39
46
  ```
47
+
40
48
  Find entries that haven't been updated recently — candidates for review.
41
49
 
42
50
  5. Run a curator health audit:
51
+
43
52
  ```
44
53
  YOUR_AGENT_core op:curator_health_audit
45
54
  ```
55
+
46
56
  Vault quality score, tag normalization status, duplicate density.
47
57
 
48
58
  6. Present: top 5 strongest patterns, top 3 recurring anti-patterns, stale entries needing refresh, and coverage gaps.
@@ -50,22 +60,26 @@ When the user wants to understand what patterns have proven valuable, what anti-
50
60
  ### "What's working across projects?" (Cross-project intelligence)
51
61
 
52
62
  1. Get patterns promoted to the global pool:
63
+
53
64
  ```
54
65
  YOUR_AGENT_core op:brain_global_patterns
55
66
  ```
56
67
 
57
68
  2. Get recommendations based on project similarity:
69
+
58
70
  ```
59
71
  YOUR_AGENT_core op:brain_recommend
60
72
  params: { projectName: "<current project>" }
61
73
  ```
62
74
 
63
75
  3. Check linked projects:
76
+
64
77
  ```
65
78
  YOUR_AGENT_core op:project_linked_projects
66
79
  ```
67
80
 
68
81
  4. Search across all projects for relevant patterns:
82
+
69
83
  ```
70
84
  YOUR_AGENT_core op:memory_cross_project_search
71
85
  params: { query: "<topic>", crossProject: true }
@@ -76,28 +90,33 @@ When the user wants to understand what patterns have proven valuable, what anti-
76
90
  ### "Am I getting smarter?" (Learning velocity)
77
91
 
78
92
  1. Recent stats:
93
+
79
94
  ```
80
95
  YOUR_AGENT_core op:brain_stats
81
96
  params: { since: "<7 days ago>" }
82
97
  ```
83
98
 
84
99
  2. Longer period for comparison:
100
+
85
101
  ```
86
102
  YOUR_AGENT_core op:brain_stats
87
103
  params: { since: "<30 days ago>" }
88
104
  ```
89
105
 
90
106
  3. Memory stats:
107
+
91
108
  ```
92
109
  YOUR_AGENT_core op:memory_stats
93
110
  ```
94
111
 
95
112
  4. Vault analytics:
113
+
96
114
  ```
97
115
  YOUR_AGENT_core op:admin_vault_analytics
98
116
  ```
99
117
 
100
118
  5. Search insights — what queries are people running, what's missing:
119
+
101
120
  ```
102
121
  YOUR_AGENT_core op:admin_search_insights
103
122
  ```
@@ -107,17 +126,21 @@ When the user wants to understand what patterns have proven valuable, what anti-
107
126
  ### "Build fresh intelligence" (Rebuild)
108
127
 
109
128
  1. Run the full pipeline:
129
+
110
130
  ```
111
131
  YOUR_AGENT_core op:brain_build_intelligence
112
132
  ```
133
+
113
134
  Compute strengths, update global registry, refresh project profiles.
114
135
 
115
136
  2. Consolidate vault (curator cleanup):
137
+
116
138
  ```
117
139
  YOUR_AGENT_core op:curator_consolidate
118
140
  ```
119
141
 
120
142
  3. Show updated metrics:
143
+
121
144
  ```
122
145
  YOUR_AGENT_core op:brain_stats
123
146
  ```
@@ -127,21 +150,25 @@ When the user wants to understand what patterns have proven valuable, what anti-
127
150
  ### "Export what I know" (Portability)
128
151
 
129
152
  Export brain intelligence:
153
+
130
154
  ```
131
155
  YOUR_AGENT_core op:brain_export
132
156
  ```
133
157
 
134
158
  Export memory:
159
+
135
160
  ```
136
161
  YOUR_AGENT_core op:memory_export
137
162
  ```
138
163
 
139
164
  Export vault as backup:
165
+
140
166
  ```
141
167
  YOUR_AGENT_core op:vault_backup
142
168
  ```
143
169
 
144
170
  These can be imported into another vault:
171
+
145
172
  ```
146
173
  YOUR_AGENT_core op:brain_import
147
174
  YOUR_AGENT_core op:memory_import
@@ -151,6 +178,7 @@ YOUR_AGENT_core op:vault_import
151
178
  ## Presenting Intelligence
152
179
 
153
180
  Format as a report:
181
+
154
182
  - **Strengths**: Top patterns with strength scores and domains
155
183
  - **Risks**: Recurring anti-patterns that keep appearing
156
184
  - **Gaps**: Domains with low coverage or stale knowledge
@@ -165,22 +193,22 @@ Debrief is complete when the user's specific question has been answered with dat
165
193
 
166
194
  ## Agent Tools Reference
167
195
 
168
- | Op | When to Use |
169
- |----|-------------|
170
- | `brain_stats` | Aggregate metrics — sessions, patterns, quality |
171
- | `brain_strengths` | Patterns ranked by proven strength |
172
- | `brain_global_patterns` | Cross-project promoted patterns |
173
- | `brain_recommend` | Project-similarity recommendations |
174
- | `brain_build_intelligence` | Rebuild full intelligence pipeline |
175
- | `brain_export` / `brain_import` | Portable intelligence transfer |
176
- | `memory_topics` | Knowledge clusters by topic |
177
- | `memory_stats` | Memory statistics |
178
- | `memory_export` / `memory_import` | Memory portability |
179
- | `memory_cross_project_search` | Search across linked projects |
180
- | `vault_age_report` | Find stale entries needing refresh |
181
- | `vault_backup` / `vault_import` | Vault backup and restore |
182
- | `curator_health_audit` | Vault quality score and status |
183
- | `curator_consolidate` | Full vault cleanup pipeline |
184
- | `admin_vault_analytics` | Overall knowledge quality metrics |
185
- | `admin_search_insights` | Search miss analysis — what's not found |
186
- | `project_linked_projects` | See connected projects |
196
+ | Op | When to Use |
197
+ | --------------------------------- | ----------------------------------------------- |
198
+ | `brain_stats` | Aggregate metrics — sessions, patterns, quality |
199
+ | `brain_strengths` | Patterns ranked by proven strength |
200
+ | `brain_global_patterns` | Cross-project promoted patterns |
201
+ | `brain_recommend` | Project-similarity recommendations |
202
+ | `brain_build_intelligence` | Rebuild full intelligence pipeline |
203
+ | `brain_export` / `brain_import` | Portable intelligence transfer |
204
+ | `memory_topics` | Knowledge clusters by topic |
205
+ | `memory_stats` | Memory statistics |
206
+ | `memory_export` / `memory_import` | Memory portability |
207
+ | `memory_cross_project_search` | Search across linked projects |
208
+ | `vault_age_report` | Find stale entries needing refresh |
209
+ | `vault_backup` / `vault_import` | Vault backup and restore |
210
+ | `curator_health_audit` | Vault quality score and status |
211
+ | `curator_consolidate` | Full vault cleanup pipeline |
212
+ | `admin_vault_analytics` | Overall knowledge quality metrics |
213
+ | `admin_search_insights` | Search miss analysis — what's not found |
214
+ | `project_linked_projects` | See connected projects |