@soleri/forge 9.0.0 → 9.2.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 (110) hide show
  1. package/dist/compose-claude-md.js +1 -1
  2. package/dist/compose-claude-md.js.map +1 -1
  3. package/dist/scaffold-filetree.js +10 -1
  4. package/dist/scaffold-filetree.js.map +1 -1
  5. package/dist/skills/brain-debrief/SKILL.md +70 -0
  6. package/dist/skills/brainstorming/SKILL.md +89 -0
  7. package/dist/skills/code-patrol/SKILL.md +86 -0
  8. package/dist/skills/context-resume/SKILL.md +95 -0
  9. package/dist/skills/deep-review/SKILL.md +186 -0
  10. package/dist/skills/executing-plans/SKILL.md +91 -0
  11. package/dist/skills/fix-and-learn/SKILL.md +102 -0
  12. package/dist/skills/health-check/SKILL.md +135 -0
  13. package/dist/skills/knowledge-harvest/SKILL.md +97 -0
  14. package/dist/skills/onboard-me/SKILL.md +121 -0
  15. package/dist/skills/parallel-execute/SKILL.md +277 -0
  16. package/dist/skills/retrospective/SKILL.md +98 -0
  17. package/dist/skills/second-opinion/SKILL.md +97 -0
  18. package/dist/skills/systematic-debugging/SKILL.md +103 -0
  19. package/dist/skills/test-driven-development/SKILL.md +91 -0
  20. package/dist/skills/vault-capture/SKILL.md +86 -0
  21. package/dist/skills/vault-navigator/SKILL.md +84 -0
  22. package/dist/skills/vault-smells/SKILL.md +251 -0
  23. package/dist/skills/verification-before-completion/SKILL.md +85 -0
  24. package/dist/skills/writing-plans/SKILL.md +108 -0
  25. package/dist/templates/agents-md.js +2 -2
  26. package/dist/templates/agents-md.js.map +1 -1
  27. package/dist/templates/claude-md-template.js +2 -2
  28. package/dist/templates/claude-md-template.js.map +1 -1
  29. package/dist/templates/shared-rules.js +35 -1
  30. package/dist/templates/shared-rules.js.map +1 -1
  31. package/dist/templates/skills.js +28 -6
  32. package/dist/templates/skills.js.map +1 -1
  33. package/dist/types.d.ts +1 -1
  34. package/dist/types.js +6 -2
  35. package/dist/types.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/__tests__/scaffolder.test.ts +17 -35
  38. package/src/compose-claude-md.ts +1 -1
  39. package/src/scaffold-filetree.ts +12 -1
  40. package/src/skills/brain-debrief/SKILL.md +70 -0
  41. package/src/skills/brainstorming/SKILL.md +89 -0
  42. package/src/skills/code-patrol/SKILL.md +86 -0
  43. package/src/skills/context-resume/SKILL.md +95 -0
  44. package/src/skills/deep-review/SKILL.md +186 -0
  45. package/src/skills/executing-plans/SKILL.md +91 -0
  46. package/src/skills/fix-and-learn/SKILL.md +102 -0
  47. package/src/skills/health-check/SKILL.md +135 -0
  48. package/src/skills/knowledge-harvest/SKILL.md +97 -0
  49. package/src/skills/onboard-me/SKILL.md +121 -0
  50. package/src/skills/parallel-execute/SKILL.md +277 -0
  51. package/src/skills/retrospective/SKILL.md +98 -0
  52. package/src/skills/second-opinion/SKILL.md +97 -0
  53. package/src/skills/systematic-debugging/SKILL.md +103 -0
  54. package/src/skills/test-driven-development/SKILL.md +91 -0
  55. package/src/skills/vault-capture/SKILL.md +86 -0
  56. package/src/skills/vault-navigator/SKILL.md +84 -0
  57. package/src/skills/vault-smells/SKILL.md +251 -0
  58. package/src/skills/verification-before-completion/SKILL.md +85 -0
  59. package/src/skills/writing-plans/SKILL.md +108 -0
  60. package/src/templates/agents-md.ts +2 -2
  61. package/src/templates/claude-md-template.ts +2 -2
  62. package/src/templates/shared-rules.ts +36 -1
  63. package/src/templates/skills.ts +27 -6
  64. package/src/types.ts +7 -2
  65. package/dist/skills/agent-dev.md +0 -122
  66. package/dist/skills/agent-guide.md +0 -110
  67. package/dist/skills/agent-persona.md +0 -66
  68. package/dist/skills/brain-debrief.md +0 -214
  69. package/dist/skills/brainstorming.md +0 -180
  70. package/dist/skills/code-patrol.md +0 -178
  71. package/dist/skills/context-resume.md +0 -146
  72. package/dist/skills/deliver-and-ship.md +0 -123
  73. package/dist/skills/env-setup.md +0 -151
  74. package/dist/skills/executing-plans.md +0 -216
  75. package/dist/skills/fix-and-learn.md +0 -167
  76. package/dist/skills/health-check.md +0 -231
  77. package/dist/skills/knowledge-harvest.md +0 -185
  78. package/dist/skills/onboard-me.md +0 -198
  79. package/dist/skills/retrospective.md +0 -205
  80. package/dist/skills/second-opinion.md +0 -149
  81. package/dist/skills/systematic-debugging.md +0 -241
  82. package/dist/skills/test-driven-development.md +0 -281
  83. package/dist/skills/vault-capture.md +0 -170
  84. package/dist/skills/vault-curate.md +0 -107
  85. package/dist/skills/vault-navigator.md +0 -140
  86. package/dist/skills/verification-before-completion.md +0 -182
  87. package/dist/skills/writing-plans.md +0 -215
  88. package/src/skills/agent-dev.md +0 -122
  89. package/src/skills/agent-guide.md +0 -110
  90. package/src/skills/agent-persona.md +0 -66
  91. package/src/skills/brain-debrief.md +0 -214
  92. package/src/skills/brainstorming.md +0 -180
  93. package/src/skills/code-patrol.md +0 -178
  94. package/src/skills/context-resume.md +0 -146
  95. package/src/skills/deliver-and-ship.md +0 -123
  96. package/src/skills/env-setup.md +0 -151
  97. package/src/skills/executing-plans.md +0 -216
  98. package/src/skills/fix-and-learn.md +0 -167
  99. package/src/skills/health-check.md +0 -231
  100. package/src/skills/knowledge-harvest.md +0 -185
  101. package/src/skills/onboard-me.md +0 -198
  102. package/src/skills/retrospective.md +0 -205
  103. package/src/skills/second-opinion.md +0 -149
  104. package/src/skills/systematic-debugging.md +0 -241
  105. package/src/skills/test-driven-development.md +0 -281
  106. package/src/skills/vault-capture.md +0 -170
  107. package/src/skills/vault-curate.md +0 -107
  108. package/src/skills/vault-navigator.md +0 -140
  109. package/src/skills/verification-before-completion.md +0 -182
  110. package/src/skills/writing-plans.md +0 -215
@@ -0,0 +1,95 @@
1
+ ---
2
+ name: context-resume
3
+ description: >
4
+ Use when the user says "where did I leave off", "what was I working on", "catch me up",
5
+ "resume", "continue where we stopped", or is starting a new session and needs to reconstruct
6
+ working context from memory, plans, and sessions.
7
+ ---
8
+
9
+ # Context Resume — Pick Up Where You Left Off
10
+
11
+ Reconstruct full working context in seconds. Chains memory, plans, sessions, and brain to rebuild exactly where you left off — even across session boundaries and context compactions.
12
+
13
+ ## Steps
14
+
15
+ ### 1. Load Active Plans
16
+
17
+ ```
18
+ YOUR_AGENT_core op:plan_stats
19
+ YOUR_AGENT_core op:get_plan
20
+ YOUR_AGENT_core op:plan_list_tasks
21
+ params: { planId: "<id>" }
22
+ ```
23
+
24
+ Present: plan objective, task status (completed/in-progress/pending), what's next.
25
+
26
+ ### 2. Search Recent Memory
27
+
28
+ ```
29
+ YOUR_AGENT_core op:memory_search
30
+ params: { query: "session summary" }
31
+ YOUR_AGENT_core op:memory_list
32
+ YOUR_AGENT_core op:vault_recent
33
+ ```
34
+
35
+ ### 3. Check Active Loops
36
+
37
+ ```
38
+ YOUR_AGENT_core op:loop_is_active
39
+ YOUR_AGENT_core op:loop_status
40
+ ```
41
+
42
+ ### 4. Brain Snapshot
43
+
44
+ ```
45
+ YOUR_AGENT_core op:brain_strengths
46
+ ```
47
+
48
+ ### 5. System Health
49
+
50
+ ```
51
+ YOUR_AGENT_core op:admin_health
52
+ ```
53
+
54
+ ## Presenting the Resume
55
+
56
+ ```
57
+ ## Where You Left Off
58
+
59
+ **Active Plans:**
60
+ - [Plan name] — X/Y tasks complete, next: [task]
61
+
62
+ **Last Session:**
63
+ - [Summary — what was done, key decisions]
64
+
65
+ **Recent Captures:**
66
+ - [New patterns/anti-patterns added]
67
+
68
+ **Active Loops:**
69
+ - [Any in-progress validation loops]
70
+
71
+ **Brain Says:**
72
+ - [Top relevant patterns]
73
+
74
+ **Health:** [OK / Issues]
75
+
76
+ ## Recommended Next Step
77
+ [Based on active plans and last session context]
78
+ ```
79
+
80
+ ## Common Mistakes
81
+
82
+ - Not checking for active loops (missing mid-flight TDD or debug cycles)
83
+ - Skipping the health check (stale caches can cause confusing behavior)
84
+ - Not loading recent vault captures (missing context from last session)
85
+
86
+ ## Quick Reference
87
+
88
+ | Op | When to Use |
89
+ |----|-------------|
90
+ | `plan_stats` / `get_plan` / `plan_list_tasks` | Active plans |
91
+ | `memory_search` / `memory_list` | Session summaries |
92
+ | `vault_recent` | Recently captured knowledge |
93
+ | `loop_is_active` / `loop_status` | In-flight loops |
94
+ | `brain_strengths` | Relevant proven patterns |
95
+ | `admin_health` | System health check |
@@ -0,0 +1,186 @@
1
+ ---
2
+ name: deep-review
3
+ description: >
4
+ Use for in-depth code review beyond linting — architecture fitness, code smells, solution quality,
5
+ optimization opportunities. Triggers on "deep review", "review this code", "is this well architected",
6
+ "code smells", "review this module", "architecture review", "is this the right approach",
7
+ "optimization review". Works on any codebase. For vault-specific knowledge quality, use vault-smells instead.
8
+ ---
9
+
10
+ # Deep Review — Architecture, Smells & Solution Quality
11
+
12
+ Multi-pass code review that goes beyond surface lint. Analyzes structural health, code smells, architectural fitness, and solution quality. Works on any codebase — vault context is optional enrichment, not a requirement.
13
+
14
+ ## Input
15
+
16
+ The user provides a **target**: file, module, directory, PR diff, or function. If unclear, ask.
17
+
18
+ ## The Three Passes
19
+
20
+ ### Pass 1: Structural Analysis & Code Smells
21
+
22
+ **Metrics** (gather by reading the code):
23
+ - File length and function count
24
+ - Cyclomatic complexity (nesting depth, branch count)
25
+ - Dependency count — imports from how many modules?
26
+ - Export surface area — how much is public vs. should be internal?
27
+
28
+ **Structural Smells:**
29
+ - **God file/class** — too many responsibilities, >300 lines with mixed concerns
30
+ - **Long parameter lists** — function takes 5+ params (should be an object/config)
31
+ - **Deep nesting** — 4+ levels of if/for/try/catch
32
+ - **Shotgun surgery** — changing this code requires touching 5+ other files
33
+ - **Primitive obsession** — passing raw strings/numbers instead of domain types
34
+ - **Boolean blindness** — functions with multiple boolean params (`fn(true, false, true)`)
35
+
36
+ **Duplication Smells:**
37
+ - Copy-paste with slight variations
38
+ - Repeated conditional logic — same if-chain in 3+ places
39
+ - Parallel structures that always change together
40
+
41
+ **Temporal Smells** (check git history):
42
+ - Files that always change together but live in different modules → missing abstraction
43
+ - Functions that get patched repeatedly → wrong abstraction
44
+ - High churn files → instability signal
45
+
46
+ ```
47
+ git log --format=format: --name-only --since="3 months ago" <target-path> | sort | uniq -c | sort -rn | head -20
48
+ ```
49
+
50
+ Present findings before moving to Pass 2.
51
+
52
+ ### Pass 2: Architectural Fitness
53
+
54
+ **Dependency Direction:**
55
+ - Do dependencies flow in the right direction? (Outer layers depend on inner, not reverse)
56
+ - Are there circular dependencies?
57
+ - Does the code reach across module boundaries it shouldn't?
58
+
59
+ **Abstraction Level:**
60
+ - Is this the right level of abstraction for the problem?
61
+ - Over-engineered? (abstraction for one use case, premature generalization)
62
+ - Under-engineered? (inline logic that should be extracted)
63
+
64
+ **Cohesion & Coupling:**
65
+ - Does everything in this module belong together? (high cohesion)
66
+ - Is the module tangled with others? (low coupling desired)
67
+ - Feature envy — does a function touch another module's internals more than its own?
68
+
69
+ **Vault Context** (optional — only if vault is connected):
70
+
71
+ ```
72
+ YOUR_AGENT_core op:search_intelligent
73
+ params: { query: "<module name> architecture pattern" }
74
+ ```
75
+
76
+ If vault has relevant patterns, check alignment. If not, skip — this pass works without vault.
77
+
78
+ ### Pass 3: Solution Quality Assessment
79
+
80
+ **Simplification:**
81
+ - Is there a simpler way to achieve the same result?
82
+ - Could any abstraction be removed without loss?
83
+ - Are there standard library/framework features that replace custom code?
84
+
85
+ **Edge Cases:**
86
+ - What inputs would break this?
87
+ - Are error paths handled or just the happy path?
88
+ - What happens with empty/null/undefined inputs?
89
+ - Concurrency: race conditions, shared mutable state?
90
+
91
+ **Performance:**
92
+ - Any O(n²) or worse hidden in loops?
93
+ - Unnecessary allocations, copies, or serialization?
94
+ - N+1 query patterns?
95
+ - Unbounded growth (arrays/maps that grow without limit)?
96
+
97
+ **Evolutionary Fitness:**
98
+ - How does this code age? Easy to modify in 6 months?
99
+ - Does it create "gravity" — attracting more complexity over time?
100
+ - Are extension points in the right places?
101
+
102
+ ## Presenting the Report
103
+
104
+ ```
105
+ ## Deep Review: [target name]
106
+
107
+ ### Structural Health
108
+ | Metric | Value | Verdict |
109
+ |--------|-------|---------|
110
+ | Lines | X | OK / ⚠️ Large |
111
+ | Functions | X | OK / ⚠️ Many |
112
+ | Max nesting | X | OK / ⚠️ Deep |
113
+ | Dependencies | X | OK / ⚠️ Heavy |
114
+ | Export surface | X public / Y total | OK / ⚠️ Wide |
115
+
116
+ ### Code Smells
117
+ | Smell | Location | Severity | Detail |
118
+ |-------|----------|----------|--------|
119
+ | God file | file.ts | ⚠️ | 450 lines, 3 mixed concerns |
120
+ | Feature envy | fn() → other module | ⚠️ | Reaches into X internals |
121
+ | Deep nesting | line 120-180 | 💡 | 5 levels, consider early returns |
122
+
123
+ ### Architecture
124
+ | Aspect | Assessment |
125
+ |--------|------------|
126
+ | Dependency direction | ✅ Clean / ⚠️ Reverse dep on X |
127
+ | Abstraction level | ✅ Right / ⚠️ Over/Under |
128
+ | Cohesion | ✅ High / ⚠️ Mixed concerns |
129
+ | Coupling | ✅ Low / ⚠️ Tight with X |
130
+
131
+ ### Solution Quality
132
+ | Area | Finding |
133
+ |------|---------|
134
+ | Simplification | [opportunity or "none found"] |
135
+ | Edge cases | [gaps found or "well covered"] |
136
+ | Performance | [concerns or "no issues"] |
137
+ | Evolutionary fitness | [assessment] |
138
+
139
+ ### Recommendations
140
+ | Priority | Action | Impact |
141
+ |----------|--------|--------|
142
+ | 1 | [most impactful] | High |
143
+ | 2 | [second] | Medium |
144
+ ```
145
+
146
+ ## Severity Scale
147
+
148
+ | Level | Meaning |
149
+ |-------|---------|
150
+ | ✅ | Clean — no action needed |
151
+ | 💡 | Info — worth knowing, low priority |
152
+ | ⚠️ | Warning — should fix, causes friction |
153
+ | 🔴 | Critical — fix before shipping, causes bugs or blocks scaling |
154
+
155
+ ## Capturing Learnings (Optional)
156
+
157
+ If the review uncovers a pattern or anti-pattern worth remembering:
158
+
159
+ ```
160
+ YOUR_AGENT_core op:capture_knowledge
161
+ params: {
162
+ title: "<pattern name>",
163
+ description: "<what was found, why it matters>",
164
+ type: "pattern" | "anti-pattern",
165
+ category: "architecture",
166
+ tags: ["code-review", "<specific-tag>"]
167
+ }
168
+ ```
169
+
170
+ Only capture if genuinely reusable — not every review finding is vault-worthy.
171
+
172
+ ## Common Mistakes
173
+
174
+ - Reviewing without reading the full file first (missing context)
175
+ - Reporting every minor style issue as a "smell" (noise kills signal)
176
+ - Suggesting rewrites when the code is adequate (perfect is the enemy of good)
177
+ - Skipping git history (temporal smells are the most actionable)
178
+ - Treating all smells as equal severity (prioritize by impact)
179
+
180
+ ## Quick Reference
181
+
182
+ | Pass | Focus | Key Activities |
183
+ |------|-------|----------------|
184
+ | 1. Structural | Metrics + Smells | Read code, check complexity, find smells, check git history |
185
+ | 2. Architecture | Fitness | Dependency direction, abstraction level, cohesion/coupling |
186
+ | 3. Solution | Quality | Simplification, edge cases, performance, evolution |
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: executing-plans
3
+ description: >
4
+ Use when the user says "execute my plan", "run the plan", "start executing", "implement the
5
+ plan step by step", or has a written plan to execute sequentially with review checkpoints.
6
+ Tasks run one at a time in order. If tasks are independent and can run in parallel, use
7
+ parallel-execute instead.
8
+ ---
9
+
10
+ # Executing Plans
11
+
12
+ Load plan, review critically, execute tasks in batches, report for review between batches.
13
+
14
+ **Announce at start:** "I'm using the executing-plans skill to implement this plan."
15
+
16
+ ## The Process
17
+
18
+ ### Step 1: Load and Review Plan
19
+
20
+ ```
21
+ YOUR_AGENT_core op:get_plan
22
+ YOUR_AGENT_core op:plan_list_tasks
23
+ params: { planId: "<id>" }
24
+ YOUR_AGENT_core op:plan_stats
25
+ ```
26
+
27
+ If no tracked plan exists, read from `docs/plans/`. Review critically — raise concerns before starting.
28
+
29
+ ### Step 2: Start Execution Loop
30
+
31
+ ```
32
+ YOUR_AGENT_core op:loop_start
33
+ params: { prompt: "<plan objective>", mode: "custom" }
34
+ ```
35
+
36
+ ### Step 3: Execute Batch (default: first 3 tasks)
37
+
38
+ For each task:
39
+ 1. `op:update_task` — mark `in_progress`
40
+ 2. Follow each step exactly
41
+ 3. Run verifications as specified
42
+ 4. `op:update_task` — mark `completed`
43
+ 5. `op:loop_iterate` — track progress
44
+
45
+ ### Step 4: Report
46
+
47
+ Show what was implemented, verification output, loop status. Say: "Ready for feedback."
48
+
49
+ ### Step 5: Continue
50
+
51
+ Apply feedback, execute next batch, repeat until complete.
52
+
53
+ ### Step 6: Complete Development
54
+
55
+ 1. Run final verification (use verification-before-completion skill)
56
+ 2. `YOUR_AGENT_core op:loop_complete`
57
+ 3. `YOUR_AGENT_core op:plan_reconcile` — compare planned vs actual
58
+ 4. `YOUR_AGENT_core op:plan_complete_lifecycle` — extract knowledge, archive
59
+ 5. `YOUR_AGENT_core op:session_capture` — save session context
60
+
61
+ Capture mid-execution learnings with `op:capture_quick` as they happen — don't wait until the end.
62
+
63
+ ## When to Stop
64
+
65
+ - Hit a blocker (missing dependency, unclear instruction, repeated test failures)
66
+ - Plan has critical gaps
67
+ - Don't understand an instruction
68
+
69
+ **Ask for clarification rather than guessing.**
70
+
71
+ ## Common Mistakes
72
+
73
+ - Not reviewing the plan critically before starting
74
+ - Skipping verifications to save time
75
+ - Guessing through blockers instead of stopping to ask
76
+ - Forgetting to reconcile the plan after execution (drift data improves future plans)
77
+ - Starting implementation on main/master without explicit consent
78
+
79
+ ## Quick Reference
80
+
81
+ | Op | When to Use |
82
+ |----|-------------|
83
+ | `get_plan` / `plan_list_tasks` / `plan_stats` | Load plan |
84
+ | `update_task` | Mark task status |
85
+ | `loop_start` / `loop_iterate` / `loop_complete` | Validation loop |
86
+ | `plan_reconcile` | Post-execution drift report |
87
+ | `plan_complete_lifecycle` | Extract knowledge, archive |
88
+ | `session_capture` | Save session context |
89
+ | `capture_quick` | Mid-execution learnings |
90
+
91
+ **Related skills:** writing-plans, verification-before-completion, test-driven-development
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: fix-and-learn
3
+ description: >
4
+ Use AFTER a root cause has been identified (typically via systematic-debugging) to execute
5
+ the fix and capture the learning in the vault. Triggers on "fix it", "apply the fix",
6
+ "patch this and remember". Do NOT use as the first response to a bug — use
7
+ systematic-debugging first to find root cause.
8
+ ---
9
+
10
+ # Fix & Learn — Debug, Repair, Capture
11
+
12
+ Fix bugs through a structured recovery workflow, then capture the root cause as a reusable anti-pattern. The learning step makes fixes compound across sessions.
13
+
14
+ ## The Search Order — MANDATORY
15
+
16
+ **Never jump to writing code.** Always follow this lookup order:
17
+
18
+ 1. **Vault first** — has this been solved before?
19
+ 2. **Web search** — is there a known solution?
20
+ 3. **Plan the fix** — design approach before touching code
21
+ 4. **Implement** — only after steps 1-3
22
+
23
+ ## Orchestration Sequence
24
+
25
+ ### Step 1: Classify and Route
26
+
27
+ ```
28
+ YOUR_AGENT_core op:route_intent
29
+ params: { prompt: "<bug description>" }
30
+ ```
31
+
32
+ ### Step 2: Check Vault First
33
+
34
+ ```
35
+ YOUR_AGENT_core op:search_intelligent
36
+ params: { query: "<error message or bug description>" }
37
+ YOUR_AGENT_core op:memory_search
38
+ params: { query: "<bug description>" }
39
+ ```
40
+
41
+ If vault returns a high-confidence match — use it. Don't re-investigate solved problems.
42
+
43
+ ### Step 3: Search the Web
44
+
45
+ If vault has no answer, search for known issues, Stack Overflow answers, GitHub issues, official docs.
46
+
47
+ ### Step 4: Start Fix Loop
48
+
49
+ ```
50
+ YOUR_AGENT_core op:loop_start
51
+ params: { prompt: "Fix: <bug description>", mode: "custom" }
52
+ ```
53
+
54
+ ### Step 5: Diagnose and Fix
55
+
56
+ If Steps 2-3 didn't produce a solution, use systematic-debugging skill:
57
+
58
+ 1. Reproduce the issue
59
+ 2. Isolate root cause
60
+ 3. Plan the fix before writing code
61
+ 4. Implement the fix
62
+ 5. Verify — no regressions
63
+
64
+ ### Step 6: Validate
65
+
66
+ Run test suite. Use verification-before-completion skill. Complete loop: `YOUR_AGENT_core op:loop_complete`.
67
+
68
+ ### Step 7: Capture the Learning
69
+
70
+ ```
71
+ YOUR_AGENT_core op:capture_knowledge
72
+ params: {
73
+ title: "<bug title>",
74
+ description: "<root cause, solution, what made it hard to find>",
75
+ type: "anti-pattern",
76
+ category: "<domain>",
77
+ tags: ["<error-type>", "<component>"]
78
+ }
79
+ ```
80
+
81
+ Run `YOUR_AGENT_core op:curator_detect_duplicates` to avoid redundant entries.
82
+
83
+ ## Exit Criteria
84
+
85
+ Bug resolved, tests pass, root cause captured in vault. A fix without a capture is incomplete.
86
+
87
+ ## Common Mistakes
88
+
89
+ - Jumping to code before searching vault/web
90
+ - Skipping the capture step after fixing
91
+ - Not running the full test suite to check regressions
92
+
93
+ ## Quick Reference
94
+
95
+ | Op | When to Use |
96
+ |----|-------------|
97
+ | `route_intent` | Classify as FIX intent |
98
+ | `search_intelligent` | Check vault for known bugs |
99
+ | `memory_search` | Search session memories |
100
+ | `loop_start` / `loop_iterate` / `loop_complete` | Iterative fix cycle |
101
+ | `capture_knowledge` / `capture_quick` | Persist anti-pattern |
102
+ | `curator_detect_duplicates` | Prevent redundant entries |
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: health-check
3
+ description: >
4
+ Use when the user asks "check health", "system status", "how healthy is the vault",
5
+ "knowledge quality", "run diagnostics", "vault health report", or wants a read-only health
6
+ assessment of the knowledge base — scoring, reporting, finding issues. Does NOT modify vault
7
+ entries. To actively clean, merge, or deduplicate, use vault-curate instead.
8
+ ---
9
+
10
+ # Health Check — Knowledge Base Maintenance
11
+
12
+ Comprehensive maintenance cycle on the knowledge base. Finds stale entries, duplicates, contradictions, and quality issues.
13
+
14
+ ## Steps
15
+
16
+ ### 1. System Health
17
+
18
+ ```
19
+ YOUR_AGENT_core op:admin_health
20
+ YOUR_AGENT_core op:admin_diagnostic
21
+ ```
22
+
23
+ ### 2. Vault Metrics
24
+
25
+ ```
26
+ YOUR_AGENT_core op:admin_vault_size
27
+ YOUR_AGENT_core op:admin_vault_analytics
28
+ YOUR_AGENT_core op:vault_domains
29
+ YOUR_AGENT_core op:vault_tags
30
+ ```
31
+
32
+ ### 3. Quality Audit
33
+
34
+ ```
35
+ YOUR_AGENT_core op:curator_health_audit
36
+ ```
37
+
38
+ ### 4. Find Duplicates
39
+
40
+ ```
41
+ YOUR_AGENT_core op:curator_detect_duplicates
42
+ ```
43
+
44
+ ### 5. Find Contradictions
45
+
46
+ ```
47
+ YOUR_AGENT_core op:curator_contradictions
48
+ YOUR_AGENT_core op:curator_resolve_contradiction
49
+ params: { contradictionId: "<id>" }
50
+ ```
51
+
52
+ ### 6. Find Stale Entries
53
+
54
+ ```
55
+ YOUR_AGENT_core op:vault_age_report
56
+ ```
57
+
58
+ Entries >30 days without updates: refresh, archive, or delete.
59
+
60
+ ### 7. Check Search Quality
61
+
62
+ ```
63
+ YOUR_AGENT_core op:admin_search_insights
64
+ ```
65
+
66
+ ### 8. Memory Health
67
+
68
+ ```
69
+ YOUR_AGENT_core op:memory_stats
70
+ YOUR_AGENT_core op:memory_deduplicate
71
+ ```
72
+
73
+ ### 9. Governance Queue
74
+
75
+ ```
76
+ YOUR_AGENT_core op:governance_proposals params: { action: "list" }
77
+ YOUR_AGENT_core op:governance_expire
78
+ ```
79
+
80
+ ### 10. Fix Everything (Optional, with user approval)
81
+
82
+ - `op:curator_groom_all` — normalize tags, fix metadata
83
+ - `op:curator_consolidate` — deduplicate, normalize, quality-score
84
+ - `op:memory_prune` — remove stale memories
85
+ - `op:brain_build_intelligence` — rebuild with clean data
86
+ - `op:admin_reset_cache` — clear caches
87
+
88
+ ## Presenting the Report
89
+
90
+ ```
91
+ ## Knowledge Health Report
92
+
93
+ ### System
94
+ | Check | Status |
95
+ |-------|--------|
96
+ | Infrastructure | OK / Issues |
97
+
98
+ ### Vault Quality
99
+ | Metric | Value | Status |
100
+ |--------|-------|--------|
101
+ | Total entries | X | — |
102
+ | Quality score | X/100 | Good/Warning/Critical |
103
+
104
+ ### Issues Found
105
+ | Issue | Count | Action |
106
+ |-------|-------|--------|
107
+ | Duplicates | X | Merge |
108
+ | Contradictions | X | Resolve |
109
+ | Stale entries (>30d) | X | Review |
110
+ | Search misses | X | Fill gaps |
111
+
112
+ ### Recommended Actions
113
+ 1. [Most impactful fix]
114
+ 2. [Second most impactful]
115
+ ```
116
+
117
+ ## Common Mistakes
118
+
119
+ - Running cleanup without presenting findings to user first
120
+ - Skipping search insights (missing knowledge gaps)
121
+ - Not rebuilding brain intelligence after major cleanup
122
+
123
+ ## Quick Reference
124
+
125
+ | Op | When to Use |
126
+ |----|-------------|
127
+ | `admin_health` / `admin_diagnostic` | System health |
128
+ | `admin_vault_analytics` / `admin_vault_size` | Vault metrics |
129
+ | `curator_health_audit` | Quality score |
130
+ | `curator_detect_duplicates` | Find duplicates |
131
+ | `curator_contradictions` | Find conflicts |
132
+ | `vault_age_report` | Stale entries |
133
+ | `admin_search_insights` | Search miss analysis |
134
+ | `curator_consolidate` | Full cleanup pipeline |
135
+ | `brain_build_intelligence` | Rebuild after cleanup |
@@ -0,0 +1,97 @@
1
+ ---
2
+ name: knowledge-harvest
3
+ description: >
4
+ Use to EXTRACT multiple patterns from a source — code, docs, PRs, articles. Triggers on
5
+ "learn from this", "harvest knowledge", "ingest this document", "extract patterns from".
6
+ The agent reads the source and identifies what to capture. For saving a single known item,
7
+ use vault-capture instead.
8
+ ---
9
+
10
+ # Knowledge Harvest — Extract Patterns From Anything
11
+
12
+ Point at code, docs, PRs, architecture decisions, or postmortems — the agent extracts every pattern, anti-pattern, decision, and principle, then captures them to the vault.
13
+
14
+ ## Steps
15
+
16
+ ### 1. Understand the Source
17
+
18
+ Read target content and classify: `YOUR_AGENT_core op:route_intent params: { prompt: "Extract knowledge from: <source>" }`
19
+
20
+ ### 2. Check What's Already Known
21
+
22
+ ```
23
+ YOUR_AGENT_core op:search_intelligent
24
+ params: { query: "<topic of source material>" }
25
+ YOUR_AGENT_core op:vault_tags
26
+ YOUR_AGENT_core op:vault_domains
27
+ ```
28
+
29
+ Focus extraction on gaps — skip what vault already covers.
30
+
31
+ ### 3. Extract and Classify
32
+
33
+ | Type | What to Look For |
34
+ |------|-----------------|
35
+ | **pattern** | Repeatable approaches that work |
36
+ | **anti-pattern** | Known mistakes to avoid |
37
+ | **decision** | Architectural choices with rationale |
38
+ | **principle** | Guiding rules or heuristics |
39
+ | **workflow** | Step-by-step procedures |
40
+
41
+ For each: determine category, severity, and tags.
42
+
43
+ ### 4. Batch Capture
44
+
45
+ ```
46
+ YOUR_AGENT_core op:capture_knowledge
47
+ params: {
48
+ title: "<clear, searchable name>",
49
+ description: "<what it is, when to apply, why it matters>",
50
+ type: "<pattern|anti-pattern|decision|principle|workflow>",
51
+ category: "<domain>",
52
+ tags: ["<tag1>", "<tag2>"],
53
+ example: "<code snippet or quote>",
54
+ why: "<reasoning>"
55
+ }
56
+ ```
57
+
58
+ Present each capture as you go: `Captured: api-auth-jwt (pattern, critical)`
59
+
60
+ ### 5. Post-Harvest Quality
61
+
62
+ - `op:curator_detect_duplicates` — find duplicates created during harvest
63
+ - `op:curator_groom_all` — normalize tags, fix metadata
64
+ - `op:curator_contradictions` — check for conflicts
65
+
66
+ ### 6. Verify and Report
67
+
68
+ ```
69
+ ## Harvest Complete
70
+
71
+ Source: [name]
72
+ Extracted: X entries (Y patterns, Z anti-patterns, W decisions)
73
+ Duplicates: N (merged/skipped)
74
+ Contradictions: N (flagged)
75
+ Vault health: OK
76
+ ```
77
+
78
+ Optionally promote universal patterns: `op:memory_promote_to_global`.
79
+
80
+ ## Common Mistakes
81
+
82
+ - Not checking vault before extracting (creates duplicates)
83
+ - Capturing too-granular entries instead of atomic, searchable ones
84
+ - Skipping post-harvest quality checks (duplicates and contradictions accumulate)
85
+
86
+ ## Quick Reference
87
+
88
+ | Op | When to Use |
89
+ |----|-------------|
90
+ | `search_intelligent` | Check existing knowledge |
91
+ | `vault_tags` / `vault_domains` | See what's covered |
92
+ | `capture_knowledge` | Capture each item |
93
+ | `curator_detect_duplicates` | Post-harvest dedup |
94
+ | `curator_groom_all` | Normalize entries |
95
+ | `curator_contradictions` | Find conflicts |
96
+ | `memory_promote_to_global` | Share cross-project |
97
+ | `admin_vault_analytics` | Knowledge quality |