knowzcode 0.1.0 → 0.3.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.
- package/.claude-plugin/marketplace.json +9 -3
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +170 -73
- package/agents/analyst.md +24 -62
- package/agents/architect.md +60 -48
- package/agents/builder.md +35 -86
- package/agents/closer.md +29 -87
- package/agents/context-scout.md +54 -0
- package/agents/knowledge-migrator.md +7 -7
- package/agents/knowz-scout.md +83 -0
- package/agents/knowz-scribe.md +155 -0
- package/agents/microfix-specialist.md +1 -6
- package/agents/project-advisor.md +110 -0
- package/agents/reviewer.md +43 -91
- package/agents/security-officer.md +194 -0
- package/agents/test-advisor.md +162 -0
- package/agents/update-coordinator.md +7 -18
- package/bin/knowzcode.mjs +94 -7
- package/commands/audit.md +245 -25
- package/commands/connect-mcp.md +525 -507
- package/commands/fix.md +8 -8
- package/commands/init.md +125 -6
- package/commands/learn.md +327 -308
- package/commands/plan.md +173 -26
- package/commands/register.md +21 -12
- package/commands/status.md +309 -291
- package/commands/telemetry.md +188 -188
- package/commands/work.md +764 -114
- package/knowzcode/automation_manifest.md +59 -59
- package/knowzcode/claude_code_execution.md +291 -22
- package/knowzcode/copilot_execution.md +231 -0
- package/knowzcode/enterprise/compliance_manifest.md +5 -0
- package/knowzcode/knowzcode_loop.md +114 -46
- package/knowzcode/knowzcode_orchestration.md +66 -0
- package/knowzcode/knowzcode_project.md +48 -233
- package/knowzcode/knowzcode_vaults.md +183 -54
- package/knowzcode/mcp_config.md +72 -47
- package/knowzcode/platform_adapters.md +630 -29
- package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
- package/knowzcode/prompts/Investigate_Codebase.md +227 -227
- package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
- package/knowzcode/prompts/Refactor_Node.md +72 -72
- package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
- package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
- package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
- package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
- package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
- package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
- package/package.json +1 -1
- package/skills/alias-resolver.json +1 -1
- package/skills/architecture-diff.json +1 -1
- package/skills/check-installation-status.json +1 -1
- package/skills/continue.md +25 -4
- package/skills/environment-guard.json +1 -1
- package/skills/generate-workgroup-id.json +1 -1
- package/skills/install-knowzcode.json +1 -1
- package/skills/load-core-context.json +1 -1
- package/skills/log-entry-builder.json +1 -1
- package/skills/spec-quality-check.json +1 -1
- package/skills/spec-template.json +1 -1
- package/skills/spec-validator.json +1 -1
- package/skills/tracker-scan.json +1 -1
- package/skills/tracker-update.json +1 -1
- package/skills/validate-installation.json +1 -1
package/commands/learn.md
CHANGED
|
@@ -1,308 +1,327 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Capture learnings to the KnowzCode
|
|
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
|
|
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
|
-
-
|
|
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
|
|
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/
|
|
72
|
-
- Look for
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
-
|
|
105
|
-
|
|
106
|
-
- "
|
|
107
|
-
- "
|
|
108
|
-
|
|
109
|
-
- If
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
After setup, run /kc:learn again.
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
###
|
|
257
|
-
```
|
|
258
|
-
❌
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
```
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
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.
|