@soleri/forge 9.3.1 → 9.4.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/scaffolder.js +39 -1
- 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 +268 -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 +154 -0
- package/dist/skills/subagent-driven-development/SKILL.md +77 -0
- package/dist/skills/using-git-worktrees/SKILL.md +80 -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 +128 -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/scaffolder.ts +41 -1
- 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 +268 -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 +154 -0
- package/src/skills/subagent-driven-development/SKILL.md +77 -0
- package/src/skills/using-git-worktrees/SKILL.md +80 -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 +130 -5
- package/src/templates/skills.ts +3 -29
- package/src/templates/vitest-config.ts +1 -0
- package/vitest.config.ts +1 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a POSIX sh script that cleans up stale Claude Code worktrees.
|
|
3
|
+
* Registered as a SessionStart hook in scaffolded agents.
|
|
4
|
+
*/
|
|
5
|
+
export function generateCleanWorktreesScript() {
|
|
6
|
+
return `#!/bin/sh
|
|
7
|
+
# Clean stale Claude Code worktrees on session start.
|
|
8
|
+
# Registered as a SessionStart hook by Soleri scaffolding.
|
|
9
|
+
# Safe: skips active worktrees, checks for unpushed commits.
|
|
10
|
+
|
|
11
|
+
WORKTREE_DIR=".claude/worktrees"
|
|
12
|
+
|
|
13
|
+
# Exit silently if no worktrees directory
|
|
14
|
+
[ -d "$WORKTREE_DIR" ] || exit 0
|
|
15
|
+
|
|
16
|
+
# Prune worktrees whose branches have been deleted
|
|
17
|
+
git worktree prune 2>/dev/null
|
|
18
|
+
|
|
19
|
+
# Get list of active worktrees (skip the main one)
|
|
20
|
+
active_worktrees="$(git worktree list --porcelain 2>/dev/null | grep '^worktree ' | sed 's/^worktree //')"
|
|
21
|
+
|
|
22
|
+
cleaned=0
|
|
23
|
+
skipped=0
|
|
24
|
+
|
|
25
|
+
for dir in "$WORKTREE_DIR"/*/; do
|
|
26
|
+
[ -d "$dir" ] || continue
|
|
27
|
+
|
|
28
|
+
# Resolve to absolute path for comparison
|
|
29
|
+
abs_dir="$(cd "$dir" 2>/dev/null && pwd)" || continue
|
|
30
|
+
|
|
31
|
+
# Skip if still in git worktree list (active)
|
|
32
|
+
if echo "$active_worktrees" | grep -qF "$abs_dir"; then
|
|
33
|
+
skipped=$((skipped + 1))
|
|
34
|
+
continue
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
# Safety: check for unpushed commits before removing
|
|
38
|
+
branch="$(git -C "$dir" rev-parse --abbrev-ref HEAD 2>/dev/null)" || branch=""
|
|
39
|
+
if [ -n "$branch" ] && [ "$branch" != "HEAD" ]; then
|
|
40
|
+
upstream="$(git -C "$dir" rev-parse --abbrev-ref "@{upstream}" 2>/dev/null)" || upstream=""
|
|
41
|
+
if [ -n "$upstream" ]; then
|
|
42
|
+
unpushed="$(git -C "$dir" log "$upstream..$branch" --oneline 2>/dev/null)"
|
|
43
|
+
if [ -n "$unpushed" ]; then
|
|
44
|
+
skipped=$((skipped + 1))
|
|
45
|
+
continue
|
|
46
|
+
fi
|
|
47
|
+
fi
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
rm -rf "$dir" 2>/dev/null && cleaned=$((cleaned + 1))
|
|
51
|
+
done
|
|
52
|
+
|
|
53
|
+
# Silent unless something was cleaned
|
|
54
|
+
if [ "$cleaned" -gt 0 ]; then
|
|
55
|
+
echo "Cleaned $cleaned stale worktree(s), $skipped active/protected"
|
|
56
|
+
fi
|
|
57
|
+
`;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=clean-worktrees.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clean-worktrees.js","sourceRoot":"","sources":["../../src/templates/clean-worktrees.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,4BAA4B;IAC1C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmDR,CAAC;AACF,CAAC"}
|
|
@@ -50,11 +50,18 @@ if [ ! -f "$SETTINGS_FILE" ]; then
|
|
|
50
50
|
"type": "prompt",
|
|
51
51
|
"prompt": "Before context is compacted, capture a session summary by calling ${config.id}_core op:session_capture with a brief summary of what was accomplished, the topics covered, files modified, and tools used."
|
|
52
52
|
}
|
|
53
|
+
],
|
|
54
|
+
"SessionStart": [
|
|
55
|
+
{
|
|
56
|
+
"type": "command",
|
|
57
|
+
"command": "sh $AGENT_DIR/scripts/clean-worktrees.sh",
|
|
58
|
+
"timeout": 10
|
|
59
|
+
}
|
|
53
60
|
]
|
|
54
61
|
}
|
|
55
62
|
}
|
|
56
63
|
SETTINGS
|
|
57
|
-
echo "[ok] Created $SETTINGS_FILE with PreCompact
|
|
64
|
+
echo "[ok] Created $SETTINGS_FILE with PreCompact + SessionStart hooks"
|
|
58
65
|
else
|
|
59
66
|
if grep -q "PreCompact" "$SETTINGS_FILE" 2>/dev/null; then
|
|
60
67
|
echo "[ok] PreCompact hook already configured — skipping"
|
|
@@ -72,6 +79,24 @@ else
|
|
|
72
79
|
"
|
|
73
80
|
echo "[ok] Added PreCompact hook to $SETTINGS_FILE"
|
|
74
81
|
fi
|
|
82
|
+
# Add SessionStart worktree cleanup hook
|
|
83
|
+
if grep -q "clean-worktrees" "$SETTINGS_FILE" 2>/dev/null; then
|
|
84
|
+
echo "[ok] SessionStart worktree cleanup hook already configured"
|
|
85
|
+
else
|
|
86
|
+
node -e "
|
|
87
|
+
const fs = require('fs');
|
|
88
|
+
const settings = JSON.parse(fs.readFileSync('$SETTINGS_FILE', 'utf-8'));
|
|
89
|
+
if (!settings.hooks) settings.hooks = {};
|
|
90
|
+
if (!settings.hooks.SessionStart) settings.hooks.SessionStart = [];
|
|
91
|
+
settings.hooks.SessionStart.push({
|
|
92
|
+
type: 'command',
|
|
93
|
+
command: 'sh $AGENT_DIR/scripts/clean-worktrees.sh',
|
|
94
|
+
timeout: 10
|
|
95
|
+
});
|
|
96
|
+
fs.writeFileSync('$SETTINGS_FILE', JSON.stringify(settings, null, 2) + '\\n');
|
|
97
|
+
"
|
|
98
|
+
echo "[ok] Added SessionStart worktree cleanup hook"
|
|
99
|
+
fi
|
|
75
100
|
fi
|
|
76
101
|
|
|
77
102
|
# Install skills to ~/.claude/commands/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-script.js","sourceRoot":"","sources":["../../src/templates/setup-script.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAmB;IACrD,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,IAAI,QAAQ,CAAC;IACnD,MAAM,WAAW,GAAG,WAAW,KAAK,QAAQ,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,KAAK,KAAK,CAAC;IAChG,MAAM,UAAU,GAAG,WAAW,KAAK,OAAO,IAAI,WAAW,KAAK,MAAM,IAAI,WAAW,KAAK,KAAK,CAAC;IAC9F,MAAM,aAAa,GAAG,WAAW,KAAK,UAAU,IAAI,WAAW,KAAK,KAAK,CAAC;IAC1E,MAAM,SAAS,GAAG;QAChB,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACvC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAChC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;KACvC,CAAC;IACF,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAExC,MAAM,aAAa,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,CAAC,CAAC;IAEb,OAAO;;;;cAIK,MAAM,CAAC,EAAE;;YAEX,MAAM,CAAC,IAAI,WAAW,SAAS;;;;;;;;;;;;;;;;;;;mBAmBxB,MAAM,CAAC,IAAI;;;;;;;;EAQ5B,aAAa;EACb,eAAe;EACf,YAAY;EACZ,eAAe;EACf,SAAS;CACV,CAAC;AACF,CAAC"}
|
|
@@ -105,6 +105,19 @@ const ENGINE_RULES_LINES = [
|
|
|
105
105
|
'- Persist lessons: capture + link. An unlinked entry is incomplete.',
|
|
106
106
|
'- Exceptions: runtime errors with stack traces → codebase first; user explicitly asks to search web.',
|
|
107
107
|
'',
|
|
108
|
+
'### Vault Search Strategy',
|
|
109
|
+
'',
|
|
110
|
+
"Default to **two-pass search** — scan first, load only what's relevant. This saves tokens and keeps context lean.",
|
|
111
|
+
'',
|
|
112
|
+
'| Situation | Strategy |',
|
|
113
|
+
'|-----------|----------|',
|
|
114
|
+
'| Broad/exploratory query | `mode: "scan"` → triage by score → `op:load_entries` for top matches |',
|
|
115
|
+
'| Specific known entry | `mode: "full"` directly |',
|
|
116
|
+
'| Work task (need vault context before coding) | Scan → pick relevant → load |',
|
|
117
|
+
'| Existence check ("do we have X?") | `mode: "scan"` only, no load needed |',
|
|
118
|
+
'',
|
|
119
|
+
'**Never load all scan results.** Pick the top 2-4 by relevance score and skip entries below 0.30 unless the query is very specific.',
|
|
120
|
+
'',
|
|
108
121
|
// ─── Planning ────────────────────────────────────────────
|
|
109
122
|
'## Planning',
|
|
110
123
|
'<!-- soleri:planning -->',
|
|
@@ -199,6 +212,37 @@ const ENGINE_RULES_LINES = [
|
|
|
199
212
|
'| skipped | ... | medium | ... |',
|
|
200
213
|
'```',
|
|
201
214
|
'',
|
|
215
|
+
// ─── YOLO Mode ──────────────────────────────────────────
|
|
216
|
+
'## YOLO Mode',
|
|
217
|
+
'<!-- soleri:yolo-mode -->',
|
|
218
|
+
'',
|
|
219
|
+
'YOLO mode skips plan approval gates for faster execution. The agent executes tasks directly without waiting for Gate 1 (`op:approve_plan`) or Gate 2 (`op:plan_split`) confirmation.',
|
|
220
|
+
'',
|
|
221
|
+
'### What Changes',
|
|
222
|
+
'',
|
|
223
|
+
'- Plan approval gates are **auto-approved** — no user confirmation needed.',
|
|
224
|
+
'- Task routing skips the two-gate ceremony — plans are created, approved, and split in one pass.',
|
|
225
|
+
'',
|
|
226
|
+
'### What Does NOT Change',
|
|
227
|
+
'',
|
|
228
|
+
'- `op:orchestrate_complete` **always runs** — knowledge capture is never skipped.',
|
|
229
|
+
'- Vault search **always runs** — decisions must be informed by existing patterns.',
|
|
230
|
+
'- Brain feedback loop remains active.',
|
|
231
|
+
'- Grade gate still applies — plans must grade A or higher.',
|
|
232
|
+
'',
|
|
233
|
+
'### Prerequisites',
|
|
234
|
+
'',
|
|
235
|
+
'- **YOLO Safety Hook Pack** must be installed: `soleri hooks add-pack yolo-safety`',
|
|
236
|
+
'- The hook pack intercepts destructive commands (force push, reset --hard, drop table) and requires explicit confirmation.',
|
|
237
|
+
'- Staging backups are created before destructive operations.',
|
|
238
|
+
'',
|
|
239
|
+
'### Activation & Deactivation',
|
|
240
|
+
'',
|
|
241
|
+
'| Action | Method |',
|
|
242
|
+
'|--------|--------|',
|
|
243
|
+
'| Activate | `soleri yolo` or `op:morph params:{ mode: "YOLO-MODE" }` |',
|
|
244
|
+
'| Deactivate | "exit YOLO", session end, or `op:activate params:{ deactivate: true }` |',
|
|
245
|
+
'',
|
|
202
246
|
// ─── Output Formatting ───────────────────────────────────
|
|
203
247
|
'## Output Formatting',
|
|
204
248
|
'<!-- soleri:output-formatting -->',
|
|
@@ -285,7 +329,7 @@ const ENGINE_RULES_LINES = [
|
|
|
285
329
|
'`op:orchestrate_complete` runs for EVERY task — simple or complex. This captures:',
|
|
286
330
|
'- Knowledge to vault (patterns learned, decisions made)',
|
|
287
331
|
'- Session summary (what was done, files changed)',
|
|
288
|
-
|
|
332
|
+
"- Brain feedback (what worked, what didn't)",
|
|
289
333
|
'',
|
|
290
334
|
'Without completion, the knowledge trail is lost. The code is in git, but the WHY disappears.',
|
|
291
335
|
'',
|
|
@@ -333,6 +377,36 @@ const ENGINE_RULES_LINES = [
|
|
|
333
377
|
'- Brain tells you **which** patterns matter (names + strength scores). Vault tells you **what** they are (rules, examples).',
|
|
334
378
|
"- Pull only what's relevant to the current task — don't load everything at session start.",
|
|
335
379
|
'',
|
|
380
|
+
'### Second Brain Features',
|
|
381
|
+
'',
|
|
382
|
+
'| Feature | How to use |',
|
|
383
|
+
'|---------|-----------|',
|
|
384
|
+
'| **Two-pass search** | `op:search_intelligent` with `mode: "scan"` for lightweight results, then `op:load_entries` for full content. See **Vault Search Strategy**. |',
|
|
385
|
+
'| **Session briefing** | `op:session_briefing` on session start — surfaces last session, active plans, recent captures, brain recommendations |',
|
|
386
|
+
'| **Evidence reconciliation** | `op:plan_reconcile_with_evidence` — cross-references plan tasks against git diff |',
|
|
387
|
+
'| **Learning radar** | `op:radar_analyze` to detect patterns from corrections, search misses, workarounds. `op:radar_candidates` to review, `op:radar_approve`/`op:radar_dismiss` |',
|
|
388
|
+
'| **External ingestion** | `op:ingest_url` for articles, `op:ingest_text` for transcripts/notes, `op:ingest_batch` for multiple items |',
|
|
389
|
+
'| **Content synthesis** | `op:synthesize` — turn vault knowledge into briefs, outlines, talking points, or post drafts |',
|
|
390
|
+
'| **Skill chains** | `op:chain_execute` — multi-step workflows with data flow between steps and approval gates |',
|
|
391
|
+
'',
|
|
392
|
+
'### Brain Feedback Loop',
|
|
393
|
+
'',
|
|
394
|
+
'After using a vault search result to inform a decision, action, or response, call `op:record_feedback` with:',
|
|
395
|
+
'- `query`: the original search query',
|
|
396
|
+
'- `entryId`: the vault entry ID that was used',
|
|
397
|
+
'- `action`: "accepted" (result was useful) or "rejected" (result was irrelevant/wrong)',
|
|
398
|
+
'- `confidence`: 0.0–1.0 how relevant the result was to the task',
|
|
399
|
+
'',
|
|
400
|
+
'Do this for:',
|
|
401
|
+
'- `search_intelligent` results that influence your next action',
|
|
402
|
+
'- `orchestrate_plan` vault recommendations you follow',
|
|
403
|
+
'- Vault entries you cite or reference in responses',
|
|
404
|
+
'',
|
|
405
|
+
'Do NOT record feedback for:',
|
|
406
|
+
'- Existence checks ("do we have X?" — just scanning, not using)',
|
|
407
|
+
"- Results you browse but don't act on",
|
|
408
|
+
'- Duplicate feedback for the same entry in the same task',
|
|
409
|
+
'',
|
|
336
410
|
// ─── Cross-Project Memory ────────────────────────────────
|
|
337
411
|
'## Cross-Project Memory',
|
|
338
412
|
'<!-- soleri:cross-project -->',
|
|
@@ -396,11 +470,27 @@ const ENGINE_RULES_LINES = [
|
|
|
396
470
|
'',
|
|
397
471
|
'### Character Persistence',
|
|
398
472
|
'',
|
|
399
|
-
'-
|
|
473
|
+
'- **MANDATORY**: Prefix every response with `{AgentName} >` when activated (e.g., `Ernesto >`, `Salvador >`). This signals to the user that the agent persona is active.',
|
|
474
|
+
"- All communication flows through your persona's voice — tone, vocabulary, opinions",
|
|
400
475
|
'- Stay in character until explicitly deactivated',
|
|
401
476
|
'- Context compaction does not change who you are — these rules persist in CLAUDE.md',
|
|
402
477
|
'- If you notice yourself dropping character, re-read your activation context',
|
|
403
478
|
'',
|
|
479
|
+
'### Operator Learning (automatic, silent)',
|
|
480
|
+
'When calling `op:orchestrate_complete`, fill the `operatorSignals` field with your observations from this session:',
|
|
481
|
+
'',
|
|
482
|
+
'- **Expertise**: which topics did the operator demonstrate knowledge in? Where did they need explanation? Report topic + level (learning/intermediate/expert).',
|
|
483
|
+
"- **Corrections**: did they tell you to change behavior? Quote their exact words. Note if it's global or project-specific.",
|
|
484
|
+
'- **Interests**: did they share anything personal? Hobbies, background, music, culture? Report the tag and context.',
|
|
485
|
+
'- **Patterns**: did you notice work habits? Batching, scoping, pacing, communication style? Report what you observed.',
|
|
486
|
+
'',
|
|
487
|
+
'Rules:',
|
|
488
|
+
"- Fill what you observed. Empty arrays for what you didn't notice.",
|
|
489
|
+
'- Store facts, not assumptions. "User asked about React hooks" not "User doesn\'t know React."',
|
|
490
|
+
'- Never announce you are learning. Never ask for confirmation.',
|
|
491
|
+
'- Decline to store: health, medical, political, religious, sexual, financial, legal content.',
|
|
492
|
+
'- The engine handles compounding and persistence — just report honestly.',
|
|
493
|
+
'',
|
|
404
494
|
'### What NOT to Route Through Tools',
|
|
405
495
|
'',
|
|
406
496
|
'- Pure file read/write/edit operations (use Read, Edit, Write tools directly)',
|
|
@@ -415,8 +505,8 @@ const ENGINE_RULES_LINES = [
|
|
|
415
505
|
'',
|
|
416
506
|
'### Session Start Protocol',
|
|
417
507
|
'',
|
|
418
|
-
'On activation, discover capabilities via `op:admin_tool_list`. Call `op:
|
|
419
|
-
'Call `op:activate` only when checking evolved capabilities or recovering session state.',
|
|
508
|
+
'On activation, discover capabilities via `op:admin_tool_list`. Call `op:session_briefing` to surface last session context, active plans, and brain recommendations.',
|
|
509
|
+
'Call `op:register` when project context is needed for a task. Call `op:activate` only when checking evolved capabilities or recovering session state.',
|
|
420
510
|
'After context compaction, re-discover capabilities — do not assume your tool inventory is still cached.',
|
|
421
511
|
'',
|
|
422
512
|
'### Context Compaction',
|
|
@@ -493,6 +583,38 @@ const ENGINE_RULES_LINES = [
|
|
|
493
583
|
'| "Check my setup" | `soleri doctor` |',
|
|
494
584
|
'| Template drift suspected | `soleri agent diff` to see what changed |',
|
|
495
585
|
'',
|
|
586
|
+
// ─── Persona Self-Update ────────────────────────────────────
|
|
587
|
+
'## Persona Self-Update',
|
|
588
|
+
'<!-- soleri:persona-self-update -->',
|
|
589
|
+
'',
|
|
590
|
+
'When the user asks to change your personality, voice, quirks, or character:',
|
|
591
|
+
'',
|
|
592
|
+
'1. **Edit your own `agent.yaml`** — the `persona:` block is the source of truth for your character.',
|
|
593
|
+
'2. **NEVER modify Soleri engine code** — `@soleri/core`, `packages/core/src/persona/defaults.ts`, or any engine package. Those define the default template for ALL agents.',
|
|
594
|
+
'3. After editing `agent.yaml`, tell the user to run `soleri agent refresh` to regenerate CLAUDE.md, then reactivate.',
|
|
595
|
+
'',
|
|
596
|
+
'### What You Can Change',
|
|
597
|
+
'',
|
|
598
|
+
'| Field | Purpose |',
|
|
599
|
+
'|-------|---------|',
|
|
600
|
+
'| `persona.template` | Template ID (informational, can be custom) |',
|
|
601
|
+
'| `persona.inspiration` | Who/what inspires the character |',
|
|
602
|
+
'| `persona.culture` | Cultural background |',
|
|
603
|
+
'| `persona.voice` | How you sound (tone, cadence, vocabulary) |',
|
|
604
|
+
'| `persona.traits` | Personality traits |',
|
|
605
|
+
'| `persona.quirks` | Memorable behaviors and expressions |',
|
|
606
|
+
'| `persona.opinions` | Beliefs about craft and quality |',
|
|
607
|
+
'| `persona.metaphors` | Domains you draw metaphors from |',
|
|
608
|
+
'| `persona.languageRule` | How you mix languages |',
|
|
609
|
+
'| `persona.greetings` | Session start messages |',
|
|
610
|
+
'| `persona.signoffs` | Session end messages |',
|
|
611
|
+
'',
|
|
612
|
+
'### What You Must NOT Change',
|
|
613
|
+
'',
|
|
614
|
+
'- Engine defaults in `packages/core/src/persona/defaults.ts`',
|
|
615
|
+
'- The `PERSONA_TEMPLATES` registry',
|
|
616
|
+
'- Any file inside `@soleri/core` or `@soleri/forge`',
|
|
617
|
+
'',
|
|
496
618
|
// ─── Verification Protocol ─────────────────────────────────
|
|
497
619
|
'## Verification Protocol',
|
|
498
620
|
'<!-- soleri:verification-protocol -->',
|
|
@@ -505,11 +627,12 @@ const ENGINE_RULES_LINES = [
|
|
|
505
627
|
'2. **Prove** — reproduce the issue (test case, error log, stack trace)',
|
|
506
628
|
'3. **Fix** — only after the issue is proven reproducible',
|
|
507
629
|
'',
|
|
508
|
-
'### Anti-
|
|
630
|
+
'### Anti-patterns',
|
|
509
631
|
'',
|
|
510
632
|
'- Fixing code "just in case" or for aesthetics without a proven issue',
|
|
511
633
|
'- Claiming a bug exists without reproduction evidence',
|
|
512
634
|
'- Refactoring working code under the guise of a bug fix',
|
|
635
|
+
'- **Dismissing test failures as "flaky" or "pre-existing" without reading the test code and the handler it exercises.** A test that fails consistently is broken, not flaky. Investigate the root cause before classifying.',
|
|
513
636
|
'',
|
|
514
637
|
'### Scope',
|
|
515
638
|
'',
|
|
@@ -1 +1 @@
|
|
|
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,mBAAmB;IACnB,gCAAgC;IAChC,EAAE;IACF,2MAA2M;IAC3M,EAAE;IACF,kIAAkI;IAClI,qHAAqH;IACrH,iFAAiF;IACjF,iGAAiG;IACjG,8GAA8G;IAC9G,EAAE;IACF,uBAAuB;IACvB,EAAE;IACF,2EAA2E;IAC3E,EAAE;IACF,4EAA4E;IAC5E,2DAA2D;IAC3D,qDAAqD;IACrD,gFAAgF;IAChF,gEAAgE;IAChE,EAAE;IACF,+BAA+B;IAC/B,EAAE;IACF,iFAAiF;IACjF,EAAE;IACF,oGAAoG;IACpG,oFAAoF;IACpF,wEAAwE;IACxE,EAAE;IACF,oIAAoI;IACpI,EAAE;IAEF,2DAA2D;IAC3D,uBAAuB;IACvB,oCAAoC;IACpC,EAAE;IACF,8FAA8F;IAC9F,uFAAuF;IACvF,EAAE;IAEF,2DAA2D;IAC3D,+BAA+B;IAC/B,wCAAwC;IACxC,EAAE;IACF,+GAA+G;IAC/G,EAAE;IACF,iGAAiG;IACjG,yEAAyE;IACzE,iGAAiG;IACjG,uEAA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B;IAC9B,6DAA6D;IAC7D,mEAAmE;IACnE,gDAAgD;IAChD,uDAAuD;IACvD,EAAE;IAEF,4DAA4D;IAC5D,sBAAsB;IACtB,8BAA8B;IAC9B,EAAE;IACF,mDAAmD;IACnD,EAAE;IACF,qBAAqB;IACrB,EAAE;IACF,4DAA4D;IAC5D,EAAE;IACF,6CAA6C;IAC7C,6CAA6C;IAC7C,8BAA8B;IAC9B,uCAAuC;IACvC,mCAAmC;IACnC,qDAAqD;IACrD,yDAAyD;IACzD,EAAE;IACF,aAAa;IACb,EAAE;IACF,4EAA4E;IAC5E,sGAAsG;IACtG,EAAE;IACF,6BAA6B;IAC7B,EAAE;IACF,mFAAmF;IACnF,yDAAyD;IACzD,kDAAkD;IAClD,
|
|
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,mBAAmB;IACnB,gCAAgC;IAChC,EAAE;IACF,2MAA2M;IAC3M,EAAE;IACF,kIAAkI;IAClI,qHAAqH;IACrH,iFAAiF;IACjF,iGAAiG;IACjG,8GAA8G;IAC9G,EAAE;IACF,uBAAuB;IACvB,EAAE;IACF,2EAA2E;IAC3E,EAAE;IACF,4EAA4E;IAC5E,2DAA2D;IAC3D,qDAAqD;IACrD,gFAAgF;IAChF,gEAAgE;IAChE,EAAE;IACF,+BAA+B;IAC/B,EAAE;IACF,iFAAi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AwE;IACxE,EAAE;IAEF,+DAA+D;IAC/D,wBAAwB;IACxB,qCAAqC;IACrC,EAAE;IACF,6EAA6E;IAC7E,EAAE;IACF,qGAAqG;IACrG,4KAA4K;IAC5K,sHAAsH;IACtH,EAAE;IACF,yBAAyB;IACzB,EAAE;IACF,qBAAqB;IACrB,qBAAqB;IACrB,qEAAqE;IACrE,6DAA6D;IAC7D,6CAA6C;IAC7C,iEAAiE;IACjE,2CAA2C;IAC3C,4DAA4D;IAC5D,0DAA0D;IAC1D,2DAA2D;IAC3D,oDAAoD;IACpD,kDAAkD;IAClD,+CAA+C;IAC/C,EAAE;IACF,8BAA8B;IAC9B,EAAE;IACF,8DAA8D;IAC9D,oCAAoC;IACpC,qDAAqD;IACrD,EAAE;IAEF,8DAA8D;IAC9D,0BAA0B;IAC1B,uCAAuC;IACvC,EAAE;IACF,mEAAmE;IACnE,EAAE;IACF,cAAc;IACd,EAAE;IACF,mDAAmD;IACnD,wEAAwE;IACxE,0DAA0D;IAC1D,EAAE;IACF,mBAAmB;IACnB,EAAE;IACF,uEAAuE;IACvE,uDAAuD;IACvD,yDAAyD;IACzD,6NAA6N;IAC7N,EAAE;IACF,WAAW;IACX,EAAE;IACF,mDAAmD;IACnD,iEAAiE;IACjE,0DAA0D;IAC1D,EAAE;IAEF,SAAS,aAAa,MAAM;CAC7B,CAAC"}
|
package/dist/templates/skills.js
CHANGED
|
@@ -3,34 +3,8 @@ import { join, dirname } from 'node:path';
|
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
5
5
|
const SKILLS_DIR = join(__dirname, '..', 'skills');
|
|
6
|
-
/**
|
|
7
|
-
const
|
|
8
|
-
'agent-dev',
|
|
9
|
-
'agent-guide',
|
|
10
|
-
'agent-persona',
|
|
11
|
-
'brain-debrief',
|
|
12
|
-
'brainstorming',
|
|
13
|
-
'code-patrol',
|
|
14
|
-
'context-resume',
|
|
15
|
-
'deep-review',
|
|
16
|
-
'deliver-and-ship',
|
|
17
|
-
'executing-plans',
|
|
18
|
-
'fix-and-learn',
|
|
19
|
-
'health-check',
|
|
20
|
-
'knowledge-harvest',
|
|
21
|
-
'onboard-me',
|
|
22
|
-
'parallel-execute',
|
|
23
|
-
'retrospective',
|
|
24
|
-
'second-opinion',
|
|
25
|
-
'systematic-debugging',
|
|
26
|
-
'test-driven-development',
|
|
27
|
-
'vault-capture',
|
|
28
|
-
'vault-curate',
|
|
29
|
-
'vault-navigator',
|
|
30
|
-
'vault-smells',
|
|
31
|
-
'verification-before-completion',
|
|
32
|
-
'writing-plans',
|
|
33
|
-
]);
|
|
6
|
+
/** Placeholder token in skill templates that gets replaced with agent-specific tool name. */
|
|
7
|
+
const AGENT_PLACEHOLDER = 'YOUR_AGENT_core';
|
|
34
8
|
/**
|
|
35
9
|
* Generate skill files for the scaffolded agent.
|
|
36
10
|
* Returns [relativePath, content] tuples for each skill.
|
|
@@ -77,7 +51,7 @@ export function generateSkills(config) {
|
|
|
77
51
|
continue;
|
|
78
52
|
}
|
|
79
53
|
let content = readFileSync(contentPath, 'utf-8');
|
|
80
|
-
if (
|
|
54
|
+
if (content.includes(AGENT_PLACEHOLDER)) {
|
|
81
55
|
content = content.replace(/YOUR_AGENT_core/g, `${config.id}_core`);
|
|
82
56
|
}
|
|
83
57
|
files.push([`skills/${skillName}/SKILL.md`, content]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.js","sourceRoot":"","sources":["../../src/templates/skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,SAAS,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GA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QACtB,IAAI,WAAmB,CAAC;QAExB,IAAI,QAAQ,CAAC,SAAS,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YACtC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;YAC5C,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;gBAAE,SAAS;YACnC,SAAS,GAAG,KAAK,CAAC;YAClB,WAAW,GAAG,OAAO,CAAC;QACxB,CAAC;aAAM,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACjC,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;YACrC,WAAW,GAAG,SAAS,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,SAAS;QACX,CAAC;QAED,IAAI,aAAa,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC;YACnD,SAAS;QACX,CAAC;QAED,IAAI,OAAO,GAAG,YAAY,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAEjD,IAAI,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,CAAC;YACxC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,kBAAkB,EAAE,GAAG,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;QACrE,CAAC;QAED,KAAK,CAAC,IAAI,CAAC,CAAC,UAAU,SAAS,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vitest-config.js","sourceRoot":"","sources":["../../src/templates/vitest-config.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB;IAClC,OAAO
|
|
1
|
+
{"version":3,"file":"vitest-config.js","sourceRoot":"","sources":["../../src/templates/vitest-config.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,oBAAoB;IAClC,OAAO;;;;;;;;;;;;;;;;;;;;;;;;CAwBR,CAAC;AACF,CAAC"}
|
package/package.json
CHANGED
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
|
}
|