@soleri/forge 9.3.1 → 9.5.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/dist/compose-claude-md.js +118 -7
- package/dist/compose-claude-md.js.map +1 -1
- package/dist/scaffold-filetree.js +42 -0
- package/dist/scaffold-filetree.js.map +1 -1
- package/dist/scaffolder.js +46 -2
- package/dist/scaffolder.js.map +1 -1
- package/dist/skills/agent-dev/SKILL.md +122 -0
- package/dist/skills/agent-guide/SKILL.md +116 -0
- package/dist/skills/agent-issues/SKILL.md +291 -0
- package/dist/skills/agent-persona/SKILL.md +66 -0
- package/dist/skills/deep-review/SKILL.md +12 -0
- package/dist/skills/deliver-and-ship/SKILL.md +123 -0
- package/dist/skills/discovery-phase/SKILL.md +69 -0
- package/dist/skills/env-setup/SKILL.md +151 -0
- package/dist/skills/executing-plans/SKILL.md +12 -0
- package/dist/skills/finishing-a-development-branch/SKILL.md +76 -0
- package/dist/skills/fix-and-learn/SKILL.md +12 -0
- package/dist/skills/mcp-doctor/SKILL.md +160 -0
- package/dist/skills/subagent-driven-development/SKILL.md +79 -0
- package/dist/skills/using-git-worktrees/SKILL.md +81 -0
- package/dist/skills/vault-curate/SKILL.md +99 -0
- package/dist/skills/verification-before-completion/SKILL.md +12 -0
- package/dist/skills/yolo-mode/SKILL.md +80 -0
- package/dist/templates/clean-worktrees.d.ts +5 -0
- package/dist/templates/clean-worktrees.js +59 -0
- package/dist/templates/clean-worktrees.js.map +1 -0
- package/dist/templates/setup-script.js +26 -1
- package/dist/templates/setup-script.js.map +1 -1
- package/dist/templates/shared-rules.js +160 -5
- package/dist/templates/shared-rules.js.map +1 -1
- package/dist/templates/skills.js +3 -29
- package/dist/templates/skills.js.map +1 -1
- package/dist/templates/vitest-config.js +1 -0
- package/dist/templates/vitest-config.js.map +1 -1
- package/package.json +1 -1
- package/src/compose-claude-md.ts +126 -9
- package/src/scaffold-filetree.ts +42 -0
- package/src/scaffolder.ts +49 -2
- package/src/skills/agent-dev/SKILL.md +122 -0
- package/src/skills/agent-guide/SKILL.md +116 -0
- package/src/skills/agent-issues/SKILL.md +291 -0
- package/src/skills/agent-persona/SKILL.md +66 -0
- package/src/skills/deep-review/SKILL.md +12 -0
- package/src/skills/deliver-and-ship/SKILL.md +123 -0
- package/src/skills/discovery-phase/SKILL.md +69 -0
- package/src/skills/env-setup/SKILL.md +151 -0
- package/src/skills/executing-plans/SKILL.md +12 -0
- package/src/skills/finishing-a-development-branch/SKILL.md +76 -0
- package/src/skills/fix-and-learn/SKILL.md +12 -0
- package/src/skills/mcp-doctor/SKILL.md +160 -0
- package/src/skills/subagent-driven-development/SKILL.md +79 -0
- package/src/skills/using-git-worktrees/SKILL.md +81 -0
- package/src/skills/vault-curate/SKILL.md +99 -0
- package/src/skills/verification-before-completion/SKILL.md +12 -0
- package/src/skills/yolo-mode/SKILL.md +80 -0
- package/src/templates/clean-worktrees.ts +58 -0
- package/src/templates/setup-script.ts +26 -1
- package/src/templates/shared-rules.ts +163 -5
- package/src/templates/skills.ts +3 -29
- package/src/templates/vitest-config.ts +1 -0
- package/vitest.config.ts +1 -0
package/src/compose-claude-md.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { readFileSync, readdirSync, existsSync } from 'node:fs';
|
|
9
9
|
import { join } from 'node:path';
|
|
10
10
|
import { parse as parseYaml } from 'yaml';
|
|
11
|
-
import type
|
|
11
|
+
import { AgentYamlSchema, type AgentYaml } from './agent-schema.js';
|
|
12
12
|
import { ENGINE_MODULE_MANIFEST, CORE_KEY_OPS } from '@soleri/core/module-manifest';
|
|
13
13
|
|
|
14
14
|
// ─── Types ────────────────────────────────────────────────────────────
|
|
@@ -39,7 +39,7 @@ export function composeClaudeMd(agentDir: string, tools?: ToolEntry[]): Composed
|
|
|
39
39
|
|
|
40
40
|
// 1. Read agent.yaml
|
|
41
41
|
const agentYamlPath = join(agentDir, 'agent.yaml');
|
|
42
|
-
const agentYaml = parseYaml(readFileSync(agentYamlPath, 'utf-8'))
|
|
42
|
+
const agentYaml = AgentYamlSchema.parse(parseYaml(readFileSync(agentYamlPath, 'utf-8')));
|
|
43
43
|
sources.push(agentYamlPath);
|
|
44
44
|
|
|
45
45
|
const sections: string[] = [];
|
|
@@ -220,6 +220,90 @@ function composeWorkflowIndex(workflowsDir: string): string | null {
|
|
|
220
220
|
return lines.join('\n');
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
/** Skill categories for grouping in the CLAUDE.md index. */
|
|
224
|
+
const SKILL_CATEGORIES: Record<string, { label: string; skills: string[] }> = {
|
|
225
|
+
getting_started: {
|
|
226
|
+
label: 'Getting Started',
|
|
227
|
+
skills: ['agent-guide', 'agent-persona', 'onboard-me', 'env-setup', 'context-resume'],
|
|
228
|
+
},
|
|
229
|
+
planning: {
|
|
230
|
+
label: 'Planning & Execution',
|
|
231
|
+
skills: ['brainstorming', 'writing-plans', 'executing-plans', 'parallel-execute'],
|
|
232
|
+
},
|
|
233
|
+
building: {
|
|
234
|
+
label: 'Building & Fixing',
|
|
235
|
+
skills: [
|
|
236
|
+
'test-driven-development',
|
|
237
|
+
'systematic-debugging',
|
|
238
|
+
'fix-and-learn',
|
|
239
|
+
'agent-dev',
|
|
240
|
+
'code-patrol',
|
|
241
|
+
],
|
|
242
|
+
},
|
|
243
|
+
knowledge: {
|
|
244
|
+
label: 'Knowledge & Learning',
|
|
245
|
+
skills: [
|
|
246
|
+
'vault-capture',
|
|
247
|
+
'vault-navigator',
|
|
248
|
+
'vault-curate',
|
|
249
|
+
'vault-smells',
|
|
250
|
+
'knowledge-harvest',
|
|
251
|
+
'brain-debrief',
|
|
252
|
+
],
|
|
253
|
+
},
|
|
254
|
+
quality: {
|
|
255
|
+
label: 'Quality & Delivery',
|
|
256
|
+
skills: [
|
|
257
|
+
'verification-before-completion',
|
|
258
|
+
'deep-review',
|
|
259
|
+
'deliver-and-ship',
|
|
260
|
+
'health-check',
|
|
261
|
+
'mcp-doctor',
|
|
262
|
+
],
|
|
263
|
+
},
|
|
264
|
+
reflection: {
|
|
265
|
+
label: 'Reflection & Research',
|
|
266
|
+
skills: ['retrospective', 'second-opinion'],
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Extract the description from SKILL.md frontmatter.
|
|
272
|
+
* Handles both single-line and multi-line YAML folded scalars (>).
|
|
273
|
+
*/
|
|
274
|
+
function extractSkillDescription(content: string): string | null {
|
|
275
|
+
// Match the frontmatter block
|
|
276
|
+
const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
|
|
277
|
+
if (!fmMatch) return null;
|
|
278
|
+
|
|
279
|
+
const fm = fmMatch[1];
|
|
280
|
+
|
|
281
|
+
// Try parsing the description field — handles both inline and folded (>) forms
|
|
282
|
+
const descIdx = fm.indexOf('description:');
|
|
283
|
+
if (descIdx === -1) return null;
|
|
284
|
+
|
|
285
|
+
const afterDesc = fm.slice(descIdx + 'description:'.length);
|
|
286
|
+
const restLines = afterDesc.split('\n');
|
|
287
|
+
|
|
288
|
+
// Single-line: "description: some text"
|
|
289
|
+
const firstLine = restLines[0].trim();
|
|
290
|
+
if (firstLine && firstLine !== '>' && firstLine !== '|') {
|
|
291
|
+
return firstLine;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
// Multi-line folded scalar (> or |): collect indented continuation lines
|
|
295
|
+
const parts: string[] = [];
|
|
296
|
+
for (let i = 1; i < restLines.length; i++) {
|
|
297
|
+
const line = restLines[i];
|
|
298
|
+
// Stop at next YAML key or end of frontmatter
|
|
299
|
+
if (line.match(/^\S/) || line.trim() === '---') break;
|
|
300
|
+
const trimmed = line.trim();
|
|
301
|
+
if (trimmed) parts.push(trimmed);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return parts.length > 0 ? parts.join(' ') : null;
|
|
305
|
+
}
|
|
306
|
+
|
|
223
307
|
function composeSkillsIndex(skillsDir: string): string | null {
|
|
224
308
|
const dirs = readdirSync(skillsDir, { withFileTypes: true })
|
|
225
309
|
.filter((d) => d.isDirectory())
|
|
@@ -227,18 +311,51 @@ function composeSkillsIndex(skillsDir: string): string | null {
|
|
|
227
311
|
|
|
228
312
|
if (dirs.length === 0) return null;
|
|
229
313
|
|
|
230
|
-
|
|
231
|
-
|
|
314
|
+
// Collect all available skills with descriptions
|
|
315
|
+
const skillMap = new Map<string, string>();
|
|
232
316
|
for (const dir of dirs) {
|
|
233
317
|
const skillPath = join(skillsDir, dir.name, 'SKILL.md');
|
|
234
318
|
if (existsSync(skillPath)) {
|
|
235
319
|
const content = readFileSync(skillPath, 'utf-8');
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
const desc = descMatch ? descMatch[1].trim() : dir.name;
|
|
239
|
-
lines.push(`- **${dir.name}**: ${desc}`);
|
|
320
|
+
const desc = extractSkillDescription(content) ?? dir.name;
|
|
321
|
+
skillMap.set(dir.name, desc);
|
|
240
322
|
}
|
|
241
323
|
}
|
|
242
324
|
|
|
243
|
-
|
|
325
|
+
if (skillMap.size === 0) return null;
|
|
326
|
+
|
|
327
|
+
const lines: string[] = [
|
|
328
|
+
'## Available Skills',
|
|
329
|
+
'',
|
|
330
|
+
'Skills are specialized workflows that activate automatically when you describe a matching task.',
|
|
331
|
+
'Each skill provides a structured, step-by-step approach backed by vault knowledge and brain patterns.',
|
|
332
|
+
'',
|
|
333
|
+
];
|
|
334
|
+
|
|
335
|
+
// Group skills into categories
|
|
336
|
+
const categorized = new Set<string>();
|
|
337
|
+
|
|
338
|
+
for (const [_key, category] of Object.entries(SKILL_CATEGORIES)) {
|
|
339
|
+
const categorySkills = category.skills.filter((s) => skillMap.has(s));
|
|
340
|
+
if (categorySkills.length === 0) continue;
|
|
341
|
+
|
|
342
|
+
lines.push(`### ${category.label}`, '');
|
|
343
|
+
for (const skill of categorySkills) {
|
|
344
|
+
lines.push(`- **${skill}**: ${skillMap.get(skill)!}`);
|
|
345
|
+
categorized.add(skill);
|
|
346
|
+
}
|
|
347
|
+
lines.push('');
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Any uncategorized skills go into an "Other" section
|
|
351
|
+
const uncategorized = [...skillMap.keys()].filter((s) => !categorized.has(s)).sort();
|
|
352
|
+
if (uncategorized.length > 0) {
|
|
353
|
+
lines.push('### Other', '');
|
|
354
|
+
for (const skill of uncategorized) {
|
|
355
|
+
lines.push(`- **${skill}**: ${skillMap.get(skill)!}`);
|
|
356
|
+
}
|
|
357
|
+
lines.push('');
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
return lines.join('\n').trimEnd();
|
|
244
361
|
}
|
package/src/scaffold-filetree.ts
CHANGED
|
@@ -189,6 +189,48 @@ When reviewing code, auditing quality, or checking for issues.
|
|
|
189
189
|
- soleri_vault op:search_intelligent
|
|
190
190
|
- soleri_vault op:capture_knowledge
|
|
191
191
|
- soleri_brain op:recommend
|
|
192
|
+
`,
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'context-handoff',
|
|
196
|
+
prompt: `# Context Handoff
|
|
197
|
+
|
|
198
|
+
## When to Use
|
|
199
|
+
Before crossing a context window boundary — \`/clear\`, context compaction, or switching tasks mid-plan.
|
|
200
|
+
|
|
201
|
+
## Steps
|
|
202
|
+
|
|
203
|
+
### 1. Generate Handoff
|
|
204
|
+
- Call \`op:handoff_generate\` to produce a structured markdown document
|
|
205
|
+
- The document captures: active plan state, recent decisions, pending tasks, session context
|
|
206
|
+
|
|
207
|
+
### 2. Capture Session (if not auto-captured)
|
|
208
|
+
- Call \`op:session_capture\` to persist session summary to memory
|
|
209
|
+
- The handoff document is ephemeral — session capture provides durable persistence
|
|
210
|
+
|
|
211
|
+
### 3. Transition
|
|
212
|
+
- Share the handoff markdown with the new context window
|
|
213
|
+
- The new session can reference plan IDs, task status, and decisions from the handoff
|
|
214
|
+
|
|
215
|
+
### 4. Resume
|
|
216
|
+
- On restart, read the handoff document
|
|
217
|
+
- Use plan IDs to look up active plans: \`op:orchestrate_status\`
|
|
218
|
+
- Continue from where the handoff left off
|
|
219
|
+
`,
|
|
220
|
+
gates: `gates:
|
|
221
|
+
- phase: pre-transition
|
|
222
|
+
requirement: Handoff document generated with current state
|
|
223
|
+
check: handoff-generated
|
|
224
|
+
|
|
225
|
+
- phase: post-transition
|
|
226
|
+
requirement: New context has loaded handoff and can reference active plans
|
|
227
|
+
check: context-restored
|
|
228
|
+
`,
|
|
229
|
+
tools: `tools:
|
|
230
|
+
- soleri_memory op:handoff_generate
|
|
231
|
+
- soleri_memory op:session_capture
|
|
232
|
+
- soleri_orchestrate op:orchestrate_status
|
|
233
|
+
- soleri_plan op:create_plan
|
|
192
234
|
`,
|
|
193
235
|
},
|
|
194
236
|
];
|
package/src/scaffolder.ts
CHANGED
|
@@ -28,6 +28,7 @@ import { generateInjectClaudeMd } from './templates/inject-claude-md.js';
|
|
|
28
28
|
import { generateActivate } from './templates/activate.js';
|
|
29
29
|
import { generateReadme } from './templates/readme.js';
|
|
30
30
|
import { generateSetupScript } from './templates/setup-script.js';
|
|
31
|
+
import { generateCleanWorktreesScript } from './templates/clean-worktrees.js';
|
|
31
32
|
import { generateAgentsMd } from './templates/agents-md.js';
|
|
32
33
|
import { generateSkills } from './templates/skills.js';
|
|
33
34
|
import { generateExtensionsIndex, generateExampleOp } from './templates/extensions.js';
|
|
@@ -354,6 +355,7 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
|
|
|
354
355
|
['scripts/copy-assets.js', generateCopyAssetsScript()],
|
|
355
356
|
['README.md', generateReadme(config)],
|
|
356
357
|
['scripts/setup.sh', generateSetupScript(config)],
|
|
358
|
+
['scripts/clean-worktrees.sh', generateCleanWorktreesScript()],
|
|
357
359
|
];
|
|
358
360
|
|
|
359
361
|
if (opencodeSetup) {
|
|
@@ -394,8 +396,11 @@ export function scaffold(config: AgentConfig): ScaffoldResult {
|
|
|
394
396
|
filesCreated.push(path);
|
|
395
397
|
}
|
|
396
398
|
|
|
397
|
-
// Make
|
|
398
|
-
|
|
399
|
+
// Make scripts executable (skip on Windows — no POSIX permissions)
|
|
400
|
+
if (process.platform !== 'win32') {
|
|
401
|
+
chmodSync(join(agentDir, 'scripts', 'setup.sh'), 0o755);
|
|
402
|
+
chmodSync(join(agentDir, 'scripts', 'clean-worktrees.sh'), 0o755);
|
|
403
|
+
}
|
|
399
404
|
|
|
400
405
|
// Write source files
|
|
401
406
|
const sourceFiles: Array<[string, string]> = [
|
|
@@ -617,6 +622,43 @@ export function listAgents(parentDir: string): AgentInfo[] {
|
|
|
617
622
|
|
|
618
623
|
for (const name of entries) {
|
|
619
624
|
const dir = join(parentDir, name);
|
|
625
|
+
|
|
626
|
+
// File-tree (v7) agents have agent.yaml
|
|
627
|
+
const agentYamlPath = join(dir, 'agent.yaml');
|
|
628
|
+
if (existsSync(agentYamlPath)) {
|
|
629
|
+
try {
|
|
630
|
+
const yamlContent = readFileSync(agentYamlPath, 'utf-8');
|
|
631
|
+
// Simple YAML parsing for id/name/role — avoid adding a dependency
|
|
632
|
+
const idMatch = yamlContent.match(/^id:\s*(.+)$/m);
|
|
633
|
+
const nameMatch = yamlContent.match(/^name:\s*(.+)$/m);
|
|
634
|
+
const roleMatch = yamlContent.match(/^role:\s*(.+)$/m);
|
|
635
|
+
|
|
636
|
+
const knowledgeDir = join(dir, 'knowledge');
|
|
637
|
+
let domains: string[] = [];
|
|
638
|
+
try {
|
|
639
|
+
domains = readdirSync(knowledgeDir)
|
|
640
|
+
.filter((f) => f.endsWith('.json'))
|
|
641
|
+
.map((f) => f.replace('.json', ''));
|
|
642
|
+
} catch {
|
|
643
|
+
/* no knowledge dir */
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
agents.push({
|
|
647
|
+
id: idMatch?.[1]?.trim() ?? name,
|
|
648
|
+
name: nameMatch?.[1]?.trim() ?? name,
|
|
649
|
+
role: roleMatch?.[1]?.trim() ?? '',
|
|
650
|
+
path: dir,
|
|
651
|
+
domains,
|
|
652
|
+
hasNodeModules: false,
|
|
653
|
+
hasDistDir: false,
|
|
654
|
+
});
|
|
655
|
+
continue;
|
|
656
|
+
} catch {
|
|
657
|
+
/* skip malformed agent.yaml */
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
// Legacy (v6) agents have package.json
|
|
620
662
|
const pkgPath = join(dir, 'package.json');
|
|
621
663
|
if (!existsSync(pkgPath)) continue;
|
|
622
664
|
|
|
@@ -749,6 +791,11 @@ function createOpencodeLauncher(
|
|
|
749
791
|
agentId: string,
|
|
750
792
|
agentDir: string,
|
|
751
793
|
): { created: boolean; path: string; error?: string } {
|
|
794
|
+
// Launcher scripts and symlinks to /usr/local/bin are Unix-only
|
|
795
|
+
if (process.platform === 'win32') {
|
|
796
|
+
return { created: false, path: '', error: 'Launcher scripts are not supported on Windows' };
|
|
797
|
+
}
|
|
798
|
+
|
|
752
799
|
const launcherPath = join('/usr', 'local', 'bin', agentId);
|
|
753
800
|
const script = [
|
|
754
801
|
'#!/usr/bin/env bash',
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-dev
|
|
3
|
+
description: >
|
|
4
|
+
Use when extending the agent itself — adding facades, tools, vault operations,
|
|
5
|
+
brain features, new skills, or modifying agent internals. Triggers on "add a facade",
|
|
6
|
+
"new tool", "extend vault", "add brain feature", "new skill", "add operation",
|
|
7
|
+
"extend agent", or when the work target is the agent's own codebase rather than
|
|
8
|
+
a project the agent assists with. Enforces vault-first knowledge gathering before
|
|
9
|
+
any code reading or planning.
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Agent Dev — Vault-First Internal Development
|
|
13
|
+
|
|
14
|
+
Develop the agent's own internals with the vault as the primary source of truth. The vault knows more about the agent than any code scan or model training data. Always search the vault first, extract maximum context, and only then touch code.
|
|
15
|
+
|
|
16
|
+
## When to Use
|
|
17
|
+
|
|
18
|
+
Any time the work target is the agent's own codebase: adding tools, extending facades, modifying vault operations, brain features, skills, or transport. Not for projects that merely _use_ the agent.
|
|
19
|
+
|
|
20
|
+
## Core Principle
|
|
21
|
+
|
|
22
|
+
**Vault first. Before code. Before training data. Always.**
|
|
23
|
+
|
|
24
|
+
The vault is the authoritative source for how the agent works. Do not rely on general knowledge from training data — it is outdated and lacks project-specific decisions. Do not scan the codebase to understand architecture — the vault already has it.
|
|
25
|
+
|
|
26
|
+
## Orchestration Sequence
|
|
27
|
+
|
|
28
|
+
### Step 1: Search the Vault (MANDATORY — before anything else)
|
|
29
|
+
|
|
30
|
+
Before reading any source file, before making any plan, before offering any advice:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
YOUR_AGENT_core op:search_vault_intelligent
|
|
34
|
+
params: { query: "<description of planned work>", options: { intent: "pattern" } }
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Search again with architecture-specific terms: the facade name, tool name, or subsystem being modified.
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
YOUR_AGENT_core op:query_vault_knowledge
|
|
41
|
+
params: { type: "workflow", category: "<relevant category>" }
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If initial results are sparse, search again with broader terms — synonyms, related subsystem names, parent concepts. Exhaust the vault before moving on.
|
|
45
|
+
|
|
46
|
+
Review all results. Extract file paths, module names, function references, conventions, and constraints. These become the foundation for every step that follows.
|
|
47
|
+
|
|
48
|
+
### Step 2: Check Brain for Proven Patterns
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
YOUR_AGENT_core op:strengths
|
|
52
|
+
params: { days: 30, minStrength: 60 }
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
YOUR_AGENT_core op:recommend
|
|
57
|
+
params: { projectPath: "." }
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Check if the brain has learned anything relevant from recent sessions.
|
|
61
|
+
|
|
62
|
+
### Step 3: Targeted Code Reading (Only What Vault Pointed To)
|
|
63
|
+
|
|
64
|
+
By now the vault has provided architecture context, file paths, and module references. Only read code when the vault describes the subsystem but lacks implementation detail (e.g., method signatures, exact line numbers).
|
|
65
|
+
|
|
66
|
+
**Read only what the vault pointed to.** Open the specific files referenced in vault results — not the surrounding codebase, not the parent directory, not "let me explore the project structure."
|
|
67
|
+
|
|
68
|
+
**Fallback: Codebase scan.** Only when vault search returned zero relevant results for the subsystem — meaning the vault genuinely has no knowledge about it — fall back to `Grep` with targeted terms. This is the last resort, not the default.
|
|
69
|
+
|
|
70
|
+
### Step 4: Plan with Vault Context
|
|
71
|
+
|
|
72
|
+
Create the implementation plan referencing vault findings explicitly:
|
|
73
|
+
|
|
74
|
+
- Which patterns apply (cite vault entry titles)
|
|
75
|
+
- Which anti-patterns to avoid (cite the specific anti-pattern)
|
|
76
|
+
- Which conventions to follow (naming, facade structure, tool registration)
|
|
77
|
+
|
|
78
|
+
Every plan must trace its decisions back to vault knowledge. If a decision has no vault backing, flag it as a new architectural choice that should be captured after implementation (Step 7).
|
|
79
|
+
|
|
80
|
+
### Step 5: Implement
|
|
81
|
+
|
|
82
|
+
Follow the plan. Key conventions for agent internals:
|
|
83
|
+
|
|
84
|
+
- **Facades**: Thin routing layer — delegate to domain modules. No business logic in facades.
|
|
85
|
+
- **Tools**: Follow `op:operation_name` naming, return structured responses.
|
|
86
|
+
- **Vault writes**: All writes go through the vault intelligence layer.
|
|
87
|
+
- **Tests**: Colocated test files. Run with vitest.
|
|
88
|
+
- **Build**: Must compile without errors before considering done.
|
|
89
|
+
|
|
90
|
+
### Step 6: Validate and Self-Correct
|
|
91
|
+
|
|
92
|
+
Run the relevant test suite. Rebuild — must complete without errors.
|
|
93
|
+
|
|
94
|
+
**Self-correction loop:** If tests fail or build breaks, do NOT ask the user what to do. Read the error, trace the cause in the code just written, fix it, and re-run. Repeat until green. The agent owns the code it wrote — if something fails, the agent fixes its own implementation. Only escalate to the user when the failure is outside the agent's control (missing infrastructure, permissions, unclear requirements).
|
|
95
|
+
|
|
96
|
+
### Step 7: Capture What Was Learned
|
|
97
|
+
|
|
98
|
+
If this work revealed new architectural knowledge, a useful pattern, or a surprising anti-pattern:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
YOUR_AGENT_core op:capture_knowledge
|
|
102
|
+
params: {
|
|
103
|
+
title: "<what was learned>",
|
|
104
|
+
description: "<the pattern or anti-pattern>",
|
|
105
|
+
type: "pattern",
|
|
106
|
+
tags: ["<relevant-tags>"]
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
This ensures future sessions benefit from today's discovery — making the vault smarter for the next developer.
|
|
111
|
+
|
|
112
|
+
## Anti-Patterns to Avoid
|
|
113
|
+
|
|
114
|
+
- **Code-first exploration**: Reading source files before searching the vault. The vault already has the architecture — scanning code is slower and gives less context.
|
|
115
|
+
- **Training-data advice**: Offering general guidance from model training data instead of searching the vault for project-specific knowledge.
|
|
116
|
+
- **Skipping vault search**: The vault contains all architecture knowledge. Not searching it means reinventing knowledge that already exists.
|
|
117
|
+
- **Planning without vault context**: Plans created without vault knowledge miss conventions, duplicate existing patterns, or violate architectural boundaries.
|
|
118
|
+
- **Broad codebase scanning**: Exploring directories and reading files "to understand the project" instead of using vault results as a targeted map.
|
|
119
|
+
|
|
120
|
+
## Exit Criteria
|
|
121
|
+
|
|
122
|
+
Development is complete when: vault was searched exhaustively first (Step 1), implementation follows discovered patterns, tests pass, build succeeds, and any new learning is captured back to vault (Step 7).
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-guide
|
|
3
|
+
description: >
|
|
4
|
+
Use when the user asks "what can you do", "help me", "how do I use this",
|
|
5
|
+
"what features do you have", "what tools are available", "how does this work",
|
|
6
|
+
"show me your capabilities", "what are you", "who are you", or any question
|
|
7
|
+
about the agent's identity, capabilities, available tools, or how to use them.
|
|
8
|
+
Not needed for proactive tool suggestions — those are handled by engine rules.
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Agent Guide — Capability Discovery
|
|
12
|
+
|
|
13
|
+
Help users understand what this agent can do, how to use it effectively, and what makes it different from a raw LLM. This skill handles the deep discovery flow — proactive tool suggestions during normal work are handled by the engine rules (Tool Advocacy section).
|
|
14
|
+
|
|
15
|
+
## When to Use
|
|
16
|
+
|
|
17
|
+
- "What can you do?" / "What are your capabilities?"
|
|
18
|
+
- "How do I search for X?" / "How do I capture knowledge?"
|
|
19
|
+
- "What tools do you have?" / "Show me your features"
|
|
20
|
+
- "Who are you?" / "What is this agent?"
|
|
21
|
+
- "Help" / "I'm stuck" / "How does this work?"
|
|
22
|
+
- First-time users, onboarding, or anyone unfamiliar with the agent
|
|
23
|
+
|
|
24
|
+
## Capability Discovery Sequence
|
|
25
|
+
|
|
26
|
+
### Step 1: Identity
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
YOUR_AGENT_core op:activate
|
|
30
|
+
params: { projectPath: "." }
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
This returns the agent's persona: name, role, description, tone, principles, and domains. Present the identity first — who the agent is and what it specializes in.
|
|
34
|
+
|
|
35
|
+
### Step 2: Health & Status
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
YOUR_AGENT_core op:admin_health
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Shows what subsystems are active: vault (how many entries), brain (vocabulary size), LLM availability, cognee status. This tells the user what the agent currently has to work with.
|
|
42
|
+
|
|
43
|
+
### Step 3: Available Tools
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
YOUR_AGENT_core op:admin_tool_list
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Lists all facades and operations. Present them grouped by category with plain-language descriptions.
|
|
50
|
+
|
|
51
|
+
### Step 4: Present by What Users Can DO
|
|
52
|
+
|
|
53
|
+
Organize capabilities by user goals, not technical names:
|
|
54
|
+
|
|
55
|
+
**Knowledge & Memory**
|
|
56
|
+
|
|
57
|
+
- Search the vault for patterns, anti-patterns, and architectural decisions
|
|
58
|
+
- Capture new knowledge from the current session
|
|
59
|
+
- Search across sessions and projects for relevant context
|
|
60
|
+
- Curate: deduplicate, groom, resolve contradictions
|
|
61
|
+
|
|
62
|
+
**Planning & Execution**
|
|
63
|
+
|
|
64
|
+
- Create structured plans with vault context and brain recommendations
|
|
65
|
+
- Split plans into tasks with complexity estimates
|
|
66
|
+
- Track execution with drift detection
|
|
67
|
+
- Complete with knowledge capture and session recording
|
|
68
|
+
|
|
69
|
+
**Intelligence & Learning**
|
|
70
|
+
|
|
71
|
+
- Brain learns from every session — patterns get stronger with use
|
|
72
|
+
- Recommendations based on similar past work
|
|
73
|
+
- Strength tracking: which patterns are proven vs experimental
|
|
74
|
+
- Feedback loop: brain improves based on what works
|
|
75
|
+
|
|
76
|
+
**Quality & Validation**
|
|
77
|
+
|
|
78
|
+
- Health checks across all subsystems
|
|
79
|
+
- Iterative validation loops with configurable targets
|
|
80
|
+
- Governance: policies, proposals, quotas
|
|
81
|
+
|
|
82
|
+
**Identity & Control**
|
|
83
|
+
|
|
84
|
+
- Persona activation and deactivation
|
|
85
|
+
- Intent routing: the agent classifies what you want and routes to the right workflow
|
|
86
|
+
- Project registration and cross-project linking
|
|
87
|
+
|
|
88
|
+
**Domain Knowledge** (varies by agent)
|
|
89
|
+
|
|
90
|
+
- Each domain has: `get_patterns`, `search`, `get_entry`, `capture`, `remove`
|
|
91
|
+
- Call `op:activate` to discover which domains are configured
|
|
92
|
+
|
|
93
|
+
## Common Questions
|
|
94
|
+
|
|
95
|
+
### "What makes you different from regular Claude?"
|
|
96
|
+
|
|
97
|
+
You have persistent knowledge (vault), learned patterns (brain), structured planning with grading, iterative validation loops, and domain-specific intelligence. Regular Claude starts fresh every conversation — this agent accumulates knowledge and gets smarter over time.
|
|
98
|
+
|
|
99
|
+
### "How do I get the most out of you?"
|
|
100
|
+
|
|
101
|
+
1. **Use the vault** — search before deciding, capture after learning
|
|
102
|
+
2. **Use planning** — structured plans beat ad-hoc work for anything non-trivial
|
|
103
|
+
3. **Trust the brain** — pattern recommendations come from real usage data
|
|
104
|
+
4. **Capture everything** — every bug fix, every pattern, every anti-pattern. The vault grows smarter with use.
|
|
105
|
+
5. **Use loops for quality** — iterative validation catches issues that single-pass work misses
|
|
106
|
+
|
|
107
|
+
### "How do I add new capabilities?"
|
|
108
|
+
|
|
109
|
+
Extensions can add new ops, facades, middleware, and hooks. Domain packs add domain-specific knowledge and validation. Use `soleri pack install <name>` or `soleri extend add-op <name>`.
|
|
110
|
+
|
|
111
|
+
## Anti-Patterns
|
|
112
|
+
|
|
113
|
+
- **Listing raw op names without context** — always explain what the op does in plain language
|
|
114
|
+
- **Claiming capabilities that do not exist** — only reference ops the agent actually has. When unsure, call `op:admin_tool_list` first
|
|
115
|
+
- **Dumping the entire tool catalog** — answer the specific question, show relevant tools, not all tools
|
|
116
|
+
- **Repeating what the user already knows** — if they ask about a specific feature, answer that, don't give the full tour
|