knowzcode 0.4.0 → 0.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 (79) hide show
  1. package/.claude-plugin/marketplace.json +61 -61
  2. package/.claude-plugin/plugin.json +8 -8
  3. package/LICENSE +121 -121
  4. package/README.md +379 -354
  5. package/agents/analyst.md +114 -114
  6. package/agents/architect.md +200 -200
  7. package/agents/builder.md +104 -104
  8. package/agents/closer.md +177 -177
  9. package/agents/context-scout.md +54 -54
  10. package/agents/knowledge-migrator.md +349 -349
  11. package/agents/knowz-scout.md +83 -83
  12. package/agents/knowz-scribe.md +180 -180
  13. package/agents/microfix-specialist.md +135 -135
  14. package/agents/project-advisor.md +111 -111
  15. package/agents/reviewer.md +172 -172
  16. package/agents/security-officer.md +194 -194
  17. package/agents/test-advisor.md +162 -162
  18. package/agents/update-coordinator.md +394 -394
  19. package/bin/knowzcode.mjs +1801 -1199
  20. package/commands/audit.md +328 -328
  21. package/commands/connect-mcp.md +574 -549
  22. package/commands/fix.md +107 -107
  23. package/commands/init.md +616 -500
  24. package/commands/learn.md +332 -332
  25. package/commands/plan.md +272 -272
  26. package/commands/register.md +757 -733
  27. package/commands/status.md +338 -309
  28. package/commands/telemetry-setup.md +368 -368
  29. package/commands/telemetry.md +188 -188
  30. package/commands/work.md +1204 -1204
  31. package/knowzcode/automation_manifest.md +59 -59
  32. package/knowzcode/claude_code_execution.md +431 -431
  33. package/knowzcode/copilot_execution.md +231 -231
  34. package/knowzcode/enterprise/compliance_manifest.md +137 -137
  35. package/knowzcode/enterprise/compliance_status.md +30 -30
  36. package/knowzcode/enterprise/guidelines/code-quality.md +67 -67
  37. package/knowzcode/enterprise/guidelines/security.md +355 -355
  38. package/knowzcode/enterprise/templates/guideline-template.md +55 -55
  39. package/knowzcode/gitignore.template +13 -13
  40. package/knowzcode/knowzcode_architecture.md +51 -51
  41. package/knowzcode/knowzcode_log.md +142 -142
  42. package/knowzcode/knowzcode_loop.md +601 -596
  43. package/knowzcode/knowzcode_orchestration.md +66 -66
  44. package/knowzcode/knowzcode_project.md +48 -48
  45. package/knowzcode/knowzcode_tracker.md +40 -40
  46. package/knowzcode/knowzcode_vaults.md +257 -257
  47. package/knowzcode/mcp_config.md +196 -191
  48. package/knowzcode/planning/Readme.md +6 -6
  49. package/knowzcode/platform_adapters.md +2577 -1260
  50. package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
  51. package/knowzcode/prompts/Investigate_Codebase.md +227 -227
  52. package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
  53. package/knowzcode/prompts/Refactor_Node.md +72 -72
  54. package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
  55. package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
  56. package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
  57. package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
  58. package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
  59. package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
  60. package/knowzcode/specs/Readme.md +10 -10
  61. package/knowzcode/telemetry_config.md +89 -89
  62. package/knowzcode/user_preferences.md +120 -120
  63. package/package.json +53 -53
  64. package/skills/alias-resolver.json +15 -15
  65. package/skills/architecture-diff.json +12 -12
  66. package/skills/check-installation-status.json +14 -14
  67. package/skills/continue.md +126 -126
  68. package/skills/environment-guard.json +12 -12
  69. package/skills/generate-workgroup-id.json +25 -25
  70. package/skills/install-knowzcode.json +21 -21
  71. package/skills/load-core-context.json +18 -18
  72. package/skills/log-entry-builder.json +15 -15
  73. package/skills/spec-quality-check.json +14 -14
  74. package/skills/spec-template.json +15 -15
  75. package/skills/spec-validator.json +25 -25
  76. package/skills/start-work.md +224 -224
  77. package/skills/tracker-scan.json +12 -12
  78. package/skills/tracker-update.json +28 -28
  79. package/skills/validate-installation.json +14 -14
@@ -1,257 +1,257 @@
1
- # KnowzCode Vault Configuration
2
-
3
- Multi-vault routing configuration for intelligent vault selection based on query intent and write conditions.
4
-
5
- ---
6
-
7
- ## Connected Vaults
8
-
9
- ### (not created)
10
- - **Name**: Code Patterns
11
- - **ID**:
12
- - **Type**: code
13
- - **Description**: Key learnings, gotchas, takeaways, and architecture insights from the codebase.
14
- - **Write Conditions**:
15
- - After Phase 2A: implementation patterns and workarounds from TDD cycles
16
- - After Phase 3: Pattern/Workaround/Performance learnings from WorkGroup scan
17
- - **Content Filter**: Pattern:, Workaround:, Performance:
18
-
19
- ### (not created)
20
- - **Name**: Ecosystem Knowledge
21
- - **ID**:
22
- - **Type**: ecosystem
23
- - **Description**: Business rules, platform logic, conventions, decisions, and cross-system details. Used for lookups of details beyond scope of current codebase, including how other systems interact.
24
- - **Write Conditions**:
25
- - After Phase 1A: scope decisions, risk assessment
26
- - After Phase 2B: security findings, quality decisions
27
- - After Phase 3: Decision/Convention/Security/Integration learnings
28
- - **Content Filter**: Decision:, Convention:, Security:, Integration:, Scope:
29
-
30
- ### (not created)
31
- - **Name**: Finalizations
32
- - **ID**:
33
- - **Type**: finalizations
34
- - **Description**: Final summaries at WorkGroup completion. All finalization details documenting complete execution and outcomes. Written only when work is verified and WorkGroup is marked completed.
35
- - **Write Conditions**:
36
- - After Phase 3: full WorkGroup summary with goal, NodeIDs, audit score, decisions, outcomes
37
- - **Content Filter**: (completion records)
38
-
39
- ---
40
-
41
- ## Vault Types
42
-
43
- | Type | Purpose | Read By | Written By | Example Queries |
44
- |------|---------|---------|------------|-----------------|
45
- | **code** | Implementation patterns, workarounds, performance | knowz-scout, knowz-scribe, agents | knowz-scribe | "Find auth middleware pattern", "Retry logic workaround" |
46
- | **ecosystem** | Decisions, conventions, security, integrations, business rules | knowz-scout, knowz-scribe, agents | knowz-scribe | "Error handling conventions", "Why Redis over Memcached?" |
47
- | **finalizations** | WorkGroup completion summaries, outcome records | knowz-scout, knowz-scribe | knowz-scribe | "What happened in WG-feat-auth?", "Recent completions" |
48
-
49
- > **Types are user-configurable labels, not framework constants.** Users can add, rename, or create custom vault types freely. The 3 defaults above cover common needs. For example, teams needing compliance tracking can add an `enterprise` type.
50
- >
51
- > **Backwards compatibility**: `research`, `domain`, and `platform` are aliases for `ecosystem`. `sessions` is an alias for `finalizations`. Existing vaults configured with these types continue to work — agents treat aliases identically when resolving vault targets.
52
-
53
- ---
54
-
55
- ## Vault Routing Rules
56
-
57
- ### Read Routing (knowz-scout + agents)
58
-
59
- | Query Type | Description | Target Vault Type |
60
- |------------|-------------|-------------------|
61
- | **Code patterns** | Implementations, patterns, "how did we build X?" | `code` |
62
- | **Decisions / conventions** | Past decisions, best practices, "why did we?" | `ecosystem` |
63
- | **Integration questions** | Third-party APIs, platform behaviors | `ecosystem` |
64
- | **Standards / compliance** | Team standards, audit results | user's enterprise vault (if configured) |
65
- | **Session history** | Past WorkGroups, outcomes | `finalizations` |
66
-
67
- ### Write Routing (knowz-scribe)
68
-
69
- | Learning Category | Target Vault Type | Title Prefix |
70
- |-------------------|-------------------|--------------|
71
- | Pattern | `code` | `Pattern:` |
72
- | Workaround | `code` | `Workaround:` |
73
- | Performance | `code` | `Performance:` |
74
- | Decision | `ecosystem` | `Decision:` |
75
- | Convention | `ecosystem` | `Convention:` |
76
- | Security | `ecosystem` | `Security:` |
77
- | Integration | `ecosystem` | `Integration:` |
78
- | Scope | `ecosystem` | `Scope:` |
79
- | Completion record | `finalizations` | `Completion:` |
80
- | Audit trail (enterprise) | user's enterprise vault | `Audit:` |
81
-
82
- ### How Routing Works
83
-
84
- 1. **For reads**: Agent reads vault descriptions and matches query intent to vault type
85
- 2. **For writes**: Knowz-scribe matches learning category to vault type using the write routing table, then applies the vault's content filter to format the payload
86
- 3. **Fallback**: If no specific match, use the first vault of type `ecosystem`. If only one vault exists, use it for everything
87
-
88
- ---
89
-
90
- ## Uncreated Vault Detection
91
-
92
- Default vault entries ship with an empty **ID** field (null GUID), indicating "not yet created on server."
93
-
94
- ### Detection Points
95
-
96
- Uncreated vaults are detected at multiple points in the workflow:
97
-
98
- 1. **`/kc:register` and `/kc:connect-mcp`** — detect empty IDs during initial setup and prompt to create vaults
99
- 2. **`/kc:work`, `/kc:plan`, and `/kc:audit`** — detect empty IDs during the MCP Probe at workflow start. These commands always call `list_vaults()` regardless of whether vault IDs exist, then present a Vault Setup table showing each uncreated vault's name, type, description, and which phases write to it. The user can create all, select specific vaults, or skip (proceeding without knowledge capture).
100
-
101
- ### Creation Flow
102
-
103
- When uncreated vaults are detected, the user sees:
104
-
105
- ```markdown
106
- ## Vault Setup
107
-
108
- Your Knowz API key is valid and MCP is connected, but {N} default vault(s) haven't been created yet.
109
- Creating vaults enables knowledge capture throughout the workflow:
110
-
111
- | Vault | Type | Description | Written During |
112
- |-------|------|-------------|----------------|
113
- ```
114
-
115
- Table rows are built dynamically from uncreated entries — only showing vaults that haven't been created. The "Written During" column is derived from each vault's Write Conditions field.
116
-
117
- Options: **A) Create all** (recommended), **B) Select which to create**, **C) Skip**.
118
-
119
- On confirmation, each vault is created via the MCP `create_vault(name, description)` tool. If `create_vault` is not available, the command falls back to matching by name against `list_vaults()` results. The entry's **ID** field is updated with the server-returned vault ID. The H3 heading is updated from `(not created)` to the vault ID.
120
-
121
- ---
122
-
123
- ## Write Conditions and Content Filters
124
-
125
- Each vault type defines when it accepts writes (Write Conditions) and how content should be formatted (Content Filter).
126
-
127
- ### Content Detail Principle
128
-
129
- Vault entries live in a vector search index — they are chunked and retrieved via semantic search. Unlike local files (specs, workgroups, logs) which are read directly and benefit from being scannable, vault entries must be **self-contained, detailed, and keyword-rich** because they are discovered by meaning, not by file path.
130
-
131
- **Include in every vault entry:**
132
- - Full reasoning and context — why, not just what
133
- - Specific technology names, library versions, framework details
134
- - Code examples, file paths, error messages where relevant
135
- - Consequences and alternatives considered
136
-
137
- **Anti-pattern** (poor search recall, useless when retrieved):
138
-
139
- > `"[NodeIDs] AuthMiddleware\n[Risk] Medium"`
140
-
141
- **Good pattern** (rich search matches, self-contained on retrieval):
142
-
143
- > `[CONTEXT] During JWT authentication implementation for the Express API, the jsonwebtoken library's verify() method silently accepts expired tokens when clockTolerance is set above 0.`
144
- > `[INSIGHT] Always set clockTolerance to 0 (default) and handle TokenExpiredError explicitly. Some tutorials suggest 30s tolerance which creates a security window where revoked tokens remain valid.`
145
- > `[RATIONALE] A 30-second tolerance means stolen tokens stay usable after revocation. Our auth middleware in src/middleware/auth.ts now checks expiry with zero tolerance.`
146
- > `[TAGS] security, jwt, express, authentication`
147
-
148
- Write vault content as if the reader has no project context — they will find this entry via a search query months from now.
149
-
150
- ### code
151
-
152
- **Write Conditions**: Learning category is Pattern, Workaround, or Performance.
153
-
154
- **Content Filter**:
155
- ```
156
- [CONTEXT] {Where and why the pattern was encountered — include the component, framework, and problem being solved. Provide enough background for someone with no project familiarity.}
157
- [PATTERN] {What was built or discovered — describe the approach, the key insight, and how it differs from the obvious/naive solution.}
158
- [EXAMPLE] {Code snippet, usage example, or file path reference — concrete enough to be directly useful when retrieved.}
159
- [TAGS] {learning category, domain, language, framework — include specific technology names for search discoverability}
160
- ```
161
-
162
- ### ecosystem
163
-
164
- **Write Conditions**: Learning category is Decision, Convention, Security, Scope, or Integration.
165
-
166
- **Content Filter**:
167
- ```
168
- [CONTEXT] {What prompted the decision — the problem, the alternatives considered, and the constraints. Include component names and file paths where relevant.}
169
- [INSIGHT] {The decision, convention, security finding, or integration detail — state it clearly and completely so it stands alone without context.}
170
- [RATIONALE] {Why this approach was chosen over alternatives — include trade-offs, risks of the rejected options, and any conditions that might change this decision.}
171
- [TAGS] {learning category, domain, specific technology names — be generous with tags for search discoverability}
172
- ```
173
-
174
- ### finalizations
175
-
176
- **Write Conditions**: Phase 3 finalization — WorkGroup completion record.
177
-
178
- **Content Filter**:
179
- ```
180
- [GOAL] {Original goal from WorkGroup — restate fully, not just the WorkGroup slug}
181
- [OUTCOME] {success | partial | abandoned — include what was delivered and what was deferred}
182
- [NODES] {NodeIDs changed — list each with a one-line summary of what it covers}
183
- [DURATION] {Phases completed (e.g. "1A-3"), total iterations, any notable delays or blockers}
184
- [SUMMARY] {Key learnings from this WorkGroup — architectural discoveries, patterns established, gotchas encountered. This is the most valuable field for future search queries.}
185
- [TAGS] {finalization, domain, outcome, key technology names}
186
- ```
187
-
188
- ---
189
-
190
- ## Single Vault Model
191
-
192
- KnowzCode works with a single vault. If only one vault is configured (regardless of its declared type), all reads and writes route to it. This is the recommended starting point:
193
-
194
- ```
195
- ┌──────────────────────────────────────────────────────┐
196
- │ KnowzCode Vault │
197
- │ │
198
- │ Purpose: All learnings, decisions, patterns, etc. │
199
- │ Read by: knowz-scout, knowz-scribe, all agents │
200
- │ Written by: knowz-scribe, /kc:learn │
201
- │ Code search: Uses local grep/glob (no code vault) │
202
- │ │
203
- └──────────────────────────────────────────────────────┘
204
- ```
205
-
206
- **Why start with one vault?**
207
- - Simpler onboarding — no vault type decisions needed
208
- - Code search works with grep/glob for most projects
209
- - MCP vault is optimized for organizational knowledge
210
- - Add specialized vaults later via `/kc:connect-mcp --configure-vaults`
211
-
212
- ---
213
-
214
- ## Manual Configuration
215
-
216
- You can manually add vaults by editing this file. Use this format:
217
-
218
- ```markdown
219
- ### {vault-id}
220
- - **Name**: {Display Name}
221
- - **ID**: {vault-id}
222
- - **Type**: code | ecosystem | finalizations | {custom}
223
- - **Description**: {Detailed description of what this vault contains. Be specific about what types of questions should be routed here. Include example queries.}
224
- - **Write Conditions**: {When knowz-scribe should write to this vault}
225
- - **Content Filter**: {Format template for create_knowledge content}
226
- ```
227
-
228
- **Tips for good descriptions:**
229
- - Be specific about content type (patterns vs decisions vs integrations)
230
- - Include example queries that should route to this vault
231
- - Mention key topics or domains covered
232
- - Write conditions should reference learning categories from the routing table
233
-
234
- ---
235
-
236
- ## Integration with Agents
237
-
238
- | Agent | Vault Interaction | Purpose |
239
- |-------|-------------------|---------|
240
- | `knowz-scout` | Read all configured vaults | Find past decisions, conventions, patterns |
241
- | `knowz-scribe` | Read and write to matching vaults | Route and capture learnings |
242
- | `analyst` | Read via knowz-scout | Past decisions + affected code patterns |
243
- | `architect` | Read via knowz-scout | Conventions + implementation examples |
244
- | `builder` | Read via knowz-scout | Best practices + similar patterns |
245
- | `reviewer` | Read via knowz-scout | Standards + precedent checks |
246
- | `closer` | Triggers knowz-scribe captures | Finalization learnings |
247
-
248
- **Fallback behavior**: If vault routing cannot determine the best vault, agents use the first `ecosystem`-type vault or prompt the user.
249
-
250
- ---
251
-
252
- ## Configuration Commands
253
-
254
- - `/kc:register` - Create account and auto-configure first vault
255
- - `/kc:connect-mcp --configure-vaults` - Interactive vault setup
256
- - `/kc:status` - Check vault connection status
257
- - `/kc:learn "insight"` - Manually create learning (routes via knowz-scribe if available, direct write otherwise)
1
+ # KnowzCode Vault Configuration
2
+
3
+ Multi-vault routing configuration for intelligent vault selection based on query intent and write conditions.
4
+
5
+ ---
6
+
7
+ ## Connected Vaults
8
+
9
+ ### (not created)
10
+ - **Name**: Code Patterns
11
+ - **ID**:
12
+ - **Type**: code
13
+ - **Description**: Key learnings, gotchas, takeaways, and architecture insights from the codebase.
14
+ - **Write Conditions**:
15
+ - After Phase 2A: implementation patterns and workarounds from TDD cycles
16
+ - After Phase 3: Pattern/Workaround/Performance learnings from WorkGroup scan
17
+ - **Content Filter**: Pattern:, Workaround:, Performance:
18
+
19
+ ### (not created)
20
+ - **Name**: Ecosystem Knowledge
21
+ - **ID**:
22
+ - **Type**: ecosystem
23
+ - **Description**: Business rules, platform logic, conventions, decisions, and cross-system details. Used for lookups of details beyond scope of current codebase, including how other systems interact.
24
+ - **Write Conditions**:
25
+ - After Phase 1A: scope decisions, risk assessment
26
+ - After Phase 2B: security findings, quality decisions
27
+ - After Phase 3: Decision/Convention/Security/Integration learnings
28
+ - **Content Filter**: Decision:, Convention:, Security:, Integration:, Scope:
29
+
30
+ ### (not created)
31
+ - **Name**: Finalizations
32
+ - **ID**:
33
+ - **Type**: finalizations
34
+ - **Description**: Final summaries at WorkGroup completion. All finalization details documenting complete execution and outcomes. Written only when work is verified and WorkGroup is marked completed.
35
+ - **Write Conditions**:
36
+ - After Phase 3: full WorkGroup summary with goal, NodeIDs, audit score, decisions, outcomes
37
+ - **Content Filter**: (completion records)
38
+
39
+ ---
40
+
41
+ ## Vault Types
42
+
43
+ | Type | Purpose | Read By | Written By | Example Queries |
44
+ |------|---------|---------|------------|-----------------|
45
+ | **code** | Implementation patterns, workarounds, performance | knowz-scout, knowz-scribe, agents | knowz-scribe | "Find auth middleware pattern", "Retry logic workaround" |
46
+ | **ecosystem** | Decisions, conventions, security, integrations, business rules | knowz-scout, knowz-scribe, agents | knowz-scribe | "Error handling conventions", "Why Redis over Memcached?" |
47
+ | **finalizations** | WorkGroup completion summaries, outcome records | knowz-scout, knowz-scribe | knowz-scribe | "What happened in WG-feat-auth?", "Recent completions" |
48
+
49
+ > **Types are user-configurable labels, not framework constants.** Users can add, rename, or create custom vault types freely. The 3 defaults above cover common needs. For example, teams needing compliance tracking can add an `enterprise` type.
50
+ >
51
+ > **Backwards compatibility**: `research`, `domain`, and `platform` are aliases for `ecosystem`. `sessions` is an alias for `finalizations`. Existing vaults configured with these types continue to work — agents treat aliases identically when resolving vault targets.
52
+
53
+ ---
54
+
55
+ ## Vault Routing Rules
56
+
57
+ ### Read Routing (knowz-scout + agents)
58
+
59
+ | Query Type | Description | Target Vault Type |
60
+ |------------|-------------|-------------------|
61
+ | **Code patterns** | Implementations, patterns, "how did we build X?" | `code` |
62
+ | **Decisions / conventions** | Past decisions, best practices, "why did we?" | `ecosystem` |
63
+ | **Integration questions** | Third-party APIs, platform behaviors | `ecosystem` |
64
+ | **Standards / compliance** | Team standards, audit results | user's enterprise vault (if configured) |
65
+ | **Session history** | Past WorkGroups, outcomes | `finalizations` |
66
+
67
+ ### Write Routing (knowz-scribe)
68
+
69
+ | Learning Category | Target Vault Type | Title Prefix |
70
+ |-------------------|-------------------|--------------|
71
+ | Pattern | `code` | `Pattern:` |
72
+ | Workaround | `code` | `Workaround:` |
73
+ | Performance | `code` | `Performance:` |
74
+ | Decision | `ecosystem` | `Decision:` |
75
+ | Convention | `ecosystem` | `Convention:` |
76
+ | Security | `ecosystem` | `Security:` |
77
+ | Integration | `ecosystem` | `Integration:` |
78
+ | Scope | `ecosystem` | `Scope:` |
79
+ | Completion record | `finalizations` | `Completion:` |
80
+ | Audit trail (enterprise) | user's enterprise vault | `Audit:` |
81
+
82
+ ### How Routing Works
83
+
84
+ 1. **For reads**: Agent reads vault descriptions and matches query intent to vault type
85
+ 2. **For writes**: Knowz-scribe matches learning category to vault type using the write routing table, then applies the vault's content filter to format the payload
86
+ 3. **Fallback**: If no specific match, use the first vault of type `ecosystem`. If only one vault exists, use it for everything
87
+
88
+ ---
89
+
90
+ ## Uncreated Vault Detection
91
+
92
+ Default vault entries ship with an empty **ID** field (null GUID), indicating "not yet created on server."
93
+
94
+ ### Detection Points
95
+
96
+ Uncreated vaults are detected at multiple points in the workflow:
97
+
98
+ 1. **`/kc:register` and `/kc:connect-mcp`** — detect empty IDs during initial setup and prompt to create vaults
99
+ 2. **`/kc:work`, `/kc:plan`, and `/kc:audit`** — detect empty IDs during the MCP Probe at workflow start. These commands always call `list_vaults()` regardless of whether vault IDs exist, then present a Vault Setup table showing each uncreated vault's name, type, description, and which phases write to it. The user can create all, select specific vaults, or skip (proceeding without knowledge capture).
100
+
101
+ ### Creation Flow
102
+
103
+ When uncreated vaults are detected, the user sees:
104
+
105
+ ```markdown
106
+ ## Vault Setup
107
+
108
+ Your Knowz API key is valid and MCP is connected, but {N} default vault(s) haven't been created yet.
109
+ Creating vaults enables knowledge capture throughout the workflow:
110
+
111
+ | Vault | Type | Description | Written During |
112
+ |-------|------|-------------|----------------|
113
+ ```
114
+
115
+ Table rows are built dynamically from uncreated entries — only showing vaults that haven't been created. The "Written During" column is derived from each vault's Write Conditions field.
116
+
117
+ Options: **A) Create all** (recommended), **B) Select which to create**, **C) Skip**.
118
+
119
+ On confirmation, each vault is created via the MCP `create_vault(name, description)` tool. If `create_vault` is not available, the command falls back to matching by name against `list_vaults()` results. The entry's **ID** field is updated with the server-returned vault ID. The H3 heading is updated from `(not created)` to the vault ID.
120
+
121
+ ---
122
+
123
+ ## Write Conditions and Content Filters
124
+
125
+ Each vault type defines when it accepts writes (Write Conditions) and how content should be formatted (Content Filter).
126
+
127
+ ### Content Detail Principle
128
+
129
+ Vault entries live in a vector search index — they are chunked and retrieved via semantic search. Unlike local files (specs, workgroups, logs) which are read directly and benefit from being scannable, vault entries must be **self-contained, detailed, and keyword-rich** because they are discovered by meaning, not by file path.
130
+
131
+ **Include in every vault entry:**
132
+ - Full reasoning and context — why, not just what
133
+ - Specific technology names, library versions, framework details
134
+ - Code examples, file paths, error messages where relevant
135
+ - Consequences and alternatives considered
136
+
137
+ **Anti-pattern** (poor search recall, useless when retrieved):
138
+
139
+ > `"[NodeIDs] AuthMiddleware\n[Risk] Medium"`
140
+
141
+ **Good pattern** (rich search matches, self-contained on retrieval):
142
+
143
+ > `[CONTEXT] During JWT authentication implementation for the Express API, the jsonwebtoken library's verify() method silently accepts expired tokens when clockTolerance is set above 0.`
144
+ > `[INSIGHT] Always set clockTolerance to 0 (default) and handle TokenExpiredError explicitly. Some tutorials suggest 30s tolerance which creates a security window where revoked tokens remain valid.`
145
+ > `[RATIONALE] A 30-second tolerance means stolen tokens stay usable after revocation. Our auth middleware in src/middleware/auth.ts now checks expiry with zero tolerance.`
146
+ > `[TAGS] security, jwt, express, authentication`
147
+
148
+ Write vault content as if the reader has no project context — they will find this entry via a search query months from now.
149
+
150
+ ### code
151
+
152
+ **Write Conditions**: Learning category is Pattern, Workaround, or Performance.
153
+
154
+ **Content Filter**:
155
+ ```
156
+ [CONTEXT] {Where and why the pattern was encountered — include the component, framework, and problem being solved. Provide enough background for someone with no project familiarity.}
157
+ [PATTERN] {What was built or discovered — describe the approach, the key insight, and how it differs from the obvious/naive solution.}
158
+ [EXAMPLE] {Code snippet, usage example, or file path reference — concrete enough to be directly useful when retrieved.}
159
+ [TAGS] {learning category, domain, language, framework — include specific technology names for search discoverability}
160
+ ```
161
+
162
+ ### ecosystem
163
+
164
+ **Write Conditions**: Learning category is Decision, Convention, Security, Scope, or Integration.
165
+
166
+ **Content Filter**:
167
+ ```
168
+ [CONTEXT] {What prompted the decision — the problem, the alternatives considered, and the constraints. Include component names and file paths where relevant.}
169
+ [INSIGHT] {The decision, convention, security finding, or integration detail — state it clearly and completely so it stands alone without context.}
170
+ [RATIONALE] {Why this approach was chosen over alternatives — include trade-offs, risks of the rejected options, and any conditions that might change this decision.}
171
+ [TAGS] {learning category, domain, specific technology names — be generous with tags for search discoverability}
172
+ ```
173
+
174
+ ### finalizations
175
+
176
+ **Write Conditions**: Phase 3 finalization — WorkGroup completion record.
177
+
178
+ **Content Filter**:
179
+ ```
180
+ [GOAL] {Original goal from WorkGroup — restate fully, not just the WorkGroup slug}
181
+ [OUTCOME] {success | partial | abandoned — include what was delivered and what was deferred}
182
+ [NODES] {NodeIDs changed — list each with a one-line summary of what it covers}
183
+ [DURATION] {Phases completed (e.g. "1A-3"), total iterations, any notable delays or blockers}
184
+ [SUMMARY] {Key learnings from this WorkGroup — architectural discoveries, patterns established, gotchas encountered. This is the most valuable field for future search queries.}
185
+ [TAGS] {finalization, domain, outcome, key technology names}
186
+ ```
187
+
188
+ ---
189
+
190
+ ## Single Vault Model
191
+
192
+ KnowzCode works with a single vault. If only one vault is configured (regardless of its declared type), all reads and writes route to it. This is the recommended starting point:
193
+
194
+ ```
195
+ ┌──────────────────────────────────────────────────────┐
196
+ │ KnowzCode Vault │
197
+ │ │
198
+ │ Purpose: All learnings, decisions, patterns, etc. │
199
+ │ Read by: knowz-scout, knowz-scribe, all agents │
200
+ │ Written by: knowz-scribe, /kc:learn │
201
+ │ Code search: Uses local grep/glob (no code vault) │
202
+ │ │
203
+ └──────────────────────────────────────────────────────┘
204
+ ```
205
+
206
+ **Why start with one vault?**
207
+ - Simpler onboarding — no vault type decisions needed
208
+ - Code search works with grep/glob for most projects
209
+ - MCP vault is optimized for organizational knowledge
210
+ - Add specialized vaults later via `/kc:connect-mcp --configure-vaults`
211
+
212
+ ---
213
+
214
+ ## Manual Configuration
215
+
216
+ You can manually add vaults by editing this file. Use this format:
217
+
218
+ ```markdown
219
+ ### {vault-id}
220
+ - **Name**: {Display Name}
221
+ - **ID**: {vault-id}
222
+ - **Type**: code | ecosystem | finalizations | {custom}
223
+ - **Description**: {Detailed description of what this vault contains. Be specific about what types of questions should be routed here. Include example queries.}
224
+ - **Write Conditions**: {When knowz-scribe should write to this vault}
225
+ - **Content Filter**: {Format template for create_knowledge content}
226
+ ```
227
+
228
+ **Tips for good descriptions:**
229
+ - Be specific about content type (patterns vs decisions vs integrations)
230
+ - Include example queries that should route to this vault
231
+ - Mention key topics or domains covered
232
+ - Write conditions should reference learning categories from the routing table
233
+
234
+ ---
235
+
236
+ ## Integration with Agents
237
+
238
+ | Agent | Vault Interaction | Purpose |
239
+ |-------|-------------------|---------|
240
+ | `knowz-scout` | Read all configured vaults | Find past decisions, conventions, patterns |
241
+ | `knowz-scribe` | Read and write to matching vaults | Route and capture learnings |
242
+ | `analyst` | Read via knowz-scout | Past decisions + affected code patterns |
243
+ | `architect` | Read via knowz-scout | Conventions + implementation examples |
244
+ | `builder` | Read via knowz-scout | Best practices + similar patterns |
245
+ | `reviewer` | Read via knowz-scout | Standards + precedent checks |
246
+ | `closer` | Triggers knowz-scribe captures | Finalization learnings |
247
+
248
+ **Fallback behavior**: If vault routing cannot determine the best vault, agents use the first `ecosystem`-type vault or prompt the user.
249
+
250
+ ---
251
+
252
+ ## Configuration Commands
253
+
254
+ - `/kc:register` - Create account and auto-configure first vault
255
+ - `/kc:connect-mcp --configure-vaults` - Interactive vault setup
256
+ - `/kc:status` - Check vault connection status
257
+ - `/kc:learn "insight"` - Manually create learning (routes via knowz-scribe if available, direct write otherwise)