@soleri/forge 9.11.0 → 9.12.1

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.
Files changed (102) hide show
  1. package/dist/compose-claude-md.js +30 -19
  2. package/dist/compose-claude-md.js.map +1 -1
  3. package/dist/scaffold-filetree.js +53 -49
  4. package/dist/scaffold-filetree.js.map +1 -1
  5. package/dist/skills/{agent-dev → soleri-agent-dev}/SKILL.md +4 -7
  6. package/dist/skills/{agent-guide → soleri-agent-guide}/SKILL.md +7 -6
  7. package/{src/skills/agent-issues → dist/skills/soleri-agent-issues}/SKILL.md +33 -6
  8. package/{src/skills/agent-persona → dist/skills/soleri-agent-persona}/SKILL.md +4 -5
  9. package/{src/skills/brain-debrief → dist/skills/soleri-brain-debrief}/SKILL.md +5 -5
  10. package/dist/skills/{brainstorming → soleri-brainstorming}/SKILL.md +4 -5
  11. package/dist/skills/soleri-build-skill/SKILL.md +210 -0
  12. package/dist/skills/{code-patrol → soleri-code-patrol}/SKILL.md +6 -2
  13. package/{src/skills/context-resume → dist/skills/soleri-context-resume}/SKILL.md +4 -4
  14. package/{src/skills/deep-review → dist/skills/soleri-deep-review}/SKILL.md +5 -5
  15. package/dist/skills/{deliver-and-ship → soleri-deliver-and-ship}/SKILL.md +5 -5
  16. package/{src/skills/discovery-phase → dist/skills/soleri-discovery-phase}/SKILL.md +18 -17
  17. package/dist/skills/soleri-dream/SKILL.md +104 -0
  18. package/dist/skills/{env-setup → soleri-env-setup}/SKILL.md +31 -7
  19. package/dist/skills/{executing-plans → soleri-executing-plans}/SKILL.md +4 -5
  20. package/{src/skills/finishing-a-development-branch → dist/skills/soleri-finishing-a-development-branch}/SKILL.md +35 -4
  21. package/dist/skills/{fix-and-learn → soleri-fix-and-learn}/SKILL.md +4 -5
  22. package/{src/skills/health-check → dist/skills/soleri-health-check}/SKILL.md +5 -5
  23. package/{src/skills/knowledge-harvest → dist/skills/soleri-knowledge-harvest}/SKILL.md +5 -5
  24. package/dist/skills/{mcp-doctor → soleri-mcp-doctor}/SKILL.md +4 -4
  25. package/{src/skills/onboard-me → dist/skills/soleri-onboard-me}/SKILL.md +14 -4
  26. package/{src/skills/parallel-execute → dist/skills/soleri-parallel-execute}/SKILL.md +12 -7
  27. package/dist/skills/soleri-research-scout/SKILL.md +225 -0
  28. package/dist/skills/{retrospective → soleri-retrospective}/SKILL.md +5 -4
  29. package/{src/skills/second-opinion → dist/skills/soleri-second-opinion}/SKILL.md +5 -2
  30. package/dist/skills/{subagent-driven-development → soleri-subagent-driven-development}/SKILL.md +36 -15
  31. package/{src/skills/systematic-debugging → dist/skills/soleri-systematic-debugging}/SKILL.md +5 -5
  32. package/{src/skills/test-driven-development → dist/skills/soleri-test-driven-development}/SKILL.md +12 -2
  33. package/dist/skills/{using-git-worktrees → soleri-using-git-worktrees}/SKILL.md +25 -4
  34. package/dist/skills/soleri-vault-capture/SKILL.md +205 -0
  35. package/{src/skills/vault-curate → dist/skills/soleri-vault-curate}/SKILL.md +13 -6
  36. package/{src/skills/vault-navigator → dist/skills/soleri-vault-navigator}/SKILL.md +14 -5
  37. package/dist/skills/{vault-smells → soleri-vault-smells}/SKILL.md +7 -8
  38. package/{src/skills/verification-before-completion → dist/skills/soleri-verification-before-completion}/SKILL.md +15 -4
  39. package/{src/skills/writing-plans → dist/skills/soleri-writing-plans}/SKILL.md +10 -4
  40. package/dist/skills/{yolo-mode → soleri-yolo-mode}/SKILL.md +4 -4
  41. package/dist/templates/clean-worktrees.js +20 -0
  42. package/dist/templates/clean-worktrees.js.map +1 -1
  43. package/dist/templates/package-json.js +1 -1
  44. package/dist/templates/readme.js +19 -19
  45. package/dist/templates/readme.js.map +1 -1
  46. package/dist/templates/setup-script.js +24 -4
  47. package/dist/templates/setup-script.js.map +1 -1
  48. package/dist/templates/shared-rules.js +53 -5
  49. package/dist/templates/shared-rules.js.map +1 -1
  50. package/dist/templates/skills.d.ts +15 -0
  51. package/dist/templates/skills.js +63 -0
  52. package/dist/templates/skills.js.map +1 -1
  53. package/package.json +2 -2
  54. package/src/__tests__/extensions-scaffold.test.ts +1 -1
  55. package/src/__tests__/scaffold-filetree.test.ts +24 -20
  56. package/src/__tests__/scaffolder.test.ts +6 -6
  57. package/src/compose-claude-md.ts +30 -19
  58. package/src/scaffold-filetree.ts +53 -49
  59. package/src/skills/{agent-dev → soleri-agent-dev}/SKILL.md +4 -7
  60. package/src/skills/{agent-guide → soleri-agent-guide}/SKILL.md +7 -6
  61. package/{dist/skills/agent-issues → src/skills/soleri-agent-issues}/SKILL.md +33 -6
  62. package/{dist/skills/agent-persona → src/skills/soleri-agent-persona}/SKILL.md +4 -5
  63. package/{dist/skills/brain-debrief → src/skills/soleri-brain-debrief}/SKILL.md +5 -5
  64. package/src/skills/{brainstorming → soleri-brainstorming}/SKILL.md +4 -5
  65. package/src/skills/soleri-build-skill/SKILL.md +210 -0
  66. package/src/skills/{code-patrol → soleri-code-patrol}/SKILL.md +6 -2
  67. package/{dist/skills/context-resume → src/skills/soleri-context-resume}/SKILL.md +4 -4
  68. package/{dist/skills/deep-review → src/skills/soleri-deep-review}/SKILL.md +5 -5
  69. package/src/skills/{deliver-and-ship → soleri-deliver-and-ship}/SKILL.md +5 -5
  70. package/{dist/skills/discovery-phase → src/skills/soleri-discovery-phase}/SKILL.md +18 -17
  71. package/src/skills/soleri-dream/SKILL.md +104 -0
  72. package/src/skills/{env-setup → soleri-env-setup}/SKILL.md +31 -7
  73. package/src/skills/{executing-plans → soleri-executing-plans}/SKILL.md +4 -5
  74. package/{dist/skills/finishing-a-development-branch → src/skills/soleri-finishing-a-development-branch}/SKILL.md +35 -4
  75. package/src/skills/{fix-and-learn → soleri-fix-and-learn}/SKILL.md +4 -5
  76. package/{dist/skills/health-check → src/skills/soleri-health-check}/SKILL.md +5 -5
  77. package/{dist/skills/knowledge-harvest → src/skills/soleri-knowledge-harvest}/SKILL.md +5 -5
  78. package/src/skills/{mcp-doctor → soleri-mcp-doctor}/SKILL.md +4 -4
  79. package/{dist/skills/onboard-me → src/skills/soleri-onboard-me}/SKILL.md +14 -4
  80. package/{dist/skills/parallel-execute → src/skills/soleri-parallel-execute}/SKILL.md +12 -7
  81. package/src/skills/soleri-research-scout/SKILL.md +225 -0
  82. package/src/skills/{retrospective → soleri-retrospective}/SKILL.md +5 -4
  83. package/{dist/skills/second-opinion → src/skills/soleri-second-opinion}/SKILL.md +5 -2
  84. package/src/skills/{subagent-driven-development → soleri-subagent-driven-development}/SKILL.md +36 -15
  85. package/{dist/skills/systematic-debugging → src/skills/soleri-systematic-debugging}/SKILL.md +5 -5
  86. package/{dist/skills/test-driven-development → src/skills/soleri-test-driven-development}/SKILL.md +12 -2
  87. package/src/skills/{using-git-worktrees → soleri-using-git-worktrees}/SKILL.md +25 -4
  88. package/src/skills/soleri-vault-capture/SKILL.md +205 -0
  89. package/{dist/skills/vault-curate → src/skills/soleri-vault-curate}/SKILL.md +13 -6
  90. package/{dist/skills/vault-navigator → src/skills/soleri-vault-navigator}/SKILL.md +14 -5
  91. package/src/skills/{vault-smells → soleri-vault-smells}/SKILL.md +7 -8
  92. package/{dist/skills/verification-before-completion → src/skills/soleri-verification-before-completion}/SKILL.md +15 -4
  93. package/{dist/skills/writing-plans → src/skills/soleri-writing-plans}/SKILL.md +10 -4
  94. package/src/skills/{yolo-mode → soleri-yolo-mode}/SKILL.md +4 -4
  95. package/src/templates/clean-worktrees.ts +20 -0
  96. package/src/templates/package-json.ts +1 -1
  97. package/src/templates/readme.ts +19 -19
  98. package/src/templates/setup-script.ts +24 -4
  99. package/src/templates/shared-rules.ts +54 -5
  100. package/src/templates/skills.ts +82 -0
  101. package/dist/skills/vault-capture/SKILL.md +0 -86
  102. package/src/skills/vault-capture/SKILL.md +0 -86
@@ -86,9 +86,9 @@ export function generateReadme(config: AgentConfig): string {
86
86
 
87
87
  const skillsInstallNote =
88
88
  claudeSetup && codexSetup
89
- ? 'Skills are installed to `~/.claude/commands/` and `~/.codex/skills/` during setup. Run `./scripts/setup.sh` to install or reinstall.'
89
+ ? 'Skills are installed to `~/.claude/skills/` and `~/.codex/skills/` during setup. Run `./scripts/setup.sh` to install or reinstall.'
90
90
  : claudeSetup
91
- ? 'Skills are installed to `~/.claude/commands/` during setup. Run `./scripts/setup.sh` to install or reinstall.'
91
+ ? 'Skills are installed to `~/.claude/skills/` during setup. Run `./scripts/setup.sh` to install or reinstall.'
92
92
  : 'Skills are installed to `~/.codex/skills/` during setup. Run `./scripts/setup.sh` to install or reinstall.';
93
93
 
94
94
  return `# ${config.name} — ${config.role}
@@ -155,33 +155,33 @@ ${skillsLead}
155
155
 
156
156
  | Skill | Description |
157
157
  |-------|-------------|
158
- | \`/test-driven-development\` | Red-green-refactor TDD workflow with vault-informed test patterns |
159
- | \`/systematic-debugging\` | Root cause investigation — vault search, web search, then diagnose |
160
- | \`/verification-before-completion\` | Evidence-based completion claims with system diagnostics |
161
- | \`/brainstorming\` | Collaborative design exploration with vault + web research first |
162
- | \`/writing-plans\` | Implementation plans with quality grading and auto-improvement |
163
- | \`/executing-plans\` | Batch execution with loop tracking and plan reconciliation |
164
- | \`/fix-and-learn\` | Fix bugs and capture root cause — vault search before any fix |
165
- | \`/code-patrol\` | Review code against YOUR vault patterns, not generic lint rules |
158
+ | \`/soleri-test-driven-development\` | Red-green-refactor TDD workflow with vault-informed test patterns |
159
+ | \`/soleri-systematic-debugging\` | Root cause investigation — vault search, web search, then diagnose |
160
+ | \`/soleri-verification-before-completion\` | Evidence-based completion claims with system diagnostics |
161
+ | \`/soleri-brainstorming\` | Collaborative design exploration with vault + web research first |
162
+ | \`/soleri-writing-plans\` | Implementation plans with quality grading and auto-improvement |
163
+ | \`/soleri-executing-plans\` | Batch execution with loop tracking and plan reconciliation |
164
+ | \`/soleri-fix-and-learn\` | Fix bugs and capture root cause — vault search before any fix |
165
+ | \`/soleri-code-patrol\` | Review code against YOUR vault patterns, not generic lint rules |
166
166
 
167
167
  **Knowledge Management:**
168
168
 
169
169
  | Skill | Description |
170
170
  |-------|-------------|
171
- | \`/vault-navigator\` | Intelligent vault search — tags, domains, age reports, cross-project |
172
- | \`/vault-capture\` | Persist knowledge with curator grooming and governance |
173
- | \`/knowledge-harvest\` | Point at any doc/code — auto-extract patterns into vault |
174
- | \`/brain-debrief\` | Intelligence report — strengths, gaps, cross-project insights |
171
+ | \`/soleri-vault-navigator\` | Intelligent vault search — tags, domains, age reports, cross-project |
172
+ | \`/soleri-vault-capture\` | Persist knowledge with curator grooming and governance |
173
+ | \`/soleri-knowledge-harvest\` | Point at any doc/code — auto-extract patterns into vault |
174
+ | \`/soleri-brain-debrief\` | Intelligence report — strengths, gaps, cross-project insights |
175
175
 
176
176
  **Magic UX:**
177
177
 
178
178
  | Skill | Description |
179
179
  |-------|-------------|
180
- | \`/context-resume\` | "What was I working on?" — full context reconstruction |
181
- | \`/second-opinion\` | Decision support from vault + brain + web combined |
182
- | \`/retrospective\` | Data-driven sprint/week retro from actual metrics |
183
- | \`/onboard-me\` | Instant project knowledge tour for newcomers |
184
- | \`/health-check\` | Vault maintenance — duplicates, contradictions, stale entries |
180
+ | \`/soleri-context-resume\` | "What was I working on?" — full context reconstruction |
181
+ | \`/soleri-second-opinion\` | Decision support from vault + brain + web combined |
182
+ | \`/soleri-retrospective\` | Data-driven sprint/week retro from actual metrics |
183
+ | \`/soleri-onboard-me\` | Instant project knowledge tour for newcomers |
184
+ | \`/soleri-health-check\` | Vault maintenance — duplicates, contradictions, stale entries |
185
185
 
186
186
  ${skillsInstallNote}
187
187
 
@@ -102,14 +102,13 @@ else
102
102
  fi
103
103
  fi
104
104
 
105
- # Install skills to ~/.claude/commands/
105
+ # Install skills to ~/.claude/skills/
106
106
  SKILLS_DIR="$AGENT_DIR/skills"
107
- COMMANDS_DIR="$HOME/.claude/commands"
107
+ CLAUDE_SKILLS_DIR="$HOME/.claude/skills"
108
108
 
109
109
  if [ -d "$SKILLS_DIR" ]; then
110
110
  echo ""
111
111
  echo "Installing skills for Claude Code..."
112
- mkdir -p "$COMMANDS_DIR"
113
112
  skill_installed=0
114
113
  skill_skipped=0
115
114
  for skill_dir in "$SKILLS_DIR"/*/; do
@@ -117,15 +116,36 @@ if [ -d "$SKILLS_DIR" ]; then
117
116
  skill_file="$skill_dir/SKILL.md"
118
117
  [ -f "$skill_file" ] || continue
119
118
  skill_name="$(basename "$skill_dir")"
120
- dest="$COMMANDS_DIR/$skill_name.md"
119
+ dest_dir="$CLAUDE_SKILLS_DIR/$skill_name"
120
+ dest="$dest_dir/SKILL.md"
121
121
  if [ -f "$dest" ]; then
122
122
  skill_skipped=$((skill_skipped + 1))
123
123
  else
124
+ mkdir -p "$dest_dir"
124
125
  cp "$skill_file" "$dest"
125
126
  skill_installed=$((skill_installed + 1))
126
127
  fi
127
128
  done
128
129
  echo "[ok] Claude skills: $skill_installed installed, $skill_skipped already present"
130
+
131
+ # Migrate legacy commands to skills (one-time cleanup)
132
+ LEGACY_DIR="$HOME/.claude/commands"
133
+ if [ -d "$LEGACY_DIR" ]; then
134
+ legacy_migrated=0
135
+ for legacy_file in "$LEGACY_DIR"/*.md; do
136
+ [ -f "$legacy_file" ] || continue
137
+ legacy_name="$(basename "$legacy_file" .md)"
138
+ dest_dir="$CLAUDE_SKILLS_DIR/$legacy_name"
139
+ if [ ! -d "$dest_dir" ]; then
140
+ mkdir -p "$dest_dir"
141
+ mv "$legacy_file" "$dest_dir/SKILL.md"
142
+ legacy_migrated=$((legacy_migrated + 1))
143
+ fi
144
+ done
145
+ if [ "$legacy_migrated" -gt 0 ]; then
146
+ echo "[ok] Migrated $legacy_migrated legacy commands from ~/.claude/commands/ to ~/.claude/skills/"
147
+ fi
148
+ fi
129
149
  fi
130
150
  `
131
151
  : '';
@@ -301,6 +301,22 @@ const ENGINE_RULES_LINES: string[] = [
301
301
  '| skipped | ... | medium | ... |',
302
302
  '```',
303
303
  '',
304
+ '### Incremental Correction',
305
+ '',
306
+ 'When a single step fails or produces wrong output, use `op:orchestrate_rerun_step` to re-execute it without restarting the entire plan.',
307
+ '',
308
+ '- **Target step** is marked as `rerun` and re-executed.',
309
+ '- **Downstream steps** are marked as `stale` (their cached output may be invalid).',
310
+ '- Use `cascadeTo` to also mark a range of downstream steps as `rerun` (not just stale).',
311
+ '- `op:plan_reconcile` includes a rerun report showing which steps were re-executed and why.',
312
+ '',
313
+ '**When to use:**',
314
+ '- A step produced incorrect output but the rest of the plan is fine.',
315
+ '- External conditions changed (e.g., a dependency was updated) and one step needs re-evaluation.',
316
+ '- A gate failed on a step that can be retried after a fix.',
317
+ '',
318
+ '**Anti-pattern:** Re-running steps speculatively. Only re-run when you have a clear reason.',
319
+ '',
304
320
 
305
321
  // ─── Workflow Overrides ──────────────────────────────────
306
322
  '## Workflow Overrides',
@@ -605,6 +621,7 @@ const ENGINE_RULES_LINES: string[] = [
605
621
  '| Debug a problem | "this is broken", "why is this failing" | `op:search_intelligent` — check vault for known bugs first |',
606
622
  '| Learn from patterns | "what works for", "recommendations" | `op:strengths` + `op:recommend` — brain-learned patterns from real usage |',
607
623
  '| Clean up knowledge | "duplicates", "clean vault", "consolidate" | `op:curator_consolidate` — automated dedup, grooming, contradiction resolution |',
624
+ '| Consolidate memory | "dream", "consolidate memory", "vault maintenance" | `op:dream_run` — automatic memory consolidation (runs on session start after 5+ sessions/24h, or force with `/dream`) |',
608
625
  '| Summarize session | "what did we accomplish", "wrap up" | `op:session_capture` — structured capture with knowledge extraction |',
609
626
  '| Explore capabilities | "what can you do", "help", "features" | List capabilities by category, not raw op names |',
610
627
  '',
@@ -682,6 +699,16 @@ const ENGINE_RULES_LINES: string[] = [
682
699
  'Call `op:register` when project context is needed for a task. Call `op:activate` only when checking evolved capabilities or recovering session state.',
683
700
  'After context compaction, re-discover capabilities — do not assume your tool inventory is still cached.',
684
701
  '',
702
+ '### Pre-flight Manifest',
703
+ '',
704
+ 'Every `session_start` response includes a `preflight` object. Use it for self-awareness:',
705
+ '- **tools** — full list of available facade ops (facade name, op name, description).',
706
+ '- **skills** — installed skill names.',
707
+ '- **activePlans** — plans currently in `executing` state (planId, title, status).',
708
+ '- **vaultSummary** — entry count, connection status, and domain list.',
709
+ '',
710
+ 'Read `preflight` before calling `op:admin_tool_list` — it covers the same ground with zero extra round-trips.',
711
+ '',
685
712
  '### Context Compaction',
686
713
  '',
687
714
  'A PreCompact hook calls `op:session_capture` before context compaction.',
@@ -703,6 +730,18 @@ const ENGINE_RULES_LINES: string[] = [
703
730
  '| Switching to a different task mid-plan | `op:handoff_generate` to bookmark state |',
704
731
  '',
705
732
 
733
+ // ─── Skill Step Checkpoints ────────────────────────────
734
+ '### Skill Step Checkpoints',
735
+ '',
736
+ 'Skills with structured steps return a checkpoint summary at each step boundary.',
737
+ 'When executing a multi-step skill:',
738
+ '1. Start with `op:skill_step_start` to create a tracker',
739
+ '2. After each step, call `op:skill_step_advance` with evidence',
740
+ '3. On completion, call `op:skill_step_complete` to validate',
741
+ '',
742
+ 'Save intermediate outputs to files, not context. This survives context compaction.',
743
+ '',
744
+
706
745
  // ─── Getting Started & Updates ─────────────────────────
707
746
  '## Getting Started & Updates',
708
747
  '<!-- soleri:getting-started -->',
@@ -844,7 +883,7 @@ const ENGINE_RULES_LINES: string[] = [
844
883
  '',
845
884
  '### Hooks & Skills',
846
885
  '',
847
- 'Your agent ships with **essential skills** by default (agent-guide, agent-persona, vault-navigator, vault-capture, systematic-debugging, writing-plans, context-resume). Install more with `soleri skills install <name>`. List available skills with `soleri skills list`.',
886
+ 'Your agent ships with **essential skills** by default (soleri-agent-guide, soleri-agent-persona, soleri-vault-navigator, soleri-vault-capture, soleri-systematic-debugging, soleri-writing-plans, soleri-context-resume). Install more with `soleri skills install <name>`. List available skills with `soleri skills list`.',
848
887
  '',
849
888
  'To scaffold all skills instead, set `skillsFilter: all` in `agent.yaml`.',
850
889
  '',
@@ -856,6 +895,15 @@ const ENGINE_RULES_LINES: string[] = [
856
895
  '| `soleri skills list` | List installed skill packs |',
857
896
  '| `soleri skills install <pack>` | Install a skill pack |',
858
897
  '',
898
+ '### Dream (Memory Consolidation)',
899
+ '',
900
+ '| Command | What it does |',
901
+ '|---------|-------------|',
902
+ '| `soleri dream` | Run vault memory consolidation (dream pass) immediately |',
903
+ '| `soleri dream schedule [--time HH:MM]` | Schedule daily dream at specified time (default: 22:00) |',
904
+ '| `soleri dream unschedule` | Remove scheduled dream cron job |',
905
+ '| `soleri dream status` | Show dream status: last run, sessions since, cron schedule |',
906
+ '',
859
907
  '### Installation & Setup',
860
908
  '',
861
909
  '| Command | What it does |',
@@ -986,10 +1034,11 @@ const ENGINE_RULES_LINES: string[] = [
986
1034
  '',
987
1035
  '1. **Orchestrator owns all decisions.** Subagents execute specs — they do NOT make design decisions. If a subagent encounters ambiguity, it returns to the orchestrator with a question, not a guess.',
988
1036
  '2. **Subagents MUST NOT create plans.** Only the parent orchestrator creates plans. Subagents receive task prompts with exact scope, file boundaries, and acceptance criteria. They execute and return results.',
989
- '3. **Worktree cleanup is guaranteed.** Three-layer defense: (a) `finally` block in dispatcher cleans per-task worktree, (b) `cleanupAll()` runs after batch completion, (c) `SessionStart` hook prunes orphaned worktrees on every session.',
990
- '4. **Escalation protocol.** When a subagent hits ambiguity or a blocking issue, it MUST return to the orchestrator with a clear description of the blocker. The orchestrator decides ask the user or resolve then re-dispatches.',
991
- '5. **No freelancing.** Subagents stay within their assigned file boundaries and acceptance criteria. No "while I\'m here" improvements, no scope creep, no out-of-scope commits.',
992
- '6. **UX output contract.** The orchestrator communicates subagent work to the user at three verbosity levels:',
1037
+ '3. **Worktree branches are local-only never push them to remote.** They exist for isolated subagent execution and get merged back locally. After merge, delete the local branch immediately with `git branch -D <branch>`.',
1038
+ '4. **Worktree cleanup is guaranteed.** Four-layer defense: (a) `finally` block in dispatcher cleans per-task worktree and local branch, (b) orchestrator deletes local branch after confirmed merge, (c) `cleanupAll()` runs after batch completion, (d) `SessionStart` hook prunes orphaned worktrees and deletes merged `subagent/*` and `worktree-agent-*` local branches.',
1039
+ '5. **Escalation protocol.** When a subagent hits ambiguity or a blocking issue, it MUST return to the orchestrator with a clear description of the blocker. The orchestrator decides — ask the user or resolve — then re-dispatches.',
1040
+ '6. **No freelancing.** Subagents stay within their assigned file boundaries and acceptance criteria. No "while I\'m here" improvements, no scope creep, no out-of-scope commits.',
1041
+ '7. **UX output contract.** The orchestrator communicates subagent work to the user at three verbosity levels:',
993
1042
  '',
994
1043
  '### UX Output Format',
995
1044
  '',
@@ -9,6 +9,78 @@ const SKILLS_DIR = join(__dirname, '..', 'skills');
9
9
  /** Placeholder token in skill templates that gets replaced with agent-specific tool name. */
10
10
  const AGENT_PLACEHOLDER = 'YOUR_AGENT_core';
11
11
 
12
+ // ---------------------------------------------------------------------------
13
+ // Frontmatter step extraction
14
+ // ---------------------------------------------------------------------------
15
+
16
+ export type SkillStepEvidence = 'tool_called' | 'file_exists';
17
+
18
+ export interface SkillStepDef {
19
+ id: string;
20
+ description: string;
21
+ evidence: SkillStepEvidence;
22
+ }
23
+
24
+ /**
25
+ * Extract optional `steps` array from YAML frontmatter.
26
+ * Uses simple regex parsing — no YAML dependency needed.
27
+ */
28
+ export function extractStepsFromFrontmatter(content: string): SkillStepDef[] | null {
29
+ const fmMatch = content.match(/^---\n([\s\S]*?)\n---/);
30
+ if (!fmMatch) return null;
31
+
32
+ const fm = fmMatch[1];
33
+ const stepsIdx = fm.indexOf('\nsteps:');
34
+ if (stepsIdx === -1) return null;
35
+
36
+ // Collect lines after "steps:" that are indented (part of the array)
37
+ const afterSteps = fm.slice(stepsIdx + '\nsteps:'.length);
38
+ const lines = afterSteps.split('\n');
39
+ const steps: SkillStepDef[] = [];
40
+ let current: Partial<SkillStepDef> | null = null;
41
+
42
+ for (const line of lines) {
43
+ // Stop at next top-level YAML key or end of indented block
44
+ if (line.match(/^\S/) && line.trim() !== '') break;
45
+
46
+ const itemMatch = line.match(/^\s+-\s+id:\s*(.+)/);
47
+ if (itemMatch) {
48
+ if (current?.id && current.description && current.evidence) {
49
+ steps.push(current as SkillStepDef);
50
+ }
51
+ current = { id: itemMatch[1].trim().replace(/^["']|["']$/g, '') };
52
+ continue;
53
+ }
54
+
55
+ if (current) {
56
+ const descMatch = line.match(/^\s+description:\s*(.+)/);
57
+ if (descMatch) {
58
+ current.description = descMatch[1].trim().replace(/^["']|["']$/g, '');
59
+ continue;
60
+ }
61
+ const evMatch = line.match(/^\s+evidence:\s*(.+)/);
62
+ if (evMatch) {
63
+ const raw = evMatch[1].trim().replace(/^["']|["']$/g, '');
64
+ if (raw === 'tool_called' || raw === 'file_exists') {
65
+ current.evidence = raw;
66
+ }
67
+ continue;
68
+ }
69
+ }
70
+ }
71
+
72
+ // Push last item
73
+ if (current?.id && current.description && current.evidence) {
74
+ steps.push(current as SkillStepDef);
75
+ }
76
+
77
+ return steps.length > 0 ? steps : null;
78
+ }
79
+
80
+ // ---------------------------------------------------------------------------
81
+ // Skill generation
82
+ // ---------------------------------------------------------------------------
83
+
12
84
  /**
13
85
  * Generate skill files for the scaffolded agent.
14
86
  * Returns [relativePath, content] tuples for each skill.
@@ -17,6 +89,10 @@ const AGENT_PLACEHOLDER = 'YOUR_AGENT_core';
17
89
  * - If config.skills is undefined/empty, all skills are included (backward compat).
18
90
  * - Superpowers-adapted skills (MIT): copied as-is
19
91
  * - Engine-adapted skills: YOUR_AGENT_core → {config.id}_core
92
+ *
93
+ * When a skill's frontmatter contains a `steps` array, the steps are appended
94
+ * as a hidden metadata block (`<!-- soleri:steps ... -->`) so the runtime can
95
+ * extract them for step-tracking.
20
96
  */
21
97
  export function generateSkills(config: AgentConfig): Array<[string, string]> {
22
98
  const files: Array<[string, string]> = [];
@@ -63,6 +139,12 @@ export function generateSkills(config: AgentConfig): Array<[string, string]> {
63
139
  content = content.replace(/YOUR_AGENT_core/g, `${config.id}_core`);
64
140
  }
65
141
 
142
+ // Extract structured steps from frontmatter and append as metadata block
143
+ const steps = extractStepsFromFrontmatter(content);
144
+ if (steps) {
145
+ content += `\n<!-- soleri:steps ${JSON.stringify(steps)} -->\n`;
146
+ }
147
+
66
148
  files.push([`skills/${skillName}/SKILL.md`, content]);
67
149
  }
68
150
 
@@ -1,86 +0,0 @@
1
- ---
2
- name: vault-capture
3
- description: >
4
- Use to capture a SINGLE known pattern, anti-pattern, workflow, decision, or principle to the
5
- vault. Triggers on "save this", "capture this", "remember this pattern", "add to vault". The
6
- user already knows what to capture. For bulk extraction from documents, code, or PRs, use
7
- knowledge-harvest instead.
8
- ---
9
-
10
- # Vault Capture — Persist Knowledge
11
-
12
- Capture patterns, anti-patterns, workflows, and principles to the vault. Captured knowledge compounds — it informs future searches, brain recommendations, and team reviews.
13
-
14
- ## Steps
15
-
16
- ### 1. Check for Duplicates
17
-
18
- ```
19
- YOUR_AGENT_core op:search_intelligent
20
- params: { query: "<knowledge title or description>" }
21
- YOUR_AGENT_core op:curator_detect_duplicates
22
- ```
23
-
24
- If similar entry exists, update it instead of creating a duplicate.
25
-
26
- ### 2. Classify the Knowledge
27
-
28
- | Type | Description |
29
- | ---------------- | ----------------------------------- |
30
- | **pattern** | Works and should be repeated |
31
- | **anti-pattern** | Fails and should be avoided |
32
- | **workflow** | Steps for a specific task |
33
- | **principle** | Guiding rule or heuristic |
34
- | **decision** | Architectural choice with rationale |
35
-
36
- ### 3. Capture
37
-
38
- ```
39
- YOUR_AGENT_core op:capture_knowledge
40
- params: {
41
- title: "<clear, searchable name>",
42
- description: "<what it is and when it applies>",
43
- type: "<pattern|anti-pattern|workflow|principle|decision>",
44
- category: "<domain>",
45
- tags: ["<tag1>", "<tag2>"],
46
- example: "<code or before/after>",
47
- why: "<reasoning>"
48
- }
49
- ```
50
-
51
- For quick captures: `YOUR_AGENT_core op:capture_quick params: { title: "<name>", description: "<details>" }`
52
-
53
- ### 4. Post-Capture Quality
54
-
55
- - `op:curator_groom params: { entryId: "<id>" }` — normalize tags
56
- - `op:curator_enrich params: { entryId: "<id>" }` — LLM enrichment
57
- - `op:curator_contradictions` — check for conflicts
58
-
59
- ### 5. Governance (if enabled)
60
-
61
- If capture returns a `proposalId`, entry is queued: `op:governance_proposals params: { action: "list" }`.
62
-
63
- ### 6. Promote to Global (Optional)
64
-
65
- For cross-project knowledge: `op:memory_promote_to_global params: { entryId: "<id>" }`.
66
-
67
- ### 7. Verify
68
-
69
- `op:admin_health` and `op:admin_vault_analytics` to confirm storage and quality.
70
-
71
- ## Common Mistakes
72
-
73
- - Not checking for duplicates before capturing
74
- - Missing the `why` field (makes entries not actionable)
75
- - Skipping post-capture grooming (tags stay unnormalized)
76
-
77
- ## Quick Reference
78
-
79
- | Op | When to Use |
80
- | ------------------------------------- | -------------------- |
81
- | `search_intelligent` | Check for duplicates |
82
- | `capture_knowledge` / `capture_quick` | Persist to vault |
83
- | `curator_groom` / `curator_enrich` | Post-capture quality |
84
- | `curator_contradictions` | Find conflicts |
85
- | `memory_promote_to_global` | Share cross-project |
86
- | `admin_health` | Verify health |
@@ -1,86 +0,0 @@
1
- ---
2
- name: vault-capture
3
- description: >
4
- Use to capture a SINGLE known pattern, anti-pattern, workflow, decision, or principle to the
5
- vault. Triggers on "save this", "capture this", "remember this pattern", "add to vault". The
6
- user already knows what to capture. For bulk extraction from documents, code, or PRs, use
7
- knowledge-harvest instead.
8
- ---
9
-
10
- # Vault Capture — Persist Knowledge
11
-
12
- Capture patterns, anti-patterns, workflows, and principles to the vault. Captured knowledge compounds — it informs future searches, brain recommendations, and team reviews.
13
-
14
- ## Steps
15
-
16
- ### 1. Check for Duplicates
17
-
18
- ```
19
- YOUR_AGENT_core op:search_intelligent
20
- params: { query: "<knowledge title or description>" }
21
- YOUR_AGENT_core op:curator_detect_duplicates
22
- ```
23
-
24
- If similar entry exists, update it instead of creating a duplicate.
25
-
26
- ### 2. Classify the Knowledge
27
-
28
- | Type | Description |
29
- | ---------------- | ----------------------------------- |
30
- | **pattern** | Works and should be repeated |
31
- | **anti-pattern** | Fails and should be avoided |
32
- | **workflow** | Steps for a specific task |
33
- | **principle** | Guiding rule or heuristic |
34
- | **decision** | Architectural choice with rationale |
35
-
36
- ### 3. Capture
37
-
38
- ```
39
- YOUR_AGENT_core op:capture_knowledge
40
- params: {
41
- title: "<clear, searchable name>",
42
- description: "<what it is and when it applies>",
43
- type: "<pattern|anti-pattern|workflow|principle|decision>",
44
- category: "<domain>",
45
- tags: ["<tag1>", "<tag2>"],
46
- example: "<code or before/after>",
47
- why: "<reasoning>"
48
- }
49
- ```
50
-
51
- For quick captures: `YOUR_AGENT_core op:capture_quick params: { title: "<name>", description: "<details>" }`
52
-
53
- ### 4. Post-Capture Quality
54
-
55
- - `op:curator_groom params: { entryId: "<id>" }` — normalize tags
56
- - `op:curator_enrich params: { entryId: "<id>" }` — LLM enrichment
57
- - `op:curator_contradictions` — check for conflicts
58
-
59
- ### 5. Governance (if enabled)
60
-
61
- If capture returns a `proposalId`, entry is queued: `op:governance_proposals params: { action: "list" }`.
62
-
63
- ### 6. Promote to Global (Optional)
64
-
65
- For cross-project knowledge: `op:memory_promote_to_global params: { entryId: "<id>" }`.
66
-
67
- ### 7. Verify
68
-
69
- `op:admin_health` and `op:admin_vault_analytics` to confirm storage and quality.
70
-
71
- ## Common Mistakes
72
-
73
- - Not checking for duplicates before capturing
74
- - Missing the `why` field (makes entries not actionable)
75
- - Skipping post-capture grooming (tags stay unnormalized)
76
-
77
- ## Quick Reference
78
-
79
- | Op | When to Use |
80
- | ------------------------------------- | -------------------- |
81
- | `search_intelligent` | Check for duplicates |
82
- | `capture_knowledge` / `capture_quick` | Persist to vault |
83
- | `curator_groom` / `curator_enrich` | Post-capture quality |
84
- | `curator_contradictions` | Find conflicts |
85
- | `memory_promote_to_global` | Share cross-project |
86
- | `admin_health` | Verify health |