@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.
Files changed (61) hide show
  1. package/dist/compose-claude-md.js +118 -7
  2. package/dist/compose-claude-md.js.map +1 -1
  3. package/dist/scaffold-filetree.js +42 -0
  4. package/dist/scaffold-filetree.js.map +1 -1
  5. package/dist/scaffolder.js +46 -2
  6. package/dist/scaffolder.js.map +1 -1
  7. package/dist/skills/agent-dev/SKILL.md +122 -0
  8. package/dist/skills/agent-guide/SKILL.md +116 -0
  9. package/dist/skills/agent-issues/SKILL.md +291 -0
  10. package/dist/skills/agent-persona/SKILL.md +66 -0
  11. package/dist/skills/deep-review/SKILL.md +12 -0
  12. package/dist/skills/deliver-and-ship/SKILL.md +123 -0
  13. package/dist/skills/discovery-phase/SKILL.md +69 -0
  14. package/dist/skills/env-setup/SKILL.md +151 -0
  15. package/dist/skills/executing-plans/SKILL.md +12 -0
  16. package/dist/skills/finishing-a-development-branch/SKILL.md +76 -0
  17. package/dist/skills/fix-and-learn/SKILL.md +12 -0
  18. package/dist/skills/mcp-doctor/SKILL.md +160 -0
  19. package/dist/skills/subagent-driven-development/SKILL.md +79 -0
  20. package/dist/skills/using-git-worktrees/SKILL.md +81 -0
  21. package/dist/skills/vault-curate/SKILL.md +99 -0
  22. package/dist/skills/verification-before-completion/SKILL.md +12 -0
  23. package/dist/skills/yolo-mode/SKILL.md +80 -0
  24. package/dist/templates/clean-worktrees.d.ts +5 -0
  25. package/dist/templates/clean-worktrees.js +59 -0
  26. package/dist/templates/clean-worktrees.js.map +1 -0
  27. package/dist/templates/setup-script.js +26 -1
  28. package/dist/templates/setup-script.js.map +1 -1
  29. package/dist/templates/shared-rules.js +160 -5
  30. package/dist/templates/shared-rules.js.map +1 -1
  31. package/dist/templates/skills.js +3 -29
  32. package/dist/templates/skills.js.map +1 -1
  33. package/dist/templates/vitest-config.js +1 -0
  34. package/dist/templates/vitest-config.js.map +1 -1
  35. package/package.json +1 -1
  36. package/src/compose-claude-md.ts +126 -9
  37. package/src/scaffold-filetree.ts +42 -0
  38. package/src/scaffolder.ts +49 -2
  39. package/src/skills/agent-dev/SKILL.md +122 -0
  40. package/src/skills/agent-guide/SKILL.md +116 -0
  41. package/src/skills/agent-issues/SKILL.md +291 -0
  42. package/src/skills/agent-persona/SKILL.md +66 -0
  43. package/src/skills/deep-review/SKILL.md +12 -0
  44. package/src/skills/deliver-and-ship/SKILL.md +123 -0
  45. package/src/skills/discovery-phase/SKILL.md +69 -0
  46. package/src/skills/env-setup/SKILL.md +151 -0
  47. package/src/skills/executing-plans/SKILL.md +12 -0
  48. package/src/skills/finishing-a-development-branch/SKILL.md +76 -0
  49. package/src/skills/fix-and-learn/SKILL.md +12 -0
  50. package/src/skills/mcp-doctor/SKILL.md +160 -0
  51. package/src/skills/subagent-driven-development/SKILL.md +79 -0
  52. package/src/skills/using-git-worktrees/SKILL.md +81 -0
  53. package/src/skills/vault-curate/SKILL.md +99 -0
  54. package/src/skills/verification-before-completion/SKILL.md +12 -0
  55. package/src/skills/yolo-mode/SKILL.md +80 -0
  56. package/src/templates/clean-worktrees.ts +58 -0
  57. package/src/templates/setup-script.ts +26 -1
  58. package/src/templates/shared-rules.ts +163 -5
  59. package/src/templates/skills.ts +3 -29
  60. package/src/templates/vitest-config.ts +1 -0
  61. package/vitest.config.ts +1 -0
@@ -0,0 +1,116 @@
1
+ ---
2
+ name: agent-guide
3
+ description: >
4
+ Use when the user asks "what can you do", "help me", "how do I use this",
5
+ "what features do you have", "what tools are available", "how does this work",
6
+ "show me your capabilities", "what are you", "who are you", or any question
7
+ about the agent's identity, capabilities, available tools, or how to use them.
8
+ Not needed for proactive tool suggestions — those are handled by engine rules.
9
+ ---
10
+
11
+ # Agent Guide — Capability Discovery
12
+
13
+ Help users understand what this agent can do, how to use it effectively, and what makes it different from a raw LLM. This skill handles the deep discovery flow — proactive tool suggestions during normal work are handled by the engine rules (Tool Advocacy section).
14
+
15
+ ## When to Use
16
+
17
+ - "What can you do?" / "What are your capabilities?"
18
+ - "How do I search for X?" / "How do I capture knowledge?"
19
+ - "What tools do you have?" / "Show me your features"
20
+ - "Who are you?" / "What is this agent?"
21
+ - "Help" / "I'm stuck" / "How does this work?"
22
+ - First-time users, onboarding, or anyone unfamiliar with the agent
23
+
24
+ ## Capability Discovery Sequence
25
+
26
+ ### Step 1: Identity
27
+
28
+ ```
29
+ YOUR_AGENT_core op:activate
30
+ params: { projectPath: "." }
31
+ ```
32
+
33
+ This returns the agent's persona: name, role, description, tone, principles, and domains. Present the identity first — who the agent is and what it specializes in.
34
+
35
+ ### Step 2: Health & Status
36
+
37
+ ```
38
+ YOUR_AGENT_core op:admin_health
39
+ ```
40
+
41
+ Shows what subsystems are active: vault (how many entries), brain (vocabulary size), LLM availability, cognee status. This tells the user what the agent currently has to work with.
42
+
43
+ ### Step 3: Available Tools
44
+
45
+ ```
46
+ YOUR_AGENT_core op:admin_tool_list
47
+ ```
48
+
49
+ Lists all facades and operations. Present them grouped by category with plain-language descriptions.
50
+
51
+ ### Step 4: Present by What Users Can DO
52
+
53
+ Organize capabilities by user goals, not technical names:
54
+
55
+ **Knowledge & Memory**
56
+
57
+ - Search the vault for patterns, anti-patterns, and architectural decisions
58
+ - Capture new knowledge from the current session
59
+ - Search across sessions and projects for relevant context
60
+ - Curate: deduplicate, groom, resolve contradictions
61
+
62
+ **Planning & Execution**
63
+
64
+ - Create structured plans with vault context and brain recommendations
65
+ - Split plans into tasks with complexity estimates
66
+ - Track execution with drift detection
67
+ - Complete with knowledge capture and session recording
68
+
69
+ **Intelligence & Learning**
70
+
71
+ - Brain learns from every session — patterns get stronger with use
72
+ - Recommendations based on similar past work
73
+ - Strength tracking: which patterns are proven vs experimental
74
+ - Feedback loop: brain improves based on what works
75
+
76
+ **Quality & Validation**
77
+
78
+ - Health checks across all subsystems
79
+ - Iterative validation loops with configurable targets
80
+ - Governance: policies, proposals, quotas
81
+
82
+ **Identity & Control**
83
+
84
+ - Persona activation and deactivation
85
+ - Intent routing: the agent classifies what you want and routes to the right workflow
86
+ - Project registration and cross-project linking
87
+
88
+ **Domain Knowledge** (varies by agent)
89
+
90
+ - Each domain has: `get_patterns`, `search`, `get_entry`, `capture`, `remove`
91
+ - Call `op:activate` to discover which domains are configured
92
+
93
+ ## Common Questions
94
+
95
+ ### "What makes you different from regular Claude?"
96
+
97
+ You have persistent knowledge (vault), learned patterns (brain), structured planning with grading, iterative validation loops, and domain-specific intelligence. Regular Claude starts fresh every conversation — this agent accumulates knowledge and gets smarter over time.
98
+
99
+ ### "How do I get the most out of you?"
100
+
101
+ 1. **Use the vault** — search before deciding, capture after learning
102
+ 2. **Use planning** — structured plans beat ad-hoc work for anything non-trivial
103
+ 3. **Trust the brain** — pattern recommendations come from real usage data
104
+ 4. **Capture everything** — every bug fix, every pattern, every anti-pattern. The vault grows smarter with use.
105
+ 5. **Use loops for quality** — iterative validation catches issues that single-pass work misses
106
+
107
+ ### "How do I add new capabilities?"
108
+
109
+ Extensions can add new ops, facades, middleware, and hooks. Domain packs add domain-specific knowledge and validation. Use `soleri pack install <name>` or `soleri extend add-op <name>`.
110
+
111
+ ## Anti-Patterns
112
+
113
+ - **Listing raw op names without context** — always explain what the op does in plain language
114
+ - **Claiming capabilities that do not exist** — only reference ops the agent actually has. When unsure, call `op:admin_tool_list` first
115
+ - **Dumping the entire tool catalog** — answer the specific question, show relevant tools, not all tools
116
+ - **Repeating what the user already knows** — if they ask about a specific feature, answer that, don't give the full tour
@@ -0,0 +1,291 @@
1
+ ---
2
+ name: agent-issues
3
+ description: >
4
+ Use when creating GitHub issues, bugs, tasks, or milestones that will be
5
+ worked on by AI coding agents. Triggers on: "create issue", "file bug",
6
+ "gh issue", "add milestone", "create task", "report bug", "gh tasks",
7
+ "create tasks", "create tickets", "file tickets", or when generating
8
+ structured work items from conversation context.
9
+ ---
10
+
11
+ # Agent-Optimized Issue Creation
12
+
13
+ Create GitHub issues that AI agents can parse, execute, and verify without ambiguity. Every issue is a self-contained work order — an agent reading it has everything needed to start, execute, and prove completion.
14
+
15
+ ## Core Principle
16
+
17
+ **Human issues describe problems. Agent issues describe solutions as testable outcomes.**
18
+
19
+ An agent cannot act on "improve avatar handling." It can act on: "Add PNG upload to `POST /v1/avatar` in `apps/api/src/routes/avatar.ts`, return `{ avatarUrl }`, reject files > 2MB with 413."
20
+
21
+ ## When to Use
22
+
23
+ - Creating any GitHub issue via `gh issue create`
24
+ - Filing bugs from conversation context or error logs
25
+ - Breaking plans into trackable work items
26
+ - Creating milestones with sub-issues
27
+ - Converting vault patterns or anti-patterns into actionable fixes
28
+
29
+ ## Issue Template by Type
30
+
31
+ ### Bug
32
+
33
+ ```markdown
34
+ # Objective
35
+
36
+ <one sentence: what's broken and what "fixed" looks like>
37
+
38
+ ## Type: bug
39
+
40
+ ## Component: <package or module name>
41
+
42
+ ## Priority: P0 | P1 | P2 | P3
43
+
44
+ ## Context
45
+
46
+ - Impact: <who/what is affected>
47
+ - Related: <links to issues, PRs, vault entries>
48
+ - First seen: <date or commit>
49
+
50
+ ## Steps to Reproduce
51
+
52
+ 1. <exact command or action>
53
+ 2. <exact command or action>
54
+ 3. Observe: <what happens>
55
+
56
+ ## Expected vs Actual
57
+
58
+ | | Behavior |
59
+ | ------------ | ------------------ |
60
+ | **Expected** | <correct behavior> |
61
+ | **Actual** | <broken behavior> |
62
+
63
+ ## Error Output
64
+ ```
65
+
66
+ <paste exact error, stack trace, or log output>
67
+
68
+ ````
69
+
70
+ ## Root Cause (if known)
71
+ - File: `path/to/file.ts` — `functionName()` or line reference
72
+ - Why: <brief technical explanation>
73
+
74
+ ## Scope
75
+ | In | Out |
76
+ |----|-----|
77
+ | Fix the specific bug | Refactoring surrounding code |
78
+ | Add regression test | Performance optimization |
79
+
80
+ ## Code Locations
81
+ - Bug site: `path/to/file.ts` — `symbolName`
82
+ - Test file: `path/to/file.test.ts`
83
+ - Related: `path/to/related.ts` — `relatedSymbol`
84
+
85
+ ## Acceptance Criteria
86
+ - [ ] Bug no longer reproduces with steps above
87
+ - [ ] Regression test added that fails without fix, passes with fix
88
+ - [ ] No new lint/type errors
89
+ - [ ] Existing tests pass
90
+
91
+ ## Verification
92
+ ```bash
93
+ <exact test command>
94
+ <exact build/lint command>
95
+ ````
96
+
97
+ ````
98
+
99
+ ### Feature
100
+
101
+ ```markdown
102
+ # Objective
103
+ <one sentence: what capability is added and why>
104
+
105
+ ## Type: feature
106
+ ## Component: <package or module name>
107
+ ## Priority: P0 | P1 | P2 | P3
108
+
109
+ ## Context
110
+ - Why: <user need or business reason>
111
+ - Related: <links to issues, PRs, vault entries, specs>
112
+
113
+ ## Scope
114
+ | In | Out |
115
+ |----|-----|
116
+ | <specific deliverable> | <what NOT to touch> |
117
+
118
+ ## Constraints
119
+ - Backward compatibility: <requirements>
120
+ - Dependencies: <allowed/forbidden>
121
+ - Performance: <budgets if any>
122
+ - Security: <requirements if any>
123
+
124
+ ## Code Locations
125
+ - Entry point: `path/to/file.ts` — `functionOrClass`
126
+ - Integration point: `path/to/other.ts` — `symbol`
127
+ - Test location: `path/to/test.ts`
128
+
129
+ ## Proposed Approach (optional)
130
+ 1. <step>
131
+ 2. <step>
132
+
133
+ ## Acceptance Criteria
134
+ - [ ] Given <precondition>, when <action>, then <result>
135
+ - [ ] Given <precondition>, when <action>, then <result>
136
+ - [ ] Tests added for new behavior
137
+ - [ ] Types exported if public API
138
+
139
+ ## Verification
140
+ ```bash
141
+ <exact test command>
142
+ <exact build command>
143
+ ````
144
+
145
+ ## Definition of Done
146
+
147
+ - [ ] Acceptance criteria satisfied
148
+ - [ ] `npm test` passes
149
+ - [ ] `npm run typecheck` passes
150
+ - [ ] Changes scoped to "In Scope" only
151
+
152
+ ````
153
+
154
+ ### Milestone
155
+
156
+ ```markdown
157
+ # Milestone: <short title>
158
+
159
+ ## Objective
160
+ <one sentence: what this milestone achieves>
161
+
162
+ ## Timeline
163
+ - Target: <date>
164
+ - Depends on: <blocking milestones or external factors>
165
+
166
+ ## Sub-Issues
167
+
168
+ | # | Type | Title | Priority | Depends On |
169
+ |---|------|-------|----------|------------|
170
+ | 1 | feature | <title> | P1 | — |
171
+ | 2 | feature | <title> | P1 | #1 |
172
+ | 3 | bug | <title> | P2 | — |
173
+
174
+ ## Completion Criteria
175
+ - [ ] All sub-issues closed
176
+ - [ ] Integration test passes end-to-end
177
+ - [ ] <milestone-level verification>
178
+ ````
179
+
180
+ ## Field Guide
181
+
182
+ ### Writing Good Objectives
183
+
184
+ | Bad | Good |
185
+ | --------------------- | ------------------------------------------------------------------------------- |
186
+ | "Fix the login" | "Login returns 401 instead of session token when OAuth callback has valid code" |
187
+ | "Add dark mode" | "Add `prefers-color-scheme` media query support to all semantic color tokens" |
188
+ | "Improve performance" | "Reduce cold-start vault search from 800ms to <200ms by lazy-loading FTS index" |
189
+
190
+ ### Writing Good Acceptance Criteria
191
+
192
+ Use Given/When/Then for behavioral criteria. Use plain checkboxes for structural criteria.
193
+
194
+ **Behavioral:**
195
+
196
+ - [ ] Given a user with valid OAuth code, when POST /auth/callback, then returns 200 with session token
197
+
198
+ **Structural:**
199
+
200
+ - [ ] Unit test covers happy path + error case
201
+ - [ ] No new `any` types introduced
202
+ - [ ] Public API documented in JSDoc
203
+
204
+ ### Writing Good Code Locations
205
+
206
+ Always include:
207
+
208
+ 1. **File path** — repo-root relative
209
+ 2. **Anchor** — function name, class name, route, or config key
210
+ 3. **Context** — what the agent should look at there
211
+
212
+ ```
213
+ - Handler: `packages/core/src/auth/callback.ts` — `handleOAuthCallback()`
214
+ - Token logic: `packages/core/src/auth/session.ts` — `createSession()`
215
+ - Test: `packages/core/src/__tests__/auth.test.ts` — "OAuth callback" describe block
216
+ ```
217
+
218
+ ### Constraints That Prevent Agent Overreach
219
+
220
+ Be explicit about boundaries. Agents optimize globally unless told not to.
221
+
222
+ ```
223
+ ## Constraints
224
+ - Do NOT modify the public API surface of `@soleri/core`
225
+ - Do NOT add new npm dependencies
226
+ - Do NOT refactor surrounding code — fix only the bug
227
+ - Backward compatible: existing agent.yaml files must still work
228
+ ```
229
+
230
+ ## Workflow
231
+
232
+ 1. **Gather context** — search vault, read error logs, check git blame
233
+ 2. **Identify code locations** — grep codebase for relevant symbols
234
+ 3. **Choose template** — bug, feature, or milestone
235
+ 4. **Fill template** — every field. Skip none.
236
+ 5. **Create issue** — `gh issue create --title "..." --body "..." --label "..."`
237
+
238
+ ## Integration with Planning
239
+
240
+ When creating issues from a plan, the plan is the source of truth — GitHub issues are the projection. Each task becomes a lean issue pointing back to the plan.
241
+
242
+ ### Plan-Sourced Task Template
243
+
244
+ ````markdown
245
+ # Objective
246
+
247
+ <one sentence: what this task delivers>
248
+
249
+ ## Plan: `<plan-id>` | Task <N> of <total>
250
+
251
+ ## Parent: #<epic-issue-number>
252
+
253
+ ## Complexity: Low | Medium | High
254
+
255
+ ## Depends on: <task dependencies or "nothing">
256
+
257
+ ## Code Locations
258
+
259
+ - `path/to/file.ts` — `symbolOrFunction`
260
+
261
+ ## Acceptance Criteria
262
+
263
+ - [ ] <testable outcome>
264
+ - [ ] <testable outcome>
265
+ - [ ] Tests pass
266
+
267
+ ## Verification
268
+
269
+ ```bash
270
+ <exact command>
271
+ ```
272
+ ````
273
+
274
+ ```
275
+
276
+ ### Rules for Plan-Sourced Issues
277
+
278
+ 1. **Plan ID is mandatory** — every task issue must include `## Plan: \`<plan-id>\`` so the full plan is one API call away
279
+ 2. **Keep issues lean** — task description + code locations + acceptance criteria
280
+ 3. **One issue per task** — don't bundle multiple plan tasks into one issue
281
+ 4. **Parent/epic issue** — create a parent issue that lists all task issues
282
+ 5. **Map complexity to priority** — High → P1, Medium → P2, Low → P3
283
+ 6. **Include task number** — "Task 3 of 11" helps track progress
284
+
285
+ ## Labels
286
+
287
+ Always apply at least:
288
+ - Type: `bug`, `feature`, `refactor`, `chore`
289
+ - Priority: `P0`, `P1`, `P2`, `P3` (if using priority labels)
290
+ - Component: package or module name (if using component labels)
291
+ ```
@@ -0,0 +1,66 @@
1
+ ---
2
+ name: agent-persona
3
+ description: >
4
+ Use when the user activates the agent's persona via its greeting phrase, or says
5
+ "activate persona", "be yourself", "stay in character", or any activation phrase
6
+ defined in the agent's persona configuration. Reinforces character persistence
7
+ through the session and survives context compaction.
8
+ ---
9
+
10
+ # Agent Persona — Stay in Character
11
+
12
+ This skill reinforces persona persistence. The MCP activation loads the runtime payload — this skill ensures the character sticks across the full session, including after context compaction.
13
+
14
+ ## How It Works
15
+
16
+ Every agent has a persona defined in `agent.yaml`. The persona contains:
17
+
18
+ - **name** — the agent's display name
19
+ - **role** — what the agent does
20
+ - **tone** — `precise`, `mentor`, or `pragmatic`
21
+ - **greeting** — the activation response
22
+ - **principles** — core values that guide behavior
23
+
24
+ ## Activation
25
+
26
+ When the user triggers activation (greeting phrase or explicit request):
27
+
28
+ ```
29
+ YOUR_AGENT_core op:activate
30
+ params: { projectPath: "." }
31
+ ```
32
+
33
+ The activation response contains the full persona payload. Adopt it immediately.
34
+
35
+ ## Rules
36
+
37
+ 1. **Stay in character for EVERY response** until the user explicitly deactivates
38
+ 2. **Technical accuracy is the priority** — persona is the wrapper, not a replacement for correctness
39
+ 3. **Tone consistency** — match the configured tone (`precise` = concise and exact, `mentor` = educational and encouraging, `pragmatic` = direct and practical)
40
+ 4. If character drifts after context compaction, the persona information in the compacted summary should restore it — follow it
41
+
42
+ ## Context Compaction Survival
43
+
44
+ Long sessions trigger context compaction. To survive:
45
+
46
+ - The persona activation state is included in compaction summaries
47
+ - After compaction, check if persona was active and re-adopt the character
48
+ - Never break character just because the conversation was compacted
49
+
50
+ ## Deactivation
51
+
52
+ When the user says "deactivate", "stop persona", "be normal", or uses the agent's deactivation phrase:
53
+
54
+ ```
55
+ YOUR_AGENT_core op:activate
56
+ params: { deactivate: true }
57
+ ```
58
+
59
+ Return to neutral assistant mode.
60
+
61
+ ## Anti-Patterns
62
+
63
+ - **Dropping character mid-session** — if activated, stay activated
64
+ - **Over-persona, under-substance** — character adds flavor, not replaces technical depth
65
+ - **Forcing persona on unwilling users** — only activate when explicitly triggered
66
+ - **Ignoring tone setting** — a `precise` agent should not use flowery language; a `mentor` agent should not be terse
@@ -188,6 +188,18 @@ Only capture if genuinely reusable — not every review finding is vault-worthy.
188
188
  - Skipping git history (temporal smells are the most actionable)
189
189
  - Treating all smells as equal severity (prioritize by impact)
190
190
 
191
+ ## Rationalization Prevention
192
+
193
+ Do NOT rationalize away findings. If a smell or issue is detected, report it honestly.
194
+
195
+ - **HARD-GATE: All three passes must complete before presenting the report. Do not skip a pass.**
196
+ - **HARD-GATE: Critical (red) findings must be flagged -- never downgrade severity to avoid difficult conversations.**
197
+ - Do not say "this is probably fine" to dismiss a code smell you detected.
198
+ - Do not omit findings because "the code works" -- working code can still be poorly architected.
199
+ - Do not soften severity because the code is recent or written by the user.
200
+ - If git history shows high churn, report it. Do not skip temporal smells for convenience.
201
+ - Present the full picture. A review that hides problems is worse than no review.
202
+
191
203
  ## Quick Reference
192
204
 
193
205
  | Pass | Focus | Key Activities |
@@ -0,0 +1,123 @@
1
+ ---
2
+ name: deliver-and-ship
3
+ description: >
4
+ Use when the user says "ship it", "ready to deploy", "package", "release",
5
+ "pre-PR check", "delivery checklist", "is this ready", "final review", or mentions
6
+ shipping, deploying, packaging, or releasing work. Runs pre-delivery quality gates
7
+ to ensure nothing ships without passing stability, knowledge capture, and code quality checks.
8
+ ---
9
+
10
+ # Deliver & Ship — Quality Gate Runner
11
+
12
+ Run all pre-delivery quality gates before shipping. This ensures nothing leaves without passing stability checks, knowledge capture, and code quality verification.
13
+
14
+ ## When to Use
15
+
16
+ When work is considered "done" and ready to be committed, PR'd, or deployed. This is the last checkpoint before code leaves the developer's hands.
17
+
18
+ ## Orchestration Sequence
19
+
20
+ ### Step 1: Code Quality
21
+
22
+ Run the project's linter, formatter, and type checker on all modified files:
23
+
24
+ 1. Check for lint/format scripts in `package.json` (or equivalent)
25
+ 2. Run `typecheck` / `tsc --noEmit` if TypeScript
26
+ 3. Run any project-specific quality gates (clippy for Rust, mypy for Python, etc.)
27
+
28
+ Any type error or lint failure is a blocker.
29
+
30
+ ### Step 2: Test Suite
31
+
32
+ Run the full test suite to catch regressions:
33
+
34
+ ```
35
+ YOUR_AGENT_core op:admin_health
36
+ ```
37
+
38
+ Verify the agent itself is healthy, then run project tests. All tests must pass.
39
+
40
+ ### Step 3: Stability Assessment
41
+
42
+ Classify the changes as safe or breaking:
43
+
44
+ - **Safe**: Internal refactors, bug fixes, additive features (new exports, new ops)
45
+ - **Breaking**: Removed exports, changed signatures, renamed public APIs, schema migrations
46
+ - Breaking changes need migration guidance in the commit/PR description
47
+
48
+ ### Step 4: Knowledge Audit
49
+
50
+ Check if patterns discovered during this work session should be captured before shipping:
51
+
52
+ ```
53
+ YOUR_AGENT_core op:memory_search
54
+ params: { query: "current session" }
55
+ ```
56
+
57
+ ```
58
+ YOUR_AGENT_core op:brain_stats
59
+ ```
60
+
61
+ Look for:
62
+
63
+ - Bug fixes that reveal an anti-pattern worth capturing
64
+ - New patterns that should be in the vault for next time
65
+ - Architectural decisions that need documenting
66
+
67
+ Uncaptured knowledge is lost knowledge. If something should be captured:
68
+
69
+ ```
70
+ YOUR_AGENT_core op:capture_knowledge
71
+ params: {
72
+ title: "<what was learned>",
73
+ description: "<the pattern or anti-pattern>",
74
+ type: "pattern",
75
+ tags: ["<relevant-tags>"]
76
+ }
77
+ ```
78
+
79
+ ### Step 5: Commit Quality
80
+
81
+ Verify commit messages follow conventional commits:
82
+
83
+ - `feat:` for new features
84
+ - `fix:` for bug fixes
85
+ - `refactor:` for refactors
86
+ - `chore:` for maintenance
87
+ - No AI attribution (blocked by engine rules)
88
+
89
+ ### Step 6: Delivery Report
90
+
91
+ Present a checklist:
92
+
93
+ - [ ] Code quality: pass/fail (Step 1)
94
+ - [ ] Tests: pass/fail (Step 2)
95
+ - [ ] Stability: safe change / breaking change (Step 3)
96
+ - [ ] Knowledge: captured / needs capture (Step 4)
97
+ - [ ] Commits: clean / needs cleanup (Step 5)
98
+
99
+ All items must pass before recommending "ship it."
100
+
101
+ ## Domain-Specific Gates
102
+
103
+ Agents with domain-specific facades may add extra gates. For example:
104
+
105
+ - **Design system agents**: token validation, contrast checks, accessibility audit
106
+ - **API agents**: schema validation, backward compatibility checks
107
+ - **Security agents**: dependency audit, secret scanning
108
+
109
+ These are additive — they don't replace the generic gates above.
110
+
111
+ ## Exit Criteria
112
+
113
+ Delivery is approved when all gates pass. If any gate fails, report the failure and recommend fixes before shipping. Never approve delivery with blocking issues.
114
+
115
+ ## Agent Tools Reference
116
+
117
+ | Op | When to Use |
118
+ | ------------------- | -------------------------------------- |
119
+ | `admin_health` | Verify agent/system health |
120
+ | `memory_search` | Check for uncaptured session knowledge |
121
+ | `brain_stats` | Review learning state |
122
+ | `capture_knowledge` | Persist patterns before shipping |
123
+ | `capture_quick` | Fast capture for simple learnings |
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: discovery-phase
3
+ description: >
4
+ Use for structured exploration before committing to a plan — "I don't know where to start",
5
+ "what are our options", "investigate", "research this", "explore options", "discovery". Ideal
6
+ when requirements are unclear, entering a new domain, or facing architectural decisions. Produces
7
+ a discovery document with options, tradeoffs, and a recommendation.
8
+ ---
9
+
10
+ # Discovery Phase
11
+
12
+ Structured exploration before committing to a plan. Define the question, research prior art, explore the codebase, identify constraints, draft options with tradeoffs, and recommend a path forward.
13
+
14
+ <HARD-GATE>
15
+ Do NOT create a plan, write code, or take any implementation action until the discovery document is complete and the user has reviewed it. Discovery produces knowledge, not artifacts.
16
+ </HARD-GATE>
17
+
18
+ ## Checklist
19
+
20
+ 1. **Define the question** — restate what we're exploring as one specific, answerable sentence
21
+ 2. **Search vault for prior art** — `YOUR_AGENT_core op:search_intelligent params: { query: "<question>", mode: "scan" }`. Also `op:memory_search` with `crossProject: true`.
22
+ 3. **Explore codebase** — read relevant files, configs, architecture, recent commits
23
+ 4. **Identify constraints** — hard (must-haves) vs soft (nice-to-haves), unknowns that block a decision
24
+ 5. **Draft 2-4 options** — each with pros, cons, risk, and effort (S/M/L)
25
+ 6. **Recommend** — pick one, state the primary reason, note what would change the answer
26
+ 7. **Capture to vault** — persist the discovery finding
27
+ 8. **Transition** — hand off to brainstorming or writing-plans skill
28
+
29
+ ## Option Format
30
+
31
+ For each option:
32
+
33
+ | Field | Content |
34
+ | ------------ | -------------------- |
35
+ | **Approach** | One-sentence summary |
36
+ | **Pros** | What it gives us |
37
+ | **Cons** | What it costs |
38
+ | **Risk** | What could go wrong |
39
+ | **Effort** | S / M / L |
40
+
41
+ ## After Discovery
42
+
43
+ ```
44
+ YOUR_AGENT_core op:capture_knowledge
45
+ params: {
46
+ title: "<topic> — discovery finding",
47
+ description: "<question, options considered, recommendation, rationale>",
48
+ type: "decision",
49
+ category: "<domain>",
50
+ tags: ["discovery", "decision"]
51
+ }
52
+ ```
53
+
54
+ Save to `docs/discoveries/YYYY-MM-DD-<topic>.md` and commit. Then transition to the next skill.
55
+
56
+ ## Anti-Patterns
57
+
58
+ - **Skipping discovery** — jumping to implementation when the problem space is unclear
59
+ - **Analysis paralysis** — timebox to 30-60 min; if no clear winner, pick the most reversible option
60
+ - **Boiling the ocean** — scope to one question; split compound questions into separate discoveries
61
+
62
+ ## Quick Reference
63
+
64
+ | Op | When to Use |
65
+ | -------------------- | ---------------------------------- |
66
+ | `search_intelligent` | Search vault for prior art |
67
+ | `memory_search` | Check session history and projects |
68
+ | `capture_knowledge` | Persist discovery finding |
69
+ | `route_intent` | Classify what comes after |