knowzcode 0.1.0 → 0.2.1

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/.claude-plugin/marketplace.json +6 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +132 -73
  4. package/agents/analyst.md +24 -62
  5. package/agents/architect.md +34 -43
  6. package/agents/builder.md +35 -86
  7. package/agents/closer.md +29 -87
  8. package/agents/context-scout.md +54 -0
  9. package/agents/knowledge-migrator.md +7 -7
  10. package/agents/knowz-scout.md +83 -0
  11. package/agents/knowz-scribe.md +155 -0
  12. package/agents/microfix-specialist.md +1 -6
  13. package/agents/reviewer.md +43 -91
  14. package/agents/update-coordinator.md +7 -18
  15. package/bin/knowzcode.mjs +94 -7
  16. package/commands/audit.md +156 -25
  17. package/commands/connect-mcp.md +525 -507
  18. package/commands/fix.md +8 -8
  19. package/commands/init.md +9 -5
  20. package/commands/learn.md +327 -308
  21. package/commands/plan.md +160 -26
  22. package/commands/register.md +21 -12
  23. package/commands/status.md +309 -291
  24. package/commands/telemetry.md +188 -188
  25. package/commands/work.md +577 -114
  26. package/knowzcode/automation_manifest.md +59 -59
  27. package/knowzcode/claude_code_execution.md +228 -22
  28. package/knowzcode/enterprise/compliance_manifest.md +2 -0
  29. package/knowzcode/knowzcode_loop.md +111 -45
  30. package/knowzcode/knowzcode_project.md +48 -233
  31. package/knowzcode/knowzcode_vaults.md +183 -54
  32. package/knowzcode/mcp_config.md +72 -47
  33. package/knowzcode/platform_adapters.md +43 -4
  34. package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
  35. package/knowzcode/prompts/Investigate_Codebase.md +227 -227
  36. package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
  37. package/knowzcode/prompts/Refactor_Node.md +72 -72
  38. package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
  39. package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
  40. package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
  41. package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
  42. package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
  43. package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
  44. package/package.json +1 -1
  45. package/skills/alias-resolver.json +1 -1
  46. package/skills/architecture-diff.json +1 -1
  47. package/skills/check-installation-status.json +1 -1
  48. package/skills/continue.md +24 -4
  49. package/skills/environment-guard.json +1 -1
  50. package/skills/generate-workgroup-id.json +1 -1
  51. package/skills/install-knowzcode.json +1 -1
  52. package/skills/load-core-context.json +1 -1
  53. package/skills/log-entry-builder.json +1 -1
  54. package/skills/spec-quality-check.json +1 -1
  55. package/skills/spec-template.json +1 -1
  56. package/skills/spec-validator.json +1 -1
  57. package/skills/tracker-scan.json +1 -1
  58. package/skills/tracker-update.json +1 -1
  59. package/skills/validate-installation.json +1 -1
package/commands/learn.md CHANGED
@@ -1,308 +1,327 @@
1
- ---
2
- description: Capture learnings to the KnowzCode research vault for organizational knowledge
3
- ---
4
-
5
- # KnowzCode Learning Capture
6
-
7
- You are the **KnowzCode Learning Agent**. Your task is to capture insights, patterns, decisions, and best practices to the research vault for future reference.
8
-
9
- ## Command Syntax
10
-
11
- ```bash
12
- /kc:learn "<insight>" [--category <type>] [--tags <tag1,tag2,...>] [--vault <name-or-id>] [--source <origin>] [--workgroup <wgid>]
13
- ```
14
-
15
- **Parameters:**
16
- - `"<insight>"` - Required. The learning to capture (in quotes)
17
- - `--category <type>` - Optional. Category prefix (pattern, decision, workaround, performance, security, convention)
18
- - `--tags <tags>` - Optional. Comma-separated tags for categorization
19
- - `--vault <name-or-id>` - Optional. Target vault for multi-vault setups
20
- - `--source <origin>` - Optional. Where this learning came from (e.g., "code review", "incident", "meeting", "pair programming")
21
- - `--workgroup <wgid>` - Optional. Explicitly link this learning to a WorkGroup for traceability
22
-
23
- **Examples:**
24
- ```bash
25
- # Simple learning (auto-routes to appropriate vault)
26
- /kc:learn "JWT refresh tokens work better than session cookies for stateless APIs"
27
-
28
- # With category
29
- /kc:learn "Always sanitize user input before SQL queries" --category security
30
-
31
- # With tags
32
- /kc:learn "Repository pattern isolates data access from business logic" --category pattern --tags architecture,data-access
33
-
34
- # Workaround documentation
35
- /kc:learn "Azure Blob SDK v12 has memory leak with large files; use streaming instead" --category workaround --tags azure,blob-storage
36
-
37
- # Explicit vault selection (multi-vault setup)
38
- /kc:learn "New hire checklist for backend developers" --vault "Company Wiki"
39
- /kc:learn "We use Repository pattern for all data access" --vault engineering-knowledge
40
-
41
- # With source and WorkGroup linking
42
- /kc:learn "Rate limiting should be per-user not per-IP" --source "incident postmortem" --category decision
43
- /kc:learn "Use streaming for files >10MB" --workgroup kc-feat-file-upload-20260201-120000
44
- ```
45
-
46
- ## Prerequisites
47
-
48
- - KnowzCode MCP server must be connected
49
- - Research vault must be configured (auto-configured via `/kc:register`)
50
- - Project must be initialized (`/kc:init`)
51
-
52
- **Quickest setup**: Run `/kc:register` - it creates your account AND configures your vault automatically.
53
-
54
- ## Your Task
55
-
56
- Capture the provided insight to the research vault using the MCP `create_knowledge` tool.
57
-
58
- ### Steps to Execute
59
-
60
- 1. **Quick MCP and Vault Detection (FIRST)**
61
-
62
- **Step 1a: Check for `create_knowledge` in your available tools list**
63
-
64
- **If `create_knowledge` is NOT available:**
65
- - MCP server is not connected
66
- - Show helpful setup guidance (see Error Handling section)
67
- - Do NOT attempt any MCP operations
68
- - STOP here
69
-
70
- **Step 1b: Read vault configuration**
71
- - Read `knowzcode/mcp_config.md`
72
- - Look for Research Vault ID under "### Research Vault (Primary)" section
73
- - Check if Vault ID is set (not "(not configured)")
74
-
75
- **If Research Vault ID IS configured:**
76
- - Proceed to step 2
77
-
78
- **If Research Vault ID is "(not configured)" or missing:**
79
- - Show "vault not configured" error:
80
- ```
81
- ❌ Research vault not configured
82
-
83
- Your MCP server is connected, but no vault is set up for learnings.
84
-
85
- Quickest fix:
86
- /kc:register
87
- (Creates account + auto-configures vault)
88
-
89
- Already have an account?
90
- /kc:connect-mcp --configure-vaults
91
- (Prompts for vault ID)
92
-
93
- After setup, run /kc:learn again.
94
- ```
95
- - STOP here
96
-
97
- 2. **Determine Target Vault (Multi-Vault Support)**
98
-
99
- a. Read `knowzcode/knowzcode_vaults.md` for connected vaults
100
- b. Filter for vaults with `type: research`
101
- c. **If only one research vault** use it automatically
102
- d. **If multiple research vaults**:
103
- - Analyze learning content against vault descriptions
104
- - Look for keyword matches:
105
- - "architecture", "pattern", "decision" → vault with architectural content
106
- - "process", "onboarding", "team" → vault with organizational content
107
- - "convention", "standard", "rule" → vault with conventions
108
- - If clear matchuse that vault
109
- - If ambiguousprompt user:
110
- ```
111
- Where should this learning be saved?
112
-
113
- Available vaults:
114
- 1. Engineering Knowledge - "architectural decisions, patterns, conventions"
115
- 2. Company Wiki - "processes, onboarding, team structure"
116
-
117
- Select vault (1-2) or type vault name:
118
- ```
119
- Use AskUserQuestion with vault options.
120
- e. **If no vaults in knowzcode_vaults.md**:
121
- - Fall back to `knowzcode/mcp_config.md` Research Vault ID
122
- - If still not configured show "vault not configured" error
123
-
124
- 3. **Parse command arguments**
125
- - Extract insight text from quotes
126
- - Parse `--category` flag (default: auto-detect)
127
- - Parse `--tags` flag (default: extract from content)
128
- - Parse `--vault` flag (optional: explicit vault selection)
129
- - Parse `--source` flag (optional: origin context like "code review", "incident", "meeting")
130
- - Parse `--workgroup` flag (optional: explicit WorkGroup link for traceability)
131
-
132
- 4. **Detect category (if not provided)**
133
- - Scan insight for signal words:
134
- ```
135
- pattern: "pattern", "reusable", "utility", "helper"
136
- decision: "chose", "decided", "opted", "because"
137
- workaround: "workaround", "limitation", "instead"
138
- performance: "optimized", "faster", "reduced", "cache"
139
- security: "security", "vulnerability", "sanitize", "auth"
140
- convention: "always", "never", "standard", "rule"
141
- ```
142
- - Default to "Note" if no clear category detected
143
-
144
- 5. **Extract/validate tags**
145
- - If `--tags` provided, use those
146
- - Otherwise, extract key terms from insight
147
- - Always include current project name
148
- - Add active WorkGroup ID if applicable
149
-
150
- 6. **Check for duplicates in selected vault**
151
- ```bash
152
- search_knowledge(
153
- query: "{insight summary}",
154
- vaultId: "{selected_vault_id}",
155
- limit: 3
156
- )
157
- ```
158
- - If similar exists (>80% match), warn user:
159
- ```
160
- ⚠️ Similar knowledge exists:
161
- > "{existing title}"
162
-
163
- Options:
164
- [Create anyway] [Skip] [Update existing]
165
- ```
166
-
167
- 7. **Build learning content**
168
- ```markdown
169
- [CONTEXT]
170
- Project: {project-name}
171
- WorkGroup: {--workgroup value or active-workgroup-id or "Manual capture"}
172
- Vault: {selected_vault_name}
173
- Source: {--source value or "KnowzCode /kc:learn command"}
174
- Date: {ISO timestamp}
175
-
176
- [INSIGHT]
177
- {User's insight text}
178
-
179
- [SOURCE]
180
- Captured via /kc:learn command
181
- Origin: {--source value or "direct capture"}
182
- ```
183
-
184
- 8. **Create knowledge item in selected vault**
185
- ```json
186
- create_knowledge({
187
- "content": "{formatted content}",
188
- "title": "{Category}: {Brief summary from insight}",
189
- "knowledgeType": "Note",
190
- "vaultId": "{selected_vault_id}",
191
- "tags": ["{category}", "{extracted-tags}", "{project-name}"],
192
- "source": "KnowzCode /kc:learn"
193
- })
194
- ```
195
-
196
- 9. **Report success with vault info**
197
- ```
198
- Learning captured!
199
-
200
- Title: {Category}: {Brief summary}
201
- Vault: {selected_vault_name} ({vault_id prefix...})
202
- Tags: {tag list}
203
-
204
- This knowledge is now available to all KnowzCode agents when querying this vault.
205
- ```
206
-
207
- ## Category Reference
208
-
209
- | Category | When to Use | Signal Words |
210
- |----------|-------------|--------------|
211
- | `Pattern:` | Reusable code pattern | pattern, reusable, utility, helper, abstraction |
212
- | `Decision:` | Architecture/design choice | chose, decided, opted, because, trade-off |
213
- | `Workaround:` | Limitation bypass | workaround, limitation, instead, temporary, bug |
214
- | `Performance:` | Optimization insight | faster, optimized, reduced, improved, cache |
215
- | `Security:` | Security consideration | security, vulnerability, sanitize, auth, encrypt |
216
- | `Convention:` | Team standard | always, never, standard, rule, convention |
217
-
218
- ## Error Handling
219
-
220
- ### MCP Not Connected (Most Common)
221
- ```
222
- ❌ Learning capture requires MCP connection
223
-
224
- The /kc:learn command needs the KnowzCode MCP server to store
225
- learnings in your organization's research vault.
226
-
227
- To get started:
228
-
229
- Recommended (easiest):
230
- /kc:register
231
- (Creates account + configures MCP + sets up vault - all automatic!)
232
-
233
- Already have an API key?
234
- /kc:connect-mcp <your-api-key>
235
-
236
- After setup, run /kc:learn again to capture your insight.
237
- ```
238
-
239
- ### Research Vault Not Configured
240
- ```
241
- Research vault not configured
242
-
243
- MCP is connected, but no vault is set up for learnings.
244
-
245
- Quickest fix:
246
- /kc:register
247
- (Creates account + auto-configures vault)
248
-
249
- Already have an account?
250
- /kc:connect-mcp --configure-vaults
251
- (Prompts for vault ID)
252
-
253
- After setup, run /kc:learn again.
254
- ```
255
-
256
- ### Project Not Initialized
257
- ```
258
- KnowzCode not initialized
259
-
260
- Run /kc:init first to set up this project, then:
261
- /kc:register (to enable learning capture)
262
- /kc:learn "your insight"
263
- ```
264
-
265
- ### Empty Insight
266
- ```
267
- No insight provided
268
-
269
- Usage: /kc:learn "your insight here"
270
-
271
- Example:
272
- /kc:learn "Always validate user input at API boundaries"
273
- ```
274
-
275
- ## Integration with Workflow
276
-
277
- ### Automatic Capture (via closer)
278
- The `closer` agent automatically detects and offers to capture learnings during WorkGroup finalization. This is the recommended flow for workflow-related insights.
279
-
280
- ### Manual Capture (via /kc:learn)
281
- Use this command for:
282
- - Ad-hoc insights discovered outside of WorkGroups
283
- - Documenting existing team knowledge
284
- - Capturing external learnings (from reviews, meetings, etc.)
285
-
286
- ## Querying Captured Learnings
287
-
288
- After capturing, learnings are queryable by all agents:
289
-
290
- ```bash
291
- # By analyst
292
- search_knowledge("authentication patterns", research_vault)
293
-
294
- # By architect
295
- ask_question("What are our error handling conventions?", research_vault)
296
-
297
- # By builder
298
- search_knowledge("database connection best practices", research_vault)
299
- ```
300
-
301
- ## Related Commands
302
-
303
- - `/kc:connect-mcp` - Configure MCP server and vaults
304
- - `/kc:status` - Check vault configuration
305
- - `/kc:work` - Start feature (uses captured learnings)
306
- - `/kc:audit` - Run audits (checks against documented patterns)
307
-
308
- Execute this learning capture now.
1
+ ---
2
+ description: Capture learnings to the KnowzCode ecosystem vault for organizational knowledge
3
+ ---
4
+
5
+ # KnowzCode Learning Capture
6
+
7
+ You are the **KnowzCode Learning Agent**. Your task is to capture insights, patterns, decisions, and best practices to the appropriate vault for future reference.
8
+
9
+ ## Command Syntax
10
+
11
+ ```bash
12
+ /kc:learn "<insight>" [--category <type>] [--tags <tag1,tag2,...>] [--vault <name-or-id>] [--source <origin>] [--workgroup <wgid>]
13
+ ```
14
+
15
+ **Parameters:**
16
+ - `"<insight>"` - Required. The learning to capture (in quotes)
17
+ - `--category <type>` - Optional. Category prefix (pattern, decision, workaround, performance, security, convention)
18
+ - `--tags <tags>` - Optional. Comma-separated tags for categorization
19
+ - `--vault <name-or-id>` - Optional. Target vault for multi-vault setups
20
+ - `--source <origin>` - Optional. Where this learning came from (e.g., "code review", "incident", "meeting", "pair programming")
21
+ - `--workgroup <wgid>` - Optional. Explicitly link this learning to a WorkGroup for traceability
22
+
23
+ **Examples:**
24
+ ```bash
25
+ # Simple learning (auto-routes to appropriate vault)
26
+ /kc:learn "JWT refresh tokens work better than session cookies for stateless APIs"
27
+
28
+ # With category
29
+ /kc:learn "Always sanitize user input before SQL queries" --category security
30
+
31
+ # With tags
32
+ /kc:learn "Repository pattern isolates data access from business logic" --category pattern --tags architecture,data-access
33
+
34
+ # Workaround documentation
35
+ /kc:learn "Azure Blob SDK v12 has memory leak with large files; use streaming instead" --category workaround --tags azure,blob-storage
36
+
37
+ # Explicit vault selection (multi-vault setup)
38
+ /kc:learn "New hire checklist for backend developers" --vault "Company Wiki"
39
+ /kc:learn "We use Repository pattern for all data access" --vault engineering-knowledge
40
+
41
+ # With source and WorkGroup linking
42
+ /kc:learn "Rate limiting should be per-user not per-IP" --source "incident postmortem" --category decision
43
+ /kc:learn "Use streaming for files >10MB" --workgroup kc-feat-file-upload-20260201-120000
44
+ ```
45
+
46
+ ## Prerequisites
47
+
48
+ - KnowzCode MCP server must be connected
49
+ - Ecosystem vault must be configured (auto-configured via `/kc:register`)
50
+ - Project must be initialized (`/kc:init`)
51
+
52
+ **Quickest setup**: Run `/kc:register` - it creates your account AND configures your vault automatically.
53
+
54
+ ## Your Task
55
+
56
+ Capture the provided insight to the appropriate vault using the MCP `create_knowledge` tool.
57
+
58
+ ### Steps to Execute
59
+
60
+ 1. **Quick MCP and Vault Detection (FIRST)**
61
+
62
+ **Step 1a: Check for `create_knowledge` in your available tools list**
63
+
64
+ **If `create_knowledge` is NOT available:**
65
+ - MCP server is not connected
66
+ - Show helpful setup guidance (see Error Handling section)
67
+ - Do NOT attempt any MCP operations
68
+ - STOP here
69
+
70
+ **Step 1b: Read vault configuration**
71
+ - Read `knowzcode/knowzcode_vaults.md` (canonical vault config)
72
+ - Look for a vault entry with type `ecosystem` that has a non-empty ID
73
+ - If not found, fall back to `knowzcode/mcp_config.md` for backwards compatibility
74
+ - Check if Vault ID is set (not empty or "(not configured)")
75
+
76
+ **If Ecosystem Vault ID IS configured:**
77
+ - Proceed to step 2
78
+
79
+ **If Ecosystem Vault ID is "(not configured)" or missing:**
80
+ - Show "vault not configured" error:
81
+ ```
82
+ ❌ Ecosystem vault not configured
83
+
84
+ Your MCP server is connected, but no vault is set up for learnings.
85
+
86
+ Quickest fix:
87
+ /kc:register
88
+ (Creates account + auto-configures vault)
89
+
90
+ Already have an account?
91
+ /kc:connect-mcp --configure-vaults
92
+ (Prompts for vault ID)
93
+
94
+ After setup, run /kc:learn again.
95
+ ```
96
+ - STOP here
97
+
98
+ 2. **Determine Target Vault (Multi-Vault Support)**
99
+
100
+ a. Read `knowzcode/knowzcode_vaults.md` for connected vaults
101
+ b. Route based on category (see Category-to-Vault Routing below)
102
+ c. **If only one vault of the target type** → use it automatically
103
+ d. **If multiple vaults of the target type**:
104
+ - Analyze learning content against vault descriptions
105
+ - Look for keyword matches:
106
+ - "architecture", "pattern", "decision" → vault with architectural content
107
+ - "process", "onboarding", "team" → vault with organizational content
108
+ - "convention", "standard", "rule"vault with conventions
109
+ - If clear match use that vault
110
+ - If ambiguous → prompt user:
111
+ ```
112
+ Where should this learning be saved?
113
+
114
+ Available vaults:
115
+ 1. Engineering Knowledge - "architectural decisions, patterns, conventions"
116
+ 2. Company Wiki - "processes, onboarding, team structure"
117
+
118
+ Select vault (1-2) or type vault name:
119
+ ```
120
+ Use AskUserQuestion with vault options.
121
+ e. **If no vaults in knowzcode_vaults.md**:
122
+ - Fall back to `knowzcode/mcp_config.md` Ecosystem Vault ID
123
+ - If still not configured → show "vault not configured" error
124
+
125
+ ### Category-to-Vault Routing
126
+
127
+ | Category | Target Vault Type |
128
+ |----------|------------------|
129
+ | `Pattern` | code |
130
+ | `Workaround` | code |
131
+ | `Performance` | code |
132
+ | `Decision` | ecosystem |
133
+ | `Convention` | ecosystem |
134
+ | `Security` | ecosystem |
135
+ | `Integration` | ecosystem |
136
+ | *(completion records)* | finalizations |
137
+ | *(no category / Note)* | ecosystem (default) |
138
+
139
+ If a `finalizations` vault is configured, completion-specific context (e.g., learnings tagged with `--workgroup` or about completed sessions) may be routed there.
140
+
141
+ 3. **Parse command arguments**
142
+ - Extract insight text from quotes
143
+ - Parse `--category` flag (default: auto-detect)
144
+ - Parse `--tags` flag (default: extract from content)
145
+ - Parse `--vault` flag (optional: explicit vault selection)
146
+ - Parse `--source` flag (optional: origin context like "code review", "incident", "meeting")
147
+ - Parse `--workgroup` flag (optional: explicit WorkGroup link for traceability)
148
+
149
+ 4. **Detect category (if not provided)**
150
+ - Scan insight for signal words:
151
+ ```
152
+ pattern: "pattern", "reusable", "utility", "helper"
153
+ decision: "chose", "decided", "opted", "because"
154
+ workaround: "workaround", "limitation", "instead"
155
+ performance: "optimized", "faster", "reduced", "cache"
156
+ security: "security", "vulnerability", "sanitize", "auth"
157
+ convention: "always", "never", "standard", "rule"
158
+ ```
159
+ - Default to "Note" if no clear category detected
160
+
161
+ 5. **Extract/validate tags**
162
+ - If `--tags` provided, use those
163
+ - Otherwise, extract key terms from insight
164
+ - Always include current project name
165
+ - Add active WorkGroup ID if applicable
166
+
167
+ 6. **Check for duplicates in selected vault**
168
+ ```bash
169
+ search_knowledge(
170
+ query: "{insight summary}",
171
+ vaultId: "{selected_vault_id}",
172
+ limit: 3
173
+ )
174
+ ```
175
+ - If similar exists (>80% match), warn user:
176
+ ```
177
+ ⚠️ Similar knowledge exists:
178
+ > "{existing title}"
179
+
180
+ Options:
181
+ [Create anyway] [Skip] [Update existing]
182
+ ```
183
+
184
+ 7. **Build learning content**
185
+ ```markdown
186
+ [CONTEXT]
187
+ Project: {project-name}
188
+ WorkGroup: {--workgroup value or active-workgroup-id or "Manual capture"}
189
+ Vault: {selected_vault_name}
190
+ Source: {--source value or "KnowzCode /kc:learn command"}
191
+ Date: {ISO timestamp}
192
+
193
+ [INSIGHT]
194
+ {User's insight text}
195
+
196
+ [SOURCE]
197
+ Captured via /kc:learn command
198
+ Origin: {--source value or "direct capture"}
199
+ ```
200
+
201
+ 8. **Create knowledge item in selected vault**
202
+ ```json
203
+ create_knowledge({
204
+ "content": "{formatted content}",
205
+ "title": "{Category}: {Brief summary from insight}",
206
+ "knowledgeType": "Note",
207
+ "vaultId": "{selected_vault_id}",
208
+ "tags": ["{category}", "{extracted-tags}", "{project-name}"],
209
+ "source": "KnowzCode /kc:learn"
210
+ })
211
+ ```
212
+
213
+ 9. **Report success with vault info**
214
+ ```
215
+ Learning captured!
216
+
217
+ Title: {Category}: {Brief summary}
218
+ Vault: {selected_vault_name} ({vault_id prefix...})
219
+ Tags: {tag list}
220
+
221
+ This knowledge is now available to all KnowzCode agents when querying this vault.
222
+ ```
223
+
224
+ ## Category Reference
225
+
226
+ | Category | When to Use | Signal Words |
227
+ |----------|-------------|--------------|
228
+ | `Pattern:` | Reusable code pattern | pattern, reusable, utility, helper, abstraction |
229
+ | `Decision:` | Architecture/design choice | chose, decided, opted, because, trade-off |
230
+ | `Workaround:` | Limitation bypass | workaround, limitation, instead, temporary, bug |
231
+ | `Performance:` | Optimization insight | faster, optimized, reduced, improved, cache |
232
+ | `Security:` | Security consideration | security, vulnerability, sanitize, auth, encrypt |
233
+ | `Convention:` | Team standard | always, never, standard, rule, convention |
234
+
235
+ ## Error Handling
236
+
237
+ ### MCP Not Connected (Most Common)
238
+ ```
239
+ Learning capture requires MCP connection
240
+
241
+ The /kc:learn command needs the KnowzCode MCP server to store
242
+ learnings in your organization's knowledge vault.
243
+
244
+ To get started:
245
+
246
+ Recommended (easiest):
247
+ /kc:register
248
+ (Creates account + configures MCP + sets up vault - all automatic!)
249
+
250
+ Already have an API key?
251
+ /kc:connect-mcp <your-api-key>
252
+
253
+ After setup, run /kc:learn again to capture your insight.
254
+ ```
255
+
256
+ ### Ecosystem Vault Not Configured
257
+ ```
258
+ Ecosystem vault not configured
259
+
260
+ MCP is connected, but no vault is set up for learnings.
261
+
262
+ Quickest fix:
263
+ /kc:register
264
+ (Creates account + auto-configures vault)
265
+
266
+ Already have an account?
267
+ /kc:connect-mcp --configure-vaults
268
+ (Prompts for vault ID)
269
+
270
+ After setup, run /kc:learn again.
271
+ ```
272
+
273
+ ### Project Not Initialized
274
+ ```
275
+ KnowzCode not initialized
276
+
277
+ Run /kc:init first to set up this project, then:
278
+ /kc:register (to enable learning capture)
279
+ /kc:learn "your insight"
280
+ ```
281
+
282
+ ### Empty Insight
283
+ ```
284
+ No insight provided
285
+
286
+ Usage: /kc:learn "your insight here"
287
+
288
+ Example:
289
+ /kc:learn "Always validate user input at API boundaries"
290
+ ```
291
+
292
+ ## Integration with Workflow
293
+
294
+ ### Automatic Capture (via closer)
295
+ The `closer` agent automatically detects and offers to capture learnings during WorkGroup finalization. This is the recommended flow for workflow-related insights.
296
+
297
+ ### Manual Capture (via /kc:learn)
298
+ Use this command for:
299
+ - Ad-hoc insights discovered outside of WorkGroups
300
+ - Documenting existing team knowledge
301
+ - Capturing external learnings (from reviews, meetings, etc.)
302
+
303
+ ## Querying Captured Learnings
304
+
305
+ After capturing, learnings are queryable by all agents:
306
+
307
+ ```bash
308
+ # Resolve vault IDs from knowzcode/knowzcode_vaults.md first, then query by type:
309
+
310
+ # By analyst
311
+ search_knowledge("authentication patterns", {vault matching "ecosystem" type})
312
+
313
+ # By architect
314
+ ask_question("What are our error handling conventions?", {vault matching "ecosystem" type})
315
+
316
+ # By builder
317
+ search_knowledge("database connection best practices", {vault matching "ecosystem" type})
318
+ ```
319
+
320
+ ## Related Commands
321
+
322
+ - `/kc:connect-mcp` - Configure MCP server and vaults
323
+ - `/kc:status` - Check vault configuration
324
+ - `/kc:work` - Start feature (uses captured learnings)
325
+ - `/kc:audit` - Run audits (checks against documented patterns)
326
+
327
+ Execute this learning capture now.