@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
|
@@ -75,6 +75,18 @@ Capture session summary: `YOUR_AGENT_core op:session_capture params: { summary:
|
|
|
75
75
|
- Running linter but not build (linter does not check compilation)
|
|
76
76
|
- Skipping the red-green cycle for regression tests
|
|
77
77
|
|
|
78
|
+
## Rationalization Prevention
|
|
79
|
+
|
|
80
|
+
Do NOT rationalize away failures. If a check fails, it fails. Period.
|
|
81
|
+
|
|
82
|
+
- **HARD-GATE: All verification commands must pass (exit 0, 0 failures) before claiming task complete.**
|
|
83
|
+
- **HARD-GATE: Agent system checks (`admin_health`, `admin_diagnostic`) must report no problems before completion.**
|
|
84
|
+
- Do not say "tests probably pass" -- run them and read the output.
|
|
85
|
+
- Do not say "this is a minor issue" to skip a failing check.
|
|
86
|
+
- Do not say "it worked last time" -- stale results are not evidence.
|
|
87
|
+
- Do not downgrade a failure to a warning to avoid blocking completion.
|
|
88
|
+
- If a check fails and you cannot fix it, report the failure honestly. Never hide it.
|
|
89
|
+
|
|
78
90
|
## Quick Reference
|
|
79
91
|
|
|
80
92
|
| Op | When to Use |
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yolo-mode
|
|
3
|
+
description: >
|
|
4
|
+
Use when the user says "yolo", "autonomous", "skip approvals", "full auto", "hands off",
|
|
5
|
+
or asks to execute without approval gates. Activates autonomous execution mode where the
|
|
6
|
+
agent skips plan approval gates but preserves all safety invariants.
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# YOLO Mode
|
|
10
|
+
|
|
11
|
+
Autonomous execution without approval gates. Plans execute immediately — no Gate 1, no Gate 2, no confirmation prompts.
|
|
12
|
+
|
|
13
|
+
**Announce at start:** "I'm activating YOLO mode — autonomous execution with safety invariants intact."
|
|
14
|
+
|
|
15
|
+
## Activation Flow
|
|
16
|
+
|
|
17
|
+
### Step 1: Verify Safety Hook Pack
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
YOUR_AGENT_core op:admin_health
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Check that the YOLO Safety Hook Pack is installed. This pack intercepts destructive commands (force push, reset --hard, drop table, rm -rf).
|
|
24
|
+
|
|
25
|
+
**HARD-GATE: Refuse to activate YOLO mode if the safety hook pack is not installed.** Tell the user: "YOLO mode requires the safety hook pack. Run `soleri hooks add-pack yolo-safety` first."
|
|
26
|
+
|
|
27
|
+
### Step 2: Morph to YOLO Mode
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
YOUR_AGENT_core op:morph
|
|
31
|
+
params: { mode: "YOLO-MODE" }
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Step 3: Confirm to User
|
|
35
|
+
|
|
36
|
+
State clearly: "YOLO mode active. Approval gates are off. Safety invariants remain enforced. Say 'exit YOLO' to return to normal mode."
|
|
37
|
+
|
|
38
|
+
## What Gets Skipped
|
|
39
|
+
|
|
40
|
+
- Plan approval Gate 1 (`op:approve_plan`)
|
|
41
|
+
- Plan approval Gate 2 (`op:plan_split` confirmation)
|
|
42
|
+
- User confirmation prompts between steps
|
|
43
|
+
- "Ready for feedback?" checkpoints
|
|
44
|
+
|
|
45
|
+
## What Is NEVER Skipped
|
|
46
|
+
|
|
47
|
+
- **`op:orchestrate_complete`** — knowledge capture runs on every task, always
|
|
48
|
+
- **Vault search before decisions** — check vault for patterns/anti-patterns before acting
|
|
49
|
+
- **YOLO Safety Hook Pack** — intercepts destructive commands (force push, drop table, rm -rf, reset --hard)
|
|
50
|
+
- **Test execution** — tests still run; failures still block completion
|
|
51
|
+
- **`op:plan_reconcile`** — drift reports still generated after execution
|
|
52
|
+
|
|
53
|
+
## Exit Conditions
|
|
54
|
+
|
|
55
|
+
YOLO mode deactivates when any of these occur:
|
|
56
|
+
|
|
57
|
+
- User says "exit YOLO", "stop YOLO", or "normal mode"
|
|
58
|
+
- Session ends
|
|
59
|
+
- Explicit deactivation: `op:morph params: { mode: "DEFAULT" }`
|
|
60
|
+
- Safety hook intercepts a destructive command (auto-exits, requires re-activation)
|
|
61
|
+
|
|
62
|
+
## Anti-Patterns
|
|
63
|
+
|
|
64
|
+
- Activating YOLO on an unfamiliar codebase — you need vault context first
|
|
65
|
+
- Skipping tests in YOLO — tests are safety, not ceremony
|
|
66
|
+
- Using YOLO for architectural decisions that need human judgment
|
|
67
|
+
- Staying in YOLO after a safety hook triggers — re-evaluate before re-activating
|
|
68
|
+
- Running YOLO without reviewing what the safety hook pack actually covers
|
|
69
|
+
|
|
70
|
+
## Quick Reference
|
|
71
|
+
|
|
72
|
+
| Op | When to Use |
|
|
73
|
+
| ---------------------- | ------------------------------------ |
|
|
74
|
+
| `admin_health` | Verify safety hook pack is installed |
|
|
75
|
+
| `morph` | Activate/deactivate YOLO mode |
|
|
76
|
+
| `orchestrate_complete` | After every task (never skip) |
|
|
77
|
+
| `search_intelligent` | Before every decision (never skip) |
|
|
78
|
+
| `plan_reconcile` | After execution (never skip) |
|
|
79
|
+
|
|
80
|
+
**Related skills:** executing-plans, writing-plans
|
|
@@ -0,0 +1,58 @@
|
|
|
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(): string {
|
|
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
|
+
}
|
|
@@ -53,11 +53,18 @@ if [ ! -f "$SETTINGS_FILE" ]; then
|
|
|
53
53
|
"type": "prompt",
|
|
54
54
|
"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."
|
|
55
55
|
}
|
|
56
|
+
],
|
|
57
|
+
"SessionStart": [
|
|
58
|
+
{
|
|
59
|
+
"type": "command",
|
|
60
|
+
"command": "sh $AGENT_DIR/scripts/clean-worktrees.sh",
|
|
61
|
+
"timeout": 10
|
|
62
|
+
}
|
|
56
63
|
]
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
66
|
SETTINGS
|
|
60
|
-
echo "[ok] Created $SETTINGS_FILE with PreCompact
|
|
67
|
+
echo "[ok] Created $SETTINGS_FILE with PreCompact + SessionStart hooks"
|
|
61
68
|
else
|
|
62
69
|
if grep -q "PreCompact" "$SETTINGS_FILE" 2>/dev/null; then
|
|
63
70
|
echo "[ok] PreCompact hook already configured — skipping"
|
|
@@ -75,6 +82,24 @@ else
|
|
|
75
82
|
"
|
|
76
83
|
echo "[ok] Added PreCompact hook to $SETTINGS_FILE"
|
|
77
84
|
fi
|
|
85
|
+
# Add SessionStart worktree cleanup hook
|
|
86
|
+
if grep -q "clean-worktrees" "$SETTINGS_FILE" 2>/dev/null; then
|
|
87
|
+
echo "[ok] SessionStart worktree cleanup hook already configured"
|
|
88
|
+
else
|
|
89
|
+
node -e "
|
|
90
|
+
const fs = require('fs');
|
|
91
|
+
const settings = JSON.parse(fs.readFileSync('$SETTINGS_FILE', 'utf-8'));
|
|
92
|
+
if (!settings.hooks) settings.hooks = {};
|
|
93
|
+
if (!settings.hooks.SessionStart) settings.hooks.SessionStart = [];
|
|
94
|
+
settings.hooks.SessionStart.push({
|
|
95
|
+
type: 'command',
|
|
96
|
+
command: 'sh $AGENT_DIR/scripts/clean-worktrees.sh',
|
|
97
|
+
timeout: 10
|
|
98
|
+
});
|
|
99
|
+
fs.writeFileSync('$SETTINGS_FILE', JSON.stringify(settings, null, 2) + '\\n');
|
|
100
|
+
"
|
|
101
|
+
echo "[ok] Added SessionStart worktree cleanup hook"
|
|
102
|
+
fi
|
|
78
103
|
fi
|
|
79
104
|
|
|
80
105
|
# Install skills to ~/.claude/commands/
|
|
@@ -114,6 +114,19 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
114
114
|
'- Persist lessons: capture + link. An unlinked entry is incomplete.',
|
|
115
115
|
'- Exceptions: runtime errors with stack traces → codebase first; user explicitly asks to search web.',
|
|
116
116
|
'',
|
|
117
|
+
'### Vault Search Strategy',
|
|
118
|
+
'',
|
|
119
|
+
"Default to **two-pass search** — scan first, load only what's relevant. This saves tokens and keeps context lean.",
|
|
120
|
+
'',
|
|
121
|
+
'| Situation | Strategy |',
|
|
122
|
+
'|-----------|----------|',
|
|
123
|
+
'| Broad/exploratory query | `mode: "scan"` → triage by score → `op:load_entries` for top matches |',
|
|
124
|
+
'| Specific known entry | `mode: "full"` directly |',
|
|
125
|
+
'| Work task (need vault context before coding) | Scan → pick relevant → load |',
|
|
126
|
+
'| Existence check ("do we have X?") | `mode: "scan"` only, no load needed |',
|
|
127
|
+
'',
|
|
128
|
+
'**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.',
|
|
129
|
+
'',
|
|
117
130
|
|
|
118
131
|
// ─── Planning ────────────────────────────────────────────
|
|
119
132
|
'## Planning',
|
|
@@ -210,6 +223,38 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
210
223
|
'```',
|
|
211
224
|
'',
|
|
212
225
|
|
|
226
|
+
// ─── YOLO Mode ──────────────────────────────────────────
|
|
227
|
+
'## YOLO Mode',
|
|
228
|
+
'<!-- soleri:yolo-mode -->',
|
|
229
|
+
'',
|
|
230
|
+
'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.',
|
|
231
|
+
'',
|
|
232
|
+
'### What Changes',
|
|
233
|
+
'',
|
|
234
|
+
'- Plan approval gates are **auto-approved** — no user confirmation needed.',
|
|
235
|
+
'- Task routing skips the two-gate ceremony — plans are created, approved, and split in one pass.',
|
|
236
|
+
'',
|
|
237
|
+
'### What Does NOT Change',
|
|
238
|
+
'',
|
|
239
|
+
'- `op:orchestrate_complete` **always runs** — knowledge capture is never skipped.',
|
|
240
|
+
'- Vault search **always runs** — decisions must be informed by existing patterns.',
|
|
241
|
+
'- Brain feedback loop remains active.',
|
|
242
|
+
'- Grade gate still applies — plans must grade A or higher.',
|
|
243
|
+
'',
|
|
244
|
+
'### Prerequisites',
|
|
245
|
+
'',
|
|
246
|
+
'- **YOLO Safety Hook Pack** must be installed: `soleri hooks add-pack yolo-safety`',
|
|
247
|
+
'- The hook pack intercepts destructive commands (force push, reset --hard, drop table) and requires explicit confirmation.',
|
|
248
|
+
'- Staging backups are created before destructive operations.',
|
|
249
|
+
'',
|
|
250
|
+
'### Activation & Deactivation',
|
|
251
|
+
'',
|
|
252
|
+
'| Action | Method |',
|
|
253
|
+
'|--------|--------|',
|
|
254
|
+
'| Activate | `soleri yolo` or `op:morph params:{ mode: "YOLO-MODE" }` |',
|
|
255
|
+
'| Deactivate | "exit YOLO", session end, or `op:activate params:{ deactivate: true }` |',
|
|
256
|
+
'',
|
|
257
|
+
|
|
213
258
|
// ─── Output Formatting ───────────────────────────────────
|
|
214
259
|
'## Output Formatting',
|
|
215
260
|
'<!-- soleri:output-formatting -->',
|
|
@@ -299,7 +344,7 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
299
344
|
'`op:orchestrate_complete` runs for EVERY task — simple or complex. This captures:',
|
|
300
345
|
'- Knowledge to vault (patterns learned, decisions made)',
|
|
301
346
|
'- Session summary (what was done, files changed)',
|
|
302
|
-
|
|
347
|
+
"- Brain feedback (what worked, what didn't)",
|
|
303
348
|
'',
|
|
304
349
|
'Without completion, the knowledge trail is lost. The code is in git, but the WHY disappears.',
|
|
305
350
|
'',
|
|
@@ -350,6 +395,54 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
350
395
|
'- Brain tells you **which** patterns matter (names + strength scores). Vault tells you **what** they are (rules, examples).',
|
|
351
396
|
"- Pull only what's relevant to the current task — don't load everything at session start.",
|
|
352
397
|
'',
|
|
398
|
+
'### Second Brain Features',
|
|
399
|
+
'',
|
|
400
|
+
'| Feature | How to use |',
|
|
401
|
+
'|---------|-----------|',
|
|
402
|
+
'| **Two-pass search** | `op:search_intelligent` with `mode: "scan"` for lightweight results, then `op:load_entries` for full content. See **Vault Search Strategy**. |',
|
|
403
|
+
'| **Session briefing** | `op:session_briefing` on session start — surfaces last session, active plans, recent captures, brain recommendations |',
|
|
404
|
+
'| **Evidence reconciliation** | `op:plan_reconcile_with_evidence` — cross-references plan tasks against git diff |',
|
|
405
|
+
'| **Learning radar** | `op:radar_analyze` to detect patterns from corrections, search misses, workarounds. `op:radar_candidates` to review, `op:radar_approve`/`op:radar_dismiss` |',
|
|
406
|
+
'| **External ingestion** | `op:ingest_url` for articles, `op:ingest_text` for transcripts/notes, `op:ingest_batch` for multiple items |',
|
|
407
|
+
'| **Content synthesis** | `op:synthesize` — turn vault knowledge into briefs, outlines, talking points, or post drafts |',
|
|
408
|
+
'| **Skill chains** | `op:chain_execute` — multi-step workflows with data flow between steps and approval gates |',
|
|
409
|
+
'',
|
|
410
|
+
'### Brain Feedback Loop',
|
|
411
|
+
'',
|
|
412
|
+
'After using a vault search result to inform a decision, action, or response, call `op:record_feedback` with:',
|
|
413
|
+
'- `query`: the original search query',
|
|
414
|
+
'- `entryId`: the vault entry ID that was used',
|
|
415
|
+
'- `action`: "accepted" (result was useful) or "rejected" (result was irrelevant/wrong)',
|
|
416
|
+
'- `confidence`: 0.0–1.0 how relevant the result was to the task',
|
|
417
|
+
'',
|
|
418
|
+
'Do this for:',
|
|
419
|
+
'- `search_intelligent` results that influence your next action',
|
|
420
|
+
'- `orchestrate_plan` vault recommendations you follow',
|
|
421
|
+
'- Vault entries you cite or reference in responses',
|
|
422
|
+
'',
|
|
423
|
+
'Do NOT record feedback for:',
|
|
424
|
+
'- Existence checks ("do we have X?" — just scanning, not using)',
|
|
425
|
+
"- Results you browse but don't act on",
|
|
426
|
+
'- Duplicate feedback for the same entry in the same task',
|
|
427
|
+
'',
|
|
428
|
+
|
|
429
|
+
// ─── Model Routing Guidance ─────────────────────────────
|
|
430
|
+
'## Model Routing Guidance',
|
|
431
|
+
'<!-- soleri:model-routing -->',
|
|
432
|
+
'',
|
|
433
|
+
'Different workflow stages benefit from different model strengths. Use this as a default when multiple models are available.',
|
|
434
|
+
'',
|
|
435
|
+
'| Stage | Recommended Model | Why |',
|
|
436
|
+
'|-------|------------------|-----|',
|
|
437
|
+
'| Research / Exploration | Opus | Cross-file reasoning, broad context synthesis |',
|
|
438
|
+
'| Planning / Architecture | Opus | Complex tradeoff analysis, alternative evaluation |',
|
|
439
|
+
'| Implementation | Sonnet | Speed, cost-efficiency for focused coding |',
|
|
440
|
+
'| Code Review / Verification | Opus | Deep analysis, false-positive filtering |',
|
|
441
|
+
'| Validation Gates | Haiku | Fast, cheap pass/fail checks |',
|
|
442
|
+
'| Knowledge Capture | Sonnet | Structured extraction, good enough quality |',
|
|
443
|
+
'',
|
|
444
|
+
'This is guidance, not enforcement. Use the best model available. When only one model is available, use it for all stages.',
|
|
445
|
+
'',
|
|
353
446
|
|
|
354
447
|
// ─── Cross-Project Memory ────────────────────────────────
|
|
355
448
|
'## Cross-Project Memory',
|
|
@@ -416,11 +509,27 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
416
509
|
'',
|
|
417
510
|
'### Character Persistence',
|
|
418
511
|
'',
|
|
419
|
-
'-
|
|
512
|
+
'- **MANDATORY**: Prefix every response with `{AgentName} >` when activated (e.g., `Ernesto >`, `Salvador >`). This signals to the user that the agent persona is active.',
|
|
513
|
+
"- All communication flows through your persona's voice — tone, vocabulary, opinions",
|
|
420
514
|
'- Stay in character until explicitly deactivated',
|
|
421
515
|
'- Context compaction does not change who you are — these rules persist in CLAUDE.md',
|
|
422
516
|
'- If you notice yourself dropping character, re-read your activation context',
|
|
423
517
|
'',
|
|
518
|
+
'### Operator Learning (automatic, silent)',
|
|
519
|
+
'When calling `op:orchestrate_complete`, fill the `operatorSignals` field with your observations from this session:',
|
|
520
|
+
'',
|
|
521
|
+
'- **Expertise**: which topics did the operator demonstrate knowledge in? Where did they need explanation? Report topic + level (learning/intermediate/expert).',
|
|
522
|
+
"- **Corrections**: did they tell you to change behavior? Quote their exact words. Note if it's global or project-specific.",
|
|
523
|
+
'- **Interests**: did they share anything personal? Hobbies, background, music, culture? Report the tag and context.',
|
|
524
|
+
'- **Patterns**: did you notice work habits? Batching, scoping, pacing, communication style? Report what you observed.',
|
|
525
|
+
'',
|
|
526
|
+
'Rules:',
|
|
527
|
+
"- Fill what you observed. Empty arrays for what you didn't notice.",
|
|
528
|
+
'- Store facts, not assumptions. "User asked about React hooks" not "User doesn\'t know React."',
|
|
529
|
+
'- Never announce you are learning. Never ask for confirmation.',
|
|
530
|
+
'- Decline to store: health, medical, political, religious, sexual, financial, legal content.',
|
|
531
|
+
'- The engine handles compounding and persistence — just report honestly.',
|
|
532
|
+
'',
|
|
424
533
|
'### What NOT to Route Through Tools',
|
|
425
534
|
'',
|
|
426
535
|
'- Pure file read/write/edit operations (use Read, Edit, Write tools directly)',
|
|
@@ -436,8 +545,8 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
436
545
|
'',
|
|
437
546
|
'### Session Start Protocol',
|
|
438
547
|
'',
|
|
439
|
-
'On activation, discover capabilities via `op:admin_tool_list`. Call `op:
|
|
440
|
-
'Call `op:activate` only when checking evolved capabilities or recovering session state.',
|
|
548
|
+
'On activation, discover capabilities via `op:admin_tool_list`. Call `op:session_briefing` to surface last session context, active plans, and brain recommendations.',
|
|
549
|
+
'Call `op:register` when project context is needed for a task. Call `op:activate` only when checking evolved capabilities or recovering session state.',
|
|
441
550
|
'After context compaction, re-discover capabilities — do not assume your tool inventory is still cached.',
|
|
442
551
|
'',
|
|
443
552
|
'### Context Compaction',
|
|
@@ -445,6 +554,21 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
445
554
|
'A PreCompact hook calls `op:session_capture` before context compaction.',
|
|
446
555
|
'Manual capture: `op:session_capture params:{ summary: "..." }`',
|
|
447
556
|
'',
|
|
557
|
+
'### Handoff Protocol',
|
|
558
|
+
'',
|
|
559
|
+
'Before crossing a context window boundary (`/clear`, context compaction, or switching tasks), generate a handoff document:',
|
|
560
|
+
'',
|
|
561
|
+
'1. **Before transition**: `op:handoff_generate` — produces a structured markdown document with active plan state, recent decisions, and pending tasks.',
|
|
562
|
+
'2. **After restart**: Reference the handoff document to restore context. It contains plan IDs, task status, decisions, and next actions.',
|
|
563
|
+
'',
|
|
564
|
+
'Handoff documents are **ephemeral** — they are returned as markdown, not persisted to vault or memory. They are a snapshot for context transfer only.',
|
|
565
|
+
'',
|
|
566
|
+
'| Trigger | Action |',
|
|
567
|
+
'|---------|--------|',
|
|
568
|
+
'| `/clear` or manual reset | `op:handoff_generate` before clearing |',
|
|
569
|
+
'| Context compaction warning | `op:handoff_generate` (alongside `op:session_capture`) |',
|
|
570
|
+
'| Switching to a different task mid-plan | `op:handoff_generate` to bookmark state |',
|
|
571
|
+
'',
|
|
448
572
|
|
|
449
573
|
// ─── Soleri CLI ─────────────────────────────────────────
|
|
450
574
|
'## Soleri CLI',
|
|
@@ -516,6 +640,39 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
516
640
|
'| Template drift suspected | `soleri agent diff` to see what changed |',
|
|
517
641
|
'',
|
|
518
642
|
|
|
643
|
+
// ─── Persona Self-Update ────────────────────────────────────
|
|
644
|
+
'## Persona Self-Update',
|
|
645
|
+
'<!-- soleri:persona-self-update -->',
|
|
646
|
+
'',
|
|
647
|
+
'When the user asks to change your personality, voice, quirks, or character:',
|
|
648
|
+
'',
|
|
649
|
+
'1. **Edit your own `agent.yaml`** — the `persona:` block is the source of truth for your character.',
|
|
650
|
+
'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.',
|
|
651
|
+
'3. After editing `agent.yaml`, tell the user to run `soleri agent refresh` to regenerate CLAUDE.md, then reactivate.',
|
|
652
|
+
'',
|
|
653
|
+
'### What You Can Change',
|
|
654
|
+
'',
|
|
655
|
+
'| Field | Purpose |',
|
|
656
|
+
'|-------|---------|',
|
|
657
|
+
'| `persona.template` | Template ID (informational, can be custom) |',
|
|
658
|
+
'| `persona.inspiration` | Who/what inspires the character |',
|
|
659
|
+
'| `persona.culture` | Cultural background |',
|
|
660
|
+
'| `persona.voice` | How you sound (tone, cadence, vocabulary) |',
|
|
661
|
+
'| `persona.traits` | Personality traits |',
|
|
662
|
+
'| `persona.quirks` | Memorable behaviors and expressions |',
|
|
663
|
+
'| `persona.opinions` | Beliefs about craft and quality |',
|
|
664
|
+
'| `persona.metaphors` | Domains you draw metaphors from |',
|
|
665
|
+
'| `persona.languageRule` | How you mix languages |',
|
|
666
|
+
'| `persona.greetings` | Session start messages |',
|
|
667
|
+
'| `persona.signoffs` | Session end messages |',
|
|
668
|
+
'',
|
|
669
|
+
'### What You Must NOT Change',
|
|
670
|
+
'',
|
|
671
|
+
'- Engine defaults in `packages/core/src/persona/defaults.ts`',
|
|
672
|
+
'- The `PERSONA_TEMPLATES` registry',
|
|
673
|
+
'- Any file inside `@soleri/core` or `@soleri/forge`',
|
|
674
|
+
'',
|
|
675
|
+
|
|
519
676
|
// ─── Verification Protocol ─────────────────────────────────
|
|
520
677
|
'## Verification Protocol',
|
|
521
678
|
'<!-- soleri:verification-protocol -->',
|
|
@@ -528,11 +685,12 @@ const ENGINE_RULES_LINES: string[] = [
|
|
|
528
685
|
'2. **Prove** — reproduce the issue (test case, error log, stack trace)',
|
|
529
686
|
'3. **Fix** — only after the issue is proven reproducible',
|
|
530
687
|
'',
|
|
531
|
-
'### Anti-
|
|
688
|
+
'### Anti-patterns',
|
|
532
689
|
'',
|
|
533
690
|
'- Fixing code "just in case" or for aesthetics without a proven issue',
|
|
534
691
|
'- Claiming a bug exists without reproduction evidence',
|
|
535
692
|
'- Refactoring working code under the guise of a bug fix',
|
|
693
|
+
'- **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.',
|
|
536
694
|
'',
|
|
537
695
|
'### Scope',
|
|
538
696
|
'',
|
package/src/templates/skills.ts
CHANGED
|
@@ -6,34 +6,8 @@ import type { AgentConfig } from '../types.js';
|
|
|
6
6
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
const SKILLS_DIR = join(__dirname, '..', 'skills');
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
const
|
|
11
|
-
'agent-dev',
|
|
12
|
-
'agent-guide',
|
|
13
|
-
'agent-persona',
|
|
14
|
-
'brain-debrief',
|
|
15
|
-
'brainstorming',
|
|
16
|
-
'code-patrol',
|
|
17
|
-
'context-resume',
|
|
18
|
-
'deep-review',
|
|
19
|
-
'deliver-and-ship',
|
|
20
|
-
'executing-plans',
|
|
21
|
-
'fix-and-learn',
|
|
22
|
-
'health-check',
|
|
23
|
-
'knowledge-harvest',
|
|
24
|
-
'onboard-me',
|
|
25
|
-
'parallel-execute',
|
|
26
|
-
'retrospective',
|
|
27
|
-
'second-opinion',
|
|
28
|
-
'systematic-debugging',
|
|
29
|
-
'test-driven-development',
|
|
30
|
-
'vault-capture',
|
|
31
|
-
'vault-curate',
|
|
32
|
-
'vault-navigator',
|
|
33
|
-
'vault-smells',
|
|
34
|
-
'verification-before-completion',
|
|
35
|
-
'writing-plans',
|
|
36
|
-
]);
|
|
9
|
+
/** Placeholder token in skill templates that gets replaced with agent-specific tool name. */
|
|
10
|
+
const AGENT_PLACEHOLDER = 'YOUR_AGENT_core';
|
|
37
11
|
|
|
38
12
|
/**
|
|
39
13
|
* Generate skill files for the scaffolded agent.
|
|
@@ -85,7 +59,7 @@ export function generateSkills(config: AgentConfig): Array<[string, string]> {
|
|
|
85
59
|
|
|
86
60
|
let content = readFileSync(contentPath, 'utf-8');
|
|
87
61
|
|
|
88
|
-
if (
|
|
62
|
+
if (content.includes(AGENT_PLACEHOLDER)) {
|
|
89
63
|
content = content.replace(/YOUR_AGENT_core/g, `${config.id}_core`);
|
|
90
64
|
}
|
|
91
65
|
|