knowzcode 0.3.7 → 0.4.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 +354 -320
  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 +1199 -956
  20. package/commands/audit.md +328 -328
  21. package/commands/connect-mcp.md +549 -549
  22. package/commands/fix.md +107 -107
  23. package/commands/init.md +500 -439
  24. package/commands/learn.md +332 -332
  25. package/commands/plan.md +272 -272
  26. package/commands/register.md +733 -733
  27. package/commands/status.md +309 -309
  28. package/commands/telemetry-setup.md +368 -368
  29. package/commands/telemetry.md +188 -188
  30. package/commands/work.md +1204 -1202
  31. package/knowzcode/automation_manifest.md +59 -59
  32. package/knowzcode/claude_code_execution.md +431 -420
  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 +596 -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 +191 -191
  48. package/knowzcode/planning/Readme.md +6 -6
  49. package/knowzcode/platform_adapters.md +1260 -1047
  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 +1 -1
  65. package/skills/architecture-diff.json +1 -1
  66. package/skills/check-installation-status.json +1 -1
  67. package/skills/continue.md +126 -126
  68. package/skills/environment-guard.json +1 -1
  69. package/skills/generate-workgroup-id.json +1 -1
  70. package/skills/install-knowzcode.json +1 -1
  71. package/skills/load-core-context.json +1 -1
  72. package/skills/log-entry-builder.json +1 -1
  73. package/skills/spec-quality-check.json +1 -1
  74. package/skills/spec-template.json +1 -1
  75. package/skills/spec-validator.json +1 -1
  76. package/skills/start-work.md +224 -224
  77. package/skills/tracker-scan.json +1 -1
  78. package/skills/tracker-update.json +1 -1
  79. package/skills/validate-installation.json +1 -1
package/commands/init.md CHANGED
@@ -1,439 +1,500 @@
1
- ---
2
- description: Initialize KnowzCode framework in the current project
3
- ---
4
-
5
- # KnowzCode Project Initialization
6
-
7
- You are the **KnowzCode Initialization Agent**. Set up the KnowzCode framework in the current working directory.
8
-
9
- ## What KnowzCode Provides
10
-
11
- KnowzCode is a structured development methodology that provides:
12
- - **Structured TDD workflow** with quality gates
13
- - **Specification-driven development** with living documentation
14
- - **Comprehensive tracking** of WorkGroups and specifications
15
- - **Platform-agnostic** — works with Claude Code, Codex, Gemini, Cursor, Copilot, and more
16
-
17
- ## Steps to Execute
18
-
19
- ### 1. Check if already initialized
20
-
21
- - Look for existing `knowzcode/` directory
22
- - If exists and has content, ask user:
23
- - **Abort** (preserve existing)
24
- - **Merge** (add missing files only)
25
- - **Overwrite** (reset to templates)
26
-
27
- ### 2. Create directory structure
28
-
29
- ```
30
- knowzcode/
31
- ├── knowzcode_project.md
32
- ├── knowzcode_tracker.md
33
- ├── knowzcode_log.md
34
- ├── knowzcode_architecture.md
35
- ├── knowzcode_loop.md
36
- ├── knowzcode_orchestration.md
37
- ├── platform_adapters.md
38
- ├── environment_context.md
39
- ├── user_preferences.md (if configured)
40
- ├── .gitignore
41
- ├── specs/
42
- ├── workgroups/
43
- ├── prompts/
44
- └── enterprise/ (optional)
45
- ```
46
-
47
- ### 3. Copy template files
48
-
49
- Use the embedded templates below.
50
-
51
- ### 4. Generate environment context
52
-
53
- - Detect project language, framework, tools
54
- - Populate `environment_context.md`
55
- - Include package managers, test runners, build tools
56
-
57
- ### 5. Capture user preferences (optional)
58
-
59
- - Ask: "Would you like to configure development preferences? (optional)"
60
- - If yes: prompt for testing frameworks, code style, quality priorities
61
- - Create `knowzcode/user_preferences.md`
62
-
63
- ### 5.5. Configure orchestration defaults (optional)
64
-
65
- Ask: "Would you like to configure agent orchestration defaults? (optional — can be changed later in knowzcode/knowzcode_orchestration.md)"
66
-
67
- If yes: prompt for:
68
- - Max concurrent builders (1-5, default: 5)
69
- - Scout mode (full/minimal/none, default: full)
70
- - Default specialists (checkboxes: security-officer, test-advisor, project-advisor)
71
- - MCP agents enabled (yes/no, default: yes)
72
-
73
- If no: generate with all defaults.
74
-
75
- Generate `knowzcode/knowzcode_orchestration.md` from the template (always — it's part of the standard file set).
76
-
77
- ### 6. Create .gitignore
78
-
79
- Protect environment-specific files from git:
80
- ```
81
- environment_context.md
82
- workgroups/
83
- *.local.md
84
- .scratch/
85
- ```
86
-
87
- ### 7. Detect AI platforms and generate adapters
88
-
89
- Check which AI platforms are present and offer to generate adapter files.
90
-
91
- **Step 7a: Detect platforms**
92
- ```
93
- CHECK for existing files:
94
- - CLAUDE.md → offer to append KnowzCode section
95
- - AGENTS.md or AGENTS.override.md → offer to generate Codex adapter
96
- - GEMINI.md or ~/.gemini/GEMINI.md → offer to generate Gemini adapter
97
- - .cursor/rules/ or .cursorrules (deprecated) → offer Cursor adapter (.cursor/rules/knowzcode.mdc)
98
- - .github/copilot-instructions.md OR .github/ directory → offer Copilot adapter (full prompt files)
99
- - .windsurf/rules/ or .windsurfrules (deprecated) → offer Windsurf adapter (.windsurf/rules/knowzcode.md)
100
- ```
101
-
102
- **Step 7b: Present options**
103
- ```
104
- PRESENT to user:
105
- "Which AI platform adapters would you like to generate?"
106
- Options:
107
- - Detected platforms only
108
- - All platforms
109
- - Skip (just use knowzcode/ directly)
110
- ```
111
-
112
- **Step 7c: Generate project-specific adapters**
113
-
114
- When generating adapters, inject detected project info to make them project-specific:
115
-
116
- 1. From `environment_context.md`, extract:
117
- - Test runner command (e.g., `npm test`, `pytest`, `dotnet test`)
118
- - Build command (e.g., `npm run build`, `go build`)
119
- - Language/framework (e.g., TypeScript/React, Python/FastAPI)
120
-
121
- 2. Inject into adapter templates where applicable:
122
- - Replace generic test/build references with detected commands
123
- - Add framework-specific notes (e.g., "Use Composer for multi-file React edits" for Cursor)
124
-
125
- 3. For Codex: note that `AGENTS.override.md` can be used for user-local overrides
126
-
127
- **Step 7d: Validate generated adapters**
128
-
129
- After generation, verify each adapter:
130
- - References correct `knowzcode/` file paths
131
- - Contains all 5 phase descriptions
132
- - Mentions TDD enforcement and quality gates
133
- - Includes PAUSE/STOP instructions at quality gates
134
-
135
- Adapter templates are in `knowzcode/platform_adapters.md`. Copy the relevant sections into the appropriate files.
136
-
137
- **Step 7e: Copilot-specific generation**
138
-
139
- When Copilot is selected, generate the full prompt file suite in addition to the instructions file:
140
-
141
- ```
142
- 1. Create .github/ directory if it doesn't exist
143
- 2. Create .github/copilot-instructions.md from platform_adapters.md template Section A
144
- 3. Create .github/prompts/ directory
145
- 4. Generate all 9 prompt files from platform_adapters.md template Section B:
146
- - .github/prompts/kc-work.prompt.md
147
- - .github/prompts/kc-analyze.prompt.md
148
- - .github/prompts/kc-specify.prompt.md
149
- - .github/prompts/kc-implement.prompt.md
150
- - .github/prompts/kc-audit.prompt.md
151
- - .github/prompts/kc-finalize.prompt.md
152
- - .github/prompts/kc-fix.prompt.md
153
- - .github/prompts/kc-plan.prompt.md
154
- - .github/prompts/kc-continue.prompt.md
155
- 5. Replace "vX.Y.Z" in generated files with the current KnowzCode version
156
- 6. Optionally create .vscode/mcp.json skeleton from template Section C
157
- (ask user: "Would you like to generate MCP configuration for VS Code?")
158
- ```
159
-
160
- **Skip Agent Teams enablement for Copilot** Copilot uses single-agent sequential execution.
161
-
162
- **Copilot success message:**
163
- ```
164
- GitHub Copilot adapter generated:
165
- .github/copilot-instructions.md (repository-level instructions)
166
- .github/prompts/kc-work.prompt.md (start workflow: #prompt:kc-work)
167
- .github/prompts/kc-analyze.prompt.md
168
- .github/prompts/kc-specify.prompt.md
169
- .github/prompts/kc-implement.prompt.md
170
- .github/prompts/kc-audit.prompt.md
171
- .github/prompts/kc-finalize.prompt.md
172
- .github/prompts/kc-fix.prompt.md (quick fix: #prompt:kc-fix)
173
- .github/prompts/kc-plan.prompt.md (research: #prompt:kc-plan)
174
- .github/prompts/kc-continue.prompt.md (resume: #prompt:kc-continue)
175
-
176
- Usage in VS Code:
177
- #prompt:kc-work "Build user authentication" — Start a feature
178
- #prompt:kc-fix "Fix login redirect bug" — Quick fix
179
- #prompt:kc-continue Resume where you left off
180
-
181
- See knowzcode/copilot_execution.md for the full execution guide.
182
- ```
183
-
184
- ### 7.5. Enable Agent Teams (Claude Code only)
185
-
186
- If the user is on Claude Code, **actively offer** to enable Agent Teams:
187
-
188
- **Step 7.5a: Ask the user**
189
- ```
190
- "Would you like to enable Agent Teams? (recommended for Claude Code)
191
-
192
- Agent Teams spawns specialized teammates for each workflow phase,
193
- giving you richer multi-agent coordination.
194
-
195
- Without it, KnowzCode uses subagent delegation (works fine, just less interactive)."
196
-
197
- Options:
198
- - Yes, for this project only (recommended)
199
- - Yes, for all projects (writes to ~/.claude/settings.json)
200
- - No (use subagent fallback)
201
- ```
202
-
203
- **Step 7.5b: If yes, create/update the appropriate settings file**
204
-
205
- - **"This project only"** → write to `.claude/settings.local.json` (project-level, gitignored)
206
- - **"All projects"** write to `~/.claude/settings.json` (home-level global config)
207
-
208
- Read the target settings file if it exists. Merge the Agent Teams env var into it:
209
-
210
- ```json
211
- {
212
- "env": {
213
- "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
214
- }
215
- }
216
- ```
217
-
218
- If the file already has other keys, preserve them and merge. If it doesn't exist, create it with the content above.
219
-
220
- **Step 7.5c: Windows note**
221
-
222
- If the platform is Windows (`process.platform === 'win32'` or detected via environment):
223
- ```
224
- Note: On Windows, Agent Teams runs in "in-process" mode by default
225
- (split-pane tmux mode is not supported in Windows Terminal).
226
- This works correctly — no action needed.
227
- ```
228
-
229
- **Step 7.5d: If no, proceed normally** — subagent delegation works without any configuration.
230
-
231
- ### 8. Optional: Set up enterprise compliance (experimental)
232
-
233
- - Ask: "Would you like to set up enterprise compliance features? (optional)"
234
- - If yes: create `knowzcode/enterprise/` directory with manifest and templates
235
- - Compliance is disabled by default
236
-
237
- ### 9. Optional: Configure MCP
238
-
239
- Inform user about enhanced features:
240
- ```
241
- Optional: Connect to KnowzCode Cloud for AI-powered capabilities:
242
- New user? /kc:register
243
- Have a key? /kc:connect-mcp <api-key>
244
- ```
245
-
246
- ### 10. Report success
247
-
248
- ```
249
- KnowzCode initialized successfully!
250
-
251
- Created:
252
- knowzcode/knowzcode_project.md
253
- knowzcode/knowzcode_tracker.md
254
- knowzcode/knowzcode_log.md
255
- knowzcode/knowzcode_architecture.md
256
- knowzcode/knowzcode_loop.md
257
- knowzcode/knowzcode_orchestration.md
258
- knowzcode/platform_adapters.md
259
- knowzcode/.gitignore
260
- knowzcode/specs/
261
- knowzcode/workgroups/
262
- knowzcode/prompts/
263
-
264
- Platform adapters: [list generated adapters or "None (skip)"]
265
-
266
- Agent Teams: [Enabled (.claude/settings.local.json) | Not enabled (subagent fallback)]
267
-
268
- Next steps:
269
- 1. Review knowzcode/knowzcode_project.md and add project details
270
- 2. Start your first feature: /kc:work "your feature description"
271
- 3. Research first: /kc:plan "your question"
272
- ```
273
-
274
- ---
275
-
276
- ## Template Files
277
-
278
- ### knowzcode_project.md
279
- ```markdown
280
- # KnowzCode Project Overview
281
-
282
- **Purpose:** Project context for KnowzCode AI agents.
283
-
284
- ### 1. Project Goal & Core Problem
285
- * **Goal:** [To be filled in during first session]
286
- * **Core Problem Solved:** [To be filled in during first session]
287
-
288
- ### 2. Scope & Key Features
289
- * **Key Features (In Scope):**
290
- * [Feature 1]: [Description]
291
- * **Out of Scope:**
292
- * [Deferred 1]: [Description]
293
-
294
- ### 3. Technology Stack
295
- | Category | Technology | Version | Notes |
296
- |:---------|:-----------|:--------|:------|
297
- | Language(s) | [Detected] | [Detected] | [Auto-detected] |
298
- | Testing | [Detected] | [Detected] | [Auto-detected] |
299
-
300
- ### Links to Other Artifacts
301
- * **Loop Protocol:** `knowzcode/knowzcode_loop.md`
302
- * **Session Log:** `knowzcode/knowzcode_log.md`
303
- * **Architecture:** `knowzcode/knowzcode_architecture.md`
304
- * **Tracker:** `knowzcode/knowzcode_tracker.md`
305
- * **Specifications:** `knowzcode/specs/`
306
- ```
307
-
308
- ### knowzcode_tracker.md
309
- ```markdown
310
- # KnowzCode Status Map (WorkGroup Tracker)
311
-
312
- **Purpose:** Tracks all active and completed WorkGroups.
313
-
314
- ## Active WorkGroups
315
-
316
- *None yet. Run `/kc:work "your feature description"` to create your first WorkGroup.*
317
-
318
- ## Completed WorkGroups
319
-
320
- *None yet.*
321
-
322
- **Next WorkGroup ID:** WG-001
323
- ```
324
-
325
- ### knowzcode_log.md
326
- ```markdown
327
- # KnowzCode Operational Record
328
-
329
- **Purpose:** Session log and quality criteria reference.
330
-
331
- ## Recent Sessions
332
-
333
- *No sessions yet.*
334
-
335
- ## Reference Quality Criteria
336
-
337
- 1. **Reliability:** Robust error handling, graceful degradation
338
- 2. **Maintainability:** Clear code structure, good naming, modularity
339
- 3. **Security:** Input validation, secure authentication, data protection
340
- 4. **Performance:** Efficient algorithms, optimized queries
341
- 5. **Testability:** Comprehensive test coverage, clear test cases
342
- ```
343
-
344
- ### knowzcode_architecture.md
345
- ```markdown
346
- # KnowzCode Architecture Documentation
347
-
348
- **Purpose:** Living architecture documentation for this project.
349
-
350
- ## System Architecture
351
-
352
- *To be populated during first feature development.*
353
-
354
- ## Key Components
355
-
356
- *To be populated during implementation.*
357
-
358
- ## Data Flow
359
-
360
- *To be populated during implementation.*
361
- ```
362
-
363
- ### environment_context.md
364
- ```markdown
365
- # KnowzCode Environment Context
366
-
367
- **Purpose:** Environment and tooling information.
368
-
369
- ## Detected Environment
370
-
371
- **Platform:** [Auto-detected]
372
- **Language:** [Auto-detected]
373
- **Package Manager:** [Auto-detected]
374
- **Test Runner:** [Auto-detected]
375
- ```
376
-
377
- ### knowzcode_orchestration.md
378
- ```markdown
379
- # KnowzCode Orchestration Configuration
380
-
381
- **Purpose:** Project-level defaults for team sizing and agent orchestration. Read by `/kc:work` and `/kc:audit` at startup. Per-invocation flags override these settings.
382
-
383
- ---
384
-
385
- ## Builder Configuration
386
-
387
- ```yaml
388
- max_builders: 5
389
- ```
390
-
391
- ---
392
-
393
- ## Scout Configuration
394
-
395
- ```yaml
396
- scout_mode: full
397
- ```
398
-
399
- ---
400
-
401
- ## Specialist Defaults
402
-
403
- ```yaml
404
- default_specialists: []
405
- ```
406
-
407
- ---
408
-
409
- ## MCP Agent Configuration
410
-
411
- ```yaml
412
- mcp_agents_enabled: true
413
- ```
414
-
415
- ---
416
-
417
- ## Override Precedence
418
-
419
- | Setting | Config Default | Flag Override |
420
- |---------|---------------|--------------|
421
- | max_builders | `max_builders:` | `--max-builders=N` |
422
- | scout_mode | `scout_mode:` | `--no-scouts` |
423
- | default_specialists | `default_specialists:` | `--specialists`, `--no-specialists` |
424
- | mcp_agents_enabled | `mcp_agents_enabled:` | `--no-mcp` |
425
-
426
- Per-invocation flags always win. `--specialists` adds to defaults; `--no-specialists` clears all.
427
- ```
428
-
429
- ---
430
-
431
- ## Error Handling
432
-
433
- If initialization fails:
434
- 1. Report which step failed
435
- 2. Show partial progress
436
- 3. Suggest remediation
437
- 4. Offer to clean up
438
-
439
- Execute this initialization now.
1
+ ---
2
+ description: Initialize KnowzCode framework in the current project
3
+ ---
4
+
5
+ # KnowzCode Project Initialization
6
+
7
+ You are the **KnowzCode Initialization Agent**. Set up the KnowzCode framework in the current working directory.
8
+
9
+ ## What KnowzCode Provides
10
+
11
+ KnowzCode is a structured development methodology that provides:
12
+ - **Structured TDD workflow** with quality gates
13
+ - **Specification-driven development** with living documentation
14
+ - **Comprehensive tracking** of WorkGroups and specifications
15
+ - **Platform-agnostic** — works with Claude Code, Codex, Gemini, Cursor, Copilot, and more
16
+
17
+ ## Steps to Execute
18
+
19
+ ### 1. Check if already initialized
20
+
21
+ - Look for existing `knowzcode/` directory
22
+ - If exists and has content, ask user:
23
+ - **Abort** (preserve existing)
24
+ - **Merge** (add missing files only)
25
+ - **Overwrite** (reset to templates)
26
+
27
+ ### 2. Create directory structure
28
+
29
+ ```
30
+ knowzcode/
31
+ ├── knowzcode_project.md
32
+ ├── knowzcode_tracker.md
33
+ ├── knowzcode_log.md
34
+ ├── knowzcode_architecture.md
35
+ ├── knowzcode_loop.md
36
+ ├── knowzcode_orchestration.md
37
+ ├── platform_adapters.md
38
+ ├── environment_context.md
39
+ ├── user_preferences.md (if configured)
40
+ ├── .gitignore
41
+ ├── specs/
42
+ ├── workgroups/
43
+ ├── prompts/
44
+ └── enterprise/ (optional)
45
+ ```
46
+
47
+ ### 3. Copy template files
48
+
49
+ Use the embedded templates below.
50
+
51
+ ### 4. Generate environment context
52
+
53
+ - Detect project language, framework, tools
54
+ - Populate `environment_context.md`
55
+ - Include package managers, test runners, build tools
56
+
57
+ ### 5. Capture user preferences (optional)
58
+
59
+ - Ask: "Would you like to configure development preferences? (optional)"
60
+ - If yes: prompt for testing frameworks, code style, quality priorities
61
+ - Create `knowzcode/user_preferences.md`
62
+
63
+ ### 5.5. Configure orchestration defaults (optional)
64
+
65
+ Ask: "Would you like to configure agent orchestration defaults? (optional — can be changed later in knowzcode/knowzcode_orchestration.md)"
66
+
67
+ If yes: prompt for:
68
+ - Max concurrent builders (1-5, default: 5)
69
+ - Scout mode (full/minimal/none, default: full)
70
+ - Default specialists (checkboxes: security-officer, test-advisor, project-advisor)
71
+ - MCP agents enabled (yes/no, default: yes)
72
+
73
+ If no: generate with all defaults.
74
+
75
+ Generate `knowzcode/knowzcode_orchestration.md` from the template (always — it's part of the standard file set).
76
+
77
+ ### 6. Create .gitignore
78
+
79
+ Protect environment-specific files from git:
80
+ ```
81
+ environment_context.md
82
+ workgroups/
83
+ *.local.md
84
+ .scratch/
85
+ ```
86
+
87
+ ### 7. Detect AI platforms and generate adapters
88
+
89
+ Check which AI platforms are present and offer to generate adapter files.
90
+
91
+ **Step 7a: Detect platforms**
92
+ ```
93
+ CHECK for existing files:
94
+ - CLAUDE.md → offer to append KnowzCode section
95
+ - AGENTS.md or AGENTS.override.md → offer to generate Codex adapter
96
+ - GEMINI.md or ~/.gemini/GEMINI.md → offer to generate Gemini adapter
97
+ - .cursor/rules/ or .cursorrules (deprecated) → offer Cursor adapter (.cursor/rules/knowzcode.mdc)
98
+ - .github/copilot-instructions.md OR .github/ directory → offer Copilot adapter (full prompt files)
99
+ - .windsurf/rules/ or .windsurfrules (deprecated) → offer Windsurf adapter (.windsurf/rules/knowzcode.md)
100
+ ```
101
+
102
+ **Step 7b: Present options**
103
+ ```
104
+ PRESENT to user:
105
+ "Which AI platform adapters would you like to generate?"
106
+ Options:
107
+ - Detected platforms only
108
+ - All platforms
109
+ - Skip (just use knowzcode/ directly)
110
+ ```
111
+
112
+ **Step 7c: Generate project-specific adapters**
113
+
114
+ When generating adapters, inject detected project info to make them project-specific:
115
+
116
+ 1. From `environment_context.md`, extract:
117
+ - Test runner command (e.g., `npm test`, `pytest`, `dotnet test`)
118
+ - Build command (e.g., `npm run build`, `go build`)
119
+ - Language/framework (e.g., TypeScript/React, Python/FastAPI)
120
+
121
+ 2. Inject into adapter templates where applicable:
122
+ - Replace generic test/build references with detected commands
123
+ - Add framework-specific notes (e.g., "Use Composer for multi-file React edits" for Cursor)
124
+
125
+ 3. For Codex: note that `AGENTS.override.md` can be used for user-local overrides
126
+
127
+ **Step 7c-codex: Generate Codex skill files**
128
+
129
+ When Codex is selected, generate skill files in addition to `AGENTS.md`:
130
+
131
+ ```
132
+ 1. Create .codex/skills/kc/ directory
133
+ 2. Generate 6 skill files from platform_adapters.md "Codex Skill Files" section:
134
+ - .codex/skills/kc/work.md
135
+ - .codex/skills/kc/plan.md
136
+ - .codex/skills/kc/fix.md
137
+ - .codex/skills/kc/audit.md
138
+ - .codex/skills/kc/learn.md
139
+ - .codex/skills/kc/continue.md
140
+ 3. Replace "vX.Y.Z" with current KnowzCode version
141
+ ```
142
+
143
+ **Codex success message:**
144
+ ```
145
+ OpenAI Codex adapter generated:
146
+ AGENTS.md (primary instructions)
147
+ .codex/skills/kc/work.md (/kc:work — start workflow)
148
+ .codex/skills/kc/plan.md (/kc:plan — research)
149
+ .codex/skills/kc/fix.md (/kc:fix — quick fix)
150
+ .codex/skills/kc/audit.md (/kc:audit — quality audit)
151
+ .codex/skills/kc/learn.md (/kc:learn — capture learning)
152
+ .codex/skills/kc/continue.md (/kc:continue — resume workflow)
153
+
154
+ Tip: Run `npx knowzcode install --platforms codex --global` to install
155
+ skills globally to ~/.codex/skills/kc/ (available in all projects).
156
+ ```
157
+
158
+ **Step 7c-gemini: Generate Gemini TOML command files**
159
+
160
+ When Gemini is selected, generate TOML command files in addition to `GEMINI.md`:
161
+
162
+ ```
163
+ 1. Create .gemini/commands/kc/ directory
164
+ 2. Generate 7 TOML files from platform_adapters.md "Native Commands" section:
165
+ - .gemini/commands/kc/work.toml
166
+ - .gemini/commands/kc/plan.toml
167
+ - .gemini/commands/kc/fix.toml
168
+ - .gemini/commands/kc/audit.toml
169
+ - .gemini/commands/kc/learn.toml
170
+ - .gemini/commands/kc/status.toml
171
+ - .gemini/commands/kc/continue.toml
172
+ 3. Replace "vX.Y.Z" with current KnowzCode version
173
+ ```
174
+
175
+ **Gemini success message:**
176
+ ```
177
+ Gemini CLI adapter generated:
178
+ GEMINI.md (primary instructions)
179
+ .gemini/commands/kc/work.toml (/kc:work start workflow)
180
+ .gemini/commands/kc/plan.toml (/kc:plan — research)
181
+ .gemini/commands/kc/fix.toml (/kc:fix quick fix)
182
+ .gemini/commands/kc/audit.toml (/kc:audit — quality audit)
183
+ .gemini/commands/kc/learn.toml (/kc:learn — capture learning)
184
+ .gemini/commands/kc/status.toml (/kc:status connection status)
185
+ .gemini/commands/kc/continue.toml (/kc:continue — resume workflow)
186
+ ```
187
+
188
+ **Step 7d: Validate generated adapters**
189
+
190
+ After generation, verify each adapter:
191
+ - References correct `knowzcode/` file paths
192
+ - Contains all 5 phase descriptions
193
+ - Mentions TDD enforcement and quality gates
194
+ - Includes PAUSE/STOP instructions at quality gates
195
+
196
+ Adapter templates are in `knowzcode/platform_adapters.md`. Copy the relevant sections into the appropriate files.
197
+
198
+ **Step 7e: Copilot-specific generation**
199
+
200
+ When Copilot is selected, generate the full prompt file suite in addition to the instructions file:
201
+
202
+ ```
203
+ 1. Create .github/ directory if it doesn't exist
204
+ 2. Create .github/copilot-instructions.md from platform_adapters.md template Section A
205
+ 3. Create .github/prompts/ directory
206
+ 4. Generate all 9 prompt files from platform_adapters.md template Section B:
207
+ - .github/prompts/kc-work.prompt.md
208
+ - .github/prompts/kc-analyze.prompt.md
209
+ - .github/prompts/kc-specify.prompt.md
210
+ - .github/prompts/kc-implement.prompt.md
211
+ - .github/prompts/kc-audit.prompt.md
212
+ - .github/prompts/kc-finalize.prompt.md
213
+ - .github/prompts/kc-fix.prompt.md
214
+ - .github/prompts/kc-plan.prompt.md
215
+ - .github/prompts/kc-continue.prompt.md
216
+ 5. Replace "vX.Y.Z" in generated files with the current KnowzCode version
217
+ 6. Optionally create .vscode/mcp.json skeleton from template Section C
218
+ (ask user: "Would you like to generate MCP configuration for VS Code?")
219
+ ```
220
+
221
+ **Skip Agent Teams enablement for Copilot** — Copilot uses single-agent sequential execution.
222
+
223
+ **Copilot success message:**
224
+ ```
225
+ GitHub Copilot adapter generated:
226
+ .github/copilot-instructions.md (repository-level instructions)
227
+ .github/prompts/kc-work.prompt.md (start workflow: #prompt:kc-work)
228
+ .github/prompts/kc-analyze.prompt.md
229
+ .github/prompts/kc-specify.prompt.md
230
+ .github/prompts/kc-implement.prompt.md
231
+ .github/prompts/kc-audit.prompt.md
232
+ .github/prompts/kc-finalize.prompt.md
233
+ .github/prompts/kc-fix.prompt.md (quick fix: #prompt:kc-fix)
234
+ .github/prompts/kc-plan.prompt.md (research: #prompt:kc-plan)
235
+ .github/prompts/kc-continue.prompt.md (resume: #prompt:kc-continue)
236
+
237
+ Usage in VS Code:
238
+ #prompt:kc-work "Build user authentication" — Start a feature
239
+ #prompt:kc-fix "Fix login redirect bug" — Quick fix
240
+ #prompt:kc-continue — Resume where you left off
241
+
242
+ See knowzcode/copilot_execution.md for the full execution guide.
243
+ ```
244
+
245
+ ### 7.5. Enable Agent Teams (Claude Code only)
246
+
247
+ If the user is on Claude Code, **actively offer** to enable Agent Teams:
248
+
249
+ **Step 7.5a: Ask the user**
250
+ ```
251
+ "Would you like to enable Agent Teams? (recommended for Claude Code)
252
+
253
+ Agent Teams spawns specialized teammates for each workflow phase,
254
+ giving you richer multi-agent coordination.
255
+
256
+ Without it, KnowzCode uses subagent delegation (works fine, just less interactive)."
257
+
258
+ Options:
259
+ - Yes, for this project only (recommended)
260
+ - Yes, for all projects (writes to ~/.claude/settings.json)
261
+ - No (use subagent fallback)
262
+ ```
263
+
264
+ **Step 7.5b: If yes, create/update the appropriate settings file**
265
+
266
+ - **"This project only"** → write to `.claude/settings.local.json` (project-level, gitignored)
267
+ - **"All projects"** → write to `~/.claude/settings.json` (home-level global config)
268
+
269
+ Read the target settings file if it exists. Merge the Agent Teams env var into it:
270
+
271
+ ```json
272
+ {
273
+ "env": {
274
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
275
+ }
276
+ }
277
+ ```
278
+
279
+ If the file already has other keys, preserve them and merge. If it doesn't exist, create it with the content above.
280
+
281
+ **Step 7.5c: Windows note**
282
+
283
+ If the platform is Windows (`process.platform === 'win32'` or detected via environment):
284
+ ```
285
+ Note: On Windows, Agent Teams runs in "in-process" mode by default
286
+ (split-pane tmux mode is not supported in Windows Terminal).
287
+ This works correctly — no action needed.
288
+ ```
289
+
290
+ **Step 7.5d: If no, proceed normally** — subagent delegation works without any configuration.
291
+
292
+ ### 8. Optional: Set up enterprise compliance (experimental)
293
+
294
+ - Ask: "Would you like to set up enterprise compliance features? (optional)"
295
+ - If yes: create `knowzcode/enterprise/` directory with manifest and templates
296
+ - Compliance is disabled by default
297
+
298
+ ### 9. Optional: Configure MCP
299
+
300
+ Inform user about enhanced features:
301
+ ```
302
+ Optional: Connect to KnowzCode Cloud for AI-powered capabilities:
303
+ New user? /kc:register
304
+ Have a key? /kc:connect-mcp <api-key>
305
+ ```
306
+
307
+ ### 10. Report success
308
+
309
+ ```
310
+ KnowzCode initialized successfully!
311
+
312
+ Created:
313
+ knowzcode/knowzcode_project.md
314
+ knowzcode/knowzcode_tracker.md
315
+ knowzcode/knowzcode_log.md
316
+ knowzcode/knowzcode_architecture.md
317
+ knowzcode/knowzcode_loop.md
318
+ knowzcode/knowzcode_orchestration.md
319
+ knowzcode/platform_adapters.md
320
+ knowzcode/.gitignore
321
+ knowzcode/specs/
322
+ knowzcode/workgroups/
323
+ knowzcode/prompts/
324
+
325
+ Platform adapters: [list generated adapters or "None (skip)"]
326
+
327
+ Agent Teams: [Enabled (.claude/settings.local.json) | Not enabled (subagent fallback)]
328
+
329
+ Next steps:
330
+ 1. Review knowzcode/knowzcode_project.md and add project details
331
+ 2. Start your first feature: /kc:work "your feature description"
332
+ 3. Research first: /kc:plan "your question"
333
+ ```
334
+
335
+ ---
336
+
337
+ ## Template Files
338
+
339
+ ### knowzcode_project.md
340
+ ```markdown
341
+ # KnowzCode Project Overview
342
+
343
+ **Purpose:** Project context for KnowzCode AI agents.
344
+
345
+ ### 1. Project Goal & Core Problem
346
+ * **Goal:** [To be filled in during first session]
347
+ * **Core Problem Solved:** [To be filled in during first session]
348
+
349
+ ### 2. Scope & Key Features
350
+ * **Key Features (In Scope):**
351
+ * [Feature 1]: [Description]
352
+ * **Out of Scope:**
353
+ * [Deferred 1]: [Description]
354
+
355
+ ### 3. Technology Stack
356
+ | Category | Technology | Version | Notes |
357
+ |:---------|:-----------|:--------|:------|
358
+ | Language(s) | [Detected] | [Detected] | [Auto-detected] |
359
+ | Testing | [Detected] | [Detected] | [Auto-detected] |
360
+
361
+ ### Links to Other Artifacts
362
+ * **Loop Protocol:** `knowzcode/knowzcode_loop.md`
363
+ * **Session Log:** `knowzcode/knowzcode_log.md`
364
+ * **Architecture:** `knowzcode/knowzcode_architecture.md`
365
+ * **Tracker:** `knowzcode/knowzcode_tracker.md`
366
+ * **Specifications:** `knowzcode/specs/`
367
+ ```
368
+
369
+ ### knowzcode_tracker.md
370
+ ```markdown
371
+ # KnowzCode Status Map (WorkGroup Tracker)
372
+
373
+ **Purpose:** Tracks all active and completed WorkGroups.
374
+
375
+ ## Active WorkGroups
376
+
377
+ *None yet. Run `/kc:work "your feature description"` to create your first WorkGroup.*
378
+
379
+ ## Completed WorkGroups
380
+
381
+ *None yet.*
382
+
383
+ **Next WorkGroup ID:** WG-001
384
+ ```
385
+
386
+ ### knowzcode_log.md
387
+ ```markdown
388
+ # KnowzCode Operational Record
389
+
390
+ **Purpose:** Session log and quality criteria reference.
391
+
392
+ ## Recent Sessions
393
+
394
+ *No sessions yet.*
395
+
396
+ ## Reference Quality Criteria
397
+
398
+ 1. **Reliability:** Robust error handling, graceful degradation
399
+ 2. **Maintainability:** Clear code structure, good naming, modularity
400
+ 3. **Security:** Input validation, secure authentication, data protection
401
+ 4. **Performance:** Efficient algorithms, optimized queries
402
+ 5. **Testability:** Comprehensive test coverage, clear test cases
403
+ ```
404
+
405
+ ### knowzcode_architecture.md
406
+ ```markdown
407
+ # KnowzCode Architecture Documentation
408
+
409
+ **Purpose:** Living architecture documentation for this project.
410
+
411
+ ## System Architecture
412
+
413
+ *To be populated during first feature development.*
414
+
415
+ ## Key Components
416
+
417
+ *To be populated during implementation.*
418
+
419
+ ## Data Flow
420
+
421
+ *To be populated during implementation.*
422
+ ```
423
+
424
+ ### environment_context.md
425
+ ```markdown
426
+ # KnowzCode Environment Context
427
+
428
+ **Purpose:** Environment and tooling information.
429
+
430
+ ## Detected Environment
431
+
432
+ **Platform:** [Auto-detected]
433
+ **Language:** [Auto-detected]
434
+ **Package Manager:** [Auto-detected]
435
+ **Test Runner:** [Auto-detected]
436
+ ```
437
+
438
+ ### knowzcode_orchestration.md
439
+ ```markdown
440
+ # KnowzCode Orchestration Configuration
441
+
442
+ **Purpose:** Project-level defaults for team sizing and agent orchestration. Read by `/kc:work` and `/kc:audit` at startup. Per-invocation flags override these settings.
443
+
444
+ ---
445
+
446
+ ## Builder Configuration
447
+
448
+ ```yaml
449
+ max_builders: 5
450
+ ```
451
+
452
+ ---
453
+
454
+ ## Scout Configuration
455
+
456
+ ```yaml
457
+ scout_mode: full
458
+ ```
459
+
460
+ ---
461
+
462
+ ## Specialist Defaults
463
+
464
+ ```yaml
465
+ default_specialists: []
466
+ ```
467
+
468
+ ---
469
+
470
+ ## MCP Agent Configuration
471
+
472
+ ```yaml
473
+ mcp_agents_enabled: true
474
+ ```
475
+
476
+ ---
477
+
478
+ ## Override Precedence
479
+
480
+ | Setting | Config Default | Flag Override |
481
+ |---------|---------------|--------------|
482
+ | max_builders | `max_builders:` | `--max-builders=N` |
483
+ | scout_mode | `scout_mode:` | `--no-scouts` |
484
+ | default_specialists | `default_specialists:` | `--specialists`, `--no-specialists` |
485
+ | mcp_agents_enabled | `mcp_agents_enabled:` | `--no-mcp` |
486
+
487
+ Per-invocation flags always win. `--specialists` adds to defaults; `--no-specialists` clears all.
488
+ ```
489
+
490
+ ---
491
+
492
+ ## Error Handling
493
+
494
+ If initialization fails:
495
+ 1. Report which step failed
496
+ 2. Show partial progress
497
+ 3. Suggest remediation
498
+ 4. Offer to clean up
499
+
500
+ Execute this initialization now.