@soleri/forge 5.12.0 → 5.13.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.
- package/README.md +3 -3
- package/dist/lib.d.ts +1 -1
- package/dist/lib.js.map +1 -1
- package/dist/patching.js +6 -5
- package/dist/patching.js.map +1 -1
- package/dist/templates/claude-md-template.d.ts +9 -5
- package/dist/templates/claude-md-template.js +67 -120
- package/dist/templates/claude-md-template.js.map +1 -1
- package/dist/templates/shared-rules.d.ts +14 -0
- package/dist/templates/shared-rules.js +119 -0
- package/dist/templates/shared-rules.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/src/lib.ts +1 -0
- package/src/patching.ts +6 -5
- package/src/templates/claude-md-template.ts +112 -265
- package/src/templates/shared-rules.ts +126 -0
- package/src/types.ts +3 -0
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ my-agent/
|
|
|
65
65
|
identity/ # Agent persona and principles
|
|
66
66
|
activation/ # CLAUDE.md injection + activation flow
|
|
67
67
|
planning/ # Multi-step plan state machine
|
|
68
|
-
__tests__/ #
|
|
68
|
+
__tests__/ # Generated test suites
|
|
69
69
|
scripts/
|
|
70
70
|
setup.sh # One-command install, build, register
|
|
71
71
|
copy-assets.js # Build script for intelligence data
|
|
@@ -101,7 +101,7 @@ Each agent exposes two types of MCP tools:
|
|
|
101
101
|
- `record_feedback` `rebuild_vocabulary` `brain_stats`
|
|
102
102
|
- `llm_status`
|
|
103
103
|
|
|
104
|
-
Total:
|
|
104
|
+
Total: 200+ operations per agent (13 semantic facades + 5 per domain).
|
|
105
105
|
|
|
106
106
|
## Forge Operations
|
|
107
107
|
|
|
@@ -201,7 +201,7 @@ Soleri Forge is itself an MCP server built on the same patterns it generates:
|
|
|
201
201
|
- **`src/patching.ts`** — Shared source file patching utilities
|
|
202
202
|
- **`src/lib.ts`** — Public API re-exports for programmatic access
|
|
203
203
|
- **`src/types.ts`** — Config schema and result types (Zod-validated)
|
|
204
|
-
- **`src/templates/`** —
|
|
204
|
+
- **`src/templates/`** — 19 template generators
|
|
205
205
|
|
|
206
206
|
## Requirements
|
|
207
207
|
|
package/dist/lib.d.ts
CHANGED
|
@@ -8,6 +8,6 @@ export { scaffold, previewScaffold, listAgents } from './scaffolder.js';
|
|
|
8
8
|
export { installKnowledge, generateVaultOnlyDomainFacade } from './knowledge-installer.js';
|
|
9
9
|
export { addDomain } from './domain-manager.js';
|
|
10
10
|
export { patchIndexTs, patchClaudeMdContent } from './patching.js';
|
|
11
|
-
export type { AgentConfig, SetupTarget, ScaffoldResult, ScaffoldPreview, AgentInfo, InstallKnowledgeResult, AddDomainResult, } from './types.js';
|
|
11
|
+
export type { AgentConfig, AgentConfigInput, SetupTarget, ScaffoldResult, ScaffoldPreview, AgentInfo, InstallKnowledgeResult, AddDomainResult, } from './types.js';
|
|
12
12
|
export { AgentConfigSchema, SETUP_TARGETS } from './types.js';
|
|
13
13
|
export { generateExtensionsIndex, generateExampleOp } from './templates/extensions.js';
|
package/dist/lib.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"lib.js","sourceRoot":"","sources":["../src/lib.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAWnE,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC"}
|
package/dist/patching.js
CHANGED
|
@@ -94,17 +94,18 @@ export function patchClaudeMdContent(source, agentId, newDomains) {
|
|
|
94
94
|
});
|
|
95
95
|
if (domainsToAdd.length === 0)
|
|
96
96
|
return source;
|
|
97
|
-
// Try
|
|
98
|
-
let anchorIdx = source.indexOf("'|
|
|
97
|
+
// Try anchors in order: v6 (curated table), v5 (full table), v4 (legacy)
|
|
98
|
+
let anchorIdx = source.indexOf("'| Intelligent search |");
|
|
99
99
|
if (anchorIdx === -1) {
|
|
100
|
-
|
|
100
|
+
anchorIdx = source.indexOf("'| Memory search |");
|
|
101
|
+
}
|
|
102
|
+
if (anchorIdx === -1) {
|
|
103
|
+
// v4 agents: insert before ## Intent Detection
|
|
101
104
|
anchorIdx = source.indexOf("'## Intent Detection'");
|
|
102
105
|
if (anchorIdx === -1)
|
|
103
106
|
return null;
|
|
104
|
-
// Back up to include the preceding empty string line ('',)
|
|
105
107
|
const emptyLineIdx = source.lastIndexOf("'',", anchorIdx);
|
|
106
108
|
if (emptyLineIdx !== -1 && anchorIdx - emptyLineIdx < 20) {
|
|
107
|
-
// Find the start of that line (the indentation)
|
|
108
109
|
const lineStart = source.lastIndexOf('\n', emptyLineIdx);
|
|
109
110
|
anchorIdx = lineStart === -1 ? emptyLineIdx : lineStart + 1;
|
|
110
111
|
}
|
package/dist/patching.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patching.js","sourceRoot":"","sources":["../src/patching.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;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AS;IAC3B,OAAO,CAAC;SACL,KAAK,CAAC,SAAS,CAAC;SAChB,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAClD,IAAI,CAAC,EAAE,CAAC,CAAC;AACd,CAAC"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import type { AgentConfig } from '../types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Generates src/activation/claude-md-content.ts for a new agent.
|
|
4
|
-
* Returns the CLAUDE.md section content with activation triggers,
|
|
5
|
-
* facade tables, intent detection, and knowledge protocol.
|
|
6
4
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
5
|
+
* Architecture:
|
|
6
|
+
* 1. Agent-specific identity (persona, domains, principles)
|
|
7
|
+
* 2. Session start protocol
|
|
8
|
+
* 3. Curated facade table (~30 key ops, grouped by category)
|
|
9
|
+
* 4. Shared behavioral rules (vault-first, planning, output formatting)
|
|
10
|
+
* 5. Hook packs (conditional)
|
|
11
|
+
*
|
|
12
|
+
* Full op list is always available via `admin_tool_list` — no need to
|
|
13
|
+
* enumerate all 145+ ops in CLAUDE.md.
|
|
10
14
|
*/
|
|
11
15
|
export declare function generateClaudeMdTemplate(config: AgentConfig): string;
|
|
@@ -1,148 +1,88 @@
|
|
|
1
|
+
import { getSharedRules } from './shared-rules.js';
|
|
1
2
|
/**
|
|
2
3
|
* Generates src/activation/claude-md-content.ts for a new agent.
|
|
3
|
-
* Returns the CLAUDE.md section content with activation triggers,
|
|
4
|
-
* facade tables, intent detection, and knowledge protocol.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* Architecture:
|
|
6
|
+
* 1. Agent-specific identity (persona, domains, principles)
|
|
7
|
+
* 2. Session start protocol
|
|
8
|
+
* 3. Curated facade table (~30 key ops, grouped by category)
|
|
9
|
+
* 4. Shared behavioral rules (vault-first, planning, output formatting)
|
|
10
|
+
* 5. Hook packs (conditional)
|
|
11
|
+
*
|
|
12
|
+
* Full op list is always available via `admin_tool_list` — no need to
|
|
13
|
+
* enumerate all 145+ ops in CLAUDE.md.
|
|
9
14
|
*/
|
|
10
15
|
export function generateClaudeMdTemplate(config) {
|
|
11
|
-
const toolPrefix = config.id;
|
|
16
|
+
const toolPrefix = config.id;
|
|
12
17
|
const marker = `${config.id}:mode`;
|
|
13
|
-
const bt = '`';
|
|
14
|
-
// Build the raw markdown lines (plain text, no escaping needed)
|
|
18
|
+
const bt = '`';
|
|
15
19
|
const mdLines = [
|
|
16
20
|
`<!-- ${marker} -->`,
|
|
17
21
|
'',
|
|
18
22
|
`# ${config.name} Mode`,
|
|
19
23
|
'',
|
|
20
|
-
|
|
24
|
+
// ─── Identity ──────────────────────────────────────────
|
|
25
|
+
`## ${config.name}`,
|
|
26
|
+
'',
|
|
27
|
+
`**Role:** ${config.role}`,
|
|
28
|
+
`**Domains:** ${config.domains.join(', ')}`,
|
|
29
|
+
`**Tone:** ${config.tone ?? 'pragmatic'}`,
|
|
30
|
+
'',
|
|
31
|
+
config.description,
|
|
32
|
+
'',
|
|
33
|
+
'**Principles:**',
|
|
34
|
+
...config.principles.map((p) => `- ${p}`),
|
|
35
|
+
'',
|
|
36
|
+
// ─── Activation ────────────────────────────────────────
|
|
37
|
+
'## Activation',
|
|
21
38
|
'',
|
|
22
|
-
`**Activate:** "Hello, ${config.name}!"
|
|
23
|
-
`**Deactivate:** "Goodbye, ${config.name}!"
|
|
39
|
+
`**Activate:** "Hello, ${config.name}!" → ${bt}${toolPrefix}_core op:activate params:{ projectPath: "." }${bt}`,
|
|
40
|
+
`**Deactivate:** "Goodbye, ${config.name}!" → ${bt}${toolPrefix}_core op:activate params:{ deactivate: true }${bt}`,
|
|
24
41
|
'',
|
|
25
42
|
'On activation, adopt the returned persona. Stay in character until deactivated.',
|
|
26
43
|
'',
|
|
44
|
+
// ─── Session Start ─────────────────────────────────────
|
|
27
45
|
'## Session Start',
|
|
28
46
|
'',
|
|
29
47
|
`On every new session: ${bt}${toolPrefix}_core op:register params:{ projectPath: "." }${bt}`,
|
|
30
48
|
'',
|
|
31
|
-
'## Facades',
|
|
32
|
-
'',
|
|
33
|
-
'| Need | Facade | Op |',
|
|
34
|
-
'|------|--------|----|',
|
|
35
|
-
`| Health check | ${bt}${toolPrefix}_core${bt} | ${bt}health${bt} |`,
|
|
36
|
-
`| Search all | ${bt}${toolPrefix}_core${bt} | ${bt}search${bt} |`,
|
|
37
|
-
`| Vault stats | ${bt}${toolPrefix}_core${bt} | ${bt}vault_stats${bt} |`,
|
|
38
|
-
`| Identity | ${bt}${toolPrefix}_core${bt} | ${bt}identity${bt} |`,
|
|
39
49
|
];
|
|
40
|
-
//
|
|
50
|
+
// ─── Curated Facade Table ──────────────────────────────
|
|
51
|
+
mdLines.push('## Key Operations', '', `Full list: ${bt}${toolPrefix}_core op:admin_tool_list${bt}`, '', '| Need | Facade | Op |', '|------|--------|----|');
|
|
52
|
+
// Essential
|
|
53
|
+
mdLines.push(`| Health check | ${bt}${toolPrefix}_core${bt} | ${bt}health${bt} |`, `| Search all | ${bt}${toolPrefix}_core${bt} | ${bt}search${bt} |`, `| Identity | ${bt}${toolPrefix}_core${bt} | ${bt}identity${bt} |`);
|
|
54
|
+
// Domain-specific (3 rows per domain)
|
|
41
55
|
for (const d of config.domains) {
|
|
42
56
|
const toolName = `${toolPrefix}_${d.replace(/-/g, '_')}`;
|
|
43
|
-
mdLines.push(`| ${d} patterns | ${bt}${toolName}${bt} | ${bt}get_patterns${bt} |`);
|
|
44
|
-
mdLines.push(`| Search ${d} | ${bt}${toolName}${bt} | ${bt}search${bt} |`);
|
|
45
|
-
mdLines.push(`| Capture ${d} | ${bt}${toolName}${bt} | ${bt}capture${bt} |`);
|
|
46
|
-
}
|
|
47
|
-
// Memory + Session + Export + Brain + Planning rows
|
|
48
|
-
mdLines.push(`| Memory search | ${bt}${toolPrefix}_core${bt} | ${bt}memory_search${bt} |`, `| Memory capture | ${bt}${toolPrefix}_core${bt} | ${bt}memory_capture${bt} |`, `| Memory list | ${bt}${toolPrefix}_core${bt} | ${bt}memory_list${bt} |`, `| Session capture | ${bt}${toolPrefix}_core${bt} | ${bt}session_capture${bt} |`, `| Export knowledge | ${bt}${toolPrefix}_core${bt} | ${bt}export${bt} |`, `| Record feedback | ${bt}${toolPrefix}_core${bt} | ${bt}record_feedback${bt} |`, `| Enhanced feedback | ${bt}${toolPrefix}_core${bt} | ${bt}brain_feedback${bt} |`, `| Feedback stats | ${bt}${toolPrefix}_core${bt} | ${bt}brain_feedback_stats${bt} |`, `| Reset extracted | ${bt}${toolPrefix}_core${bt} | ${bt}brain_reset_extracted${bt} |`, `| Rebuild vocabulary | ${bt}${toolPrefix}_core${bt} | ${bt}rebuild_vocabulary${bt} |`, `| Brain stats | ${bt}${toolPrefix}_core${bt} | ${bt}brain_stats${bt} |`, `| LLM status | ${bt}${toolPrefix}_core${bt} | ${bt}llm_status${bt} |`, `| Create plan | ${bt}${toolPrefix}_core${bt} | ${bt}create_plan${bt} |`, `| Get plan | ${bt}${toolPrefix}_core${bt} | ${bt}get_plan${bt} |`, `| Approve plan | ${bt}${toolPrefix}_core${bt} | ${bt}approve_plan${bt} |`, `| Update task | ${bt}${toolPrefix}_core${bt} | ${bt}update_task${bt} |`, `| Complete plan | ${bt}${toolPrefix}_core${bt} | ${bt}complete_plan${bt} |`, `| Route intent | ${bt}${toolPrefix}_core${bt} | ${bt}route_intent${bt} |`, `| Morph mode | ${bt}${toolPrefix}_core${bt} | ${bt}morph${bt} |`, `| Get behavior rules | ${bt}${toolPrefix}_core${bt} | ${bt}get_behavior_rules${bt} |`, `| Get identity | ${bt}${toolPrefix}_core${bt} | ${bt}get_identity${bt} |`, `| Update identity | ${bt}${toolPrefix}_core${bt} | ${bt}update_identity${bt} |`, `| Add guideline | ${bt}${toolPrefix}_core${bt} | ${bt}add_guideline${bt} |`, `| Remove guideline | ${bt}${toolPrefix}_core${bt} | ${bt}remove_guideline${bt} |`, `| Rollback identity | ${bt}${toolPrefix}_core${bt} | ${bt}rollback_identity${bt} |`, `| Cognee status | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_status${bt} |`, `| Cognee search | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_search${bt} |`, `| Cognee add | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_add${bt} |`, `| Cognee cognify | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_cognify${bt} |`, `| Cognee config | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_config${bt} |`, `| LLM rotate key | ${bt}${toolPrefix}_core${bt} | ${bt}llm_rotate${bt} |`, `| LLM call | ${bt}${toolPrefix}_core${bt} | ${bt}llm_call${bt} |`, `| Governance policy | ${bt}${toolPrefix}_core${bt} | ${bt}governance_policy${bt} |`, `| Governance proposals | ${bt}${toolPrefix}_core${bt} | ${bt}governance_proposals${bt} |`, `| Governance stats | ${bt}${toolPrefix}_core${bt} | ${bt}governance_stats${bt} |`, `| Expire proposals | ${bt}${toolPrefix}_core${bt} | ${bt}governance_expire${bt} |`, `| Governance dashboard | ${bt}${toolPrefix}_core${bt} | ${bt}governance_dashboard${bt} |`,
|
|
49
|
-
// Planning Extra ops
|
|
50
|
-
`| Iterate plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_iterate${bt} |`, `| Split plan tasks | ${bt}${toolPrefix}_core${bt} | ${bt}plan_split${bt} |`, `| Reconcile plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_reconcile${bt} |`, `| Complete lifecycle | ${bt}${toolPrefix}_core${bt} | ${bt}plan_complete_lifecycle${bt} |`, `| Dispatch tasks | ${bt}${toolPrefix}_core${bt} | ${bt}plan_dispatch${bt} |`, `| Review plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_review${bt} |`, `| Archive plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_archive${bt} |`, `| List plan tasks | ${bt}${toolPrefix}_core${bt} | ${bt}plan_list_tasks${bt} |`, `| Plan stats | ${bt}${toolPrefix}_core${bt} | ${bt}plan_stats${bt} |`,
|
|
51
|
-
// Memory Extra ops
|
|
52
|
-
`| Delete memory | ${bt}${toolPrefix}_core${bt} | ${bt}memory_delete${bt} |`, `| Memory stats | ${bt}${toolPrefix}_core${bt} | ${bt}memory_stats${bt} |`, `| Export memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_export${bt} |`, `| Import memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_import${bt} |`, `| Prune memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_prune${bt} |`, `| Deduplicate memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_deduplicate${bt} |`, `| Memory topics | ${bt}${toolPrefix}_core${bt} | ${bt}memory_topics${bt} |`, `| Memories by project | ${bt}${toolPrefix}_core${bt} | ${bt}memory_by_project${bt} |`,
|
|
53
|
-
// Vault Extra ops
|
|
54
|
-
`| Get vault entry | ${bt}${toolPrefix}_core${bt} | ${bt}vault_get${bt} |`, `| Update entry | ${bt}${toolPrefix}_core${bt} | ${bt}vault_update${bt} |`, `| Remove entry | ${bt}${toolPrefix}_core${bt} | ${bt}vault_remove${bt} |`, `| Bulk add | ${bt}${toolPrefix}_core${bt} | ${bt}vault_bulk_add${bt} |`, `| Bulk remove | ${bt}${toolPrefix}_core${bt} | ${bt}vault_bulk_remove${bt} |`, `| Vault tags | ${bt}${toolPrefix}_core${bt} | ${bt}vault_tags${bt} |`, `| Vault domains | ${bt}${toolPrefix}_core${bt} | ${bt}vault_domains${bt} |`, `| Recent entries | ${bt}${toolPrefix}_core${bt} | ${bt}vault_recent${bt} |`, `| Import entries | ${bt}${toolPrefix}_core${bt} | ${bt}vault_import${bt} |`, `| Seed entries | ${bt}${toolPrefix}_core${bt} | ${bt}vault_seed${bt} |`, `| Backup vault | ${bt}${toolPrefix}_core${bt} | ${bt}vault_backup${bt} |`, `| Vault age report | ${bt}${toolPrefix}_core${bt} | ${bt}vault_age_report${bt} |`,
|
|
55
|
-
// Admin ops
|
|
56
|
-
`| Admin health | ${bt}${toolPrefix}_core${bt} | ${bt}admin_health${bt} |`, `| Tool list | ${bt}${toolPrefix}_core${bt} | ${bt}admin_tool_list${bt} |`, `| Config | ${bt}${toolPrefix}_core${bt} | ${bt}admin_config${bt} |`, `| Vault size | ${bt}${toolPrefix}_core${bt} | ${bt}admin_vault_size${bt} |`, `| Uptime | ${bt}${toolPrefix}_core${bt} | ${bt}admin_uptime${bt} |`, `| Version | ${bt}${toolPrefix}_core${bt} | ${bt}admin_version${bt} |`, `| Reset cache | ${bt}${toolPrefix}_core${bt} | ${bt}admin_reset_cache${bt} |`, `| Diagnostic | ${bt}${toolPrefix}_core${bt} | ${bt}admin_diagnostic${bt} |`,
|
|
57
|
-
// Loop ops
|
|
58
|
-
`| Start loop | ${bt}${toolPrefix}_core${bt} | ${bt}loop_start${bt} |`, `| Loop iterate | ${bt}${toolPrefix}_core${bt} | ${bt}loop_iterate${bt} |`, `| Loop status | ${bt}${toolPrefix}_core${bt} | ${bt}loop_status${bt} |`, `| Cancel loop | ${bt}${toolPrefix}_core${bt} | ${bt}loop_cancel${bt} |`, `| Loop history | ${bt}${toolPrefix}_core${bt} | ${bt}loop_history${bt} |`, `| Loop active | ${bt}${toolPrefix}_core${bt} | ${bt}loop_is_active${bt} |`, `| Complete loop | ${bt}${toolPrefix}_core${bt} | ${bt}loop_complete${bt} |`,
|
|
59
|
-
// Orchestrate ops
|
|
60
|
-
`| Orchestrate plan | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_plan${bt} |`, `| Orchestrate execute | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_execute${bt} |`, `| Orchestrate complete | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_complete${bt} |`, `| Orchestrate status | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_status${bt} |`, `| Quick capture | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_quick_capture${bt} |`,
|
|
61
|
-
// Capture ops
|
|
62
|
-
`| Capture knowledge | ${bt}${toolPrefix}_core${bt} | ${bt}capture_knowledge${bt} |`, `| Quick capture entry | ${bt}${toolPrefix}_core${bt} | ${bt}capture_quick${bt} |`, `| Intelligent search | ${bt}${toolPrefix}_core${bt} | ${bt}search_intelligent${bt} |`, `| Search feedback | ${bt}${toolPrefix}_core${bt} | ${bt}search_feedback${bt} |`,
|
|
63
|
-
// Grading ops
|
|
64
|
-
`| Grade plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_grade${bt} |`, `| Check history | ${bt}${toolPrefix}_core${bt} | ${bt}plan_check_history${bt} |`, `| Latest check | ${bt}${toolPrefix}_core${bt} | ${bt}plan_latest_check${bt} |`, `| Meets grade | ${bt}${toolPrefix}_core${bt} | ${bt}plan_meets_grade${bt} |`, `| Auto improve plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_auto_improve${bt} |`,
|
|
65
|
-
// Admin Extra ops
|
|
66
|
-
`| Telemetry stats | ${bt}${toolPrefix}_core${bt} | ${bt}admin_telemetry${bt} |`, `| Recent calls | ${bt}${toolPrefix}_core${bt} | ${bt}admin_telemetry_recent${bt} |`, `| Reset telemetry | ${bt}${toolPrefix}_core${bt} | ${bt}admin_telemetry_reset${bt} |`, `| Permissions | ${bt}${toolPrefix}_core${bt} | ${bt}admin_permissions${bt} |`, `| Vault analytics | ${bt}${toolPrefix}_core${bt} | ${bt}admin_vault_analytics${bt} |`, `| Search insights | ${bt}${toolPrefix}_core${bt} | ${bt}admin_search_insights${bt} |`, `| Module status | ${bt}${toolPrefix}_core${bt} | ${bt}admin_module_status${bt} |`, `| Environment | ${bt}${toolPrefix}_core${bt} | ${bt}admin_env${bt} |`, `| Garbage collect | ${bt}${toolPrefix}_core${bt} | ${bt}admin_gc${bt} |`, `| Export config | ${bt}${toolPrefix}_core${bt} | ${bt}admin_export_config${bt} |`,
|
|
67
|
-
// Curator Extra ops
|
|
68
|
-
`| Entry history | ${bt}${toolPrefix}_core${bt} | ${bt}curator_entry_history${bt} |`, `| Record snapshot | ${bt}${toolPrefix}_core${bt} | ${bt}curator_record_snapshot${bt} |`, `| Queue stats | ${bt}${toolPrefix}_core${bt} | ${bt}curator_queue_stats${bt} |`, `| Enrich metadata | ${bt}${toolPrefix}_core${bt} | ${bt}curator_enrich${bt} |`,
|
|
69
|
-
// Project ops
|
|
70
|
-
`| Get project | ${bt}${toolPrefix}_core${bt} | ${bt}project_get${bt} |`, `| List projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_list${bt} |`, `| Unregister project | ${bt}${toolPrefix}_core${bt} | ${bt}project_unregister${bt} |`, `| Project rules | ${bt}${toolPrefix}_core${bt} | ${bt}project_get_rules${bt} |`, `| All project rules | ${bt}${toolPrefix}_core${bt} | ${bt}project_list_rules${bt} |`, `| Add rule | ${bt}${toolPrefix}_core${bt} | ${bt}project_add_rule${bt} |`, `| Remove rule | ${bt}${toolPrefix}_core${bt} | ${bt}project_remove_rule${bt} |`, `| Link projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_link${bt} |`, `| Unlink projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_unlink${bt} |`, `| Project links | ${bt}${toolPrefix}_core${bt} | ${bt}project_get_links${bt} |`, `| Linked projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_linked_projects${bt} |`, `| Touch project | ${bt}${toolPrefix}_core${bt} | ${bt}project_touch${bt} |`,
|
|
71
|
-
// Cross-project memory ops
|
|
72
|
-
`| Promote to global | ${bt}${toolPrefix}_core${bt} | ${bt}memory_promote_to_global${bt} |`, `| Configure memory | ${bt}${toolPrefix}_core${bt} | ${bt}memory_configure${bt} |`, `| Cross-project search | ${bt}${toolPrefix}_core${bt} | ${bt}memory_cross_project_search${bt} |`);
|
|
73
|
-
mdLines.push('', '## Auto-Routing', '', 'A UserPromptSubmit hook auto-classifies every prompt via keyword matching.', `When you see a ${bt}[MODE-NAME]${bt} indicator in the system context:`, '', `1. Call ${bt}${toolPrefix}_core op:route_intent params:{ prompt: "<user message>" }${bt} to get full behavior rules`, '2. Follow the returned behavior rules for the detected mode', '3. Briefly acknowledge mode changes in your response (e.g., "Switching to FIX-MODE")', '', 'Available modes: FIX-MODE, BUILD-MODE, IMPROVE-MODE, DELIVER-MODE, REVIEW-MODE, PLAN-MODE, DESIGN-MODE, VALIDATE-MODE, EXPLORE-MODE, GENERAL-MODE.', 'GENERAL-MODE means the hook detected a work task but could not classify a specific mode — route_intent will refine it.', '', '## Intent Detection', '', '| Signal | Intent |', '|--------|--------|', '| Problem described ("broken", "janky", "weird") | FIX |', '| Need expressed ("I need", "we should have") | BUILD |', '| Quality questioned ("is this right?") | REVIEW |', '| Advice sought ("how should I", "best way") | PLAN |', '| Improvement requested ("make it faster") | IMPROVE |', '', '## Knowledge Protocol', '', 'When seeking guidance: vault before codebase before web.', '', `1. Search vault \u2014 ${bt}${toolPrefix}_core op:search${bt}`, '2. Codebase \u2014 only if vault has nothing', '3. Web \u2014 last resort', '', '## Knowledge Capture', '', 'When learning something that should persist, use the domain capture ops.', '', '## Session Capture', '', 'A PreCompact hook is configured to call `session_capture` before context compaction.', 'This automatically preserves session summaries as memories for future sessions.', `To manually capture: ${bt}${toolPrefix}_core op:session_capture params:{ summary: "..." }${bt}`, '', '## Planning', '', 'For multi-step tasks, use the planning system:', `1. Create: ${bt}${toolPrefix}_core op:create_plan params:{ objective: "...", scope: "...", tasks: [...] }${bt}`, `2. Approve: ${bt}${toolPrefix}_core op:approve_plan params:{ planId: "...", startExecution: true }${bt}`, `3. Track: ${bt}${toolPrefix}_core op:update_task params:{ planId: "...", taskId: "...", status: "completed" }${bt}`, `4. Complete: ${bt}${toolPrefix}_core op:complete_plan params:{ planId: "..." }${bt}`, '', 'Check activation response for recovered plans in `executing` state — remind the user.', '', `<!-- /${marker} -->`);
|
|
74
|
-
// ─── Hook Packs section (when configured) ─────────────────────
|
|
75
|
-
if (config.hookPacks?.length) {
|
|
76
|
-
const PACK_INFO = {
|
|
77
|
-
'typescript-safety': {
|
|
78
|
-
description: 'Block unsafe TypeScript patterns',
|
|
79
|
-
hooks: {
|
|
80
|
-
'no-any-types': '`:any`, `as any`, `<any>`, `Record<string, any>`',
|
|
81
|
-
'no-console-log': '`console.log` in committed code',
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
a11y: {
|
|
85
|
-
description: 'Accessibility enforcement',
|
|
86
|
-
hooks: {
|
|
87
|
-
'semantic-html': 'Generic divs where semantic HTML should be used',
|
|
88
|
-
'focus-ring-required': 'Missing visible focus indicators',
|
|
89
|
-
'ux-touch-targets': 'Touch targets smaller than 44px',
|
|
90
|
-
},
|
|
91
|
-
},
|
|
92
|
-
'css-discipline': {
|
|
93
|
-
description: 'CSS best practices',
|
|
94
|
-
hooks: {
|
|
95
|
-
'no-important': '`!important` in CSS',
|
|
96
|
-
'no-inline-styles': 'Inline style attributes',
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
'clean-commits': {
|
|
100
|
-
description: 'Clean git history',
|
|
101
|
-
hooks: {
|
|
102
|
-
'no-ai-attribution': 'AI attribution in commits',
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
};
|
|
106
|
-
// Build rows — expand 'full' to constituent packs
|
|
107
|
-
const rows = [];
|
|
108
|
-
for (const packName of config.hookPacks) {
|
|
109
|
-
if (packName === 'full') {
|
|
110
|
-
// Composed pack — expand all constituent packs
|
|
111
|
-
for (const [subPack, info] of Object.entries(PACK_INFO)) {
|
|
112
|
-
for (const [hook, blocks] of Object.entries(info.hooks)) {
|
|
113
|
-
rows.push({ pack: subPack, hook, blocks });
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
else if (PACK_INFO[packName]) {
|
|
118
|
-
for (const [hook, blocks] of Object.entries(PACK_INFO[packName].hooks)) {
|
|
119
|
-
rows.push({ pack: packName, hook, blocks });
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (rows.length > 0) {
|
|
124
|
-
// Insert before the closing marker
|
|
125
|
-
const closingMarkerIndex = mdLines.length - 1;
|
|
126
|
-
const hookLines = [
|
|
127
|
-
'',
|
|
128
|
-
'## Hook Packs',
|
|
129
|
-
'',
|
|
130
|
-
'Quality gates installed in `.claude/`. Run `scripts/setup.sh` to install globally.',
|
|
131
|
-
'',
|
|
132
|
-
'| Pack | Hook | Blocks |',
|
|
133
|
-
'|------|------|--------|',
|
|
134
|
-
...rows.map((r) => `| ${r.pack} | ${r.hook} | ${r.blocks} |`),
|
|
135
|
-
];
|
|
136
|
-
mdLines.splice(closingMarkerIndex, 0, ...hookLines);
|
|
137
|
-
}
|
|
57
|
+
mdLines.push(`| ${d} patterns | ${bt}${toolName}${bt} | ${bt}get_patterns${bt} |`, `| Search ${d} | ${bt}${toolName}${bt} | ${bt}search${bt} |`, `| Capture ${d} | ${bt}${toolName}${bt} | ${bt}capture${bt} |`);
|
|
138
58
|
}
|
|
139
|
-
//
|
|
59
|
+
// Knowledge & Search
|
|
60
|
+
mdLines.push(`| Intelligent search | ${bt}${toolPrefix}_core${bt} | ${bt}search_intelligent${bt} |`, `| Quick capture | ${bt}${toolPrefix}_core${bt} | ${bt}capture_quick${bt} |`, `| Batch capture | ${bt}${toolPrefix}_core${bt} | ${bt}capture_knowledge${bt} |`);
|
|
61
|
+
// Memory
|
|
62
|
+
mdLines.push(`| Memory search | ${bt}${toolPrefix}_core${bt} | ${bt}memory_search${bt} |`, `| Memory capture | ${bt}${toolPrefix}_core${bt} | ${bt}memory_capture${bt} |`, `| Session capture | ${bt}${toolPrefix}_core${bt} | ${bt}session_capture${bt} |`);
|
|
63
|
+
// Planning
|
|
64
|
+
mdLines.push(`| Create plan | ${bt}${toolPrefix}_core${bt} | ${bt}create_plan${bt} |`, `| Approve plan | ${bt}${toolPrefix}_core${bt} | ${bt}approve_plan${bt} |`, `| Update task | ${bt}${toolPrefix}_core${bt} | ${bt}update_task${bt} |`, `| Complete plan | ${bt}${toolPrefix}_core${bt} | ${bt}complete_plan${bt} |`);
|
|
65
|
+
// Orchestration
|
|
66
|
+
mdLines.push(`| Orchestrate plan | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_plan${bt} |`, `| Orchestrate execute | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_execute${bt} |`, `| Orchestrate complete | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_complete${bt} |`);
|
|
67
|
+
// Brain & Control
|
|
68
|
+
mdLines.push(`| Brain stats | ${bt}${toolPrefix}_core${bt} | ${bt}brain_stats${bt} |`, `| Brain feedback | ${bt}${toolPrefix}_core${bt} | ${bt}brain_feedback${bt} |`, `| Route intent | ${bt}${toolPrefix}_core${bt} | ${bt}route_intent${bt} |`, `| Get behavior rules | ${bt}${toolPrefix}_core${bt} | ${bt}get_behavior_rules${bt} |`, `| Morph mode | ${bt}${toolPrefix}_core${bt} | ${bt}morph${bt} |`);
|
|
69
|
+
// Admin
|
|
70
|
+
mdLines.push(`| Admin health | ${bt}${toolPrefix}_core${bt} | ${bt}admin_health${bt} |`, `| Tool list | ${bt}${toolPrefix}_core${bt} | ${bt}admin_tool_list${bt} |`);
|
|
71
|
+
// Governance
|
|
72
|
+
mdLines.push(`| Governance dashboard | ${bt}${toolPrefix}_core${bt} | ${bt}governance_dashboard${bt} |`, `| Governance policy | ${bt}${toolPrefix}_core${bt} | ${bt}governance_policy${bt} |`);
|
|
73
|
+
mdLines.push('');
|
|
74
|
+
// ─── Shared Behavioral Rules ───────────────────────────
|
|
75
|
+
mdLines.push(...getSharedRules(toolPrefix));
|
|
76
|
+
// ─── Hook Packs (conditional) ──────────────────────────
|
|
77
|
+
appendHookPacks(mdLines, config);
|
|
78
|
+
// ─── Closing marker ────────────────────────────────────
|
|
79
|
+
mdLines.push(`<!-- /${marker} -->`);
|
|
80
|
+
// Escape each markdown line for single-quoted TS string literal
|
|
140
81
|
const quotedLines = mdLines.map((line) => {
|
|
141
82
|
const escaped = line.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
|
142
83
|
return ` '${escaped}',`;
|
|
143
84
|
});
|
|
144
|
-
|
|
145
|
-
const tsLines = [
|
|
85
|
+
return [
|
|
146
86
|
'/**',
|
|
147
87
|
` * CLAUDE.md content for ${config.name}.`,
|
|
148
88
|
' * Generated by Soleri — do not edit manually.',
|
|
@@ -156,7 +96,14 @@ export function generateClaudeMdTemplate(config) {
|
|
|
156
96
|
'export function getClaudeMdMarker(): string {',
|
|
157
97
|
` return '${marker}';`,
|
|
158
98
|
'}',
|
|
159
|
-
];
|
|
160
|
-
|
|
99
|
+
].join('\n');
|
|
100
|
+
}
|
|
101
|
+
function appendHookPacks(mdLines, config) {
|
|
102
|
+
if (!config.hookPacks?.length)
|
|
103
|
+
return;
|
|
104
|
+
// Domain-agnostic: just list installed pack names.
|
|
105
|
+
// The hooks themselves (in .claude/) enforce the rules — no need to
|
|
106
|
+
// hardcode domain-specific descriptions in the template.
|
|
107
|
+
mdLines.push('## Hook Packs', '', 'Quality gates installed in `.claude/`. Run `scripts/setup.sh` to install globally.', '', `Installed packs: ${config.hookPacks.join(', ')}`, '', 'Each hook runs on every tool call and blocks violations automatically.', 'See `.claude/hooks/` for individual hook definitions.', '');
|
|
161
108
|
}
|
|
162
109
|
//# sourceMappingURL=claude-md-template.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claude-md-template.js","sourceRoot":"","sources":["../../src/templates/claude-md-template.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAmB;IAC1D,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,+CAA+C;IAC7E,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,OAAO,CAAC;IACnC,MAAM,EAAE,GAAG,GAAG,CAAC,CAAC,kCAAkC;IAElD,gEAAgE;IAChE,MAAM,OAAO,GAAa;QACxB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,EAAE;QACF,+CAA+C;QAC/C,aAAa,MAAM,IAAI;QACvB,GAAG;KACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC;AAED,SAAS,eAAe,CAAC,OAAiB,EAAE,MAAmB;IAC7D,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM;QAAE,OAAO;IAEtC,mDAAmD;IACnD,oEAAoE;IACpE,yDAAyD;IACzD,OAAO,CAAC,IAAI,CACV,eAAe,EACf,EAAE,EACF,oFAAoF,EACpF,EAAE,EACF,oBAAoB,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EACjD,EAAE,EACF,wEAAwE,EACxE,uDAAuD,EACvD,EAAE,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared behavioral rules that every Soleri agent ships with.
|
|
3
|
+
*
|
|
4
|
+
* These rules are agent-agnostic and mirror the quality of Salvador's
|
|
5
|
+
* hand-crafted CLAUDE.md behavioral sections. They cover:
|
|
6
|
+
* - Vault-first knowledge protocol
|
|
7
|
+
* - Planning enforcement (two-gate approval)
|
|
8
|
+
* - Output formatting (plan metadata tables, drift reports)
|
|
9
|
+
* - Knowledge capture discipline
|
|
10
|
+
* - Intent routing
|
|
11
|
+
* - Session lifecycle
|
|
12
|
+
*/
|
|
13
|
+
/** Returns markdown lines for all shared behavioral sections. */
|
|
14
|
+
export declare function getSharedRules(toolPrefix: string): string[];
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared behavioral rules that every Soleri agent ships with.
|
|
3
|
+
*
|
|
4
|
+
* These rules are agent-agnostic and mirror the quality of Salvador's
|
|
5
|
+
* hand-crafted CLAUDE.md behavioral sections. They cover:
|
|
6
|
+
* - Vault-first knowledge protocol
|
|
7
|
+
* - Planning enforcement (two-gate approval)
|
|
8
|
+
* - Output formatting (plan metadata tables, drift reports)
|
|
9
|
+
* - Knowledge capture discipline
|
|
10
|
+
* - Intent routing
|
|
11
|
+
* - Session lifecycle
|
|
12
|
+
*/
|
|
13
|
+
/** Returns markdown lines for all shared behavioral sections. */
|
|
14
|
+
export function getSharedRules(toolPrefix) {
|
|
15
|
+
const bt = '`';
|
|
16
|
+
return [
|
|
17
|
+
// ─── Vault-First Protocol ────────────────────────────────
|
|
18
|
+
'## Vault as Source of Truth',
|
|
19
|
+
'',
|
|
20
|
+
'Before every decision — planning, design, architecture, problem-solving — consult the vault.',
|
|
21
|
+
'',
|
|
22
|
+
'**Lookup order:**',
|
|
23
|
+
`1. Vault — ${bt}${toolPrefix}_core op:search_intelligent params:{ query: "..." }${bt}`,
|
|
24
|
+
'2. Codebase — only if vault has nothing',
|
|
25
|
+
'3. Web / training knowledge — last resort',
|
|
26
|
+
'',
|
|
27
|
+
'If the vault has a pattern, follow it. If it has an anti-pattern, avoid it.',
|
|
28
|
+
'',
|
|
29
|
+
// ─── Planning Enforcement ────────────────────────────────
|
|
30
|
+
'## Planning',
|
|
31
|
+
'',
|
|
32
|
+
'For multi-step tasks, use the planning system. **Never skip gates.**',
|
|
33
|
+
'',
|
|
34
|
+
'**Lifecycle:**',
|
|
35
|
+
`${bt}draft → approved (Gate 1) → tasks approved (Gate 2) → executing → reconciling → completed${bt}`,
|
|
36
|
+
'',
|
|
37
|
+
'**Sequence:**',
|
|
38
|
+
`1. Create: ${bt}${toolPrefix}_core op:create_plan params:{ objective: "...", scope: "...", tasks: [...] }${bt}`,
|
|
39
|
+
`2. Approve plan (Gate 1): ${bt}${toolPrefix}_core op:approve_plan params:{ planId: "..." }${bt}`,
|
|
40
|
+
`3. Split tasks (Gate 2): ${bt}${toolPrefix}_core op:plan_split params:{ planId: "..." }${bt}`,
|
|
41
|
+
`4. Track: ${bt}${toolPrefix}_core op:update_task params:{ planId: "...", taskId: "...", status: "completed" }${bt}`,
|
|
42
|
+
`5. Reconcile: ${bt}${toolPrefix}_core op:plan_reconcile params:{ planId: "..." }${bt}`,
|
|
43
|
+
`6. Complete: ${bt}${toolPrefix}_core op:plan_complete_lifecycle params:{ planId: "..." }${bt}`,
|
|
44
|
+
'',
|
|
45
|
+
'Wait for explicit user approval before proceeding past each gate.',
|
|
46
|
+
'Check activation response for recovered plans in `executing` state — remind the user.',
|
|
47
|
+
'',
|
|
48
|
+
'**Exceptions:** Read-only operations, user says "just do it", single-line fixes.',
|
|
49
|
+
'',
|
|
50
|
+
// ─── Output Formatting ───────────────────────────────────
|
|
51
|
+
'## Output Formatting',
|
|
52
|
+
'',
|
|
53
|
+
'**Plan metadata** — always show at top of every plan summary:',
|
|
54
|
+
'',
|
|
55
|
+
'| Field | Value |',
|
|
56
|
+
'|-------|-------|',
|
|
57
|
+
'| **Plan ID** | {planId} |',
|
|
58
|
+
'| **Check ID** | {checkId} |',
|
|
59
|
+
'| **Grade** | {grade} ({score}/100) |',
|
|
60
|
+
'| **Status** | {status} |',
|
|
61
|
+
'',
|
|
62
|
+
'**Drift reports:**',
|
|
63
|
+
'',
|
|
64
|
+
'| Field | Value |',
|
|
65
|
+
'|-------|-------|',
|
|
66
|
+
'| **Accuracy** | {accuracyScore}/100 |',
|
|
67
|
+
'| **Drift Items** | {count} |',
|
|
68
|
+
'',
|
|
69
|
+
'| Type | Description | Impact |',
|
|
70
|
+
'|------|-------------|--------|',
|
|
71
|
+
'| skipped | ... | medium |',
|
|
72
|
+
'',
|
|
73
|
+
// ─── Knowledge Capture ───────────────────────────────────
|
|
74
|
+
'## Knowledge Capture',
|
|
75
|
+
'',
|
|
76
|
+
"When learning something that should persist, capture it — don't just promise to remember.",
|
|
77
|
+
'',
|
|
78
|
+
`- Domain knowledge: ${bt}${toolPrefix}_core op:capture_quick params:{ title: "...", description: "..." }${bt}`,
|
|
79
|
+
`- Batch capture: ${bt}${toolPrefix}_core op:capture_knowledge params:{ entries: [...] }${bt}`,
|
|
80
|
+
`- Intelligent search: ${bt}${toolPrefix}_core op:search_intelligent params:{ query: "..." }${bt}`,
|
|
81
|
+
'',
|
|
82
|
+
// ─── Intent Detection ────────────────────────────────────
|
|
83
|
+
'## Intent Detection',
|
|
84
|
+
'',
|
|
85
|
+
'A UserPromptSubmit hook auto-classifies prompts. When you see a `[MODE-NAME]` indicator:',
|
|
86
|
+
'',
|
|
87
|
+
`1. Call ${bt}${toolPrefix}_core op:route_intent params:{ prompt: "<user message>" }${bt}`,
|
|
88
|
+
'2. Follow the returned behavior rules',
|
|
89
|
+
'3. Briefly acknowledge mode changes',
|
|
90
|
+
'',
|
|
91
|
+
'| Signal | Intent |',
|
|
92
|
+
'|--------|--------|',
|
|
93
|
+
'| Problem described ("broken", "janky", "weird") | FIX |',
|
|
94
|
+
'| Need expressed ("I need", "we should have") | BUILD |',
|
|
95
|
+
'| Quality questioned ("is this right?") | REVIEW |',
|
|
96
|
+
'| Advice sought ("how should I", "best way") | PLAN |',
|
|
97
|
+
'| Improvement requested ("make it faster") | IMPROVE |',
|
|
98
|
+
'| Ready to ship ("deploy", "release") | DELIVER |',
|
|
99
|
+
'',
|
|
100
|
+
// ─── Session Lifecycle ───────────────────────────────────
|
|
101
|
+
'## Session Lifecycle',
|
|
102
|
+
'',
|
|
103
|
+
'A PreCompact hook calls `session_capture` before context compaction.',
|
|
104
|
+
`Manual capture: ${bt}${toolPrefix}_core op:session_capture params:{ summary: "..." }${bt}`,
|
|
105
|
+
'',
|
|
106
|
+
// ─── Orchestration ───────────────────────────────────────
|
|
107
|
+
'## Orchestration',
|
|
108
|
+
'',
|
|
109
|
+
'For complex workflows, use the orchestration layer instead of manual planning:',
|
|
110
|
+
'',
|
|
111
|
+
`1. Plan: ${bt}${toolPrefix}_core op:orchestrate_plan params:{ prompt: "...", projectPath: "." }${bt}`,
|
|
112
|
+
`2. Execute: ${bt}${toolPrefix}_core op:orchestrate_execute params:{ planId: "..." }${bt}`,
|
|
113
|
+
`3. Complete: ${bt}${toolPrefix}_core op:orchestrate_complete params:{ planId: "..." }${bt}`,
|
|
114
|
+
'',
|
|
115
|
+
'The orchestrator handles vault lookup, brain recommendations, and knowledge capture automatically.',
|
|
116
|
+
'',
|
|
117
|
+
];
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=shared-rules.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-rules.js","sourceRoot":"","sources":["../../src/templates/shared-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,iEAAiE;AACjE,MAAM,UAAU,cAAc,CAAC,UAAkB;IAC/C,MAAM,EAAE,GAAG,GAAG,CAAC;IAEf,OAAO;QACL,4DAA4D;QAC5D,6BAA6B;QAC7B,EAAE;QACF,8FAA8F;QAC9F,EAAE;QACF,mBAAmB;QACnB,cAAc,EAAE,GAAG,UAAU,sDAAsD,EAAE,EAAE;QACvF,yCAAyC;QACzC,2CAA2C;QAC3C,EAAE;QACF,6EAA6E;QAC7E,EAAE;QAEF,4DAA4D;QAC5D,aAAa;QACb,EAAE;QACF,sEAAsE;QACtE,EAAE;QACF,gBAAgB;QAChB,GAAG,EAAE,4FAA4F,EAAE,EAAE;QACrG,EAAE;QACF,eAAe;QACf,cAAc,EAAE,GAAG,UAAU,+EAA+E,EAAE,EAAE;QAChH,6BAA6B,EAAE,GAAG,UAAU,iDAAiD,EAAE,EAAE;QACjG,4BAA4B,EAAE,GAAG,UAAU,+CAA+C,EAAE,EAAE;QAC9F,aAAa,EAAE,GAAG,UAAU,oFAAoF,EAAE,EAAE;QACpH,iBAAiB,EAAE,GAAG,UAAU,mDAAmD,EAAE,EAAE;QACvF,gBAAgB,EAAE,GAAG,UAAU,4DAA4D,EAAE,EAAE;QAC/F,EAAE;QACF,mEAAmE;QACnE,uFAAuF;QACvF,EAAE;QACF,kFAAkF;QAClF,EAAE;QAEF,4DAA4D;QAC5D,sBAAsB;QACtB,EAAE;QACF,+DAA+D;QAC/D,EAAE;QACF,mBAAmB;QACnB,mBAAmB;QACnB,4BAA4B;QAC5B,8BAA8B;QAC9B,uCAAuC;QACvC,2BAA2B;QAC3B,EAAE;QACF,oBAAoB;QACpB,EAAE;QACF,mBAAmB;QACnB,mBAAmB;QACnB,wCAAwC;QACxC,+BAA+B;QAC/B,EAAE;QACF,iCAAiC;QACjC,iCAAiC;QACjC,4BAA4B;QAC5B,EAAE;QAEF,4DAA4D;QAC5D,sBAAsB;QACtB,EAAE;QACF,2FAA2F;QAC3F,EAAE;QACF,uBAAuB,EAAE,GAAG,UAAU,qEAAqE,EAAE,EAAE;QAC/G,oBAAoB,EAAE,GAAG,UAAU,uDAAuD,EAAE,EAAE;QAC9F,yBAAyB,EAAE,GAAG,UAAU,sDAAsD,EAAE,EAAE;QAClG,EAAE;QAEF,4DAA4D;QAC5D,qBAAqB;QACrB,EAAE;QACF,0FAA0F;QAC1F,EAAE;QACF,WAAW,EAAE,GAAG,UAAU,4DAA4D,EAAE,EAAE;QAC1F,uCAAuC;QACvC,qCAAqC;QACrC,EAAE;QACF,qBAAqB;QACrB,qBAAqB;QACrB,0DAA0D;QAC1D,yDAAyD;QACzD,oDAAoD;QACpD,uDAAuD;QACvD,wDAAwD;QACxD,mDAAmD;QACnD,EAAE;QAEF,4DAA4D;QAC5D,sBAAsB;QACtB,EAAE;QACF,sEAAsE;QACtE,mBAAmB,EAAE,GAAG,UAAU,qDAAqD,EAAE,EAAE;QAC3F,EAAE;QAEF,4DAA4D;QAC5D,kBAAkB;QAClB,EAAE;QACF,gFAAgF;QAChF,EAAE;QACF,YAAY,EAAE,GAAG,UAAU,uEAAuE,EAAE,EAAE;QACtG,eAAe,EAAE,GAAG,UAAU,wDAAwD,EAAE,EAAE;QAC1F,gBAAgB,EAAE,GAAG,UAAU,yDAAyD,EAAE,EAAE;QAC5F,EAAE;QACF,oGAAoG;QACpG,EAAE;KACH,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -60,6 +60,8 @@ export declare const AgentConfigSchema: z.ZodObject<{
|
|
|
60
60
|
telegram?: boolean | undefined;
|
|
61
61
|
}>;
|
|
62
62
|
export type AgentConfig = z.infer<typeof AgentConfigSchema>;
|
|
63
|
+
/** Input type — fields with defaults are optional (use before Zod parsing) */
|
|
64
|
+
export type AgentConfigInput = z.input<typeof AgentConfigSchema>;
|
|
63
65
|
/** Result of scaffolding */
|
|
64
66
|
export interface ScaffoldResult {
|
|
65
67
|
success: boolean;
|
package/package.json
CHANGED
package/src/lib.ts
CHANGED
package/src/patching.ts
CHANGED
|
@@ -120,16 +120,17 @@ export function patchClaudeMdContent(
|
|
|
120
120
|
|
|
121
121
|
if (domainsToAdd.length === 0) return source;
|
|
122
122
|
|
|
123
|
-
// Try
|
|
124
|
-
let anchorIdx = source.indexOf("'|
|
|
123
|
+
// Try anchors in order: v6 (curated table), v5 (full table), v4 (legacy)
|
|
124
|
+
let anchorIdx = source.indexOf("'| Intelligent search |");
|
|
125
125
|
if (anchorIdx === -1) {
|
|
126
|
-
|
|
126
|
+
anchorIdx = source.indexOf("'| Memory search |");
|
|
127
|
+
}
|
|
128
|
+
if (anchorIdx === -1) {
|
|
129
|
+
// v4 agents: insert before ## Intent Detection
|
|
127
130
|
anchorIdx = source.indexOf("'## Intent Detection'");
|
|
128
131
|
if (anchorIdx === -1) return null;
|
|
129
|
-
// Back up to include the preceding empty string line ('',)
|
|
130
132
|
const emptyLineIdx = source.lastIndexOf("'',", anchorIdx);
|
|
131
133
|
if (emptyLineIdx !== -1 && anchorIdx - emptyLineIdx < 20) {
|
|
132
|
-
// Find the start of that line (the indentation)
|
|
133
134
|
const lineStart = source.lastIndexOf('\n', emptyLineIdx);
|
|
134
135
|
anchorIdx = lineStart === -1 ? emptyLineIdx : lineStart + 1;
|
|
135
136
|
}
|
|
@@ -1,324 +1,154 @@
|
|
|
1
1
|
import type { AgentConfig } from '../types.js';
|
|
2
|
+
import { getSharedRules } from './shared-rules.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Generates src/activation/claude-md-content.ts for a new agent.
|
|
5
|
-
* Returns the CLAUDE.md section content with activation triggers,
|
|
6
|
-
* facade tables, intent detection, and knowledge protocol.
|
|
7
6
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
7
|
+
* Architecture:
|
|
8
|
+
* 1. Agent-specific identity (persona, domains, principles)
|
|
9
|
+
* 2. Session start protocol
|
|
10
|
+
* 3. Curated facade table (~30 key ops, grouped by category)
|
|
11
|
+
* 4. Shared behavioral rules (vault-first, planning, output formatting)
|
|
12
|
+
* 5. Hook packs (conditional)
|
|
13
|
+
*
|
|
14
|
+
* Full op list is always available via `admin_tool_list` — no need to
|
|
15
|
+
* enumerate all 145+ ops in CLAUDE.md.
|
|
11
16
|
*/
|
|
12
17
|
export function generateClaudeMdTemplate(config: AgentConfig): string {
|
|
13
|
-
const toolPrefix = config.id;
|
|
18
|
+
const toolPrefix = config.id;
|
|
14
19
|
const marker = `${config.id}:mode`;
|
|
15
|
-
const bt = '`';
|
|
20
|
+
const bt = '`';
|
|
16
21
|
|
|
17
|
-
// Build the raw markdown lines (plain text, no escaping needed)
|
|
18
22
|
const mdLines: string[] = [
|
|
19
23
|
`<!-- ${marker} -->`,
|
|
20
24
|
'',
|
|
21
25
|
`# ${config.name} Mode`,
|
|
22
26
|
'',
|
|
23
|
-
|
|
27
|
+
|
|
28
|
+
// ─── Identity ──────────────────────────────────────────
|
|
29
|
+
`## ${config.name}`,
|
|
30
|
+
'',
|
|
31
|
+
`**Role:** ${config.role}`,
|
|
32
|
+
`**Domains:** ${config.domains.join(', ')}`,
|
|
33
|
+
`**Tone:** ${config.tone ?? 'pragmatic'}`,
|
|
34
|
+
'',
|
|
35
|
+
config.description,
|
|
36
|
+
'',
|
|
37
|
+
'**Principles:**',
|
|
38
|
+
...config.principles.map((p) => `- ${p}`),
|
|
24
39
|
'',
|
|
25
|
-
|
|
26
|
-
|
|
40
|
+
|
|
41
|
+
// ─── Activation ────────────────────────────────────────
|
|
42
|
+
'## Activation',
|
|
43
|
+
'',
|
|
44
|
+
`**Activate:** "Hello, ${config.name}!" → ${bt}${toolPrefix}_core op:activate params:{ projectPath: "." }${bt}`,
|
|
45
|
+
`**Deactivate:** "Goodbye, ${config.name}!" → ${bt}${toolPrefix}_core op:activate params:{ deactivate: true }${bt}`,
|
|
27
46
|
'',
|
|
28
47
|
'On activation, adopt the returned persona. Stay in character until deactivated.',
|
|
29
48
|
'',
|
|
49
|
+
|
|
50
|
+
// ─── Session Start ─────────────────────────────────────
|
|
30
51
|
'## Session Start',
|
|
31
52
|
'',
|
|
32
53
|
`On every new session: ${bt}${toolPrefix}_core op:register params:{ projectPath: "." }${bt}`,
|
|
33
54
|
'',
|
|
34
|
-
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
// ─── Curated Facade Table ──────────────────────────────
|
|
58
|
+
mdLines.push(
|
|
59
|
+
'## Key Operations',
|
|
60
|
+
'',
|
|
61
|
+
`Full list: ${bt}${toolPrefix}_core op:admin_tool_list${bt}`,
|
|
35
62
|
'',
|
|
36
63
|
'| Need | Facade | Op |',
|
|
37
64
|
'|------|--------|----|',
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
// Essential
|
|
68
|
+
mdLines.push(
|
|
38
69
|
`| Health check | ${bt}${toolPrefix}_core${bt} | ${bt}health${bt} |`,
|
|
39
70
|
`| Search all | ${bt}${toolPrefix}_core${bt} | ${bt}search${bt} |`,
|
|
40
|
-
`| Vault stats | ${bt}${toolPrefix}_core${bt} | ${bt}vault_stats${bt} |`,
|
|
41
71
|
`| Identity | ${bt}${toolPrefix}_core${bt} | ${bt}identity${bt} |`,
|
|
42
|
-
|
|
72
|
+
);
|
|
43
73
|
|
|
44
|
-
// Domain-specific
|
|
74
|
+
// Domain-specific (3 rows per domain)
|
|
45
75
|
for (const d of config.domains) {
|
|
46
76
|
const toolName = `${toolPrefix}_${d.replace(/-/g, '_')}`;
|
|
47
|
-
mdLines.push(
|
|
48
|
-
|
|
49
|
-
|
|
77
|
+
mdLines.push(
|
|
78
|
+
`| ${d} patterns | ${bt}${toolName}${bt} | ${bt}get_patterns${bt} |`,
|
|
79
|
+
`| Search ${d} | ${bt}${toolName}${bt} | ${bt}search${bt} |`,
|
|
80
|
+
`| Capture ${d} | ${bt}${toolName}${bt} | ${bt}capture${bt} |`,
|
|
81
|
+
);
|
|
50
82
|
}
|
|
51
83
|
|
|
52
|
-
//
|
|
84
|
+
// Knowledge & Search
|
|
85
|
+
mdLines.push(
|
|
86
|
+
`| Intelligent search | ${bt}${toolPrefix}_core${bt} | ${bt}search_intelligent${bt} |`,
|
|
87
|
+
`| Quick capture | ${bt}${toolPrefix}_core${bt} | ${bt}capture_quick${bt} |`,
|
|
88
|
+
`| Batch capture | ${bt}${toolPrefix}_core${bt} | ${bt}capture_knowledge${bt} |`,
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// Memory
|
|
53
92
|
mdLines.push(
|
|
54
93
|
`| Memory search | ${bt}${toolPrefix}_core${bt} | ${bt}memory_search${bt} |`,
|
|
55
94
|
`| Memory capture | ${bt}${toolPrefix}_core${bt} | ${bt}memory_capture${bt} |`,
|
|
56
|
-
`| Memory list | ${bt}${toolPrefix}_core${bt} | ${bt}memory_list${bt} |`,
|
|
57
95
|
`| Session capture | ${bt}${toolPrefix}_core${bt} | ${bt}session_capture${bt} |`,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`| Reset extracted | ${bt}${toolPrefix}_core${bt} | ${bt}brain_reset_extracted${bt} |`,
|
|
63
|
-
`| Rebuild vocabulary | ${bt}${toolPrefix}_core${bt} | ${bt}rebuild_vocabulary${bt} |`,
|
|
64
|
-
`| Brain stats | ${bt}${toolPrefix}_core${bt} | ${bt}brain_stats${bt} |`,
|
|
65
|
-
`| LLM status | ${bt}${toolPrefix}_core${bt} | ${bt}llm_status${bt} |`,
|
|
96
|
+
);
|
|
97
|
+
|
|
98
|
+
// Planning
|
|
99
|
+
mdLines.push(
|
|
66
100
|
`| Create plan | ${bt}${toolPrefix}_core${bt} | ${bt}create_plan${bt} |`,
|
|
67
|
-
`| Get plan | ${bt}${toolPrefix}_core${bt} | ${bt}get_plan${bt} |`,
|
|
68
101
|
`| Approve plan | ${bt}${toolPrefix}_core${bt} | ${bt}approve_plan${bt} |`,
|
|
69
102
|
`| Update task | ${bt}${toolPrefix}_core${bt} | ${bt}update_task${bt} |`,
|
|
70
103
|
`| Complete plan | ${bt}${toolPrefix}_core${bt} | ${bt}complete_plan${bt} |`,
|
|
104
|
+
);
|
|
105
|
+
|
|
106
|
+
// Orchestration
|
|
107
|
+
mdLines.push(
|
|
108
|
+
`| Orchestrate plan | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_plan${bt} |`,
|
|
109
|
+
`| Orchestrate execute | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_execute${bt} |`,
|
|
110
|
+
`| Orchestrate complete | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_complete${bt} |`,
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
// Brain & Control
|
|
114
|
+
mdLines.push(
|
|
115
|
+
`| Brain stats | ${bt}${toolPrefix}_core${bt} | ${bt}brain_stats${bt} |`,
|
|
116
|
+
`| Brain feedback | ${bt}${toolPrefix}_core${bt} | ${bt}brain_feedback${bt} |`,
|
|
71
117
|
`| Route intent | ${bt}${toolPrefix}_core${bt} | ${bt}route_intent${bt} |`,
|
|
72
|
-
`| Morph mode | ${bt}${toolPrefix}_core${bt} | ${bt}morph${bt} |`,
|
|
73
118
|
`| Get behavior rules | ${bt}${toolPrefix}_core${bt} | ${bt}get_behavior_rules${bt} |`,
|
|
74
|
-
`|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
`| Cognee status | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_status${bt} |`,
|
|
80
|
-
`| Cognee search | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_search${bt} |`,
|
|
81
|
-
`| Cognee add | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_add${bt} |`,
|
|
82
|
-
`| Cognee cognify | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_cognify${bt} |`,
|
|
83
|
-
`| Cognee config | ${bt}${toolPrefix}_core${bt} | ${bt}cognee_config${bt} |`,
|
|
84
|
-
`| LLM rotate key | ${bt}${toolPrefix}_core${bt} | ${bt}llm_rotate${bt} |`,
|
|
85
|
-
`| LLM call | ${bt}${toolPrefix}_core${bt} | ${bt}llm_call${bt} |`,
|
|
86
|
-
`| Governance policy | ${bt}${toolPrefix}_core${bt} | ${bt}governance_policy${bt} |`,
|
|
87
|
-
`| Governance proposals | ${bt}${toolPrefix}_core${bt} | ${bt}governance_proposals${bt} |`,
|
|
88
|
-
`| Governance stats | ${bt}${toolPrefix}_core${bt} | ${bt}governance_stats${bt} |`,
|
|
89
|
-
`| Expire proposals | ${bt}${toolPrefix}_core${bt} | ${bt}governance_expire${bt} |`,
|
|
90
|
-
`| Governance dashboard | ${bt}${toolPrefix}_core${bt} | ${bt}governance_dashboard${bt} |`,
|
|
91
|
-
// Planning Extra ops
|
|
92
|
-
`| Iterate plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_iterate${bt} |`,
|
|
93
|
-
`| Split plan tasks | ${bt}${toolPrefix}_core${bt} | ${bt}plan_split${bt} |`,
|
|
94
|
-
`| Reconcile plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_reconcile${bt} |`,
|
|
95
|
-
`| Complete lifecycle | ${bt}${toolPrefix}_core${bt} | ${bt}plan_complete_lifecycle${bt} |`,
|
|
96
|
-
`| Dispatch tasks | ${bt}${toolPrefix}_core${bt} | ${bt}plan_dispatch${bt} |`,
|
|
97
|
-
`| Review plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_review${bt} |`,
|
|
98
|
-
`| Archive plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_archive${bt} |`,
|
|
99
|
-
`| List plan tasks | ${bt}${toolPrefix}_core${bt} | ${bt}plan_list_tasks${bt} |`,
|
|
100
|
-
`| Plan stats | ${bt}${toolPrefix}_core${bt} | ${bt}plan_stats${bt} |`,
|
|
101
|
-
// Memory Extra ops
|
|
102
|
-
`| Delete memory | ${bt}${toolPrefix}_core${bt} | ${bt}memory_delete${bt} |`,
|
|
103
|
-
`| Memory stats | ${bt}${toolPrefix}_core${bt} | ${bt}memory_stats${bt} |`,
|
|
104
|
-
`| Export memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_export${bt} |`,
|
|
105
|
-
`| Import memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_import${bt} |`,
|
|
106
|
-
`| Prune memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_prune${bt} |`,
|
|
107
|
-
`| Deduplicate memories | ${bt}${toolPrefix}_core${bt} | ${bt}memory_deduplicate${bt} |`,
|
|
108
|
-
`| Memory topics | ${bt}${toolPrefix}_core${bt} | ${bt}memory_topics${bt} |`,
|
|
109
|
-
`| Memories by project | ${bt}${toolPrefix}_core${bt} | ${bt}memory_by_project${bt} |`,
|
|
110
|
-
// Vault Extra ops
|
|
111
|
-
`| Get vault entry | ${bt}${toolPrefix}_core${bt} | ${bt}vault_get${bt} |`,
|
|
112
|
-
`| Update entry | ${bt}${toolPrefix}_core${bt} | ${bt}vault_update${bt} |`,
|
|
113
|
-
`| Remove entry | ${bt}${toolPrefix}_core${bt} | ${bt}vault_remove${bt} |`,
|
|
114
|
-
`| Bulk add | ${bt}${toolPrefix}_core${bt} | ${bt}vault_bulk_add${bt} |`,
|
|
115
|
-
`| Bulk remove | ${bt}${toolPrefix}_core${bt} | ${bt}vault_bulk_remove${bt} |`,
|
|
116
|
-
`| Vault tags | ${bt}${toolPrefix}_core${bt} | ${bt}vault_tags${bt} |`,
|
|
117
|
-
`| Vault domains | ${bt}${toolPrefix}_core${bt} | ${bt}vault_domains${bt} |`,
|
|
118
|
-
`| Recent entries | ${bt}${toolPrefix}_core${bt} | ${bt}vault_recent${bt} |`,
|
|
119
|
-
`| Import entries | ${bt}${toolPrefix}_core${bt} | ${bt}vault_import${bt} |`,
|
|
120
|
-
`| Seed entries | ${bt}${toolPrefix}_core${bt} | ${bt}vault_seed${bt} |`,
|
|
121
|
-
`| Backup vault | ${bt}${toolPrefix}_core${bt} | ${bt}vault_backup${bt} |`,
|
|
122
|
-
`| Vault age report | ${bt}${toolPrefix}_core${bt} | ${bt}vault_age_report${bt} |`,
|
|
123
|
-
// Admin ops
|
|
119
|
+
`| Morph mode | ${bt}${toolPrefix}_core${bt} | ${bt}morph${bt} |`,
|
|
120
|
+
);
|
|
121
|
+
|
|
122
|
+
// Admin
|
|
123
|
+
mdLines.push(
|
|
124
124
|
`| Admin health | ${bt}${toolPrefix}_core${bt} | ${bt}admin_health${bt} |`,
|
|
125
125
|
`| Tool list | ${bt}${toolPrefix}_core${bt} | ${bt}admin_tool_list${bt} |`,
|
|
126
|
-
`| Config | ${bt}${toolPrefix}_core${bt} | ${bt}admin_config${bt} |`,
|
|
127
|
-
`| Vault size | ${bt}${toolPrefix}_core${bt} | ${bt}admin_vault_size${bt} |`,
|
|
128
|
-
`| Uptime | ${bt}${toolPrefix}_core${bt} | ${bt}admin_uptime${bt} |`,
|
|
129
|
-
`| Version | ${bt}${toolPrefix}_core${bt} | ${bt}admin_version${bt} |`,
|
|
130
|
-
`| Reset cache | ${bt}${toolPrefix}_core${bt} | ${bt}admin_reset_cache${bt} |`,
|
|
131
|
-
`| Diagnostic | ${bt}${toolPrefix}_core${bt} | ${bt}admin_diagnostic${bt} |`,
|
|
132
|
-
// Loop ops
|
|
133
|
-
`| Start loop | ${bt}${toolPrefix}_core${bt} | ${bt}loop_start${bt} |`,
|
|
134
|
-
`| Loop iterate | ${bt}${toolPrefix}_core${bt} | ${bt}loop_iterate${bt} |`,
|
|
135
|
-
`| Loop status | ${bt}${toolPrefix}_core${bt} | ${bt}loop_status${bt} |`,
|
|
136
|
-
`| Cancel loop | ${bt}${toolPrefix}_core${bt} | ${bt}loop_cancel${bt} |`,
|
|
137
|
-
`| Loop history | ${bt}${toolPrefix}_core${bt} | ${bt}loop_history${bt} |`,
|
|
138
|
-
`| Loop active | ${bt}${toolPrefix}_core${bt} | ${bt}loop_is_active${bt} |`,
|
|
139
|
-
`| Complete loop | ${bt}${toolPrefix}_core${bt} | ${bt}loop_complete${bt} |`,
|
|
140
|
-
// Orchestrate ops
|
|
141
|
-
`| Orchestrate plan | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_plan${bt} |`,
|
|
142
|
-
`| Orchestrate execute | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_execute${bt} |`,
|
|
143
|
-
`| Orchestrate complete | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_complete${bt} |`,
|
|
144
|
-
`| Orchestrate status | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_status${bt} |`,
|
|
145
|
-
`| Quick capture | ${bt}${toolPrefix}_core${bt} | ${bt}orchestrate_quick_capture${bt} |`,
|
|
146
|
-
// Capture ops
|
|
147
|
-
`| Capture knowledge | ${bt}${toolPrefix}_core${bt} | ${bt}capture_knowledge${bt} |`,
|
|
148
|
-
`| Quick capture entry | ${bt}${toolPrefix}_core${bt} | ${bt}capture_quick${bt} |`,
|
|
149
|
-
`| Intelligent search | ${bt}${toolPrefix}_core${bt} | ${bt}search_intelligent${bt} |`,
|
|
150
|
-
`| Search feedback | ${bt}${toolPrefix}_core${bt} | ${bt}search_feedback${bt} |`,
|
|
151
|
-
// Grading ops
|
|
152
|
-
`| Grade plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_grade${bt} |`,
|
|
153
|
-
`| Check history | ${bt}${toolPrefix}_core${bt} | ${bt}plan_check_history${bt} |`,
|
|
154
|
-
`| Latest check | ${bt}${toolPrefix}_core${bt} | ${bt}plan_latest_check${bt} |`,
|
|
155
|
-
`| Meets grade | ${bt}${toolPrefix}_core${bt} | ${bt}plan_meets_grade${bt} |`,
|
|
156
|
-
`| Auto improve plan | ${bt}${toolPrefix}_core${bt} | ${bt}plan_auto_improve${bt} |`,
|
|
157
|
-
// Admin Extra ops
|
|
158
|
-
`| Telemetry stats | ${bt}${toolPrefix}_core${bt} | ${bt}admin_telemetry${bt} |`,
|
|
159
|
-
`| Recent calls | ${bt}${toolPrefix}_core${bt} | ${bt}admin_telemetry_recent${bt} |`,
|
|
160
|
-
`| Reset telemetry | ${bt}${toolPrefix}_core${bt} | ${bt}admin_telemetry_reset${bt} |`,
|
|
161
|
-
`| Permissions | ${bt}${toolPrefix}_core${bt} | ${bt}admin_permissions${bt} |`,
|
|
162
|
-
`| Vault analytics | ${bt}${toolPrefix}_core${bt} | ${bt}admin_vault_analytics${bt} |`,
|
|
163
|
-
`| Search insights | ${bt}${toolPrefix}_core${bt} | ${bt}admin_search_insights${bt} |`,
|
|
164
|
-
`| Module status | ${bt}${toolPrefix}_core${bt} | ${bt}admin_module_status${bt} |`,
|
|
165
|
-
`| Environment | ${bt}${toolPrefix}_core${bt} | ${bt}admin_env${bt} |`,
|
|
166
|
-
`| Garbage collect | ${bt}${toolPrefix}_core${bt} | ${bt}admin_gc${bt} |`,
|
|
167
|
-
`| Export config | ${bt}${toolPrefix}_core${bt} | ${bt}admin_export_config${bt} |`,
|
|
168
|
-
// Curator Extra ops
|
|
169
|
-
`| Entry history | ${bt}${toolPrefix}_core${bt} | ${bt}curator_entry_history${bt} |`,
|
|
170
|
-
`| Record snapshot | ${bt}${toolPrefix}_core${bt} | ${bt}curator_record_snapshot${bt} |`,
|
|
171
|
-
`| Queue stats | ${bt}${toolPrefix}_core${bt} | ${bt}curator_queue_stats${bt} |`,
|
|
172
|
-
`| Enrich metadata | ${bt}${toolPrefix}_core${bt} | ${bt}curator_enrich${bt} |`,
|
|
173
|
-
// Project ops
|
|
174
|
-
`| Get project | ${bt}${toolPrefix}_core${bt} | ${bt}project_get${bt} |`,
|
|
175
|
-
`| List projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_list${bt} |`,
|
|
176
|
-
`| Unregister project | ${bt}${toolPrefix}_core${bt} | ${bt}project_unregister${bt} |`,
|
|
177
|
-
`| Project rules | ${bt}${toolPrefix}_core${bt} | ${bt}project_get_rules${bt} |`,
|
|
178
|
-
`| All project rules | ${bt}${toolPrefix}_core${bt} | ${bt}project_list_rules${bt} |`,
|
|
179
|
-
`| Add rule | ${bt}${toolPrefix}_core${bt} | ${bt}project_add_rule${bt} |`,
|
|
180
|
-
`| Remove rule | ${bt}${toolPrefix}_core${bt} | ${bt}project_remove_rule${bt} |`,
|
|
181
|
-
`| Link projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_link${bt} |`,
|
|
182
|
-
`| Unlink projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_unlink${bt} |`,
|
|
183
|
-
`| Project links | ${bt}${toolPrefix}_core${bt} | ${bt}project_get_links${bt} |`,
|
|
184
|
-
`| Linked projects | ${bt}${toolPrefix}_core${bt} | ${bt}project_linked_projects${bt} |`,
|
|
185
|
-
`| Touch project | ${bt}${toolPrefix}_core${bt} | ${bt}project_touch${bt} |`,
|
|
186
|
-
// Cross-project memory ops
|
|
187
|
-
`| Promote to global | ${bt}${toolPrefix}_core${bt} | ${bt}memory_promote_to_global${bt} |`,
|
|
188
|
-
`| Configure memory | ${bt}${toolPrefix}_core${bt} | ${bt}memory_configure${bt} |`,
|
|
189
|
-
`| Cross-project search | ${bt}${toolPrefix}_core${bt} | ${bt}memory_cross_project_search${bt} |`,
|
|
190
126
|
);
|
|
191
127
|
|
|
128
|
+
// Governance
|
|
192
129
|
mdLines.push(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
'',
|
|
196
|
-
'A UserPromptSubmit hook auto-classifies every prompt via keyword matching.',
|
|
197
|
-
`When you see a ${bt}[MODE-NAME]${bt} indicator in the system context:`,
|
|
198
|
-
'',
|
|
199
|
-
`1. Call ${bt}${toolPrefix}_core op:route_intent params:{ prompt: "<user message>" }${bt} to get full behavior rules`,
|
|
200
|
-
'2. Follow the returned behavior rules for the detected mode',
|
|
201
|
-
'3. Briefly acknowledge mode changes in your response (e.g., "Switching to FIX-MODE")',
|
|
202
|
-
'',
|
|
203
|
-
'Available modes: FIX-MODE, BUILD-MODE, IMPROVE-MODE, DELIVER-MODE, REVIEW-MODE, PLAN-MODE, DESIGN-MODE, VALIDATE-MODE, EXPLORE-MODE, GENERAL-MODE.',
|
|
204
|
-
'GENERAL-MODE means the hook detected a work task but could not classify a specific mode — route_intent will refine it.',
|
|
205
|
-
'',
|
|
206
|
-
'## Intent Detection',
|
|
207
|
-
'',
|
|
208
|
-
'| Signal | Intent |',
|
|
209
|
-
'|--------|--------|',
|
|
210
|
-
'| Problem described ("broken", "janky", "weird") | FIX |',
|
|
211
|
-
'| Need expressed ("I need", "we should have") | BUILD |',
|
|
212
|
-
'| Quality questioned ("is this right?") | REVIEW |',
|
|
213
|
-
'| Advice sought ("how should I", "best way") | PLAN |',
|
|
214
|
-
'| Improvement requested ("make it faster") | IMPROVE |',
|
|
215
|
-
'',
|
|
216
|
-
'## Knowledge Protocol',
|
|
217
|
-
'',
|
|
218
|
-
'When seeking guidance: vault before codebase before web.',
|
|
219
|
-
'',
|
|
220
|
-
`1. Search vault \u2014 ${bt}${toolPrefix}_core op:search${bt}`,
|
|
221
|
-
'2. Codebase \u2014 only if vault has nothing',
|
|
222
|
-
'3. Web \u2014 last resort',
|
|
223
|
-
'',
|
|
224
|
-
'## Knowledge Capture',
|
|
225
|
-
'',
|
|
226
|
-
'When learning something that should persist, use the domain capture ops.',
|
|
227
|
-
'',
|
|
228
|
-
'## Session Capture',
|
|
229
|
-
'',
|
|
230
|
-
'A PreCompact hook is configured to call `session_capture` before context compaction.',
|
|
231
|
-
'This automatically preserves session summaries as memories for future sessions.',
|
|
232
|
-
`To manually capture: ${bt}${toolPrefix}_core op:session_capture params:{ summary: "..." }${bt}`,
|
|
233
|
-
'',
|
|
234
|
-
'## Planning',
|
|
235
|
-
'',
|
|
236
|
-
'For multi-step tasks, use the planning system:',
|
|
237
|
-
`1. Create: ${bt}${toolPrefix}_core op:create_plan params:{ objective: "...", scope: "...", tasks: [...] }${bt}`,
|
|
238
|
-
`2. Approve: ${bt}${toolPrefix}_core op:approve_plan params:{ planId: "...", startExecution: true }${bt}`,
|
|
239
|
-
`3. Track: ${bt}${toolPrefix}_core op:update_task params:{ planId: "...", taskId: "...", status: "completed" }${bt}`,
|
|
240
|
-
`4. Complete: ${bt}${toolPrefix}_core op:complete_plan params:{ planId: "..." }${bt}`,
|
|
241
|
-
'',
|
|
242
|
-
'Check activation response for recovered plans in `executing` state — remind the user.',
|
|
243
|
-
'',
|
|
244
|
-
`<!-- /${marker} -->`,
|
|
130
|
+
`| Governance dashboard | ${bt}${toolPrefix}_core${bt} | ${bt}governance_dashboard${bt} |`,
|
|
131
|
+
`| Governance policy | ${bt}${toolPrefix}_core${bt} | ${bt}governance_policy${bt} |`,
|
|
245
132
|
);
|
|
246
133
|
|
|
247
|
-
|
|
248
|
-
if (config.hookPacks?.length) {
|
|
249
|
-
const PACK_INFO: Record<string, { description: string; hooks: Record<string, string> }> = {
|
|
250
|
-
'typescript-safety': {
|
|
251
|
-
description: 'Block unsafe TypeScript patterns',
|
|
252
|
-
hooks: {
|
|
253
|
-
'no-any-types': '`:any`, `as any`, `<any>`, `Record<string, any>`',
|
|
254
|
-
'no-console-log': '`console.log` in committed code',
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
|
-
a11y: {
|
|
258
|
-
description: 'Accessibility enforcement',
|
|
259
|
-
hooks: {
|
|
260
|
-
'semantic-html': 'Generic divs where semantic HTML should be used',
|
|
261
|
-
'focus-ring-required': 'Missing visible focus indicators',
|
|
262
|
-
'ux-touch-targets': 'Touch targets smaller than 44px',
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
'css-discipline': {
|
|
266
|
-
description: 'CSS best practices',
|
|
267
|
-
hooks: {
|
|
268
|
-
'no-important': '`!important` in CSS',
|
|
269
|
-
'no-inline-styles': 'Inline style attributes',
|
|
270
|
-
},
|
|
271
|
-
},
|
|
272
|
-
'clean-commits': {
|
|
273
|
-
description: 'Clean git history',
|
|
274
|
-
hooks: {
|
|
275
|
-
'no-ai-attribution': 'AI attribution in commits',
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
};
|
|
134
|
+
mdLines.push('');
|
|
279
135
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
for (const packName of config.hookPacks) {
|
|
283
|
-
if (packName === 'full') {
|
|
284
|
-
// Composed pack — expand all constituent packs
|
|
285
|
-
for (const [subPack, info] of Object.entries(PACK_INFO)) {
|
|
286
|
-
for (const [hook, blocks] of Object.entries(info.hooks)) {
|
|
287
|
-
rows.push({ pack: subPack, hook, blocks });
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
} else if (PACK_INFO[packName]) {
|
|
291
|
-
for (const [hook, blocks] of Object.entries(PACK_INFO[packName].hooks)) {
|
|
292
|
-
rows.push({ pack: packName, hook, blocks });
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
136
|
+
// ─── Shared Behavioral Rules ───────────────────────────
|
|
137
|
+
mdLines.push(...getSharedRules(toolPrefix));
|
|
296
138
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
'## Hook Packs',
|
|
303
|
-
'',
|
|
304
|
-
'Quality gates installed in `.claude/`. Run `scripts/setup.sh` to install globally.',
|
|
305
|
-
'',
|
|
306
|
-
'| Pack | Hook | Blocks |',
|
|
307
|
-
'|------|------|--------|',
|
|
308
|
-
...rows.map((r) => `| ${r.pack} | ${r.hook} | ${r.blocks} |`),
|
|
309
|
-
];
|
|
310
|
-
mdLines.splice(closingMarkerIndex, 0, ...hookLines);
|
|
311
|
-
}
|
|
312
|
-
}
|
|
139
|
+
// ─── Hook Packs (conditional) ──────────────────────────
|
|
140
|
+
appendHookPacks(mdLines, config);
|
|
141
|
+
|
|
142
|
+
// ─── Closing marker ────────────────────────────────────
|
|
143
|
+
mdLines.push(`<!-- /${marker} -->`);
|
|
313
144
|
|
|
314
|
-
// Escape each markdown line for
|
|
145
|
+
// Escape each markdown line for single-quoted TS string literal
|
|
315
146
|
const quotedLines = mdLines.map((line) => {
|
|
316
147
|
const escaped = line.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
|
317
148
|
return ` '${escaped}',`;
|
|
318
149
|
});
|
|
319
150
|
|
|
320
|
-
|
|
321
|
-
const tsLines = [
|
|
151
|
+
return [
|
|
322
152
|
'/**',
|
|
323
153
|
` * CLAUDE.md content for ${config.name}.`,
|
|
324
154
|
' * Generated by Soleri — do not edit manually.',
|
|
@@ -332,7 +162,24 @@ export function generateClaudeMdTemplate(config: AgentConfig): string {
|
|
|
332
162
|
'export function getClaudeMdMarker(): string {',
|
|
333
163
|
` return '${marker}';`,
|
|
334
164
|
'}',
|
|
335
|
-
];
|
|
165
|
+
].join('\n');
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
function appendHookPacks(mdLines: string[], config: AgentConfig): void {
|
|
169
|
+
if (!config.hookPacks?.length) return;
|
|
336
170
|
|
|
337
|
-
|
|
171
|
+
// Domain-agnostic: just list installed pack names.
|
|
172
|
+
// The hooks themselves (in .claude/) enforce the rules — no need to
|
|
173
|
+
// hardcode domain-specific descriptions in the template.
|
|
174
|
+
mdLines.push(
|
|
175
|
+
'## Hook Packs',
|
|
176
|
+
'',
|
|
177
|
+
'Quality gates installed in `.claude/`. Run `scripts/setup.sh` to install globally.',
|
|
178
|
+
'',
|
|
179
|
+
`Installed packs: ${config.hookPacks.join(', ')}`,
|
|
180
|
+
'',
|
|
181
|
+
'Each hook runs on every tool call and blocks violations automatically.',
|
|
182
|
+
'See `.claude/hooks/` for individual hook definitions.',
|
|
183
|
+
'',
|
|
184
|
+
);
|
|
338
185
|
}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared behavioral rules that every Soleri agent ships with.
|
|
3
|
+
*
|
|
4
|
+
* These rules are agent-agnostic and mirror the quality of Salvador's
|
|
5
|
+
* hand-crafted CLAUDE.md behavioral sections. They cover:
|
|
6
|
+
* - Vault-first knowledge protocol
|
|
7
|
+
* - Planning enforcement (two-gate approval)
|
|
8
|
+
* - Output formatting (plan metadata tables, drift reports)
|
|
9
|
+
* - Knowledge capture discipline
|
|
10
|
+
* - Intent routing
|
|
11
|
+
* - Session lifecycle
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** Returns markdown lines for all shared behavioral sections. */
|
|
15
|
+
export function getSharedRules(toolPrefix: string): string[] {
|
|
16
|
+
const bt = '`';
|
|
17
|
+
|
|
18
|
+
return [
|
|
19
|
+
// ─── Vault-First Protocol ────────────────────────────────
|
|
20
|
+
'## Vault as Source of Truth',
|
|
21
|
+
'',
|
|
22
|
+
'Before every decision — planning, design, architecture, problem-solving — consult the vault.',
|
|
23
|
+
'',
|
|
24
|
+
'**Lookup order:**',
|
|
25
|
+
`1. Vault — ${bt}${toolPrefix}_core op:search_intelligent params:{ query: "..." }${bt}`,
|
|
26
|
+
'2. Codebase — only if vault has nothing',
|
|
27
|
+
'3. Web / training knowledge — last resort',
|
|
28
|
+
'',
|
|
29
|
+
'If the vault has a pattern, follow it. If it has an anti-pattern, avoid it.',
|
|
30
|
+
'',
|
|
31
|
+
|
|
32
|
+
// ─── Planning Enforcement ────────────────────────────────
|
|
33
|
+
'## Planning',
|
|
34
|
+
'',
|
|
35
|
+
'For multi-step tasks, use the planning system. **Never skip gates.**',
|
|
36
|
+
'',
|
|
37
|
+
'**Lifecycle:**',
|
|
38
|
+
`${bt}draft → approved (Gate 1) → tasks approved (Gate 2) → executing → reconciling → completed${bt}`,
|
|
39
|
+
'',
|
|
40
|
+
'**Sequence:**',
|
|
41
|
+
`1. Create: ${bt}${toolPrefix}_core op:create_plan params:{ objective: "...", scope: "...", tasks: [...] }${bt}`,
|
|
42
|
+
`2. Approve plan (Gate 1): ${bt}${toolPrefix}_core op:approve_plan params:{ planId: "..." }${bt}`,
|
|
43
|
+
`3. Split tasks (Gate 2): ${bt}${toolPrefix}_core op:plan_split params:{ planId: "..." }${bt}`,
|
|
44
|
+
`4. Track: ${bt}${toolPrefix}_core op:update_task params:{ planId: "...", taskId: "...", status: "completed" }${bt}`,
|
|
45
|
+
`5. Reconcile: ${bt}${toolPrefix}_core op:plan_reconcile params:{ planId: "..." }${bt}`,
|
|
46
|
+
`6. Complete: ${bt}${toolPrefix}_core op:plan_complete_lifecycle params:{ planId: "..." }${bt}`,
|
|
47
|
+
'',
|
|
48
|
+
'Wait for explicit user approval before proceeding past each gate.',
|
|
49
|
+
'Check activation response for recovered plans in `executing` state — remind the user.',
|
|
50
|
+
'',
|
|
51
|
+
'**Exceptions:** Read-only operations, user says "just do it", single-line fixes.',
|
|
52
|
+
'',
|
|
53
|
+
|
|
54
|
+
// ─── Output Formatting ───────────────────────────────────
|
|
55
|
+
'## Output Formatting',
|
|
56
|
+
'',
|
|
57
|
+
'**Plan metadata** — always show at top of every plan summary:',
|
|
58
|
+
'',
|
|
59
|
+
'| Field | Value |',
|
|
60
|
+
'|-------|-------|',
|
|
61
|
+
'| **Plan ID** | {planId} |',
|
|
62
|
+
'| **Check ID** | {checkId} |',
|
|
63
|
+
'| **Grade** | {grade} ({score}/100) |',
|
|
64
|
+
'| **Status** | {status} |',
|
|
65
|
+
'',
|
|
66
|
+
'**Drift reports:**',
|
|
67
|
+
'',
|
|
68
|
+
'| Field | Value |',
|
|
69
|
+
'|-------|-------|',
|
|
70
|
+
'| **Accuracy** | {accuracyScore}/100 |',
|
|
71
|
+
'| **Drift Items** | {count} |',
|
|
72
|
+
'',
|
|
73
|
+
'| Type | Description | Impact |',
|
|
74
|
+
'|------|-------------|--------|',
|
|
75
|
+
'| skipped | ... | medium |',
|
|
76
|
+
'',
|
|
77
|
+
|
|
78
|
+
// ─── Knowledge Capture ───────────────────────────────────
|
|
79
|
+
'## Knowledge Capture',
|
|
80
|
+
'',
|
|
81
|
+
"When learning something that should persist, capture it — don't just promise to remember.",
|
|
82
|
+
'',
|
|
83
|
+
`- Domain knowledge: ${bt}${toolPrefix}_core op:capture_quick params:{ title: "...", description: "..." }${bt}`,
|
|
84
|
+
`- Batch capture: ${bt}${toolPrefix}_core op:capture_knowledge params:{ entries: [...] }${bt}`,
|
|
85
|
+
`- Intelligent search: ${bt}${toolPrefix}_core op:search_intelligent params:{ query: "..." }${bt}`,
|
|
86
|
+
'',
|
|
87
|
+
|
|
88
|
+
// ─── Intent Detection ────────────────────────────────────
|
|
89
|
+
'## Intent Detection',
|
|
90
|
+
'',
|
|
91
|
+
'A UserPromptSubmit hook auto-classifies prompts. When you see a `[MODE-NAME]` indicator:',
|
|
92
|
+
'',
|
|
93
|
+
`1. Call ${bt}${toolPrefix}_core op:route_intent params:{ prompt: "<user message>" }${bt}`,
|
|
94
|
+
'2. Follow the returned behavior rules',
|
|
95
|
+
'3. Briefly acknowledge mode changes',
|
|
96
|
+
'',
|
|
97
|
+
'| Signal | Intent |',
|
|
98
|
+
'|--------|--------|',
|
|
99
|
+
'| Problem described ("broken", "janky", "weird") | FIX |',
|
|
100
|
+
'| Need expressed ("I need", "we should have") | BUILD |',
|
|
101
|
+
'| Quality questioned ("is this right?") | REVIEW |',
|
|
102
|
+
'| Advice sought ("how should I", "best way") | PLAN |',
|
|
103
|
+
'| Improvement requested ("make it faster") | IMPROVE |',
|
|
104
|
+
'| Ready to ship ("deploy", "release") | DELIVER |',
|
|
105
|
+
'',
|
|
106
|
+
|
|
107
|
+
// ─── Session Lifecycle ───────────────────────────────────
|
|
108
|
+
'## Session Lifecycle',
|
|
109
|
+
'',
|
|
110
|
+
'A PreCompact hook calls `session_capture` before context compaction.',
|
|
111
|
+
`Manual capture: ${bt}${toolPrefix}_core op:session_capture params:{ summary: "..." }${bt}`,
|
|
112
|
+
'',
|
|
113
|
+
|
|
114
|
+
// ─── Orchestration ───────────────────────────────────────
|
|
115
|
+
'## Orchestration',
|
|
116
|
+
'',
|
|
117
|
+
'For complex workflows, use the orchestration layer instead of manual planning:',
|
|
118
|
+
'',
|
|
119
|
+
`1. Plan: ${bt}${toolPrefix}_core op:orchestrate_plan params:{ prompt: "...", projectPath: "." }${bt}`,
|
|
120
|
+
`2. Execute: ${bt}${toolPrefix}_core op:orchestrate_execute params:{ planId: "..." }${bt}`,
|
|
121
|
+
`3. Complete: ${bt}${toolPrefix}_core op:orchestrate_complete params:{ planId: "..." }${bt}`,
|
|
122
|
+
'',
|
|
123
|
+
'The orchestrator handles vault lookup, brain recommendations, and knowledge capture automatically.',
|
|
124
|
+
'',
|
|
125
|
+
];
|
|
126
|
+
}
|
package/src/types.ts
CHANGED
|
@@ -39,6 +39,9 @@ export const AgentConfigSchema = z.object({
|
|
|
39
39
|
|
|
40
40
|
export type AgentConfig = z.infer<typeof AgentConfigSchema>;
|
|
41
41
|
|
|
42
|
+
/** Input type — fields with defaults are optional (use before Zod parsing) */
|
|
43
|
+
export type AgentConfigInput = z.input<typeof AgentConfigSchema>;
|
|
44
|
+
|
|
42
45
|
/** Result of scaffolding */
|
|
43
46
|
export interface ScaffoldResult {
|
|
44
47
|
success: boolean;
|