@soleri/forge 5.14.0 → 5.14.2
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/dist/index.js +0 -0
- package/dist/lib.d.ts +2 -0
- package/dist/lib.js +2 -0
- package/dist/lib.js.map +1 -1
- package/dist/skills/brain-debrief.md +47 -19
- package/dist/skills/brainstorming.md +19 -9
- package/dist/skills/code-patrol.md +21 -19
- package/dist/skills/context-resume.md +14 -11
- package/dist/skills/executing-plans.md +30 -15
- package/dist/skills/fix-and-learn.md +17 -14
- package/dist/skills/health-check.md +29 -23
- package/dist/skills/knowledge-harvest.md +27 -20
- package/dist/skills/onboard-me.md +16 -15
- package/dist/skills/retrospective.md +34 -18
- package/dist/skills/second-opinion.md +16 -9
- package/dist/skills/systematic-debugging.md +40 -29
- package/dist/skills/test-driven-development.md +45 -30
- package/dist/skills/vault-capture.md +31 -15
- package/dist/skills/vault-navigator.md +24 -13
- package/dist/skills/verification-before-completion.md +38 -26
- package/dist/skills/writing-plans.md +21 -13
- package/dist/templates/claude-md-template.d.ts +9 -8
- package/dist/templates/claude-md-template.js +29 -11
- package/dist/templates/claude-md-template.js.map +1 -1
- package/dist/templates/inject-claude-md.js +65 -25
- package/dist/templates/inject-claude-md.js.map +1 -1
- package/dist/templates/shared-rules.d.ts +10 -6
- package/dist/templates/shared-rules.js +242 -199
- package/dist/templates/shared-rules.js.map +1 -1
- package/dist/templates/test-facades.js +6 -4
- package/dist/templates/test-facades.js.map +1 -1
- package/package.json +1 -1
- package/src/lib.ts +2 -0
- package/src/templates/claude-md-template.ts +30 -12
- package/src/templates/inject-claude-md.ts +65 -25
- package/src/templates/shared-rules.ts +259 -210
- package/src/templates/test-facades.ts +6 -4
- package/dist/skills/skills/brain-debrief.md +0 -214
- package/dist/skills/skills/brainstorming.md +0 -180
- package/dist/skills/skills/code-patrol.md +0 -178
- package/dist/skills/skills/context-resume.md +0 -146
- package/dist/skills/skills/executing-plans.md +0 -216
- package/dist/skills/skills/fix-and-learn.md +0 -167
- package/dist/skills/skills/health-check.md +0 -231
- package/dist/skills/skills/knowledge-harvest.md +0 -185
- package/dist/skills/skills/onboard-me.md +0 -198
- package/dist/skills/skills/retrospective.md +0 -205
- package/dist/skills/skills/second-opinion.md +0 -149
- package/dist/skills/skills/systematic-debugging.md +0 -241
- package/dist/skills/skills/test-driven-development.md +0 -281
- package/dist/skills/skills/vault-capture.md +0 -170
- package/dist/skills/skills/vault-navigator.md +0 -140
- package/dist/skills/skills/verification-before-completion.md +0 -182
- package/dist/skills/skills/writing-plans.md +0 -215
- package/dist/templates/brain.d.ts +0 -6
- package/dist/templates/brain.js +0 -478
- package/dist/templates/brain.js.map +0 -1
- package/dist/templates/core-facade.d.ts +0 -6
- package/dist/templates/core-facade.js +0 -564
- package/dist/templates/core-facade.js.map +0 -1
- package/dist/templates/facade-factory.d.ts +0 -1
- package/dist/templates/facade-factory.js +0 -63
- package/dist/templates/facade-factory.js.map +0 -1
- package/dist/templates/facade-types.d.ts +0 -1
- package/dist/templates/facade-types.js +0 -46
- package/dist/templates/facade-types.js.map +0 -1
- package/dist/templates/intelligence-loader.d.ts +0 -1
- package/dist/templates/intelligence-loader.js +0 -43
- package/dist/templates/intelligence-loader.js.map +0 -1
- package/dist/templates/intelligence-types.d.ts +0 -1
- package/dist/templates/intelligence-types.js +0 -24
- package/dist/templates/intelligence-types.js.map +0 -1
- package/dist/templates/llm-client.d.ts +0 -7
- package/dist/templates/llm-client.js +0 -300
- package/dist/templates/llm-client.js.map +0 -1
- package/dist/templates/llm-key-pool.d.ts +0 -7
- package/dist/templates/llm-key-pool.js +0 -211
- package/dist/templates/llm-key-pool.js.map +0 -1
- package/dist/templates/llm-types.d.ts +0 -5
- package/dist/templates/llm-types.js +0 -161
- package/dist/templates/llm-types.js.map +0 -1
- package/dist/templates/llm-utils.d.ts +0 -5
- package/dist/templates/llm-utils.js +0 -260
- package/dist/templates/llm-utils.js.map +0 -1
- package/dist/templates/planner.d.ts +0 -5
- package/dist/templates/planner.js +0 -150
- package/dist/templates/planner.js.map +0 -1
- package/dist/templates/test-brain.d.ts +0 -6
- package/dist/templates/test-brain.js +0 -474
- package/dist/templates/test-brain.js.map +0 -1
- package/dist/templates/test-llm.d.ts +0 -7
- package/dist/templates/test-llm.js +0 -574
- package/dist/templates/test-llm.js.map +0 -1
- package/dist/templates/test-loader.d.ts +0 -5
- package/dist/templates/test-loader.js +0 -146
- package/dist/templates/test-loader.js.map +0 -1
- package/dist/templates/test-planner.d.ts +0 -5
- package/dist/templates/test-planner.js +0 -271
- package/dist/templates/test-planner.js.map +0 -1
- package/dist/templates/test-vault.d.ts +0 -5
- package/dist/templates/test-vault.js +0 -380
- package/dist/templates/test-vault.js.map +0 -1
- package/dist/templates/vault.d.ts +0 -5
- package/dist/templates/vault.js +0 -263
- package/dist/templates/vault.js.map +0 -1
|
@@ -1,204 +1,247 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Shared
|
|
2
|
+
* Shared Soleri engine rules — agent-agnostic.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* These rules are injected ONCE into global ~/.claude/CLAUDE.md under
|
|
5
|
+
* the `<!-- soleri:engine-rules -->` marker. They describe behavioral
|
|
6
|
+
* rules WITHOUT tool prefixes. The active agent's facade table (in its
|
|
7
|
+
* own `<!-- agent-id:mode -->` block) maps op names to actual tools.
|
|
8
|
+
*
|
|
9
|
+
* Uses op:name syntax — the active agent provides the tool prefix.
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
export function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
'',
|
|
16
|
-
'- **MANDATORY**: Consult the vault BEFORE every decision — planning, design, architecture, patterns, problem-solving.',
|
|
17
|
-
`- Lookup order: 1) VAULT (${bt}${toolPrefix}_core op:search_intelligent${bt}) → 2) MEMORY (${bt}${toolPrefix}_core op:memory_search${bt}) → 3) CODEBASE → 4) WEB/TRAINING.`,
|
|
18
|
-
'- If the vault has a pattern, follow it. If it has an anti-pattern, avoid it.',
|
|
19
|
-
`- Persist lessons: call ${bt}${toolPrefix}_core op:capture_knowledge${bt} — don't just promise "I will remember this".`,
|
|
20
|
-
'- Exceptions: runtime errors with stack traces → codebase first; user explicitly asks to search web.',
|
|
21
|
-
'',
|
|
22
|
-
// ─── Planning ────────────────────────────────────────────
|
|
23
|
-
'## Planning',
|
|
24
|
-
`<!-- ${toolPrefix}:planning -->`,
|
|
25
|
-
'',
|
|
26
|
-
`- Use ${bt}${toolPrefix}_core op:create_plan${bt} before writing ANY code. Show the plan, wait for approval.`,
|
|
27
|
-
`- Two-gate approval: Gate 1 (${bt}op:approve_plan${bt}), Gate 2 (${bt}op:plan_split${bt}). Never skip either.`,
|
|
28
|
-
'- Wait for explicit "yes" / "approve" before proceeding past each gate.',
|
|
29
|
-
`- After execution: ${bt}op:plan_reconcile${bt} (drift report) then ${bt}op:plan_complete_lifecycle${bt} (knowledge capture, archive).`,
|
|
30
|
-
'- Never let a plan stay in `executing` or `reconciling` state without reminding the user.',
|
|
31
|
-
'- On session start: check for plans in `executing`/`reconciling` state and remind.',
|
|
32
|
-
'- Exceptions: read-only operations, user says "just do it", single-line fixes.',
|
|
33
|
-
'',
|
|
34
|
-
'### Lifecycle States',
|
|
35
|
-
'',
|
|
36
|
-
'| State | Expires | Next Action |',
|
|
37
|
-
'|-------|---------|-------------|',
|
|
38
|
-
`| ${bt}draft${bt} | 30 min | ${bt}${toolPrefix}_core op:create_plan${bt} (iterate) |`,
|
|
39
|
-
`| ${bt}approved${bt} | 30 min | ${bt}${toolPrefix}_core op:plan_split${bt} |`,
|
|
40
|
-
`| ${bt}executing${bt} | Never | ${bt}${toolPrefix}_core op:plan_reconcile${bt} |`,
|
|
41
|
-
`| ${bt}reconciling${bt} | Never | ${bt}${toolPrefix}_core op:plan_complete_lifecycle${bt} |`,
|
|
42
|
-
`| ${bt}completed${bt} | — | Done |`,
|
|
43
|
-
'',
|
|
44
|
-
'### Plan Presentation',
|
|
45
|
-
'',
|
|
46
|
-
'Every plan summary MUST include this format:',
|
|
47
|
-
'',
|
|
48
|
-
'```',
|
|
49
|
-
'## Plan: [Short Title]',
|
|
50
|
-
'',
|
|
51
|
-
'| Field | Value |',
|
|
52
|
-
'|-------|-------|',
|
|
53
|
-
'| **Plan ID** | {planId} |',
|
|
54
|
-
'| **Check ID** | {checkId} |',
|
|
55
|
-
'| **Grade** | {grade} ({score}/100) |',
|
|
56
|
-
'| **Status** | {status} |',
|
|
57
|
-
'| **Lifecycle** | {lifecycleStatus} |',
|
|
58
|
-
'',
|
|
59
|
-
'**Objective:** [One sentence]',
|
|
60
|
-
'',
|
|
61
|
-
'**Scope:**',
|
|
62
|
-
'| Included | Excluded |',
|
|
63
|
-
'|----------|----------|',
|
|
64
|
-
'| item 1 | item 1 |',
|
|
65
|
-
'',
|
|
66
|
-
'**Approach:**',
|
|
67
|
-
'| Step | Task |',
|
|
68
|
-
'|------|------|',
|
|
69
|
-
'| 1 | Description |',
|
|
70
|
-
'```',
|
|
71
|
-
'',
|
|
72
|
-
'Without visible IDs, users cannot resume, reference, or approve plans.',
|
|
73
|
-
'',
|
|
74
|
-
'### Drift Report',
|
|
75
|
-
'',
|
|
76
|
-
'```',
|
|
77
|
-
'| Field | Value |',
|
|
78
|
-
'|-------|-------|',
|
|
79
|
-
'| **Accuracy** | {accuracyScore}/100 |',
|
|
80
|
-
'| **Drift Items** | {count} |',
|
|
81
|
-
'',
|
|
82
|
-
'| Type | Description | Impact | Rationale |',
|
|
83
|
-
'|------|-------------|--------|-----------|',
|
|
84
|
-
'| skipped | ... | medium | ... |',
|
|
85
|
-
'```',
|
|
86
|
-
'',
|
|
87
|
-
// ─── Output Formatting ───────────────────────────────────
|
|
88
|
-
'## Output Formatting',
|
|
89
|
-
`<!-- ${toolPrefix}:output-formatting -->`,
|
|
90
|
-
'',
|
|
91
|
-
'**MANDATORY**: Present tool outputs in human-readable format, NOT raw JSON.',
|
|
92
|
-
'',
|
|
93
|
-
'**Tasks** — show as numbered table:',
|
|
94
|
-
'```',
|
|
95
|
-
'| # | Type | Task | Complexity |',
|
|
96
|
-
'|---|------|------|------------|',
|
|
97
|
-
'| 1 | Impl | ... | High |',
|
|
98
|
-
'```',
|
|
99
|
-
'',
|
|
100
|
-
'**Completion** — show outcome, knowledge captured count, archive path.',
|
|
101
|
-
'',
|
|
102
|
-
'**Status lines** — `Persisted: X plans, Y tasks, Z checks` / `Recovered: X plans, Y tasks`',
|
|
103
|
-
'',
|
|
104
|
-
// ─── Clean Commits ───────────────────────────────────────
|
|
105
|
-
'## Clean Commits',
|
|
106
|
-
`<!-- ${toolPrefix}:clean-commits -->`,
|
|
107
|
-
'',
|
|
108
|
-
'**MANDATORY**: No AI attribution in commit messages.',
|
|
109
|
-
'',
|
|
110
|
-
'Blocked patterns:',
|
|
111
|
-
'- `Co-Authored-By: Claude` (any variant)',
|
|
112
|
-
'- `noreply@anthropic.com`',
|
|
113
|
-
'- `Generated with Claude`, `AI-generated`',
|
|
114
|
-
'- Any mention of `Anthropic`, `Claude Opus`, `Claude Sonnet`, `Claude Haiku`',
|
|
115
|
-
'',
|
|
116
|
-
'Use conventional commits:',
|
|
117
|
-
'```',
|
|
118
|
-
'feat: add user authentication',
|
|
119
|
-
'fix: resolve login timeout issue',
|
|
120
|
-
'refactor: simplify data fetching logic',
|
|
121
|
-
'```',
|
|
122
|
-
'',
|
|
123
|
-
// ─── Knowledge Capture ───────────────────────────────────
|
|
124
|
-
'## Knowledge Capture',
|
|
125
|
-
`<!-- ${toolPrefix}:knowledge-capture -->`,
|
|
126
|
-
'',
|
|
127
|
-
"**MANDATORY**: Persist lessons, don't just promise them.",
|
|
128
|
-
'',
|
|
129
|
-
'When you learn something that should persist:',
|
|
130
|
-
'1. **DON\'T** just say "I will remember this"',
|
|
131
|
-
`2. **DO** call ${bt}${toolPrefix}_core op:capture_knowledge${bt} to persist to vault`,
|
|
132
|
-
"3. **DO** update relevant files if it's a behavioral change",
|
|
133
|
-
'',
|
|
134
|
-
'| Type | Tool | Persists To |',
|
|
135
|
-
'|------|------|-------------|',
|
|
136
|
-
`| Patterns/Anti-patterns | ${bt}${toolPrefix}_core op:capture_knowledge${bt} | vault |`,
|
|
137
|
-
`| Quick capture | ${bt}${toolPrefix}_core op:capture_quick${bt} | vault |`,
|
|
138
|
-
`| Session summaries | ${bt}${toolPrefix}_core op:session_capture${bt} | memory |`,
|
|
139
|
-
'',
|
|
140
|
-
// ─── Work Task Routing ───────────────────────────────────
|
|
141
|
-
'## Work Task Routing',
|
|
142
|
-
`<!-- ${toolPrefix}:task-routing -->`,
|
|
143
|
-
'',
|
|
144
|
-
'Use the orchestration layer for ALL work tasks:',
|
|
145
|
-
`- ${bt}${toolPrefix}_core op:orchestrate_plan${bt} → vault + brain + structured plan.`,
|
|
146
|
-
`- ${bt}${toolPrefix}_core op:orchestrate_execute${bt} → execution tracking.`,
|
|
147
|
-
`- ${bt}${toolPrefix}_core op:orchestrate_complete${bt} → epilogue (vault, session).`,
|
|
148
|
-
'',
|
|
149
|
-
'The orchestrator handles vault lookup, brain recommendations, and knowledge capture automatically.',
|
|
150
|
-
'',
|
|
151
|
-
// ─── Intent Detection ────────────────────────────────────
|
|
152
|
-
'## Intent Detection',
|
|
153
|
-
`<!-- ${toolPrefix}:intent-detection -->`,
|
|
154
|
-
'',
|
|
155
|
-
`**Semantic-First**: Analyze user MEANING before calling ${bt}route_intent${bt}.`,
|
|
156
|
-
'',
|
|
157
|
-
'| Signal | Intent |',
|
|
158
|
-
'|--------|--------|',
|
|
159
|
-
'| Problem described ("broken", "janky", "weird") | FIX |',
|
|
160
|
-
'| Need expressed ("I need", "we should have") | BUILD |',
|
|
161
|
-
'| Quality questioned ("is this right?") | REVIEW |',
|
|
162
|
-
'| Advice sought ("how should I", "best way") | PLAN |',
|
|
163
|
-
'| Improvement requested ("make it faster") | IMPROVE |',
|
|
164
|
-
'| Ready to ship ("deploy", "release") | DELIVER |',
|
|
165
|
-
'',
|
|
166
|
-
`Use ${bt}${toolPrefix}_core op:route_intent${bt} only to CONFIRM your analysis or when meaning is unclear.`,
|
|
167
|
-
'',
|
|
168
|
-
// ─── Validation Loop ─────────────────────────────────────
|
|
169
|
-
'## Iterative Validation Loop',
|
|
170
|
-
`<!-- ${toolPrefix}:validation-loop -->`,
|
|
171
|
-
'',
|
|
172
|
-
`- When a user gives a **work task**, start a loop: ${bt}${toolPrefix}_core op:loop_start params:{ prompt: "<task>", mode: "custom" }${bt}`,
|
|
173
|
-
'- Do NOT start loops for: questions, explanations, status checks, git operations, exploration, simple one-line fixes.',
|
|
174
|
-
'',
|
|
175
|
-
'| Mode | Tool | Target | Max Iter |',
|
|
176
|
-
'|------|------|--------|----------|',
|
|
177
|
-
`| ${bt}plan-iteration${bt} | ${bt}${toolPrefix}_core op:create_plan${bt} | grade >= A | 10 |`,
|
|
178
|
-
`| ${bt}custom${bt} | user-defined | promise-based | 20 |`,
|
|
179
|
-
'',
|
|
180
|
-
// ─── Brain-Informed Work ─────────────────────────────────
|
|
181
|
-
'## Brain-Informed Work',
|
|
182
|
-
`<!-- ${toolPrefix}:brain -->`,
|
|
183
|
-
'',
|
|
184
|
-
'- Brain patterns surface at session start. For relevant patterns, pull rules just-in-time from the vault.',
|
|
185
|
-
'- Brain tells you **which** patterns matter (names + strength scores). Vault tells you **what** they are (rules, examples).',
|
|
186
|
-
"- Pull only what's relevant to the current task — don't load everything at session start.",
|
|
187
|
-
'',
|
|
188
|
-
// ─── Cross-Project Memory ────────────────────────────────
|
|
189
|
-
'## Cross-Project Memory',
|
|
190
|
-
`<!-- ${toolPrefix}:cross-project -->`,
|
|
191
|
-
'',
|
|
192
|
-
`- Use ${bt}crossProject: true${bt} in ${bt}${toolPrefix}_core op:memory_search${bt} for patterns across related projects.`,
|
|
193
|
-
`- Promote universal patterns to global pool with ${bt}${toolPrefix}_core op:memory_promote_to_global${bt}.`,
|
|
194
|
-
'',
|
|
195
|
-
// ─── Session Lifecycle ───────────────────────────────────
|
|
196
|
-
'## Session Lifecycle',
|
|
197
|
-
`<!-- ${toolPrefix}:session -->`,
|
|
198
|
-
'',
|
|
199
|
-
'A PreCompact hook calls `session_capture` before context compaction.',
|
|
200
|
-
`Manual capture: ${bt}${toolPrefix}_core op:session_capture params:{ summary: "..." }${bt}`,
|
|
201
|
-
'',
|
|
202
|
-
];
|
|
11
|
+
const ENGINE_MARKER = 'soleri:engine-rules';
|
|
12
|
+
export function getEngineMarker() {
|
|
13
|
+
return ENGINE_MARKER;
|
|
14
|
+
}
|
|
15
|
+
/** Returns the full engine rules markdown content (with markers). */
|
|
16
|
+
export function getEngineRulesContent() {
|
|
17
|
+
return ENGINE_RULES_LINES.join('\n');
|
|
203
18
|
}
|
|
19
|
+
const ENGINE_RULES_LINES = [
|
|
20
|
+
`<!-- ${ENGINE_MARKER} -->`,
|
|
21
|
+
'',
|
|
22
|
+
'# Soleri Engine Rules',
|
|
23
|
+
'',
|
|
24
|
+
"Shared behavioral rules for all Soleri agents. The active agent's facade table provides tool names.",
|
|
25
|
+
'',
|
|
26
|
+
// ─── Response Integrity ─────────────────────────────────
|
|
27
|
+
'## Response Integrity',
|
|
28
|
+
'<!-- soleri:response-integrity -->',
|
|
29
|
+
'',
|
|
30
|
+
'- If you\'re not confident in your answer, say "I\'m not sure" and explain why. Never guess.',
|
|
31
|
+
'- After every response, rate your confidence from 1 to 10. Anything below 7, flag it.',
|
|
32
|
+
'',
|
|
33
|
+
// ─── Memory Quality Gate ───────────────────────────────
|
|
34
|
+
'## Memory Quality Gate',
|
|
35
|
+
'<!-- soleri:memory-quality -->',
|
|
36
|
+
'',
|
|
37
|
+
'**MANDATORY** before writing to auto memory: apply the **"Will I hit this again?"** test.',
|
|
38
|
+
'',
|
|
39
|
+
'**SAVE** — recurring bugs, non-obvious gotchas, structural issues, behavioral quirks that will resurface.',
|
|
40
|
+
"**NEVER SAVE** — one-time config, solved-and-done fixes, values already persisted in files, setup steps that won't repeat, anything where the fix is already in the codebase.",
|
|
41
|
+
'',
|
|
42
|
+
"If in doubt, don't save. Less memory with high signal beats more memory with noise.",
|
|
43
|
+
'',
|
|
44
|
+
// ─── Vault-First Protocol ────────────────────────────────
|
|
45
|
+
'## Vault as Source of Truth',
|
|
46
|
+
'<!-- soleri:vault-protocol -->',
|
|
47
|
+
'',
|
|
48
|
+
'- **MANDATORY**: Consult the vault BEFORE every decision — planning, design, architecture, patterns, problem-solving.',
|
|
49
|
+
'- Lookup order: 1) VAULT (`op:search_intelligent`) → 2) MEMORY (`op:memory_search`) → 3) CODEBASE → 4) WEB/TRAINING.',
|
|
50
|
+
'- If the vault has a pattern, follow it. If it has an anti-pattern, avoid it.',
|
|
51
|
+
'- Persist lessons: call `op:capture_knowledge` — don\'t just promise "I will remember this".',
|
|
52
|
+
'- Exceptions: runtime errors with stack traces → codebase first; user explicitly asks to search web.',
|
|
53
|
+
'',
|
|
54
|
+
// ─── Planning ────────────────────────────────────────────
|
|
55
|
+
'## Planning',
|
|
56
|
+
'<!-- soleri:planning -->',
|
|
57
|
+
'',
|
|
58
|
+
'- Use `op:create_plan` before writing ANY code. Show the plan, wait for approval.',
|
|
59
|
+
'- Two-gate approval: Gate 1 (`op:approve_plan`), Gate 2 (`op:plan_split`). Never skip either.',
|
|
60
|
+
'- Wait for explicit "yes" / "approve" before proceeding past each gate.',
|
|
61
|
+
'- After execution: `op:plan_reconcile` (drift report) then `op:plan_complete_lifecycle` (knowledge capture, archive).',
|
|
62
|
+
'- Never let a plan stay in `executing` or `reconciling` state without reminding the user.',
|
|
63
|
+
'- On session start: check for plans in `executing`/`reconciling` state and remind.',
|
|
64
|
+
'- Exceptions: read-only operations, user says "just do it", single-line fixes.',
|
|
65
|
+
'',
|
|
66
|
+
'### Lifecycle States',
|
|
67
|
+
'',
|
|
68
|
+
'| State | Expires | Next Action |',
|
|
69
|
+
'|-------|---------|-------------|',
|
|
70
|
+
'| `draft` | 30 min | `op:create_plan` (iterate) |',
|
|
71
|
+
'| `approved` | 30 min | `op:plan_split` |',
|
|
72
|
+
'| `executing` | Never | `op:plan_reconcile` |',
|
|
73
|
+
'| `reconciling` | Never | `op:plan_complete_lifecycle` |',
|
|
74
|
+
'| `completed` | — | Done |',
|
|
75
|
+
'',
|
|
76
|
+
'### Plan Presentation',
|
|
77
|
+
'',
|
|
78
|
+
'Every plan summary MUST include this format:',
|
|
79
|
+
'',
|
|
80
|
+
'```',
|
|
81
|
+
'## Plan: [Short Title]',
|
|
82
|
+
'',
|
|
83
|
+
'| Field | Value |',
|
|
84
|
+
'|-------|-------|',
|
|
85
|
+
'| **Plan ID** | {planId} |',
|
|
86
|
+
'| **Check ID** | {checkId} |',
|
|
87
|
+
'| **Grade** | {grade} ({score}/100) |',
|
|
88
|
+
'| **Status** | {status} |',
|
|
89
|
+
'| **Lifecycle** | {lifecycleStatus} |',
|
|
90
|
+
'',
|
|
91
|
+
'**Objective:** [One sentence]',
|
|
92
|
+
'',
|
|
93
|
+
'**Scope:**',
|
|
94
|
+
'| Included | Excluded |',
|
|
95
|
+
'|----------|----------|',
|
|
96
|
+
'| item 1 | item 1 |',
|
|
97
|
+
'',
|
|
98
|
+
'**Approach:**',
|
|
99
|
+
'| Step | Task |',
|
|
100
|
+
'|------|------|',
|
|
101
|
+
'| 1 | Description |',
|
|
102
|
+
'```',
|
|
103
|
+
'',
|
|
104
|
+
'Without visible IDs, users cannot resume, reference, or approve plans.',
|
|
105
|
+
'',
|
|
106
|
+
'### Drift Report',
|
|
107
|
+
'',
|
|
108
|
+
'```',
|
|
109
|
+
'| Field | Value |',
|
|
110
|
+
'|-------|-------|',
|
|
111
|
+
'| **Accuracy** | {accuracyScore}/100 |',
|
|
112
|
+
'| **Drift Items** | {count} |',
|
|
113
|
+
'',
|
|
114
|
+
'| Type | Description | Impact | Rationale |',
|
|
115
|
+
'|------|-------------|--------|-----------|',
|
|
116
|
+
'| skipped | ... | medium | ... |',
|
|
117
|
+
'```',
|
|
118
|
+
'',
|
|
119
|
+
// ─── Output Formatting ───────────────────────────────────
|
|
120
|
+
'## Output Formatting',
|
|
121
|
+
'<!-- soleri:output-formatting -->',
|
|
122
|
+
'',
|
|
123
|
+
'**MANDATORY**: Present tool outputs in human-readable format, NOT raw JSON.',
|
|
124
|
+
'',
|
|
125
|
+
'**Tasks** — show as numbered table:',
|
|
126
|
+
'```',
|
|
127
|
+
'| # | Type | Task | Complexity |',
|
|
128
|
+
'|---|------|------|------------|',
|
|
129
|
+
'| 1 | Impl | ... | High |',
|
|
130
|
+
'```',
|
|
131
|
+
'',
|
|
132
|
+
'**Completion** — show outcome, knowledge captured count, archive path.',
|
|
133
|
+
'',
|
|
134
|
+
'**Status lines** — `Persisted: X plans, Y tasks, Z checks` / `Recovered: X plans, Y tasks`',
|
|
135
|
+
'',
|
|
136
|
+
// ─── Clean Commits ───────────────────────────────────────
|
|
137
|
+
'## Clean Commits',
|
|
138
|
+
'<!-- soleri:clean-commits -->',
|
|
139
|
+
'',
|
|
140
|
+
'**MANDATORY**: No AI attribution in commit messages.',
|
|
141
|
+
'',
|
|
142
|
+
'Blocked patterns:',
|
|
143
|
+
'- `Co-Authored-By: Claude` (any variant)',
|
|
144
|
+
'- `noreply@anthropic.com`',
|
|
145
|
+
'- `Generated with Claude`, `AI-generated`',
|
|
146
|
+
'- Any mention of `Anthropic`, `Claude Opus`, `Claude Sonnet`, `Claude Haiku`',
|
|
147
|
+
'',
|
|
148
|
+
'Use conventional commits:',
|
|
149
|
+
'```',
|
|
150
|
+
'feat: add user authentication',
|
|
151
|
+
'fix: resolve login timeout issue',
|
|
152
|
+
'refactor: simplify data fetching logic',
|
|
153
|
+
'```',
|
|
154
|
+
'',
|
|
155
|
+
// ─── Knowledge Capture ───────────────────────────────────
|
|
156
|
+
'## Knowledge Capture',
|
|
157
|
+
'<!-- soleri:knowledge-capture -->',
|
|
158
|
+
'',
|
|
159
|
+
"**MANDATORY**: Persist lessons, don't just promise them.",
|
|
160
|
+
'',
|
|
161
|
+
'When you learn something that should persist:',
|
|
162
|
+
'1. **DON\'T** just say "I will remember this"',
|
|
163
|
+
'2. **DO** call `op:capture_knowledge` to persist to vault',
|
|
164
|
+
"3. **DO** update relevant files if it's a behavioral change",
|
|
165
|
+
'',
|
|
166
|
+
'| Type | Op | Persists To |',
|
|
167
|
+
'|------|-----|-------------|',
|
|
168
|
+
'| Patterns/Anti-patterns | `op:capture_knowledge` | vault |',
|
|
169
|
+
'| Quick capture | `op:capture_quick` | vault |',
|
|
170
|
+
'| Session summaries | `op:session_capture` | memory |',
|
|
171
|
+
'',
|
|
172
|
+
// ─── Work Task Routing ───────────────────────────────────
|
|
173
|
+
'## Work Task Routing',
|
|
174
|
+
'<!-- soleri:task-routing -->',
|
|
175
|
+
'',
|
|
176
|
+
'Use the orchestration layer for ALL work tasks:',
|
|
177
|
+
'- `op:orchestrate_plan` → vault + brain + structured plan.',
|
|
178
|
+
'- `op:orchestrate_execute` → execution tracking.',
|
|
179
|
+
'- `op:orchestrate_complete` → epilogue (vault, session).',
|
|
180
|
+
'',
|
|
181
|
+
'The orchestrator handles vault lookup, brain recommendations, and knowledge capture automatically.',
|
|
182
|
+
'',
|
|
183
|
+
// ─── Intent Detection ────────────────────────────────────
|
|
184
|
+
'## Intent Detection',
|
|
185
|
+
'<!-- soleri:intent-detection -->',
|
|
186
|
+
'',
|
|
187
|
+
'**Semantic-First**: Analyze user MEANING before calling `op:route_intent`.',
|
|
188
|
+
'',
|
|
189
|
+
'| Signal | Intent |',
|
|
190
|
+
'|--------|--------|',
|
|
191
|
+
'| Problem described ("broken", "janky", "weird") | FIX |',
|
|
192
|
+
'| Need expressed ("I need", "we should have") | BUILD |',
|
|
193
|
+
'| Quality questioned ("is this right?") | REVIEW |',
|
|
194
|
+
'| Advice sought ("how should I", "best way") | PLAN |',
|
|
195
|
+
'| Improvement requested ("make it faster") | IMPROVE |',
|
|
196
|
+
'| Ready to ship ("deploy", "release") | DELIVER |',
|
|
197
|
+
'',
|
|
198
|
+
'Use `op:route_intent` only to CONFIRM your analysis or when meaning is unclear.',
|
|
199
|
+
'',
|
|
200
|
+
// ─── Validation Loop ─────────────────────────────────────
|
|
201
|
+
'## Iterative Validation Loop',
|
|
202
|
+
'<!-- soleri:validation-loop -->',
|
|
203
|
+
'',
|
|
204
|
+
'- When a user gives a **work task**, start a loop: `op:loop_start params:{ prompt: "<task>", mode: "custom" }`',
|
|
205
|
+
'- Do NOT start loops for: questions, explanations, status checks, git operations, exploration, simple one-line fixes.',
|
|
206
|
+
'',
|
|
207
|
+
'| Mode | Op | Target | Max Iter |',
|
|
208
|
+
'|------|-----|--------|----------|',
|
|
209
|
+
'| `plan-iteration` | `op:create_plan` | grade >= A | 10 |',
|
|
210
|
+
'| `custom` | user-defined | promise-based | 20 |',
|
|
211
|
+
'',
|
|
212
|
+
// ─── Brain-Informed Work ─────────────────────────────────
|
|
213
|
+
'## Brain-Informed Work',
|
|
214
|
+
'<!-- soleri:brain -->',
|
|
215
|
+
'',
|
|
216
|
+
'- Brain patterns surface at session start. For relevant patterns, pull rules just-in-time from the vault.',
|
|
217
|
+
'- Brain tells you **which** patterns matter (names + strength scores). Vault tells you **what** they are (rules, examples).',
|
|
218
|
+
"- Pull only what's relevant to the current task — don't load everything at session start.",
|
|
219
|
+
'',
|
|
220
|
+
// ─── Cross-Project Memory ────────────────────────────────
|
|
221
|
+
'## Cross-Project Memory',
|
|
222
|
+
'<!-- soleri:cross-project -->',
|
|
223
|
+
'',
|
|
224
|
+
'- Use `crossProject: true` in `op:memory_search` for patterns across related projects.',
|
|
225
|
+
'- Promote universal patterns to global pool with `op:memory_promote_to_global`.',
|
|
226
|
+
'',
|
|
227
|
+
// ─── Session Lifecycle ───────────────────────────────────
|
|
228
|
+
'## Session Lifecycle',
|
|
229
|
+
'<!-- soleri:session -->',
|
|
230
|
+
'',
|
|
231
|
+
'### Session Start Protocol',
|
|
232
|
+
'',
|
|
233
|
+
'On EVERY new session:',
|
|
234
|
+
'1. Register project: `op:register params:{ projectPath: "." }`',
|
|
235
|
+
'2. Check activation response for `persistence.status`, `vault.connected`, `project.registered`.',
|
|
236
|
+
'3. Check for plans awaiting reconciliation via `op:check_persistence`:',
|
|
237
|
+
' - `executing` → Remind user to call `op:plan_reconcile`.',
|
|
238
|
+
' - `reconciling` → Remind user to call `op:plan_complete_lifecycle`.',
|
|
239
|
+
'',
|
|
240
|
+
'### Context Compaction',
|
|
241
|
+
'',
|
|
242
|
+
'A PreCompact hook calls `op:session_capture` before context compaction.',
|
|
243
|
+
'Manual capture: `op:session_capture params:{ summary: "..." }`',
|
|
244
|
+
'',
|
|
245
|
+
`<!-- /${ENGINE_MARKER} -->`,
|
|
246
|
+
];
|
|
204
247
|
//# sourceMappingURL=shared-rules.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared-rules.js","sourceRoot":"","sources":["../../src/templates/shared-rules.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"shared-rules.js","sourceRoot":"","sources":["../../src/templates/shared-rules.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,aAAa,GAAG,qBAAqB,CAAC;AAE5C,MAAM,UAAU,eAAe;IAC7B,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,qBAAqB;IACnC,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAED,MAAM,kBAAkB,GAAa;IACnC,QAAQ,aAAa,MAAM;IAC3B,EAAE;IACF,uBAAuB;IACvB,EAAE;IACF,qGAAqG;IACrG,EAAE;IAEF,2DAA2D;IAC3D,uBAAuB;IACvB,oCAAoC;IACpC,EAAE;IACF,8FAA8F;IAC9F,uFAAuF;IACvF,EAAE;IAEF,0DAA0D;IAC1D,wBAAwB;IACxB,gCAAgC;IAChC,EAAE;IACF,2FAA2F;IAC3F,EAAE;IACF,2GAA2G;IAC3G,+KAA+K;IA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IAEF,4DAA4D;IAC5D,yBAAyB;IACzB,+BAA+B;IAC/B,EAAE;IACF,wFAAwF;IACxF,iFAAiF;IACjF,EAAE;IAEF,4DAA4D;IAC5D,sBAAsB;IACtB,yBAAyB;IACzB,EAAE;IACF,4BAA4B;IAC5B,EAAE;IACF,uBAAuB;IACvB,gEAAgE;IAChE,iGAAiG;IACjG,wEAAwE;IACxE,6DAA6D;IAC7D,wEAAwE;IACxE,EAAE;IACF,wBAAwB;IACxB,EAAE;IACF,yEAAyE;IACzE,gEAAgE;IAChE,EAAE;IAEF,SAAS,aAAa,MAAM;CAC7B,CAAC"}
|
|
@@ -60,9 +60,10 @@ ${domainDescribes}
|
|
|
60
60
|
return createSemanticFacades(runtime, '${config.id}');
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
it('should create
|
|
63
|
+
it('should create all expected semantic facades', () => {
|
|
64
64
|
const facades = buildSemanticFacades();
|
|
65
|
-
|
|
65
|
+
// At least the core 10 facades must exist; new ones may be added by @soleri/core
|
|
66
|
+
expect(facades.length).toBeGreaterThanOrEqual(10);
|
|
66
67
|
const names = facades.map(f => f.name);
|
|
67
68
|
expect(names).toContain('${config.id}_vault');
|
|
68
69
|
expect(names).toContain('${config.id}_plan');
|
|
@@ -76,10 +77,11 @@ ${domainDescribes}
|
|
|
76
77
|
expect(names).toContain('${config.id}_cognee');
|
|
77
78
|
});
|
|
78
79
|
|
|
79
|
-
it('total ops across all facades should
|
|
80
|
+
it('total ops across all facades should meet minimum threshold', () => {
|
|
80
81
|
const facades = buildSemanticFacades();
|
|
81
82
|
const totalOps = facades.reduce((sum, f) => sum + f.ops.length, 0);
|
|
82
|
-
|
|
83
|
+
// At least 209 ops (baseline); new ops may be added by @soleri/core
|
|
84
|
+
expect(totalOps).toBeGreaterThanOrEqual(209);
|
|
83
85
|
});
|
|
84
86
|
});
|
|
85
87
|
|
|
@@ -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;;;;;+CAK8B,MAAM,CAAC,EAAE
|
|
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;;;;;+CAK8B,MAAM,CAAC,EAAE;;;;;;;;iCAQvB,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;iCACT,MAAM,CAAC,EAAE;;;;;;;;;;;cAW5B,MAAM,CAAC,EAAE;;+CAEwB,MAAM,CAAC,EAAE,4BAA4B,MAAM,CAAC,EAAE;;;;;;;;;;;;;;;;;;;;iDAoB5C,MA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CAAC;AACvD,CAAC"}
|
package/package.json
CHANGED
package/src/lib.ts
CHANGED
|
@@ -21,3 +21,5 @@ export type {
|
|
|
21
21
|
export { AgentConfigSchema, SETUP_TARGETS } from './types.js';
|
|
22
22
|
export { generateExtensionsIndex, generateExampleOp } from './templates/extensions.js';
|
|
23
23
|
export { generateClaudeMdTemplate } from './templates/claude-md-template.js';
|
|
24
|
+
export { getEngineRulesContent, getEngineMarker } from './templates/shared-rules.js';
|
|
25
|
+
export { generateInjectClaudeMd } from './templates/inject-claude-md.js';
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import type { AgentConfig } from '../types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getEngineMarker, getEngineRulesContent } from './shared-rules.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Generates src/activation/claude-md-content.ts for a new agent.
|
|
6
6
|
*
|
|
7
|
-
* Architecture:
|
|
8
|
-
* 1.
|
|
9
|
-
* 2.
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* Architecture (split injection):
|
|
8
|
+
* 1. Engine rules — shared, prefix-free, injected once under `<!-- soleri:engine-rules -->`
|
|
9
|
+
* 2. Agent block — lightweight, agent-specific, under `<!-- agent-id:mode -->`
|
|
10
|
+
* - Identity (persona, domains, principles)
|
|
11
|
+
* - Session start protocol
|
|
12
|
+
* - Curated facade table (~30 key ops, grouped by category)
|
|
13
|
+
* - Hook packs (conditional)
|
|
13
14
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
15
|
+
* The facade table maps `op:name` → actual `agentId_core op:name` tool calls.
|
|
16
|
+
* Full op list is always available via `admin_tool_list`.
|
|
16
17
|
*/
|
|
17
18
|
export function generateClaudeMdTemplate(config: AgentConfig): string {
|
|
18
19
|
const toolPrefix = config.id;
|
|
@@ -87,9 +88,6 @@ export function generateClaudeMdTemplate(config: AgentConfig): string {
|
|
|
87
88
|
|
|
88
89
|
mdLines.push('', `> Full list: ${bt}${toolPrefix}_core op:admin_tool_list${bt}`, '');
|
|
89
90
|
|
|
90
|
-
// ─── Shared Behavioral Rules ───────────────────────────
|
|
91
|
-
mdLines.push(...getSharedRules(toolPrefix));
|
|
92
|
-
|
|
93
91
|
// ─── Hook Packs (conditional) ──────────────────────────
|
|
94
92
|
appendHookPacks(mdLines, config);
|
|
95
93
|
|
|
@@ -102,11 +100,20 @@ export function generateClaudeMdTemplate(config: AgentConfig): string {
|
|
|
102
100
|
return ` '${escaped}',`;
|
|
103
101
|
});
|
|
104
102
|
|
|
103
|
+
// Generate engine rules as a quoted string literal
|
|
104
|
+
const engineContent = getEngineRulesContent();
|
|
105
|
+
const engineQuotedLines = engineContent.split('\n').map((line) => {
|
|
106
|
+
const escaped = line.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
|
|
107
|
+
return ` '${escaped}',`;
|
|
108
|
+
});
|
|
109
|
+
|
|
105
110
|
return [
|
|
106
111
|
'/**',
|
|
107
112
|
` * CLAUDE.md content for ${config.name}.`,
|
|
108
113
|
' * Generated by Soleri — do not edit manually.',
|
|
109
114
|
' */',
|
|
115
|
+
'',
|
|
116
|
+
'/** Agent-specific block (identity + activation + facade table). */',
|
|
110
117
|
'export function getClaudeMdContent(): string {',
|
|
111
118
|
' return [',
|
|
112
119
|
...quotedLines,
|
|
@@ -116,6 +123,17 @@ export function generateClaudeMdTemplate(config: AgentConfig): string {
|
|
|
116
123
|
'export function getClaudeMdMarker(): string {',
|
|
117
124
|
` return '${marker}';`,
|
|
118
125
|
'}',
|
|
126
|
+
'',
|
|
127
|
+
'/** Shared engine rules — injected once, skipped if already present. */',
|
|
128
|
+
'export function getEngineRulesContent(): string {',
|
|
129
|
+
' return [',
|
|
130
|
+
...engineQuotedLines,
|
|
131
|
+
" ].join('\\n');",
|
|
132
|
+
'}',
|
|
133
|
+
'',
|
|
134
|
+
'export function getEngineRulesMarker(): string {',
|
|
135
|
+
` return '${getEngineMarker()}';`,
|
|
136
|
+
'}',
|
|
119
137
|
].join('\n');
|
|
120
138
|
}
|
|
121
139
|
|