@soleri/cli 1.7.0 → 1.9.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 (59) hide show
  1. package/code-reviewer/.claude/hookify.focus-ring-required.local.md +21 -0
  2. package/code-reviewer/.claude/hookify.no-ai-attribution.local.md +18 -0
  3. package/code-reviewer/.claude/hookify.no-any-types.local.md +18 -0
  4. package/code-reviewer/.claude/hookify.no-console-log.local.md +21 -0
  5. package/code-reviewer/.claude/hookify.no-important.local.md +18 -0
  6. package/code-reviewer/.claude/hookify.no-inline-styles.local.md +21 -0
  7. package/code-reviewer/.claude/hookify.semantic-html.local.md +18 -0
  8. package/code-reviewer/.claude/hookify.ux-touch-targets.local.md +18 -0
  9. package/code-reviewer/.mcp.json +11 -0
  10. package/code-reviewer/README.md +346 -0
  11. package/code-reviewer/package-lock.json +4484 -0
  12. package/code-reviewer/package.json +45 -0
  13. package/code-reviewer/scripts/copy-assets.js +15 -0
  14. package/code-reviewer/scripts/setup.sh +130 -0
  15. package/code-reviewer/skills/brainstorming/SKILL.md +170 -0
  16. package/code-reviewer/skills/code-patrol/SKILL.md +176 -0
  17. package/code-reviewer/skills/context-resume/SKILL.md +143 -0
  18. package/code-reviewer/skills/executing-plans/SKILL.md +201 -0
  19. package/code-reviewer/skills/fix-and-learn/SKILL.md +164 -0
  20. package/code-reviewer/skills/health-check/SKILL.md +225 -0
  21. package/code-reviewer/skills/second-opinion/SKILL.md +142 -0
  22. package/code-reviewer/skills/systematic-debugging/SKILL.md +230 -0
  23. package/code-reviewer/skills/verification-before-completion/SKILL.md +170 -0
  24. package/code-reviewer/skills/writing-plans/SKILL.md +207 -0
  25. package/code-reviewer/src/__tests__/facades.test.ts +598 -0
  26. package/code-reviewer/src/activation/activate.ts +125 -0
  27. package/code-reviewer/src/activation/claude-md-content.ts +217 -0
  28. package/code-reviewer/src/activation/inject-claude-md.ts +113 -0
  29. package/code-reviewer/src/extensions/index.ts +47 -0
  30. package/code-reviewer/src/extensions/ops/example.ts +28 -0
  31. package/code-reviewer/src/identity/persona.ts +62 -0
  32. package/code-reviewer/src/index.ts +278 -0
  33. package/code-reviewer/src/intelligence/data/architecture.json +5 -0
  34. package/code-reviewer/src/intelligence/data/code-review.json +5 -0
  35. package/code-reviewer/tsconfig.json +30 -0
  36. package/code-reviewer/vitest.config.ts +23 -0
  37. package/dist/commands/create.js +6 -0
  38. package/dist/commands/create.js.map +1 -1
  39. package/dist/commands/extend.d.ts +2 -0
  40. package/dist/commands/extend.js +167 -0
  41. package/dist/commands/extend.js.map +1 -0
  42. package/dist/main.js +2 -0
  43. package/dist/main.js.map +1 -1
  44. package/dist/prompts/archetypes.d.ts +21 -0
  45. package/dist/prompts/archetypes.js +183 -0
  46. package/dist/prompts/archetypes.js.map +1 -0
  47. package/dist/prompts/create-wizard.d.ts +1 -1
  48. package/dist/prompts/create-wizard.js +295 -76
  49. package/dist/prompts/create-wizard.js.map +1 -1
  50. package/dist/prompts/playbook.d.ts +63 -0
  51. package/dist/prompts/playbook.js +250 -0
  52. package/dist/prompts/playbook.js.map +1 -0
  53. package/package.json +1 -1
  54. package/src/commands/create.ts +6 -0
  55. package/src/commands/extend.ts +197 -0
  56. package/src/main.ts +2 -0
  57. package/src/prompts/archetypes.ts +212 -0
  58. package/src/prompts/create-wizard.ts +345 -69
  59. package/src/prompts/playbook.ts +301 -0
@@ -0,0 +1,21 @@
1
+ ---
2
+ # Soleri Hook Pack: a11y
3
+ # Version: 1.0.0
4
+ # Rule: focus-ring-required
5
+ name: focus-ring-required
6
+ enabled: true
7
+ event: file
8
+ action: warn
9
+ conditions:
10
+ - field: file_path
11
+ operator: regex_match
12
+ pattern: src/components/ui/.*\.tsx$
13
+ - field: content
14
+ operator: regex_match
15
+ pattern: (<button|<Button|<a\s+href)
16
+ - field: content
17
+ operator: not_regex_match
18
+ pattern: (focus:ring|focus-visible:ring|focus:outline)
19
+ ---
20
+
21
+ ⚠️ **A11y:** Add focus ring for keyboard navigation: `focus:ring-2 focus:ring-accent focus:ring-offset-2`
@@ -0,0 +1,18 @@
1
+ ---
2
+ # Soleri Hook Pack: clean-commits
3
+ # Version: 1.0.0
4
+ # Rule: no-ai-attribution
5
+ name: no-ai-attribution
6
+ enabled: true
7
+ event: bash
8
+ action: block
9
+ conditions:
10
+ - field: command
11
+ operator: regex_match
12
+ pattern: git\s+commit.*(-m|--message)
13
+ - field: command
14
+ operator: regex_match
15
+ pattern: (🤖|Co-Authored-By|Generated with|AI-generated|by Claude|Claude Code|with Claude|noreply@anthropic\.com|Anthropic|Claude\s+(Opus|Sonnet|Haiku))
16
+ ---
17
+
18
+ 🚫 **AI attribution blocked.** Use clean conventional commits: `feat:`, `fix:`, `refactor:`. No 🤖, Claude, Co-Authored-By, or Anthropic references.
@@ -0,0 +1,18 @@
1
+ ---
2
+ # Soleri Hook Pack: typescript-safety
3
+ # Version: 1.0.0
4
+ # Rule: no-any-types
5
+ name: no-any-types
6
+ enabled: true
7
+ event: file
8
+ action: block
9
+ conditions:
10
+ - field: file_path
11
+ operator: regex_match
12
+ pattern: \.(tsx?|jsx?)$
13
+ - field: content
14
+ operator: regex_match
15
+ pattern: (:\s*any(?![a-zA-Z])|as\s+any(?![a-zA-Z])|<any>|Record<string,\s*any>)
16
+ ---
17
+
18
+ 🚫 **Type bypass blocked.** Replace `:any` with specific type or `unknown`. Fix `as any` at the source.
@@ -0,0 +1,21 @@
1
+ ---
2
+ # Soleri Hook Pack: typescript-safety
3
+ # Version: 1.0.0
4
+ # Rule: no-console-log
5
+ name: no-console-log
6
+ enabled: true
7
+ event: file
8
+ action: warn
9
+ conditions:
10
+ - field: file_path
11
+ operator: regex_match
12
+ pattern: src/.*\.(tsx?|jsx?)$
13
+ - field: file_path
14
+ operator: not_regex_match
15
+ pattern: (\.test\.|\.spec\.|\.stories\.)
16
+ - field: content
17
+ operator: regex_match
18
+ pattern: console\.(log|debug|info)\(
19
+ ---
20
+
21
+ ⚠️ **Debug code detected.** Remove `console.log/debug/info` before commit. `console.error/warn` allowed.
@@ -0,0 +1,18 @@
1
+ ---
2
+ # Soleri Hook Pack: css-discipline
3
+ # Version: 1.0.0
4
+ # Rule: no-important
5
+ name: no-important
6
+ enabled: true
7
+ event: file
8
+ action: block
9
+ conditions:
10
+ - field: file_path
11
+ operator: regex_match
12
+ pattern: \.(tsx?|jsx?|css)$
13
+ - field: content
14
+ operator: regex_match
15
+ pattern: '!important'
16
+ ---
17
+
18
+ 🚫 **!important blocked.** Fix specificity instead. Use Tailwind `!` prefix (`!text-error`) only if needed.
@@ -0,0 +1,21 @@
1
+ ---
2
+ # Soleri Hook Pack: css-discipline
3
+ # Version: 1.0.0
4
+ # Rule: no-inline-styles
5
+ name: no-inline-styles
6
+ enabled: true
7
+ event: file
8
+ action: warn
9
+ conditions:
10
+ - field: file_path
11
+ operator: regex_match
12
+ pattern: src/components/.*\.tsx$
13
+ - field: file_path
14
+ operator: not_contains
15
+ pattern: .stories.tsx
16
+ - field: content
17
+ operator: regex_match
18
+ pattern: style=\{\{[^}]*(padding|margin|width|height|fontSize|color|background)[^}]*\}\}
19
+ ---
20
+
21
+ ⚠️ **Inline style detected.** Use Tailwind: `p-4` not `style={{ padding: '16px' }}`. Exception: CSS variables.
@@ -0,0 +1,18 @@
1
+ ---
2
+ # Soleri Hook Pack: a11y
3
+ # Version: 1.0.0
4
+ # Rule: semantic-html
5
+ name: semantic-html
6
+ enabled: true
7
+ event: file
8
+ action: warn
9
+ conditions:
10
+ - field: file_path
11
+ operator: regex_match
12
+ pattern: src/components/.*\.tsx$
13
+ - field: content
14
+ operator: regex_match
15
+ pattern: (<div\s+onClick(?!=)|<span\s+onClick(?!=))
16
+ ---
17
+
18
+ ⚠️ **A11y:** Use `<button>` instead of `<div onClick>`. Semantic HTML provides keyboard support.
@@ -0,0 +1,18 @@
1
+ ---
2
+ # Soleri Hook Pack: a11y
3
+ # Version: 1.0.0
4
+ # Rule: ux-touch-targets
5
+ name: ux-touch-targets
6
+ enabled: true
7
+ event: file
8
+ action: warn
9
+ conditions:
10
+ - field: file_path
11
+ operator: regex_match
12
+ pattern: src/components/.*\.tsx$
13
+ - field: content
14
+ operator: regex_match
15
+ pattern: (<button[^>]*className="[^"]*(?:p-1|p-2|h-6|h-7|h-8|w-6|w-7|w-8)[^"]*"[^>]*>|className="[^"]*(?:p-1|p-2)[^"]*"[^>]*onClick)
16
+ ---
17
+
18
+ ⚠️ **Touch target too small.** Min 44x44px required. Add `min-h-11 min-w-11` to small interactive elements.
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "code-reviewer": {
4
+ "command": "node",
5
+ "args": [
6
+ "dist/index.js"
7
+ ],
8
+ "cwd": "."
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,346 @@
1
+ # Code Reviewer — Catches bugs, enforces code patterns, and reviews pull requests before merge
2
+
3
+ This agent reviews code for quality issues, anti-patterns, naming conventions, test coverage gaps, and architectural violations. It provides actionable feedback with concrete fix suggestions.
4
+
5
+ ## Why Code Reviewer
6
+
7
+ Every team accumulates knowledge — patterns that work, mistakes to avoid, architectural decisions and their reasoning. Without a system, this knowledge lives in people's heads, scattered docs, or buried in Slack threads. When someone leaves or context shifts, it's gone.
8
+
9
+ Code Reviewer is your team's persistent knowledge layer. It:
10
+ - **Remembers** patterns, decisions, and lessons across sessions and projects
11
+ - **Retrieves** the right knowledge at the right time using intelligent search
12
+ - **Learns** from your feedback — accepted suggestions boost similar patterns, dismissed ones fade
13
+ - **Plans** multi-step tasks and tracks execution
14
+ - **Grows** with every interaction — the more you use it, the smarter it gets
15
+
16
+ The agent starts empty. That's intentional. Your expertise is the content; Code Reviewer is the infrastructure that makes it searchable, persistent, and always available.
17
+
18
+ ## Quick Start
19
+
20
+ ```bash
21
+ # 1. Install and build
22
+ cd code-reviewer
23
+ npm install
24
+ npm run build
25
+
26
+ # 2. Add to Claude Code
27
+ ./scripts/setup.sh
28
+
29
+ # 3. Start a new Claude Code session, then say:
30
+ # "Hello, Code Reviewer!"
31
+ ```
32
+
33
+ That's it. Code Reviewer will activate, check your setup, and offer to configure itself.
34
+
35
+ ## Prerequisites
36
+
37
+ - **Node.js 18+** — `node --version` to check
38
+ - **Claude Code** — Anthropic's CLI for Claude (`claude` command)
39
+
40
+ ## What Happens When You Say "Hello, Code Reviewer!"
41
+
42
+ 1. Code Reviewer returns its persona, principles, and tool recommendations
43
+ 2. Claude adopts the Code Reviewer persona for the rest of the session
44
+ 3. Code Reviewer checks if your project has CLAUDE.md integration
45
+ 4. If not, it offers to inject its configuration (facades table, intent detection, knowledge protocol)
46
+
47
+ ## Manual Setup (if setup.sh doesn't work)
48
+
49
+ Add this to `~/.claude/settings.json` under `mcpServers`:
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "code-reviewer": {
55
+ "command": "node",
56
+ "args": ["dist/index.js"],
57
+ "cwd": "/absolute/path/to/code-reviewer"
58
+ }
59
+ }
60
+ }
61
+ ```
62
+
63
+ Then restart Claude Code.
64
+
65
+ ## Domains
66
+
67
+ | Domain | What it covers |
68
+ |--------|---------------|
69
+ | code-review | *Ready for knowledge capture* |
70
+ | architecture | *Ready for knowledge capture* |
71
+
72
+ ## Core Principles
73
+
74
+ - Actionable feedback only
75
+ - Respect existing patterns
76
+ - Simplicity over cleverness
77
+
78
+ ## Built-in Skills
79
+
80
+ Code Reviewer ships with 17 structured workflow skills, invocable via `/<skill-name>` in Claude Code:
81
+
82
+ **Development Workflows:**
83
+
84
+ | Skill | Description |
85
+ |-------|-------------|
86
+ | `/test-driven-development` | Red-green-refactor TDD workflow with vault-informed test patterns |
87
+ | `/systematic-debugging` | Root cause investigation — vault search, web search, then diagnose |
88
+ | `/verification-before-completion` | Evidence-based completion claims with system diagnostics |
89
+ | `/brainstorming` | Collaborative design exploration with vault + web research first |
90
+ | `/writing-plans` | Implementation plans with quality grading and auto-improvement |
91
+ | `/executing-plans` | Batch execution with loop tracking and plan reconciliation |
92
+ | `/fix-and-learn` | Fix bugs and capture root cause — vault search before any fix |
93
+ | `/code-patrol` | Review code against YOUR vault patterns, not generic lint rules |
94
+
95
+ **Knowledge Management:**
96
+
97
+ | Skill | Description |
98
+ |-------|-------------|
99
+ | `/vault-navigator` | Intelligent vault search — tags, domains, age reports, cross-project |
100
+ | `/vault-capture` | Persist knowledge with curator grooming and governance |
101
+ | `/knowledge-harvest` | Point at any doc/code — auto-extract patterns into vault |
102
+ | `/brain-debrief` | Intelligence report — strengths, gaps, cross-project insights |
103
+
104
+ **Magic UX:**
105
+
106
+ | Skill | Description |
107
+ |-------|-------------|
108
+ | `/context-resume` | "What was I working on?" — full context reconstruction |
109
+ | `/second-opinion` | Decision support from vault + brain + web combined |
110
+ | `/retrospective` | Data-driven sprint/week retro from actual metrics |
111
+ | `/onboard-me` | Instant project knowledge tour for newcomers |
112
+ | `/health-check` | Vault maintenance — duplicates, contradictions, stale entries |
113
+
114
+ Skills are installed to `~/.claude/commands/` during setup. Run `./scripts/setup.sh` to install or reinstall.
115
+
116
+ ## Features
117
+
118
+ ### Knowledge Vault
119
+ SQLite-backed knowledge storage with FTS5 full-text search. Domains start empty and grow as you capture patterns.
120
+
121
+ ### Intelligence Layer (Brain)
122
+ A local, zero-dependency intelligence layer that sits between facades and vault:
123
+ - **TF-IDF + Hybrid Scoring** — Re-ranks search results across 5 dimensions: semantic similarity (40%), severity (15%), recency (15%), tag overlap (15%), domain match (15%)
124
+ - **Auto-Tagging** — Extracts tags from title + description using TF-IDF scoring on capture
125
+ - **Duplicate Detection** — Checks similarity before capture: blocks at >= 0.8, warns at >= 0.6
126
+ - **Adaptive Weights** — Tracks accepted/dismissed results; after 30+ feedback entries, scoring weights auto-tune
127
+ - **Graceful Degradation** — Works immediately on empty vaults; falls back to severity + recency when vocabulary is empty
128
+
129
+ ### Memory System
130
+ Captures session summaries, lessons learned, and user preferences. Memories persist across sessions and are searchable.
131
+
132
+ ### Session Capture
133
+ A PreCompact hook automatically captures session summaries before context compaction, preserving context across sessions.
134
+
135
+ ### Planning
136
+ Multi-step task planning with state machine: draft → approved → executing → completed. Plans are surfaced on activation.
137
+
138
+ ### Export
139
+ Export vault knowledge as JSON bundles for version control and sharing.
140
+
141
+ ### LLM Client (Optional)
142
+ Unified OpenAI/Anthropic client with multi-key rotation, circuit breakers, and model routing. Works without configuration — capabilities unlock when API keys are provided.
143
+
144
+ **Setup:**
145
+ Create `~/.code-reviewer/keys.json`:
146
+ ```json
147
+ {
148
+ "openai": ["sk-..."],
149
+ "anthropic": ["sk-ant-..."]
150
+ }
151
+ ```
152
+
153
+ Or set environment variables: `OPENAI_API_KEY`, `ANTHROPIC_API_KEY`.
154
+
155
+ **Model routing** (optional) — `~/.code-reviewer/model-routing.json`:
156
+ ```json
157
+ {
158
+ "routes": [],
159
+ "defaultOpenAIModel": "gpt-4o-mini",
160
+ "defaultAnthropicModel": "claude-sonnet-4-20250514"
161
+ }
162
+ ```
163
+
164
+ Use `llm_status` to check provider availability and key pool health.
165
+
166
+ ## How to Use
167
+
168
+ ### Activating and Deactivating
169
+
170
+ - **"Hello, Code Reviewer!"** — Activate the persona. Claude adopts Code Reviewer's identity, principles, and tool access for the session.
171
+ - **"Goodbye, Code Reviewer!"** — Deactivate. Claude returns to its default behavior.
172
+
173
+ ### Daily Workflow
174
+
175
+ Once active, Code Reviewer works as your domain advisor. Here's how a typical session looks:
176
+
177
+ **Ask for guidance** — Code Reviewer searches its vault and responds with relevant patterns:
178
+ \`\`\`
179
+ You: How should we handle rate limiting?
180
+ Code Reviewer: [searches vault] Based on my patterns, here's what I recommend...
181
+ \`\`\`
182
+
183
+ **Capture knowledge** — When you discover something worth remembering, tell Code Reviewer to capture it:
184
+ \`\`\`
185
+ You: We decided to use token bucket for rate limiting. Capture this as a pattern.
186
+ Code Reviewer: [captures to vault with auto-tags: rate-limiting, token-bucket, api-design]
187
+ \`\`\`
188
+
189
+ **Plan multi-step work** — For larger tasks, Code Reviewer creates trackable plans:
190
+ \`\`\`
191
+ You: Plan out the caching implementation.
192
+ Code Reviewer: Created plan "Add Caching Layer" with 4 tasks:
193
+ 1. Define cache invalidation strategy
194
+ 2. Add Redis client configuration
195
+ 3. Implement cache middleware
196
+ 4. Add cache-related tests
197
+ Approve to start execution?
198
+ \`\`\`
199
+
200
+ **Give feedback** — When Code Reviewer suggests something, your response teaches it:
201
+ \`\`\`
202
+ You: That pattern doesn't apply here — we're using GraphQL, not REST.
203
+ Code Reviewer: [records feedback] Got it. I'll adjust future recommendations.
204
+ \`\`\`
205
+
206
+ **Search across sessions** — Knowledge persists. Next week, next month, different project:
207
+ \`\`\`
208
+ You: What did we decide about rate limiting last month?
209
+ Code Reviewer: [searches vault + memory] You chose token bucket with...
210
+ \`\`\`
211
+
212
+ ### Key Operations
213
+
214
+ | What you want | What to say |
215
+ |---------------|-------------|
216
+ | Search knowledge | Ask any domain question |
217
+ | Capture a pattern | "Capture this as a pattern" / "Remember this" |
218
+ | Create a plan | "Plan out [task]" |
219
+ | Check vault health | "What's in your vault?" / "Vault stats" |
220
+ | Export knowledge | "Export your knowledge as JSON" |
221
+ | Check LLM status | "LLM status" (if API keys configured) |
222
+
223
+ ## Populating Your Agent
224
+
225
+ Code Reviewer starts with an empty vault. Here's how to fill it with knowledge.
226
+
227
+ ### One at a Time (conversational capture)
228
+
229
+ The simplest way — tell Code Reviewer what you've learned and ask it to capture:
230
+
231
+ \`\`\`
232
+ You: We decided to use token bucket for rate limiting with a 100 req/min limit.
233
+ Capture this as a pattern in api-design.
234
+
235
+ Code Reviewer: [captures to vault]
236
+ Captured: api-rate-limiting (pattern, warning)
237
+ Auto-tags: rate-limiting, token-bucket, api-design
238
+ \`\`\`
239
+
240
+ ### Bulk Ingestion (document feed)
241
+
242
+ To populate the vault from existing documents (architecture docs, coding standards, RFCs, post-mortems), paste or reference the document and ask Code Reviewer to extract patterns:
243
+
244
+ \`\`\`
245
+ You: Here's our API design guide: [paste content or file path]
246
+ Read through it and capture every pattern, anti-pattern, and rule
247
+ into the api-design domain.
248
+
249
+ Code Reviewer: [reads document, extracts and captures each pattern]
250
+ Captured 12 entries:
251
+ - api-auth-jwt (pattern, critical) — Always use short-lived JWTs
252
+ - api-no-sql-in-controllers (anti-pattern, warning) — Keep SQL in data layer
253
+ - api-pagination-required (rule, warning) — All list endpoints must paginate
254
+ ...
255
+ \`\`\`
256
+
257
+ This works with any text: wiki pages, Slack threads, PR review comments, meeting notes. Claude acts as the intake pipeline — it reads, classifies, and calls \`capture\` for each extracted entry.
258
+
259
+ ### JSON Bundles (manual or scripted)
260
+
261
+ For programmatic loading, edit the JSON files directly:
262
+
263
+ \`\`\`json
264
+ // src/intelligence/data/api-design.json
265
+ {
266
+ "domain": "api-design",
267
+ "version": "1.0.0",
268
+ "entries": [
269
+ {
270
+ "id": "api-auth-jwt",
271
+ "type": "pattern",
272
+ "domain": "api-design",
273
+ "title": "Use short-lived JWTs for authentication",
274
+ "severity": "critical",
275
+ "description": "Issue JWTs with 15-minute expiry...",
276
+ "tags": ["auth", "jwt", "security"]
277
+ }
278
+ ]
279
+ }
280
+ \`\`\`
281
+
282
+ Then rebuild (\`npm run build\`) to pick up the changes. Entries from JSON bundles load on startup.
283
+
284
+ ### Tips for Building a Useful Vault
285
+
286
+ - **Start with your team's top 10 decisions** — the ones people keep asking about
287
+ - **Capture anti-patterns from real incidents** — what went wrong and why
288
+ - **Use severity wisely** — \`critical\` for must-follow rules, \`warning\` for strong recommendations, \`suggestion\` for nice-to-haves
289
+ - **Let auto-tagging work** — the Brain extracts tags from titles and descriptions automatically. You can add manual tags too, but you don't have to
290
+ - **Export regularly** — \`export\` dumps your vault to JSON for version control and sharing with teammates
291
+
292
+ ## Growing Your Agent
293
+
294
+ Code Reviewer gets smarter through use — no code changes needed:
295
+
296
+ 1. **Capture patterns** — Every time you capture a decision, pattern, or lesson, the vault grows. The Brain auto-tags entries and detects duplicates.
297
+ 2. **Give feedback** — Accept or dismiss suggestions. After 30+ feedback entries, the Brain auto-tunes its scoring weights to match your preferences.
298
+ 3. **Use memory** — Session summaries are captured automatically before context compaction. Lessons and preferences persist across sessions.
299
+ 4. **Register projects** — Register Code Reviewer with multiple projects. It builds context about each one and surfaces relevant knowledge on activation.
300
+ 5. **Export and share** — Export vault knowledge as JSON. Share bundles with teammates or back them up in version control.
301
+
302
+ The more you interact, the more valuable Code Reviewer becomes. A fresh agent with 50+ captured patterns and a month of feedback is significantly more useful than one on day one.
303
+
304
+ ## Roadmap
305
+
306
+ Code Reviewer ships with a solid foundation. Below are optional improvements you can add yourself, ordered by impact.
307
+
308
+ ### 1. Curator Pipeline
309
+ **What:** Background vault maintenance — tag normalization, duplicate merging, quality scoring, stale entry detection.
310
+ **Why:** Without grooming, vault quality degrades over time. Tags drift, duplicates accumulate, outdated entries linger.
311
+ **How:** Add a `src/curator/` module with: a job queue (SQLite-backed), a groom pipeline that scans entries on a schedule, a tag normalizer that consolidates synonyms, and a duplicate detector that merges near-identical entries. Wire it as a `curator` facade with ops like `groom`, `scan`, `normalize_tags`, `merge_duplicates`. Can optionally use the LLM client for GPT-powered classification.
312
+
313
+ ### 2. Document Intake
314
+ **What:** Ingest documents (PDF, markdown, text) into the vault automatically — extract content, classify it, deduplicate, and write entries.
315
+ **Why:** Manual knowledge entry is the biggest friction point. An intake pipeline lets you point at reference material and populate the vault.
316
+ **How:** Add a `src/intake/` module with: a content extractor (start with markdown/text, add PDF via `pdf-parse`), a chunker that splits long documents into entry-sized pieces, a classifier that assigns domain/type/severity (can use LLM or heuristics), and a dedup gate that checks against existing entries before writing. Expose as an `intake` facade op.
317
+
318
+ ### 3. Learning Loop
319
+ **What:** Turn accumulated feedback into measurable improvement — track which suggestions get accepted vs dismissed, extract user preferences, adjust scoring.
320
+ **Why:** The Brain already records feedback and tunes weights after 30+ entries. A full learning loop goes further: it builds a preference profile, identifies which patterns resonate, and deprioritizes ones that get consistently dismissed.
321
+ **How:** Add a `src/learning/` module with: a feedback analyzer that aggregates accept/dismiss rates per tag and per domain, a preference extractor that builds a user profile from feedback patterns, and a scoring adjuster that feeds insights back into the Brain's weight tuner. Run periodically or trigger after N new feedback entries.
322
+
323
+ ### 4. Embeddings & Vector Search
324
+ **What:** Supplement TF-IDF with embedding-based semantic search using OpenAI's embedding API.
325
+ **Why:** TF-IDF is keyword-based — it misses semantic similarity (e.g., "auth" vs "authentication"). Embeddings capture meaning, not just words.
326
+ **How:** Add an embedding service that calls OpenAI's `text-embedding-3-small` via the LLM client, stores vectors in a `vault_embeddings` table, and adds a vector similarity search path to the Brain. Use cosine similarity to rank. Falls back to TF-IDF when no API key is configured.
327
+
328
+ ### 5. Cross-Project Memory
329
+ **What:** Share knowledge and memories across projects — a global pattern pool, project linking, and unified search.
330
+ **Why:** Lessons learned in one project often apply to others. Without cross-project memory, each project starts from zero.
331
+ **How:** Extend the memory system with: a global pool table that stores entries visible to all projects, project link records that connect related projects, and a cross-project search op that queries across all registered projects. Add `scope` (project/global) to memory entries.
332
+
333
+ ### 6. Context Engine
334
+ **What:** Semantic analysis of user messages — intent classification, entity extraction, and context-aware knowledge retrieval.
335
+ **Why:** Currently the agent responds to explicit ops. A context engine lets it understand *what the user means* and proactively retrieve relevant knowledge.
336
+ **How:** Add a `src/context/` module with: an intent classifier (rule-based patterns like "how do I" → PLAN, "this is broken" → FIX), an entity extractor that pulls domain-specific terms from messages, and a knowledge retriever that combines intent + entities to query the vault. Can start rule-based and upgrade to LLM-powered later.
337
+
338
+ ### 7. Proactive Agency
339
+ **What:** The agent doesn't just answer — it anticipates, warns, and suggests without being asked.
340
+ **Why:** Moves the agent from reactive (Q&A) to proactive (advisor). Catches issues before they become problems.
341
+ **How:** Add a `src/agency/` module with: a suggestion generator that surfaces relevant patterns based on context, a warning detector that flags potential issues (e.g., anti-patterns in captured code), and a notification system that delivers insights at the right moment. Wire into Claude Code hooks for file-change triggers.
342
+
343
+ ### 8. Plugin System
344
+ **What:** Runtime-extensible architecture — load, validate, and hot-reload plugins that add new facades, ops, or intelligence.
345
+ **Why:** Lets users extend the agent without modifying core code. Third parties can publish domain-specific plugins.
346
+ **How:** Add a `src/plugins/` module with: a plugin loader that scans a directory for plugin packages, a validator that checks plugin manifests against a schema, a registry that tracks active plugins and their facades, and a hot-reload watcher. Each plugin exports a `register()` function that receives the vault and brain instances.