knowzcode 0.4.0 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/.claude-plugin/marketplace.json +61 -61
  2. package/.claude-plugin/plugin.json +8 -8
  3. package/LICENSE +121 -121
  4. package/README.md +379 -354
  5. package/agents/analyst.md +114 -114
  6. package/agents/architect.md +200 -200
  7. package/agents/builder.md +104 -104
  8. package/agents/closer.md +177 -177
  9. package/agents/context-scout.md +54 -54
  10. package/agents/knowledge-migrator.md +349 -349
  11. package/agents/knowz-scout.md +83 -83
  12. package/agents/knowz-scribe.md +180 -180
  13. package/agents/microfix-specialist.md +135 -135
  14. package/agents/project-advisor.md +111 -111
  15. package/agents/reviewer.md +172 -172
  16. package/agents/security-officer.md +194 -194
  17. package/agents/test-advisor.md +162 -162
  18. package/agents/update-coordinator.md +394 -394
  19. package/bin/knowzcode.mjs +1457 -1199
  20. package/commands/audit.md +328 -328
  21. package/commands/connect-mcp.md +574 -549
  22. package/commands/fix.md +107 -107
  23. package/commands/init.md +616 -500
  24. package/commands/learn.md +332 -332
  25. package/commands/plan.md +272 -272
  26. package/commands/register.md +757 -733
  27. package/commands/status.md +338 -309
  28. package/commands/telemetry-setup.md +368 -368
  29. package/commands/telemetry.md +188 -188
  30. package/commands/work.md +1204 -1204
  31. package/knowzcode/automation_manifest.md +59 -59
  32. package/knowzcode/claude_code_execution.md +431 -431
  33. package/knowzcode/copilot_execution.md +231 -231
  34. package/knowzcode/enterprise/compliance_manifest.md +137 -137
  35. package/knowzcode/enterprise/compliance_status.md +30 -30
  36. package/knowzcode/enterprise/guidelines/code-quality.md +67 -67
  37. package/knowzcode/enterprise/guidelines/security.md +355 -355
  38. package/knowzcode/enterprise/templates/guideline-template.md +55 -55
  39. package/knowzcode/gitignore.template +13 -13
  40. package/knowzcode/knowzcode_architecture.md +51 -51
  41. package/knowzcode/knowzcode_log.md +142 -142
  42. package/knowzcode/knowzcode_loop.md +601 -596
  43. package/knowzcode/knowzcode_orchestration.md +66 -66
  44. package/knowzcode/knowzcode_project.md +48 -48
  45. package/knowzcode/knowzcode_tracker.md +40 -40
  46. package/knowzcode/knowzcode_vaults.md +257 -257
  47. package/knowzcode/mcp_config.md +196 -191
  48. package/knowzcode/planning/Readme.md +6 -6
  49. package/knowzcode/platform_adapters.md +2577 -1260
  50. package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
  51. package/knowzcode/prompts/Investigate_Codebase.md +227 -227
  52. package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
  53. package/knowzcode/prompts/Refactor_Node.md +72 -72
  54. package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
  55. package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
  56. package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
  57. package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
  58. package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
  59. package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
  60. package/knowzcode/specs/Readme.md +10 -10
  61. package/knowzcode/telemetry_config.md +89 -89
  62. package/knowzcode/user_preferences.md +120 -120
  63. package/package.json +53 -53
  64. package/skills/alias-resolver.json +15 -15
  65. package/skills/architecture-diff.json +12 -12
  66. package/skills/check-installation-status.json +14 -14
  67. package/skills/continue.md +126 -126
  68. package/skills/environment-guard.json +12 -12
  69. package/skills/generate-workgroup-id.json +25 -25
  70. package/skills/install-knowzcode.json +21 -21
  71. package/skills/load-core-context.json +18 -18
  72. package/skills/log-entry-builder.json +15 -15
  73. package/skills/spec-quality-check.json +14 -14
  74. package/skills/spec-template.json +15 -15
  75. package/skills/spec-validator.json +25 -25
  76. package/skills/start-work.md +224 -224
  77. package/skills/tracker-scan.json +12 -12
  78. package/skills/tracker-update.json +28 -28
  79. package/skills/validate-installation.json +14 -14
package/commands/init.md CHANGED
@@ -1,500 +1,616 @@
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.
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 .agents/skills/ directory
133
+ 2. Generate 12 skill files from platform_adapters.md "Codex Skill Files" section:
134
+ - .agents/skills/kc-work/SKILL.md
135
+ - .agents/skills/kc-plan/SKILL.md
136
+ - .agents/skills/kc-fix/SKILL.md
137
+ - .agents/skills/kc-audit/SKILL.md
138
+ - .agents/skills/kc-learn/SKILL.md
139
+ - .agents/skills/kc-continue/SKILL.md
140
+ - .agents/skills/kc-init/SKILL.md
141
+ - .agents/skills/kc-status/SKILL.md
142
+ - .agents/skills/kc-connect-mcp/SKILL.md
143
+ - .agents/skills/kc-register/SKILL.md
144
+ - .agents/skills/kc-telemetry/SKILL.md
145
+ - .agents/skills/kc-telemetry-setup/SKILL.md
146
+ 3. Replace "vX.Y.Z" with current KnowzCode version
147
+ ```
148
+
149
+ **Codex success message:**
150
+ ```
151
+ OpenAI Codex adapter generated:
152
+ AGENTS.md (primary instructions)
153
+ .agents/skills/kc-work/SKILL.md (/kc:work — start workflow)
154
+ .agents/skills/kc-plan/SKILL.md (/kc:plan research)
155
+ .agents/skills/kc-fix/SKILL.md (/kc:fix quick fix)
156
+ .agents/skills/kc-audit/SKILL.md (/kc:audit — quality audit)
157
+ .agents/skills/kc-learn/SKILL.md (/kc:learn — capture learning)
158
+ .agents/skills/kc-continue/SKILL.md (/kc:continue resume workflow)
159
+ .agents/skills/kc-init/SKILL.md (/kc:init — initialize project)
160
+ .agents/skills/kc-status/SKILL.md (/kc:status check status)
161
+ .agents/skills/kc-connect-mcp/SKILL.md (/kc:connect-mcp — configure MCP)
162
+ .agents/skills/kc-register/SKILL.md (/kc:register — register account)
163
+ .agents/skills/kc-telemetry/SKILL.md (/kc:telemetry — investigate errors)
164
+ .agents/skills/kc-telemetry-setup/SKILL.md (/kc:telemetry-setup configure sources)
165
+
166
+ Tip: Run `npx knowzcode install --platforms codex --global` to install
167
+ skills globally to ~/.agents/skills/ (available in all projects).
168
+ ```
169
+
170
+ **Step 7c-gemini-mcp: Offer MCP configuration for Gemini CLI**
171
+
172
+ After generating GEMINI.md + commands + skills + subagents, run Smart Discovery first:
173
+ 1. Check `KNOWZ_API_KEY` environment variable
174
+ 2. Check `knowzcode/mcp_config.md` — if `Connected: Yes`, endpoint and key info available
175
+ 3. Check `.mcp.json` or `.vscode/mcp.json` for existing API key (extract Bearer token)
176
+
177
+ If existing config found:
178
+ "Found existing MCP config (endpoint: {endpoint}, key ending ...{last4}).
179
+ Configure Gemini using this existing config? [Yes] [No, enter different key] [Skip]"
180
+ If Yes: write .gemini/settings.json using discovered config (no key prompt needed)
181
+
182
+ If no existing config found, ask:
183
+ ```
184
+ "Would you like to configure MCP for Gemini CLI? (Requires a KnowzCode API key)"
185
+ ```
186
+
187
+ - If **"Yes, I have a key"**: Accept API key →
188
+ 1. Write `.gemini/settings.json` (merge with existing if present):
189
+ ```json
190
+ {
191
+ "mcpServers": {
192
+ "knowz": {
193
+ "url": "https://mcp.knowz.io/mcp",
194
+ "headers": {
195
+ "Authorization": "Bearer <api-key>",
196
+ "X-Project-Path": "<project-path>"
197
+ }
198
+ }
199
+ }
200
+ }
201
+ ```
202
+ 2. Verify by calling `list_vaults` if possible
203
+ 3. Update `knowzcode/mcp_config.md` with connection status
204
+ - If **"Yes, register first"**: Direct to `/kc:register`
205
+ - If **"No"**: Skip, mention `/kc:connect-mcp` for later setup
206
+
207
+ **Step 7c-gemini: Generate Gemini TOML commands, skills, and subagents**
208
+
209
+ When Gemini is selected, generate TOML command files, skill files, and subagent definitions in addition to `GEMINI.md`:
210
+
211
+ ```
212
+ 1. Create .gemini/commands/kc/ directory
213
+ 2. Generate 12 TOML files from platform_adapters.md "Native Commands" section:
214
+ - .gemini/commands/kc/work.toml
215
+ - .gemini/commands/kc/plan.toml
216
+ - .gemini/commands/kc/fix.toml
217
+ - .gemini/commands/kc/audit.toml
218
+ - .gemini/commands/kc/learn.toml
219
+ - .gemini/commands/kc/status.toml
220
+ - .gemini/commands/kc/continue.toml
221
+ - .gemini/commands/kc/init.toml
222
+ - .gemini/commands/kc/connect-mcp.toml
223
+ - .gemini/commands/kc/register.toml
224
+ - .gemini/commands/kc/telemetry.toml
225
+ - .gemini/commands/kc/telemetry-setup.toml
226
+ 3. Create .gemini/skills/ directory
227
+ 4. Generate 12 skill files from platform_adapters.md "Gemini Skill Files" section:
228
+ - .gemini/skills/kc-work/SKILL.md
229
+ - .gemini/skills/kc-plan/SKILL.md
230
+ - .gemini/skills/kc-fix/SKILL.md
231
+ - .gemini/skills/kc-audit/SKILL.md
232
+ - .gemini/skills/kc-learn/SKILL.md
233
+ - .gemini/skills/kc-continue/SKILL.md
234
+ - .gemini/skills/kc-init/SKILL.md
235
+ - .gemini/skills/kc-status/SKILL.md
236
+ - .gemini/skills/kc-connect-mcp/SKILL.md
237
+ - .gemini/skills/kc-register/SKILL.md
238
+ - .gemini/skills/kc-telemetry/SKILL.md
239
+ - .gemini/skills/kc-telemetry-setup/SKILL.md
240
+ 5. Replace "vX.Y.Z" with current KnowzCode version
241
+ ```
242
+
243
+ **Step 7c-gemini-agents: Generate Gemini subagent files (experimental, opt-in)**
244
+
245
+ Ask user: "Would you like to generate Gemini subagent definitions? (experimental requires `experimental.enableAgents: true` in Gemini settings.json)"
246
+
247
+ If yes:
248
+ ```
249
+ 1. Create .gemini/agents/ directory
250
+ 2. Generate 14 subagent files from platform_adapters.md "Gemini Subagents" section:
251
+ - .gemini/agents/kc-analyst.md
252
+ - .gemini/agents/kc-architect.md
253
+ - .gemini/agents/kc-builder.md
254
+ - .gemini/agents/kc-reviewer.md
255
+ - .gemini/agents/kc-closer.md
256
+ - .gemini/agents/kc-context-scout.md
257
+ - .gemini/agents/kc-knowz-scout.md
258
+ - .gemini/agents/kc-knowz-scribe.md
259
+ - .gemini/agents/kc-microfix.md
260
+ - .gemini/agents/kc-knowledge-migrator.md
261
+ - .gemini/agents/kc-update-coordinator.md
262
+ - .gemini/agents/kc-security-officer.md
263
+ - .gemini/agents/kc-test-advisor.md
264
+ - .gemini/agents/kc-project-advisor.md
265
+ 3. Replace "vX.Y.Z" with current KnowzCode version
266
+ ```
267
+
268
+ **Gemini success message:**
269
+ ```
270
+ Gemini CLI adapter generated:
271
+ GEMINI.md (primary instructions)
272
+ .gemini/commands/kc/work.toml (/kc:work — start workflow)
273
+ .gemini/commands/kc/plan.toml (/kc:plan — research)
274
+ .gemini/commands/kc/fix.toml (/kc:fix — quick fix)
275
+ .gemini/commands/kc/audit.toml (/kc:audit — quality audit)
276
+ .gemini/commands/kc/learn.toml (/kc:learn — capture learning)
277
+ .gemini/commands/kc/status.toml (/kc:status — connection status)
278
+ .gemini/commands/kc/continue.toml (/kc:continue — resume workflow)
279
+ .gemini/commands/kc/init.toml (/kc:init initialize project)
280
+ .gemini/commands/kc/connect-mcp.toml (/kc:connect-mcp — configure MCP)
281
+ .gemini/commands/kc/register.toml (/kc:register register account)
282
+ .gemini/commands/kc/telemetry.toml (/kc:telemetry — investigate errors)
283
+ .gemini/commands/kc/telemetry-setup.toml (/kc:telemetry-setup configure sources)
284
+ .gemini/skills/kc-work/SKILL.md (discoverable skill)
285
+ .gemini/skills/kc-plan/SKILL.md (discoverable skill)
286
+ .gemini/skills/kc-fix/SKILL.md (discoverable skill)
287
+ .gemini/skills/kc-audit/SKILL.md (discoverable skill)
288
+ .gemini/skills/kc-learn/SKILL.md (discoverable skill)
289
+ .gemini/skills/kc-continue/SKILL.md (discoverable skill)
290
+ .gemini/skills/kc-init/SKILL.md (discoverable skill)
291
+ .gemini/skills/kc-status/SKILL.md (discoverable skill)
292
+ .gemini/skills/kc-connect-mcp/SKILL.md (discoverable skill)
293
+ .gemini/skills/kc-register/SKILL.md (discoverable skill)
294
+ .gemini/skills/kc-telemetry/SKILL.md (discoverable skill)
295
+ .gemini/skills/kc-telemetry-setup/SKILL.md (discoverable skill)
296
+ .gemini/agents/kc-*.md (14 subagents) (experimental if opted in)
297
+
298
+ MCP: [Configured (.gemini/settings.json) | Not configured — run /kc:connect-mcp later]
299
+
300
+ Tip: Run `npx knowzcode install --platforms gemini --global` to install
301
+ skills globally to ~/.gemini/skills/ (available in all projects).
302
+ ```
303
+
304
+ **Step 7d: Validate generated adapters**
305
+
306
+ After generation, verify each adapter:
307
+ - References correct `knowzcode/` file paths
308
+ - Contains all 5 phase descriptions
309
+ - Mentions TDD enforcement and quality gates
310
+ - Includes PAUSE/STOP instructions at quality gates
311
+
312
+ Adapter templates are in `knowzcode/platform_adapters.md`. Copy the relevant sections into the appropriate files.
313
+
314
+ **Step 7e: Copilot-specific generation**
315
+
316
+ When Copilot is selected, generate the full prompt file suite in addition to the instructions file:
317
+
318
+ ```
319
+ 1. Create .github/ directory if it doesn't exist
320
+ 2. Create .github/copilot-instructions.md from platform_adapters.md template Section A
321
+ 3. Create .github/prompts/ directory
322
+ 4. Generate all 9 prompt files from platform_adapters.md template Section B:
323
+ - .github/prompts/kc-work.prompt.md
324
+ - .github/prompts/kc-analyze.prompt.md
325
+ - .github/prompts/kc-specify.prompt.md
326
+ - .github/prompts/kc-implement.prompt.md
327
+ - .github/prompts/kc-audit.prompt.md
328
+ - .github/prompts/kc-finalize.prompt.md
329
+ - .github/prompts/kc-fix.prompt.md
330
+ - .github/prompts/kc-plan.prompt.md
331
+ - .github/prompts/kc-continue.prompt.md
332
+ 5. Replace "vX.Y.Z" in generated files with the current KnowzCode version
333
+ 6. Optionally create .vscode/mcp.json skeleton from template Section C
334
+ (ask user: "Would you like to generate MCP configuration for VS Code?")
335
+ ```
336
+
337
+ **Skip Agent Teams enablement for Copilot** — Copilot uses single-agent sequential execution.
338
+
339
+ **Copilot success message:**
340
+ ```
341
+ GitHub Copilot adapter generated:
342
+ .github/copilot-instructions.md (repository-level instructions)
343
+ .github/prompts/kc-work.prompt.md (start workflow: #prompt:kc-work)
344
+ .github/prompts/kc-analyze.prompt.md
345
+ .github/prompts/kc-specify.prompt.md
346
+ .github/prompts/kc-implement.prompt.md
347
+ .github/prompts/kc-audit.prompt.md
348
+ .github/prompts/kc-finalize.prompt.md
349
+ .github/prompts/kc-fix.prompt.md (quick fix: #prompt:kc-fix)
350
+ .github/prompts/kc-plan.prompt.md (research: #prompt:kc-plan)
351
+ .github/prompts/kc-continue.prompt.md (resume: #prompt:kc-continue)
352
+
353
+ Usage in VS Code:
354
+ #prompt:kc-work "Build user authentication" — Start a feature
355
+ #prompt:kc-fix "Fix login redirect bug" — Quick fix
356
+ #prompt:kc-continue — Resume where you left off
357
+
358
+ See knowzcode/copilot_execution.md for the full execution guide.
359
+ ```
360
+
361
+ ### 7.5. Enable Agent Teams (Claude Code only)
362
+
363
+ If the user is on Claude Code, **actively offer** to enable Agent Teams:
364
+
365
+ **Step 7.5a: Ask the user**
366
+ ```
367
+ "Would you like to enable Agent Teams? (recommended for Claude Code)
368
+
369
+ Agent Teams spawns specialized teammates for each workflow phase,
370
+ giving you richer multi-agent coordination.
371
+
372
+ Without it, KnowzCode uses subagent delegation (works fine, just less interactive)."
373
+
374
+ Options:
375
+ - Yes, for this project only (recommended)
376
+ - Yes, for all projects (writes to ~/.claude/settings.json)
377
+ - No (use subagent fallback)
378
+ ```
379
+
380
+ **Step 7.5b: If yes, create/update the appropriate settings file**
381
+
382
+ - **"This project only"** → write to `.claude/settings.local.json` (project-level, gitignored)
383
+ - **"All projects"** write to `~/.claude/settings.json` (home-level global config)
384
+
385
+ Read the target settings file if it exists. Merge the Agent Teams env var into it:
386
+
387
+ ```json
388
+ {
389
+ "env": {
390
+ "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
391
+ }
392
+ }
393
+ ```
394
+
395
+ If the file already has other keys, preserve them and merge. If it doesn't exist, create it with the content above.
396
+
397
+ **Step 7.5c: Windows note**
398
+
399
+ If the platform is Windows (`process.platform === 'win32'` or detected via environment):
400
+ ```
401
+ Note: On Windows, Agent Teams runs in "in-process" mode by default
402
+ (split-pane tmux mode is not supported in Windows Terminal).
403
+ This works correctly — no action needed.
404
+ ```
405
+
406
+ **Step 7.5d: If no, proceed normally** — subagent delegation works without any configuration.
407
+
408
+ ### 8. Optional: Set up enterprise compliance (experimental)
409
+
410
+ - Ask: "Would you like to set up enterprise compliance features? (optional)"
411
+ - If yes: create `knowzcode/enterprise/` directory with manifest and templates
412
+ - Compliance is disabled by default
413
+
414
+ ### 9. Optional: Configure MCP
415
+
416
+ Inform user about enhanced features:
417
+ ```
418
+ Optional: Connect to KnowzCode Cloud for AI-powered capabilities:
419
+ New user? /kc:register
420
+ Have a key? /kc:connect-mcp <api-key>
421
+ ```
422
+
423
+ ### 10. Report success
424
+
425
+ ```
426
+ KnowzCode initialized successfully!
427
+
428
+ Created:
429
+ knowzcode/knowzcode_project.md
430
+ knowzcode/knowzcode_tracker.md
431
+ knowzcode/knowzcode_log.md
432
+ knowzcode/knowzcode_architecture.md
433
+ knowzcode/knowzcode_loop.md
434
+ knowzcode/knowzcode_orchestration.md
435
+ knowzcode/platform_adapters.md
436
+ knowzcode/.gitignore
437
+ knowzcode/specs/
438
+ knowzcode/workgroups/
439
+ knowzcode/prompts/
440
+
441
+ Platform adapters: [list generated adapters or "None (skip)"]
442
+
443
+ Agent Teams: [Enabled (.claude/settings.local.json) | Not enabled (subagent fallback)]
444
+
445
+ Next steps:
446
+ 1. Review knowzcode/knowzcode_project.md and add project details
447
+ 2. Start your first feature: /kc:work "your feature description"
448
+ 3. Research first: /kc:plan "your question"
449
+ ```
450
+
451
+ ---
452
+
453
+ ## Template Files
454
+
455
+ ### knowzcode_project.md
456
+ ```markdown
457
+ # KnowzCode Project Overview
458
+
459
+ **Purpose:** Project context for KnowzCode AI agents.
460
+
461
+ ### 1. Project Goal & Core Problem
462
+ * **Goal:** [To be filled in during first session]
463
+ * **Core Problem Solved:** [To be filled in during first session]
464
+
465
+ ### 2. Scope & Key Features
466
+ * **Key Features (In Scope):**
467
+ * [Feature 1]: [Description]
468
+ * **Out of Scope:**
469
+ * [Deferred 1]: [Description]
470
+
471
+ ### 3. Technology Stack
472
+ | Category | Technology | Version | Notes |
473
+ |:---------|:-----------|:--------|:------|
474
+ | Language(s) | [Detected] | [Detected] | [Auto-detected] |
475
+ | Testing | [Detected] | [Detected] | [Auto-detected] |
476
+
477
+ ### Links to Other Artifacts
478
+ * **Loop Protocol:** `knowzcode/knowzcode_loop.md`
479
+ * **Session Log:** `knowzcode/knowzcode_log.md`
480
+ * **Architecture:** `knowzcode/knowzcode_architecture.md`
481
+ * **Tracker:** `knowzcode/knowzcode_tracker.md`
482
+ * **Specifications:** `knowzcode/specs/`
483
+ ```
484
+
485
+ ### knowzcode_tracker.md
486
+ ```markdown
487
+ # KnowzCode Status Map (WorkGroup Tracker)
488
+
489
+ **Purpose:** Tracks all active and completed WorkGroups.
490
+
491
+ ## Active WorkGroups
492
+
493
+ *None yet. Run `/kc:work "your feature description"` to create your first WorkGroup.*
494
+
495
+ ## Completed WorkGroups
496
+
497
+ *None yet.*
498
+
499
+ **Next WorkGroup ID:** WG-001
500
+ ```
501
+
502
+ ### knowzcode_log.md
503
+ ```markdown
504
+ # KnowzCode Operational Record
505
+
506
+ **Purpose:** Session log and quality criteria reference.
507
+
508
+ ## Recent Sessions
509
+
510
+ *No sessions yet.*
511
+
512
+ ## Reference Quality Criteria
513
+
514
+ 1. **Reliability:** Robust error handling, graceful degradation
515
+ 2. **Maintainability:** Clear code structure, good naming, modularity
516
+ 3. **Security:** Input validation, secure authentication, data protection
517
+ 4. **Performance:** Efficient algorithms, optimized queries
518
+ 5. **Testability:** Comprehensive test coverage, clear test cases
519
+ ```
520
+
521
+ ### knowzcode_architecture.md
522
+ ```markdown
523
+ # KnowzCode Architecture Documentation
524
+
525
+ **Purpose:** Living architecture documentation for this project.
526
+
527
+ ## System Architecture
528
+
529
+ *To be populated during first feature development.*
530
+
531
+ ## Key Components
532
+
533
+ *To be populated during implementation.*
534
+
535
+ ## Data Flow
536
+
537
+ *To be populated during implementation.*
538
+ ```
539
+
540
+ ### environment_context.md
541
+ ```markdown
542
+ # KnowzCode Environment Context
543
+
544
+ **Purpose:** Environment and tooling information.
545
+
546
+ ## Detected Environment
547
+
548
+ **Platform:** [Auto-detected]
549
+ **Language:** [Auto-detected]
550
+ **Package Manager:** [Auto-detected]
551
+ **Test Runner:** [Auto-detected]
552
+ ```
553
+
554
+ ### knowzcode_orchestration.md
555
+ ```markdown
556
+ # KnowzCode Orchestration Configuration
557
+
558
+ **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.
559
+
560
+ ---
561
+
562
+ ## Builder Configuration
563
+
564
+ ```yaml
565
+ max_builders: 5
566
+ ```
567
+
568
+ ---
569
+
570
+ ## Scout Configuration
571
+
572
+ ```yaml
573
+ scout_mode: full
574
+ ```
575
+
576
+ ---
577
+
578
+ ## Specialist Defaults
579
+
580
+ ```yaml
581
+ default_specialists: []
582
+ ```
583
+
584
+ ---
585
+
586
+ ## MCP Agent Configuration
587
+
588
+ ```yaml
589
+ mcp_agents_enabled: true
590
+ ```
591
+
592
+ ---
593
+
594
+ ## Override Precedence
595
+
596
+ | Setting | Config Default | Flag Override |
597
+ |---------|---------------|--------------|
598
+ | max_builders | `max_builders:` | `--max-builders=N` |
599
+ | scout_mode | `scout_mode:` | `--no-scouts` |
600
+ | default_specialists | `default_specialists:` | `--specialists`, `--no-specialists` |
601
+ | mcp_agents_enabled | `mcp_agents_enabled:` | `--no-mcp` |
602
+
603
+ Per-invocation flags always win. `--specialists` adds to defaults; `--no-specialists` clears all.
604
+ ```
605
+
606
+ ---
607
+
608
+ ## Error Handling
609
+
610
+ If initialization fails:
611
+ 1. Report which step failed
612
+ 2. Show partial progress
613
+ 3. Suggest remediation
614
+ 4. Offer to clean up
615
+
616
+ Execute this initialization now.