knowzcode 0.1.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 (73) hide show
  1. package/.claude-plugin/marketplace.json +55 -0
  2. package/.claude-plugin/plugin.json +8 -0
  3. package/LICENSE +121 -0
  4. package/README.md +223 -0
  5. package/agents/analyst.md +121 -0
  6. package/agents/architect.md +121 -0
  7. package/agents/builder.md +155 -0
  8. package/agents/closer.md +148 -0
  9. package/agents/knowledge-migrator.md +349 -0
  10. package/agents/microfix-specialist.md +140 -0
  11. package/agents/reviewer.md +220 -0
  12. package/agents/update-coordinator.md +405 -0
  13. package/bin/knowzcode.mjs +869 -0
  14. package/commands/audit.md +108 -0
  15. package/commands/connect-mcp.md +507 -0
  16. package/commands/fix.md +107 -0
  17. package/commands/init.md +320 -0
  18. package/commands/learn.md +308 -0
  19. package/commands/plan.md +125 -0
  20. package/commands/register.md +724 -0
  21. package/commands/status.md +291 -0
  22. package/commands/telemetry-setup.md +368 -0
  23. package/commands/telemetry.md +188 -0
  24. package/commands/work.md +390 -0
  25. package/knowzcode/automation_manifest.md +59 -0
  26. package/knowzcode/claude_code_execution.md +133 -0
  27. package/knowzcode/enterprise/compliance_manifest.md +132 -0
  28. package/knowzcode/enterprise/compliance_status.md +30 -0
  29. package/knowzcode/enterprise/guidelines/code-quality.md +67 -0
  30. package/knowzcode/enterprise/guidelines/custom/.gitkeep +0 -0
  31. package/knowzcode/enterprise/guidelines/security.md +355 -0
  32. package/knowzcode/enterprise/reports/.gitkeep +0 -0
  33. package/knowzcode/enterprise/templates/guideline-template.md +55 -0
  34. package/knowzcode/gitignore.template +13 -0
  35. package/knowzcode/knowzcode_architecture.md +51 -0
  36. package/knowzcode/knowzcode_log.md +142 -0
  37. package/knowzcode/knowzcode_loop.md +515 -0
  38. package/knowzcode/knowzcode_project.md +233 -0
  39. package/knowzcode/knowzcode_tracker.md +40 -0
  40. package/knowzcode/knowzcode_vaults.md +104 -0
  41. package/knowzcode/mcp_config.md +166 -0
  42. package/knowzcode/planning/Readme.md +6 -0
  43. package/knowzcode/platform_adapters.md +388 -0
  44. package/knowzcode/prompts/Execute_Micro_Fix.md +57 -0
  45. package/knowzcode/prompts/Investigate_Codebase.md +227 -0
  46. package/knowzcode/prompts/Migrate_Knowledge.md +301 -0
  47. package/knowzcode/prompts/Refactor_Node.md +72 -0
  48. package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -0
  49. package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -0
  50. package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -0
  51. package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -0
  52. package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -0
  53. package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -0
  54. package/knowzcode/specs/Readme.md +10 -0
  55. package/knowzcode/telemetry_config.md +89 -0
  56. package/knowzcode/user_preferences.md +120 -0
  57. package/package.json +53 -0
  58. package/skills/alias-resolver.json +15 -0
  59. package/skills/architecture-diff.json +12 -0
  60. package/skills/check-installation-status.json +14 -0
  61. package/skills/continue.md +105 -0
  62. package/skills/environment-guard.json +12 -0
  63. package/skills/generate-workgroup-id.json +25 -0
  64. package/skills/install-knowzcode.json +21 -0
  65. package/skills/load-core-context.json +18 -0
  66. package/skills/log-entry-builder.json +15 -0
  67. package/skills/spec-quality-check.json +14 -0
  68. package/skills/spec-template.json +15 -0
  69. package/skills/spec-validator.json +25 -0
  70. package/skills/start-work.md +224 -0
  71. package/skills/tracker-scan.json +12 -0
  72. package/skills/tracker-update.json +28 -0
  73. package/skills/validate-installation.json +14 -0
@@ -0,0 +1,308 @@
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 match → use that vault
109
+ - If ambiguous → prompt 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.
@@ -0,0 +1,125 @@
1
+ ---
2
+ description: "Research and investigate before implementing"
3
+ argument-hint: "<topic or question>"
4
+ ---
5
+
6
+ # KnowzCode Plan
7
+
8
+ Research a topic, feature, or question using parallel investigation before committing to implementation.
9
+
10
+ **Usage**: `/kc:plan <topic or question>`
11
+
12
+ **Examples**:
13
+ ```
14
+ /kc:plan "is the API using proper error handling?"
15
+ /kc:plan "add user authentication with JWT"
16
+ /kc:plan "how does caching work in this codebase?"
17
+ ```
18
+
19
+ ---
20
+
21
+ ## Step 1: Validate Input
22
+
23
+ If no argument provided, ask: "What would you like me to research?"
24
+
25
+ ## Step 2: Check Initialization
26
+
27
+ If `knowzcode/` doesn't exist, inform user to run `/kc:init` first. STOP.
28
+
29
+ ## Step 3: Launch Parallel Investigation
30
+
31
+ ### Agent Teams Mode (if available)
32
+
33
+ Spawn three teammates to investigate simultaneously:
34
+
35
+ 1. Spawn `analyst` teammate:
36
+ > You are researching "{topic}" from a **code exploration** angle.
37
+ > Read `agents/analyst.md` for your role definition.
38
+ > Read `knowzcode/claude_code_execution.md` for team conventions.
39
+ > Investigate: affected files, dependencies, existing patterns.
40
+ > Max 10 tool calls. Write findings to a concise summary.
41
+
42
+ 2. Spawn `architect` teammate:
43
+ > You are researching "{topic}" from an **architecture** angle.
44
+ > Read `agents/architect.md` for your role definition.
45
+ > Read `knowzcode/claude_code_execution.md` for team conventions.
46
+ > Investigate: layer analysis, design implications, pattern fit.
47
+ > Max 10 tool calls. Write findings to a concise summary.
48
+
49
+ 3. Spawn `reviewer` teammate:
50
+ > You are researching "{topic}" from a **security and quality** angle.
51
+ > Read `agents/reviewer.md` for your role definition.
52
+ > Read `knowzcode/claude_code_execution.md` for team conventions.
53
+ > Investigate: risks, performance concerns, quality gaps.
54
+ > Max 10 tool calls. Write findings to a concise summary.
55
+
56
+ Create three tasks (no dependencies — all run in parallel).
57
+ Wait for all three to complete, then synthesize in Step 5.
58
+
59
+ ### Subagent Mode (fallback)
60
+
61
+ Delegate to three agents in parallel via `Task()`:
62
+ - **analyst**: Code exploration — affected files, dependencies, existing patterns
63
+ - **architect**: Architecture assessment — layer analysis, design implications, pattern fit
64
+ - **reviewer**: Security and quality — risks, performance concerns, quality gaps
65
+
66
+ Each uses focused, efficient scoping (max 10 tool calls).
67
+
68
+ ## Step 4: Check Existing Knowledge (in parallel)
69
+
70
+ While agents investigate, also check:
71
+ - `knowzcode/specs/*.md` for relevant specifications
72
+ - `knowzcode/knowzcode_tracker.md` for related WorkGroups
73
+ - `knowzcode/workgroups/*.md` for prior related work
74
+
75
+ If MCP is configured: `search_knowledge(research_vault, "{topic}")` for past decisions.
76
+
77
+ ## Step 5: Synthesize Findings
78
+
79
+ ```markdown
80
+ ## Investigation: {topic}
81
+
82
+ ### Code Analysis
83
+ {summarized findings from analyst}
84
+
85
+ ### Architecture Assessment
86
+ {summarized findings from architect}
87
+
88
+ ### Security & Quality
89
+ {summarized findings from reviewer}
90
+
91
+ ### Existing Knowledge
92
+ - **Relevant Specs**: {list or "None found"}
93
+ - **Prior WorkGroups**: {list or "None found"}
94
+
95
+ ### Recommended Approaches
96
+
97
+ **Option 1**: {approach}
98
+ - Pros: ...
99
+ - Cons: ...
100
+
101
+ **Option 2**: {approach}
102
+ - Pros: ...
103
+ - Cons: ...
104
+
105
+ ### Risks & Considerations
106
+ {synthesized risks}
107
+
108
+ ---
109
+
110
+ **Ready to implement?** Say "implement", "do option 1", or "go ahead" to start `/kc:work` with this context.
111
+ ```
112
+
113
+ ## Step 6: Listen for Implementation Intent
114
+
115
+ Watch for: "implement", "do it", "go ahead", "option N", "start work", "build this"
116
+
117
+ When triggered, invoke `/kc:work "{original_topic}"` with investigation context.
118
+
119
+ ---
120
+
121
+ ## Notes
122
+
123
+ - Research agents use focused, efficient scoping (max 10 tool calls each)
124
+ - Investigation context is preserved when transitioning to `/kc:work`
125
+ - This replaces the old planning types (strategy, ideas, pre-flight, etc.)