@soleri/forge 5.4.0 → 5.6.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 (72) hide show
  1. package/dist/scaffolder.js +98 -6
  2. package/dist/scaffolder.js.map +1 -1
  3. package/dist/skills/brain-debrief.md +186 -0
  4. package/dist/skills/brainstorming.md +170 -0
  5. package/dist/skills/code-patrol.md +176 -0
  6. package/dist/skills/context-resume.md +143 -0
  7. package/dist/skills/executing-plans.md +201 -0
  8. package/dist/skills/fix-and-learn.md +164 -0
  9. package/dist/skills/health-check.md +225 -0
  10. package/dist/skills/knowledge-harvest.md +178 -0
  11. package/dist/skills/onboard-me.md +197 -0
  12. package/dist/skills/retrospective.md +189 -0
  13. package/dist/skills/second-opinion.md +142 -0
  14. package/dist/skills/skills/brain-debrief.md +214 -0
  15. package/dist/skills/skills/brainstorming.md +180 -0
  16. package/dist/skills/skills/code-patrol.md +178 -0
  17. package/dist/skills/skills/context-resume.md +146 -0
  18. package/dist/skills/skills/executing-plans.md +216 -0
  19. package/dist/skills/skills/fix-and-learn.md +167 -0
  20. package/dist/skills/skills/health-check.md +231 -0
  21. package/dist/skills/skills/knowledge-harvest.md +185 -0
  22. package/dist/skills/skills/onboard-me.md +198 -0
  23. package/dist/skills/skills/retrospective.md +205 -0
  24. package/dist/skills/skills/second-opinion.md +149 -0
  25. package/dist/skills/skills/systematic-debugging.md +241 -0
  26. package/dist/skills/skills/test-driven-development.md +281 -0
  27. package/dist/skills/skills/vault-capture.md +170 -0
  28. package/dist/skills/skills/vault-navigator.md +140 -0
  29. package/dist/skills/skills/verification-before-completion.md +182 -0
  30. package/dist/skills/skills/writing-plans.md +215 -0
  31. package/dist/skills/systematic-debugging.md +230 -0
  32. package/dist/skills/test-driven-development.md +266 -0
  33. package/dist/skills/vault-capture.md +154 -0
  34. package/dist/skills/vault-navigator.md +129 -0
  35. package/dist/skills/verification-before-completion.md +170 -0
  36. package/dist/skills/writing-plans.md +207 -0
  37. package/dist/templates/entry-point.js +8 -0
  38. package/dist/templates/entry-point.js.map +1 -1
  39. package/dist/templates/readme.js +38 -0
  40. package/dist/templates/readme.js.map +1 -1
  41. package/dist/templates/setup-script.js +26 -0
  42. package/dist/templates/setup-script.js.map +1 -1
  43. package/dist/templates/skills.d.ts +16 -0
  44. package/dist/templates/skills.js +73 -0
  45. package/dist/templates/skills.js.map +1 -0
  46. package/dist/templates/test-facades.js +35 -6
  47. package/dist/templates/test-facades.js.map +1 -1
  48. package/package.json +2 -2
  49. package/src/__tests__/scaffolder.test.ts +115 -2
  50. package/src/scaffolder.ts +100 -6
  51. package/src/skills/brain-debrief.md +214 -0
  52. package/src/skills/brainstorming.md +180 -0
  53. package/src/skills/code-patrol.md +178 -0
  54. package/src/skills/context-resume.md +146 -0
  55. package/src/skills/executing-plans.md +216 -0
  56. package/src/skills/fix-and-learn.md +167 -0
  57. package/src/skills/health-check.md +231 -0
  58. package/src/skills/knowledge-harvest.md +185 -0
  59. package/src/skills/onboard-me.md +198 -0
  60. package/src/skills/retrospective.md +205 -0
  61. package/src/skills/second-opinion.md +149 -0
  62. package/src/skills/systematic-debugging.md +241 -0
  63. package/src/skills/test-driven-development.md +281 -0
  64. package/src/skills/vault-capture.md +170 -0
  65. package/src/skills/vault-navigator.md +140 -0
  66. package/src/skills/verification-before-completion.md +182 -0
  67. package/src/skills/writing-plans.md +215 -0
  68. package/src/templates/entry-point.ts +8 -0
  69. package/src/templates/readme.ts +38 -0
  70. package/src/templates/setup-script.ts +26 -0
  71. package/src/templates/skills.ts +82 -0
  72. package/src/templates/test-facades.ts +35 -6
@@ -0,0 +1,230 @@
1
+ ---
2
+ name: systematic-debugging
3
+ description: Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
4
+ ---
5
+
6
+ <!-- Adapted from superpowers (MIT License) -->
7
+
8
+ # Systematic Debugging
9
+
10
+ ## Overview
11
+
12
+ Random fixes waste time and create new bugs. Quick patches mask underlying issues.
13
+
14
+ **Core principle:** ALWAYS find root cause before attempting fixes. Symptom fixes are failure.
15
+
16
+ **Violating the letter of this process is violating the spirit of debugging.**
17
+
18
+ ## The Iron Law
19
+
20
+ ```
21
+ NO FIXES WITHOUT ROOT CAUSE INVESTIGATION FIRST
22
+ ```
23
+
24
+ If you haven't completed Phase 1, you cannot propose fixes.
25
+
26
+ ## When to Use
27
+
28
+ Use for ANY technical issue:
29
+ - Test failures
30
+ - Bugs in production
31
+ - Unexpected behavior
32
+ - Performance problems
33
+ - Build failures
34
+ - Integration issues
35
+
36
+ **Use this ESPECIALLY when:**
37
+ - Under time pressure (emergencies make guessing tempting)
38
+ - "Just one quick fix" seems obvious
39
+ - You've already tried multiple fixes
40
+ - Previous fix didn't work
41
+ - You don't fully understand the issue
42
+
43
+ ## Phase 0: Search Before Investigating
44
+
45
+ **BEFORE touching any code**, search for existing solutions. Follow this order:
46
+
47
+ ### Vault First
48
+ ```
49
+ YOUR_AGENT_core op:search_intelligent
50
+ params: { query: "<description of the bug or error message>" }
51
+ ```
52
+
53
+ If the vault has a matching anti-pattern or previous fix, it likely contains the root cause and solution — apply it directly. This can save hours of investigation.
54
+
55
+ Also check brain strengths for relevant debugging patterns:
56
+
57
+ ```
58
+ YOUR_AGENT_core op:brain_strengths
59
+ ```
60
+
61
+ Check memory for similar bugs across sessions:
62
+
63
+ ```
64
+ YOUR_AGENT_core op:memory_search
65
+ params: { query: "<error or symptom>" }
66
+ ```
67
+
68
+ ### Web Search Second
69
+ If the vault has nothing, search the web before investigating from scratch:
70
+ - **Paste the exact error message** — someone likely hit this before
71
+ - **Check GitHub issues** on relevant libraries
72
+ - **Check Stack Overflow** for the error + framework/library combination
73
+ - **Check official docs** — is this a known limitation or misconfiguration?
74
+
75
+ A 30-second search that finds "this is a known issue in v3.2, upgrade to v3.3" saves hours of root cause investigation.
76
+
77
+ ### Then Investigate
78
+ Only if vault and web search produce no answer, proceed to Phase 1.
79
+
80
+ ## Start a Debug Loop
81
+
82
+ For complex bugs, start a validation loop to track investigation iterations:
83
+
84
+ ```
85
+ YOUR_AGENT_core op:loop_start
86
+ params: { prompt: "Debug: <bug description>", mode: "custom" }
87
+ ```
88
+
89
+ ## The Four Phases
90
+
91
+ You MUST complete each phase before proceeding to the next.
92
+
93
+ ### Phase 1: Root Cause Investigation
94
+
95
+ **BEFORE attempting ANY fix:**
96
+
97
+ 1. Read Error Messages Carefully
98
+ 2. Reproduce Consistently
99
+ 3. Check Recent Changes
100
+ 4. Gather Evidence in Multi-Component Systems (add diagnostic instrumentation at each component boundary)
101
+ 5. Trace Data Flow backward through call stack
102
+
103
+ Track each investigation step:
104
+ ```
105
+ YOUR_AGENT_core op:loop_iterate
106
+ ```
107
+
108
+ ### Phase 2: Pattern Analysis
109
+
110
+ 1. Find Working Examples
111
+ 2. Compare Against References (read completely, don't skim)
112
+ 3. Identify Differences
113
+ 4. Understand Dependencies
114
+
115
+ Search vault for working patterns to compare against:
116
+ ```
117
+ YOUR_AGENT_core op:search_intelligent
118
+ params: { query: "<working feature similar to broken one>" }
119
+ ```
120
+
121
+ ### Phase 3: Hypothesis and Testing
122
+
123
+ 1. Form Single Hypothesis ("I think X is the root cause because Y")
124
+ 2. Test Minimally (one variable at a time)
125
+ 3. Verify Before Continuing
126
+ 4. When You Don't Know — say so, ask for help
127
+
128
+ ### Phase 4: Implementation
129
+
130
+ 1. Create Failing Test Case (use test-driven-development skill)
131
+ 2. Implement Single Fix (root cause only, one change at a time)
132
+ 3. Verify Fix
133
+ 4. If Fix Doesn't Work: count attempts. If < 3, return to Phase 1. If >= 3, STOP and question architecture.
134
+ 5. If 3+ Fixes Failed: Question Architecture — discuss with human partner before attempting more fixes.
135
+
136
+ ## Phase 5: Capture the Learning
137
+
138
+ Complete the debug loop:
139
+ ```
140
+ YOUR_AGENT_core op:loop_complete
141
+ ```
142
+
143
+ **MANDATORY after every resolved bug.** A fix without a capture is an incomplete fix.
144
+
145
+ ```
146
+ YOUR_AGENT_core op:capture_knowledge
147
+ params: {
148
+ title: "<short bug description>",
149
+ description: "<root cause, solution, and what made it hard to find>",
150
+ type: "anti-pattern",
151
+ category: "<relevant domain>",
152
+ tags: ["<relevant>", "<tags>"]
153
+ }
154
+ ```
155
+
156
+ For quick captures when the fix is straightforward:
157
+
158
+ ```
159
+ YOUR_AGENT_core op:capture_quick
160
+ params: {
161
+ title: "<bug description>",
162
+ description: "<root cause and fix>"
163
+ }
164
+ ```
165
+
166
+ Capture a session summary:
167
+ ```
168
+ YOUR_AGENT_core op:session_capture
169
+ params: { summary: "<bug, root cause, fix, files modified>" }
170
+ ```
171
+
172
+ This is what makes the agent smarter over time. Next time someone hits a similar bug, Phase 0 vault search will surface your solution immediately.
173
+
174
+ ## Red Flags - STOP and Follow Process
175
+
176
+ - "Quick fix for now, investigate later"
177
+ - "Just try changing X and see if it works"
178
+ - "Add multiple changes, run tests"
179
+ - "Skip the test, I'll manually verify"
180
+ - "It's probably X, let me fix that"
181
+ - "I don't fully understand but this might work"
182
+ - Proposing solutions before tracing data flow
183
+ - "One more fix attempt" (when already tried 2+)
184
+ - Each fix reveals new problem in different place
185
+
186
+ **ALL of these mean: STOP. Return to Phase 1.**
187
+
188
+ ## Common Rationalizations
189
+
190
+ | Excuse | Reality |
191
+ |--------|---------|
192
+ | "Issue is simple, don't need process" | Simple issues have root causes too. |
193
+ | "Emergency, no time for process" | Systematic is FASTER than guess-and-check thrashing. |
194
+ | "Just try this first, then investigate" | First fix sets the pattern. Do it right from the start. |
195
+ | "I'll write test after confirming fix works" | Untested fixes don't stick. Test first proves it. |
196
+ | "Multiple fixes at once saves time" | Can't isolate what worked. Causes new bugs. |
197
+ | "Reference too long, I'll adapt the pattern" | Partial understanding guarantees bugs. Read it completely. |
198
+ | "I see the problem, let me fix it" | Seeing symptoms ≠ understanding root cause. |
199
+ | "One more fix attempt" (after 2+ failures) | 3+ failures = architectural problem. Question pattern, don't fix again. |
200
+ | "Skip the vault, I know this one" | The vault may know it better. 30 seconds to check saves hours. |
201
+
202
+ ## Quick Reference
203
+
204
+ | Phase | Key Activities | Agent Tools |
205
+ |-------|---------------|-------------|
206
+ | **0. Search First** | Vault search, web search, memory | `search_intelligent`, `brain_strengths`, `memory_search` |
207
+ | **1. Root Cause** | Read errors, reproduce, trace | `loop_iterate` |
208
+ | **2. Pattern** | Find working examples, compare | `search_intelligent` |
209
+ | **3. Hypothesis** | Form theory, test minimally | `loop_iterate` |
210
+ | **4. Implementation** | Create test, fix, verify | `loop_iterate` |
211
+ | **5. Capture** | Persist root cause, close loop | `capture_knowledge`, `loop_complete`, `session_capture` |
212
+
213
+ ## Agent Tools Reference
214
+
215
+ | Op | When to Use |
216
+ |----|-------------|
217
+ | `search_intelligent` | Search vault for known bugs and patterns |
218
+ | `brain_strengths` | Check proven debugging patterns |
219
+ | `memory_search` | Search across session memories |
220
+ | `loop_start` | Begin iterative debug cycle |
221
+ | `loop_iterate` | Track each investigation/fix attempt |
222
+ | `loop_complete` | Finish debug cycle |
223
+ | `capture_knowledge` | Full anti-pattern capture |
224
+ | `capture_quick` | Fast capture for simple fixes |
225
+ | `session_capture` | Persist session context |
226
+
227
+ **Related skills:**
228
+ - test-driven-development
229
+ - verification-before-completion
230
+ - fix-and-learn (combines debugging + capture in one workflow)
@@ -0,0 +1,266 @@
1
+ ---
2
+ name: test-driven-development
3
+ description: Use when implementing any feature or bugfix, before writing implementation code
4
+ ---
5
+
6
+ <!-- Adapted from superpowers (MIT License) -->
7
+
8
+ # Test-Driven Development (TDD)
9
+
10
+ ## Overview
11
+
12
+ Write the test first. Watch it fail. Write minimal code to pass.
13
+
14
+ **Core principle:** If you didn't watch the test fail, you don't know if it tests the right thing.
15
+
16
+ **Violating the letter of the rules is violating the spirit of the rules.**
17
+
18
+ ## When to Use
19
+
20
+ **Always:**
21
+ - New features
22
+ - Bug fixes
23
+ - Refactoring
24
+ - Behavior changes
25
+
26
+ **Exceptions (ask your human partner):**
27
+ - Throwaway prototypes
28
+ - Generated code
29
+ - Configuration files
30
+
31
+ Thinking "skip TDD just this once"? Stop. That's rationalization.
32
+
33
+ ## Before You Start — Search First, Code Second
34
+
35
+ **Never start writing tests blind.** Follow this lookup order:
36
+
37
+ ### 1. Vault First
38
+ Check for existing testing patterns in the knowledge base:
39
+
40
+ ```
41
+ YOUR_AGENT_core op:search_intelligent
42
+ params: { query: "<what you're about to test>" }
43
+ ```
44
+
45
+ Look for:
46
+ - **Testing patterns** for similar features (how were they tested before?)
47
+ - **Anti-patterns** — common testing mistakes in this domain
48
+ - **Proven approaches** from brain strengths:
49
+
50
+ ```
51
+ YOUR_AGENT_core op:brain_strengths
52
+ ```
53
+
54
+ If the vault has testing guidance for this domain, follow it. Don't reinvent test strategies that have already been validated.
55
+
56
+ ### 2. Web Search
57
+ If the vault has no relevant patterns, search the web for established testing approaches:
58
+ - Library-specific testing patterns (e.g., how to test React hooks, Express middleware)
59
+ - Best practices for the specific type of test (integration, e2e, unit)
60
+ - Known gotchas in the testing framework being used
61
+
62
+ ### 3. Then Write the Test
63
+ Only after consulting vault and web, proceed to write the failing test. You'll write better tests when informed by existing knowledge.
64
+
65
+ ## Start a TDD Loop
66
+
67
+ For multi-test TDD cycles, start a validation loop to track iterations:
68
+
69
+ ```
70
+ YOUR_AGENT_core op:loop_start
71
+ params: { prompt: "TDD: <feature being implemented>", mode: "custom" }
72
+ ```
73
+
74
+ ## The Iron Law
75
+
76
+ ```
77
+ NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
78
+ ```
79
+
80
+ Write code before the test? Delete it. Start over.
81
+
82
+ **No exceptions:**
83
+ - Don't keep it as "reference"
84
+ - Don't "adapt" it while writing tests
85
+ - Don't look at it
86
+ - Delete means delete
87
+
88
+ Implement fresh from tests. Period.
89
+
90
+ ## Red-Green-Refactor
91
+
92
+ ### RED - Write Failing Test
93
+
94
+ Write one minimal test showing what should happen.
95
+
96
+ Good: clear name, tests real behavior, one thing
97
+ Bad: vague name, tests mock not code
98
+
99
+ **Requirements:**
100
+ - One behavior
101
+ - Clear name
102
+ - Real code (no mocks unless unavoidable)
103
+
104
+ ### Verify RED - Watch It Fail
105
+
106
+ **MANDATORY. Never skip.**
107
+
108
+ Run: `npm test path/to/test.test.ts`
109
+
110
+ Confirm:
111
+ - Test fails (not errors)
112
+ - Failure message is expected
113
+ - Fails because feature missing (not typos)
114
+
115
+ **Test passes?** You're testing existing behavior. Fix test.
116
+ **Test errors?** Fix error, re-run until it fails correctly.
117
+
118
+ Track the iteration:
119
+ ```
120
+ YOUR_AGENT_core op:loop_iterate
121
+ ```
122
+
123
+ ### GREEN - Minimal Code
124
+
125
+ Write simplest code to pass the test. Don't add features, refactor other code, or "improve" beyond the test.
126
+
127
+ ### Verify GREEN - Watch It Pass
128
+
129
+ **MANDATORY.**
130
+
131
+ Run: `npm test path/to/test.test.ts`
132
+
133
+ Confirm:
134
+ - Test passes
135
+ - Other tests still pass
136
+ - Output pristine (no errors, warnings)
137
+
138
+ **Test fails?** Fix code, not test.
139
+ **Other tests fail?** Fix now.
140
+
141
+ Track the iteration:
142
+ ```
143
+ YOUR_AGENT_core op:loop_iterate
144
+ ```
145
+
146
+ ### REFACTOR - Clean Up
147
+
148
+ After green only:
149
+ - Remove duplication
150
+ - Improve names
151
+ - Extract helpers
152
+
153
+ Keep tests green. Don't add behavior.
154
+
155
+ ### Repeat
156
+
157
+ Next failing test for next feature.
158
+
159
+ ## Good Tests
160
+
161
+ | Quality | Good | Bad |
162
+ |---------|------|-----|
163
+ | **Minimal** | One thing. "and" in name? Split it. | `test('validates email and domain and whitespace')` |
164
+ | **Clear** | Name describes behavior | `test('test1')` |
165
+ | **Shows intent** | Demonstrates desired API | Obscures what code should do |
166
+
167
+ ## Why Order Matters
168
+
169
+ Tests written after code pass immediately — proving nothing. Test-first forces you to watch the test fail, proving it actually tests something.
170
+
171
+ ## Common Rationalizations
172
+
173
+ | Excuse | Reality |
174
+ |--------|---------|
175
+ | "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
176
+ | "I'll test after" | Tests passing immediately prove nothing. |
177
+ | "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
178
+ | "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
179
+ | "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
180
+ | "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
181
+ | "Need to explore first" | Fine. Throw away exploration, start with TDD. |
182
+ | "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
183
+ | "TDD will slow me down" | TDD faster than debugging. Pragmatic = test-first. |
184
+ | "Manual test faster" | Manual doesn't prove edge cases. You'll re-test every change. |
185
+ | "Existing code has no tests" | You're improving it. Add tests for existing code. |
186
+
187
+ ## Red Flags - STOP and Start Over
188
+
189
+ - Code before test
190
+ - Test after implementation
191
+ - Test passes immediately
192
+ - Can't explain why test failed
193
+ - Tests added "later"
194
+ - Rationalizing "just this once"
195
+ - "I already manually tested it"
196
+ - "Tests after achieve the same purpose"
197
+ - "It's about spirit not ritual"
198
+ - "Keep as reference" or "adapt existing code"
199
+ - "Already spent X hours, deleting is wasteful"
200
+ - "TDD is dogmatic, I'm being pragmatic"
201
+ - "This is different because..."
202
+
203
+ **All of these mean: Delete code. Start over with TDD.**
204
+
205
+ ## Verification Checklist
206
+
207
+ Before marking work complete:
208
+
209
+ - [ ] Every new function/method has a test
210
+ - [ ] Watched each test fail before implementing
211
+ - [ ] Each test failed for expected reason (feature missing, not typo)
212
+ - [ ] Wrote minimal code to pass each test
213
+ - [ ] All tests pass
214
+ - [ ] Output pristine (no errors, warnings)
215
+ - [ ] Tests use real code (mocks only if unavoidable)
216
+ - [ ] Edge cases and errors covered
217
+
218
+ Can't check all boxes? You skipped TDD. Start over.
219
+
220
+ ## After TDD — Capture and Complete
221
+
222
+ Complete the loop:
223
+ ```
224
+ YOUR_AGENT_core op:loop_complete
225
+ ```
226
+
227
+ If you discovered a new testing pattern, edge case, or anti-pattern during the TDD cycle, capture it:
228
+
229
+ ```
230
+ YOUR_AGENT_core op:capture_quick
231
+ params: {
232
+ title: "<testing pattern or anti-pattern>",
233
+ description: "<what you learned, when it applies, why it matters>"
234
+ }
235
+ ```
236
+
237
+ This compounds across sessions — next time someone works on similar code, the vault will surface your testing insight.
238
+
239
+ ## When Stuck
240
+
241
+ | Problem | Solution |
242
+ |---------|----------|
243
+ | Don't know how to test | Write wished-for API. Write assertion first. Ask your human partner. |
244
+ | Test too complicated | Design too complicated. Simplify interface. |
245
+ | Must mock everything | Code too coupled. Use dependency injection. |
246
+ | Test setup huge | Extract helpers. Still complex? Simplify design. |
247
+
248
+ ## Final Rule
249
+
250
+ ```
251
+ Production code → test exists and failed first
252
+ Otherwise → not TDD
253
+ ```
254
+
255
+ No exceptions without your human partner's permission.
256
+
257
+ ## Agent Tools Reference
258
+
259
+ | Op | When to Use |
260
+ |----|-------------|
261
+ | `search_intelligent` | Find testing patterns before starting |
262
+ | `brain_strengths` | Check proven testing approaches |
263
+ | `loop_start` | Begin TDD validation loop |
264
+ | `loop_iterate` | Track each red-green cycle |
265
+ | `loop_complete` | Finish TDD loop |
266
+ | `capture_quick` | Capture new testing patterns |
@@ -0,0 +1,154 @@
1
+ ---
2
+ name: vault-capture
3
+ description: Use when the user says "capture this", "save to vault", "remember this pattern", "log this anti-pattern", "store this knowledge", "add to vault", "capture what we learned", or wants to persist a pattern, anti-pattern, workflow, or principle to the knowledge base.
4
+ ---
5
+
6
+ # Vault Capture — Persist Knowledge
7
+
8
+ Capture patterns, anti-patterns, workflows, and principles to the vault. Captured knowledge compounds — it informs future vault searches, brain recommendations, and team reviews.
9
+
10
+ ## When to Use
11
+
12
+ After discovering something worth remembering: a solution that worked, a mistake to avoid, a workflow that proved effective, or a principle that should guide future work.
13
+
14
+ ## Orchestration Sequence
15
+
16
+ ### Step 1: Check for Duplicates
17
+ Call `YOUR_AGENT_core op:search_intelligent` with the knowledge title or description. If a similar entry exists, consider updating it instead of creating a duplicate.
18
+
19
+ ```
20
+ YOUR_AGENT_core op:search_intelligent
21
+ params: { query: "<knowledge title or description>" }
22
+ ```
23
+
24
+ Also run duplicate detection explicitly:
25
+
26
+ ```
27
+ YOUR_AGENT_core op:curator_detect_duplicates
28
+ ```
29
+
30
+ If duplicates are found, decide: update the existing entry or merge them.
31
+
32
+ ### Step 2: Classify the Knowledge
33
+ Determine the entry type:
34
+ - **pattern** — Something that works and should be repeated
35
+ - **anti-pattern** — Something that fails and should be avoided
36
+ - **workflow** — A sequence of steps for a specific task
37
+ - **principle** — A guiding rule or heuristic
38
+ - **decision** — An architectural or design choice with rationale
39
+
40
+ Use intent routing to help classify:
41
+
42
+ ```
43
+ YOUR_AGENT_core op:route_intent
44
+ params: { prompt: "<description of the knowledge>" }
45
+ ```
46
+
47
+ ### Step 3: Capture
48
+ For quick, single-entry captures:
49
+ Call `YOUR_AGENT_core op:capture_knowledge` with:
50
+ - **title**: Clear, searchable name
51
+ - **description**: What it is and when it applies
52
+ - **type**: From Step 2 classification
53
+ - **category**: Domain area (e.g., "component-patterns", "api-design", "infrastructure")
54
+ - **tags**: Searchable keywords
55
+ - **example**: Code snippet or before/after if applicable
56
+ - **why**: The reasoning — this is what makes the entry actionable
57
+
58
+ ```
59
+ YOUR_AGENT_core op:capture_knowledge
60
+ params: {
61
+ title: "<clear, searchable name>",
62
+ description: "<what it is and when it applies>",
63
+ type: "<pattern|anti-pattern|workflow|principle|decision>",
64
+ category: "<domain area>",
65
+ tags: ["<tag1>", "<tag2>"],
66
+ example: "<code or before/after>",
67
+ why: "<reasoning>"
68
+ }
69
+ ```
70
+
71
+ For quick captures:
72
+ ```
73
+ YOUR_AGENT_core op:capture_quick
74
+ params: { title: "<name>", description: "<details>" }
75
+ ```
76
+
77
+ ### Step 4: Post-Capture Quality
78
+
79
+ After capturing, run the curator to ensure quality:
80
+
81
+ **Groom the entry** — normalize tags, fix metadata:
82
+ ```
83
+ YOUR_AGENT_core op:curator_groom
84
+ params: { entryId: "<captured entry id>" }
85
+ ```
86
+
87
+ **Enrich the entry** — use LLM to add context, improve description:
88
+ ```
89
+ YOUR_AGENT_core op:curator_enrich
90
+ params: { entryId: "<captured entry id>" }
91
+ ```
92
+
93
+ **Check for contradictions** — does this conflict with existing knowledge?
94
+ ```
95
+ YOUR_AGENT_core op:curator_contradictions
96
+ ```
97
+
98
+ If contradictions found, resolve them:
99
+ ```
100
+ YOUR_AGENT_core op:curator_resolve_contradiction
101
+ params: { contradictionId: "<id>" }
102
+ ```
103
+
104
+ ### Step 5: Handle Governance (if enabled)
105
+ If governance policy requires review, the capture returns a `proposalId`. The entry is queued for approval.
106
+
107
+ ```
108
+ YOUR_AGENT_core op:governance_proposals
109
+ params: { action: "list" }
110
+ ```
111
+
112
+ Present pending proposals to the user for approval.
113
+
114
+ ### Step 6: Promote to Global (Optional)
115
+ If the knowledge applies across projects (not project-specific):
116
+ ```
117
+ YOUR_AGENT_core op:memory_promote_to_global
118
+ params: { entryId: "<entry id>" }
119
+ ```
120
+
121
+ This makes it available in cross-project searches and brain recommendations.
122
+
123
+ ### Step 7: Verify Health
124
+ Confirm the capture was stored and vault health is maintained:
125
+ ```
126
+ YOUR_AGENT_core op:admin_health
127
+ ```
128
+
129
+ Check vault analytics for overall knowledge quality:
130
+ ```
131
+ YOUR_AGENT_core op:admin_vault_analytics
132
+ ```
133
+
134
+ ## Exit Criteria
135
+
136
+ Capture is complete when: the entry is stored (or queued for review), categorized, tagged, groomed, and vault health confirmed. If promoted to global, cross-project availability is verified.
137
+
138
+ ## Agent Tools Reference
139
+
140
+ | Op | When to Use |
141
+ |----|-------------|
142
+ | `search_intelligent` | Check for duplicates before capture |
143
+ | `curator_detect_duplicates` | Explicit duplicate detection |
144
+ | `route_intent` | Help classify knowledge type |
145
+ | `capture_knowledge` | Full-metadata capture |
146
+ | `capture_quick` | Fast capture for simple entries |
147
+ | `curator_groom` | Normalize tags and metadata |
148
+ | `curator_enrich` | LLM-powered metadata enrichment |
149
+ | `curator_contradictions` | Find conflicting entries |
150
+ | `curator_resolve_contradiction` | Resolve conflicts |
151
+ | `governance_proposals` | Check/manage approval queue |
152
+ | `memory_promote_to_global` | Share across projects |
153
+ | `admin_health` | Verify system health |
154
+ | `admin_vault_analytics` | Overall knowledge quality metrics |