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.
- package/.claude-plugin/marketplace.json +61 -61
- package/.claude-plugin/plugin.json +8 -8
- package/LICENSE +121 -121
- package/README.md +354 -320
- package/agents/analyst.md +114 -114
- package/agents/architect.md +200 -200
- package/agents/builder.md +104 -104
- package/agents/closer.md +177 -177
- package/agents/context-scout.md +54 -54
- package/agents/knowledge-migrator.md +349 -349
- package/agents/knowz-scout.md +83 -83
- package/agents/knowz-scribe.md +180 -180
- package/agents/microfix-specialist.md +135 -135
- package/agents/project-advisor.md +111 -111
- package/agents/reviewer.md +172 -172
- package/agents/security-officer.md +194 -194
- package/agents/test-advisor.md +162 -162
- package/agents/update-coordinator.md +394 -394
- package/bin/knowzcode.mjs +1199 -956
- package/commands/audit.md +328 -328
- package/commands/connect-mcp.md +549 -549
- package/commands/fix.md +107 -107
- package/commands/init.md +500 -439
- package/commands/learn.md +332 -332
- package/commands/plan.md +272 -272
- package/commands/register.md +733 -733
- package/commands/status.md +309 -309
- package/commands/telemetry-setup.md +368 -368
- package/commands/telemetry.md +188 -188
- package/commands/work.md +1204 -1202
- package/knowzcode/automation_manifest.md +59 -59
- package/knowzcode/claude_code_execution.md +431 -420
- package/knowzcode/copilot_execution.md +231 -231
- package/knowzcode/enterprise/compliance_manifest.md +137 -137
- package/knowzcode/enterprise/compliance_status.md +30 -30
- package/knowzcode/enterprise/guidelines/code-quality.md +67 -67
- package/knowzcode/enterprise/guidelines/security.md +355 -355
- package/knowzcode/enterprise/templates/guideline-template.md +55 -55
- package/knowzcode/gitignore.template +13 -13
- package/knowzcode/knowzcode_architecture.md +51 -51
- package/knowzcode/knowzcode_log.md +142 -142
- package/knowzcode/knowzcode_loop.md +596 -596
- package/knowzcode/knowzcode_orchestration.md +66 -66
- package/knowzcode/knowzcode_project.md +48 -48
- package/knowzcode/knowzcode_tracker.md +40 -40
- package/knowzcode/knowzcode_vaults.md +257 -257
- package/knowzcode/mcp_config.md +191 -191
- package/knowzcode/planning/Readme.md +6 -6
- package/knowzcode/platform_adapters.md +1260 -1047
- package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
- package/knowzcode/prompts/Investigate_Codebase.md +227 -227
- package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
- package/knowzcode/prompts/Refactor_Node.md +72 -72
- package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
- package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
- package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
- package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
- package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
- package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
- package/knowzcode/specs/Readme.md +10 -10
- package/knowzcode/telemetry_config.md +89 -89
- package/knowzcode/user_preferences.md +120 -120
- package/package.json +53 -53
- package/skills/alias-resolver.json +1 -1
- package/skills/architecture-diff.json +1 -1
- package/skills/check-installation-status.json +1 -1
- package/skills/continue.md +126 -126
- package/skills/environment-guard.json +1 -1
- package/skills/generate-workgroup-id.json +1 -1
- package/skills/install-knowzcode.json +1 -1
- package/skills/load-core-context.json +1 -1
- package/skills/log-entry-builder.json +1 -1
- package/skills/spec-quality-check.json +1 -1
- package/skills/spec-template.json +1 -1
- package/skills/spec-validator.json +1 -1
- package/skills/start-work.md +224 -224
- package/skills/tracker-scan.json +1 -1
- package/skills/tracker-update.json +1 -1
- package/skills/validate-installation.json +1 -1
|
@@ -1,1047 +1,1260 @@
|
|
|
1
|
-
# KnowzCode Platform Adapters
|
|
2
|
-
|
|
3
|
-
This file contains adapter templates for integrating KnowzCode with different AI coding platforms. Each adapter teaches the platform's AI how to follow the KnowzCode methodology with full phase walkthroughs, quality gates, and TDD enforcement.
|
|
4
|
-
|
|
5
|
-
Generated by `/kc:init`. Adapters should be placed in the project root (or platform-specific location).
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Claude Code (CLAUDE.md section)
|
|
10
|
-
|
|
11
|
-
Append to or create `CLAUDE.md` in project root:
|
|
12
|
-
|
|
13
|
-
```markdown
|
|
14
|
-
# KnowzCode Integration
|
|
15
|
-
|
|
16
|
-
This project uses KnowzCode for structured TDD development with multi-agent orchestration.
|
|
17
|
-
|
|
18
|
-
## Required Reading
|
|
19
|
-
- `knowzcode/knowzcode_loop.md` — Development methodology (TDD, quality gates, phases)
|
|
20
|
-
- `knowzcode/knowzcode_project.md` — Project context and tech stack
|
|
21
|
-
- `knowzcode/knowzcode_tracker.md` — Current WorkGroup status
|
|
22
|
-
- `knowzcode/knowzcode_architecture.md` — Architecture documentation
|
|
23
|
-
|
|
24
|
-
## Workflow Phases
|
|
25
|
-
Follow the phases in `knowzcode_loop.md` for all feature work:
|
|
26
|
-
1. **Phase 1A: Impact Analysis** — Identify affected components, propose Change Set. PAUSE for user approval.
|
|
27
|
-
2. **Phase 1B: Specification** — Draft specs for all NodeIDs. PAUSE for user approval. Commit specs.
|
|
28
|
-
3. **Phase 2A: Implementation** — Strict TDD (Red-Green-Refactor). No production code without a failing test.
|
|
29
|
-
4. **Phase 2B: Completeness Audit** — Independent READ-ONLY audit. PAUSE for user decision on gaps.
|
|
30
|
-
5. **Phase 3: Finalization** — Update specs to as-built, update tracker, log entry, final commit.
|
|
31
|
-
|
|
32
|
-
## Quality Gates
|
|
33
|
-
Never skip phases. PAUSE for user approval at each gate:
|
|
34
|
-
- After Change Set proposal (1A)
|
|
35
|
-
- After spec drafts (1B)
|
|
36
|
-
- After implementation (2A — awaiting audit)
|
|
37
|
-
- After audit results (2B — user decides on gaps)
|
|
38
|
-
|
|
39
|
-
## TDD Enforcement
|
|
40
|
-
TDD is mandatory — no production code without a failing test first.
|
|
41
|
-
Red-Green-Refactor cycle for every feature/criterion in the spec.
|
|
42
|
-
|
|
43
|
-
## Agents
|
|
44
|
-
Specialized agents handle each phase when using Agent Teams or subagent execution:
|
|
45
|
-
- `analyst` (1A), `architect` (1B), `builder` (2A), `reviewer` (2B), `closer` (3)
|
|
46
|
-
- Agent Teams is the preferred execution model when enabled (experimental, requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` env var)
|
|
47
|
-
- Subagent fallback for environments without Agent Teams
|
|
48
|
-
|
|
49
|
-
## Commands
|
|
50
|
-
- `/kc:work "goal"` — Start feature workflow
|
|
51
|
-
- `/kc:plan "topic"` — Research before implementing
|
|
52
|
-
- `/kc:audit [type]` — Run quality audits (spec, architecture, security, integration)
|
|
53
|
-
- `/kc:fix "target" "summary"` — Quick targeted fix
|
|
54
|
-
- `/kc:learn "insight"` — Capture learning to vault
|
|
55
|
-
- `/kc:status` — Check MCP connection and vault status
|
|
56
|
-
|
|
57
|
-
## MCP Integration
|
|
58
|
-
If configured, agents use `search_knowledge`, `ask_question`, and `create_knowledge` for enhanced context.
|
|
59
|
-
All commands work without MCP — it enhances but never blocks.
|
|
60
|
-
|
|
61
|
-
### Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
62
|
-
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds, convention changes —
|
|
63
|
-
**must** be captured. Knowledge lives in two places:
|
|
64
|
-
|
|
65
|
-
- **MCP vaults** (when connected): `knowzcode/knowzcode_vaults.md` defines vault IDs, routing rules,
|
|
66
|
-
and write conditions. Always pass `vaultId` when calling `create_knowledge` — omitting it saves
|
|
67
|
-
to the tenant default vault, NOT the project vault.
|
|
68
|
-
- **Local files** (always available): specs, workgroup files, log entries, architecture docs, and
|
|
69
|
-
`knowzcode/pending_captures.md` (scribe fallback queue when MCP is unavailable).
|
|
70
|
-
|
|
71
|
-
If MCP is not connected, knowledge still gets captured locally. Never let insights die in the conversation.
|
|
72
|
-
|
|
73
|
-
**Vault content detail**: Vault entries are retrieved via semantic search, not read directly like local files. Write detailed, self-contained entries with full reasoning, specific technology names, code examples, and file paths. Terse entries produce poor search results. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
74
|
-
|
|
75
|
-
### Knowz-Scribe Delegation
|
|
76
|
-
When knowz-scribe is active (Agent Teams mode), it owns all vault writes — do NOT call `create_knowledge` directly. Send knowledge to the scribe instead:
|
|
77
|
-
|
|
78
|
-
- **Phase captures**: Handled automatically at quality gates via task-tracked DMs
|
|
79
|
-
- **Explicit**: `"Log: {description}"` — scribe MUST write it; it decides routing (which vault or local file)
|
|
80
|
-
- **Soft**: `"Consider: {description}"` — scribe evaluates whether to capture and where; may skip if not insight-worthy or duplicative
|
|
81
|
-
|
|
82
|
-
Any agent can send ad-hoc knowledge to the scribe at any time. The scribe handles routing, dedup, and formatting. If MCP is unavailable, the scribe queues captures to `knowzcode/pending_captures.md` for later sync. When no scribe is active, use `/kc:learn "insight"` for automatic routing.
|
|
83
|
-
|
|
84
|
-
## WorkGroup Files
|
|
85
|
-
- Created in `knowzcode/workgroups/` (gitignored)
|
|
86
|
-
- Every todo must start with `KnowzCode:` prefix
|
|
87
|
-
- Track phase history, Change Set, and outstanding work
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## OpenAI Codex (AGENTS.md)
|
|
93
|
-
|
|
94
|
-
Create `AGENTS.md` in project root. Notes: `AGENTS.override.md` can be used for user-local overrides. 32KB file size limit. Plain text format (no YAML frontmatter). Codex (2026) also supports `SKILL.md` files for discoverable skills — these appear as available commands in the Codex UI. `AGENTS.md` remains the primary instruction mechanism for KnowzCode methodology.
|
|
95
|
-
|
|
96
|
-
```markdown
|
|
97
|
-
# KnowzCode Development Methodology
|
|
98
|
-
|
|
99
|
-
This project uses KnowzCode for structured TDD development.
|
|
100
|
-
Read `knowzcode/knowzcode_loop.md` before starting any feature work.
|
|
101
|
-
|
|
102
|
-
## Phase Walkthrough
|
|
103
|
-
|
|
104
|
-
### Before Starting
|
|
105
|
-
1. Read `knowzcode/knowzcode_tracker.md` — check for active WorkGroups
|
|
106
|
-
2. Read `knowzcode/knowzcode_project.md` — understand project context
|
|
107
|
-
3. Read `knowzcode/knowzcode_architecture.md` — understand current architecture
|
|
108
|
-
|
|
109
|
-
### Phase 1A: Impact Analysis
|
|
110
|
-
- Analyze what needs to change for the given goal
|
|
111
|
-
- Create NodeIDs for NEW capabilities only (not per-file)
|
|
112
|
-
- Check `knowzcode/specs/` for existing specs in the same domain
|
|
113
|
-
- Propose a Change Set with NodeIDs, affected files, and risk assessment
|
|
114
|
-
- **STOP**: Present Change Set for user approval before continuing
|
|
115
|
-
|
|
116
|
-
### Phase 1B: Specification
|
|
117
|
-
- Draft specs for each NodeID using the 4-section format:
|
|
118
|
-
- Rules & Decisions, Interfaces, Verification Criteria, Debt & Gaps
|
|
119
|
-
- Minimum: 1+ Rules, 1+ Interface, 2+ VERIFY statements per spec
|
|
120
|
-
- Save to `knowzcode/specs/{NodeID}.md`
|
|
121
|
-
- **STOP**: Present specs for user approval
|
|
122
|
-
- After approval: `git commit` the specs as a checkpoint
|
|
123
|
-
|
|
124
|
-
### Phase 2A: Implementation (TDD MANDATORY)
|
|
125
|
-
- For EACH feature/criterion in the spec:
|
|
126
|
-
1. RED: Write a failing test first
|
|
127
|
-
2. GREEN: Write minimal code to make the test pass
|
|
128
|
-
3. REFACTOR: Clean up while keeping tests green
|
|
129
|
-
- Run full test suite + static analysis + build after all features
|
|
130
|
-
- Maximum 10 verification iterations before pausing
|
|
131
|
-
- **STOP**: Report implementation results
|
|
132
|
-
|
|
133
|
-
### Phase 2B: Completeness Audit
|
|
134
|
-
- READ-ONLY audit — do NOT modify source files
|
|
135
|
-
- Compare implementation against all VERIFY statements in specs
|
|
136
|
-
- Calculate completion percentage
|
|
137
|
-
- Report gaps, security concerns, integration issues
|
|
138
|
-
- **STOP**: Present audit results for user decision
|
|
139
|
-
|
|
140
|
-
### Phase 3: Finalization
|
|
141
|
-
- Update specs to "As-Built" status
|
|
142
|
-
- Check architecture doc for drift
|
|
143
|
-
- Prepend log entry to `knowzcode/knowzcode_log.md`
|
|
144
|
-
- Update tracker statuses to `[VERIFIED]`
|
|
145
|
-
- Create final commit with all changes
|
|
146
|
-
|
|
147
|
-
## Key Rules
|
|
148
|
-
- Always propose a Change Set before implementing
|
|
149
|
-
- Get user approval at every quality gate (STOP points above)
|
|
150
|
-
- TDD is mandatory — no production code without failing tests
|
|
151
|
-
- Log all completions in `knowzcode/knowzcode_log.md`
|
|
152
|
-
- Track work in `knowzcode/knowzcode_tracker.md`
|
|
153
|
-
- Every WorkGroup todo must start with `KnowzCode:` prefix
|
|
154
|
-
- Target <20 specs per project — consolidate when domains overlap
|
|
155
|
-
|
|
156
|
-
## Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
157
|
-
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds — **must** be captured.
|
|
158
|
-
When MCP is connected, write to vaults per `knowzcode/knowzcode_vaults.md` — always pass `vaultId` with `create_knowledge`.
|
|
159
|
-
When MCP is unavailable, capture locally in specs, log entries, or docs. Never let insights die in the conversation.
|
|
160
|
-
Use `/kc:learn "insight"` for automatic routing.
|
|
161
|
-
Vault entries are retrieved via semantic search — write detailed, self-contained content. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
162
|
-
|
|
163
|
-
## Quick Fix (Micro-Fix)
|
|
164
|
-
For single-file, <50 line, no-ripple-effect changes:
|
|
165
|
-
1. Implement the fix
|
|
166
|
-
2. Run targeted tests
|
|
167
|
-
3. Log a MicroFix entry
|
|
168
|
-
4. Commit with `fix:` prefix
|
|
169
|
-
|
|
170
|
-
## Key Files
|
|
171
|
-
- `knowzcode/knowzcode_loop.md` — Complete methodology
|
|
172
|
-
- `knowzcode/knowzcode_project.md` — Project context
|
|
173
|
-
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
174
|
-
- `knowzcode/knowzcode_tracker.md` — WorkGroup tracking
|
|
175
|
-
- `knowzcode/specs/` — Component specifications
|
|
176
|
-
- `knowzcode/workgroups/` — Active session data (gitignored)
|
|
177
|
-
```
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
Read
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
#
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
##
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
- `knowzcode/
|
|
233
|
-
- `knowzcode/
|
|
234
|
-
- `knowzcode/
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
##
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
-
|
|
345
|
-
-
|
|
346
|
-
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
#
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
##
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
-
|
|
460
|
-
-
|
|
461
|
-
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
##
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
##
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
-
|
|
960
|
-
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
##
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
-
|
|
1005
|
-
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
for
|
|
1
|
+
# KnowzCode Platform Adapters
|
|
2
|
+
|
|
3
|
+
This file contains adapter templates for integrating KnowzCode with different AI coding platforms. Each adapter teaches the platform's AI how to follow the KnowzCode methodology with full phase walkthroughs, quality gates, and TDD enforcement.
|
|
4
|
+
|
|
5
|
+
Generated by `/kc:init`. Adapters should be placed in the project root (or platform-specific location).
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Claude Code (CLAUDE.md section)
|
|
10
|
+
|
|
11
|
+
Append to or create `CLAUDE.md` in project root:
|
|
12
|
+
|
|
13
|
+
```markdown
|
|
14
|
+
# KnowzCode Integration
|
|
15
|
+
|
|
16
|
+
This project uses KnowzCode for structured TDD development with multi-agent orchestration.
|
|
17
|
+
|
|
18
|
+
## Required Reading
|
|
19
|
+
- `knowzcode/knowzcode_loop.md` — Development methodology (TDD, quality gates, phases)
|
|
20
|
+
- `knowzcode/knowzcode_project.md` — Project context and tech stack
|
|
21
|
+
- `knowzcode/knowzcode_tracker.md` — Current WorkGroup status
|
|
22
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture documentation
|
|
23
|
+
|
|
24
|
+
## Workflow Phases
|
|
25
|
+
Follow the phases in `knowzcode_loop.md` for all feature work:
|
|
26
|
+
1. **Phase 1A: Impact Analysis** — Identify affected components, propose Change Set. PAUSE for user approval.
|
|
27
|
+
2. **Phase 1B: Specification** — Draft specs for all NodeIDs. PAUSE for user approval. Commit specs.
|
|
28
|
+
3. **Phase 2A: Implementation** — Strict TDD (Red-Green-Refactor). No production code without a failing test.
|
|
29
|
+
4. **Phase 2B: Completeness Audit** — Independent READ-ONLY audit. PAUSE for user decision on gaps.
|
|
30
|
+
5. **Phase 3: Finalization** — Update specs to as-built, update tracker, log entry, final commit.
|
|
31
|
+
|
|
32
|
+
## Quality Gates
|
|
33
|
+
Never skip phases. PAUSE for user approval at each gate:
|
|
34
|
+
- After Change Set proposal (1A)
|
|
35
|
+
- After spec drafts (1B)
|
|
36
|
+
- After implementation (2A — awaiting audit)
|
|
37
|
+
- After audit results (2B — user decides on gaps)
|
|
38
|
+
|
|
39
|
+
## TDD Enforcement
|
|
40
|
+
TDD is mandatory — no production code without a failing test first.
|
|
41
|
+
Red-Green-Refactor cycle for every feature/criterion in the spec.
|
|
42
|
+
|
|
43
|
+
## Agents
|
|
44
|
+
Specialized agents handle each phase when using Agent Teams or subagent execution:
|
|
45
|
+
- `analyst` (1A), `architect` (1B), `builder` (2A), `reviewer` (2B), `closer` (3)
|
|
46
|
+
- Agent Teams is the preferred execution model when enabled (experimental, requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` env var)
|
|
47
|
+
- Subagent fallback for environments without Agent Teams
|
|
48
|
+
|
|
49
|
+
## Commands
|
|
50
|
+
- `/kc:work "goal"` — Start feature workflow
|
|
51
|
+
- `/kc:plan "topic"` — Research before implementing
|
|
52
|
+
- `/kc:audit [type]` — Run quality audits (spec, architecture, security, integration)
|
|
53
|
+
- `/kc:fix "target" "summary"` — Quick targeted fix
|
|
54
|
+
- `/kc:learn "insight"` — Capture learning to vault
|
|
55
|
+
- `/kc:status` — Check MCP connection and vault status
|
|
56
|
+
|
|
57
|
+
## MCP Integration
|
|
58
|
+
If configured, agents use `search_knowledge`, `ask_question`, and `create_knowledge` for enhanced context.
|
|
59
|
+
All commands work without MCP — it enhances but never blocks.
|
|
60
|
+
|
|
61
|
+
### Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
62
|
+
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds, convention changes —
|
|
63
|
+
**must** be captured. Knowledge lives in two places:
|
|
64
|
+
|
|
65
|
+
- **MCP vaults** (when connected): `knowzcode/knowzcode_vaults.md` defines vault IDs, routing rules,
|
|
66
|
+
and write conditions. Always pass `vaultId` when calling `create_knowledge` — omitting it saves
|
|
67
|
+
to the tenant default vault, NOT the project vault.
|
|
68
|
+
- **Local files** (always available): specs, workgroup files, log entries, architecture docs, and
|
|
69
|
+
`knowzcode/pending_captures.md` (scribe fallback queue when MCP is unavailable).
|
|
70
|
+
|
|
71
|
+
If MCP is not connected, knowledge still gets captured locally. Never let insights die in the conversation.
|
|
72
|
+
|
|
73
|
+
**Vault content detail**: Vault entries are retrieved via semantic search, not read directly like local files. Write detailed, self-contained entries with full reasoning, specific technology names, code examples, and file paths. Terse entries produce poor search results. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
74
|
+
|
|
75
|
+
### Knowz-Scribe Delegation
|
|
76
|
+
When knowz-scribe is active (Agent Teams mode), it owns all vault writes — do NOT call `create_knowledge` directly. Send knowledge to the scribe instead:
|
|
77
|
+
|
|
78
|
+
- **Phase captures**: Handled automatically at quality gates via task-tracked DMs
|
|
79
|
+
- **Explicit**: `"Log: {description}"` — scribe MUST write it; it decides routing (which vault or local file)
|
|
80
|
+
- **Soft**: `"Consider: {description}"` — scribe evaluates whether to capture and where; may skip if not insight-worthy or duplicative
|
|
81
|
+
|
|
82
|
+
Any agent can send ad-hoc knowledge to the scribe at any time. The scribe handles routing, dedup, and formatting. If MCP is unavailable, the scribe queues captures to `knowzcode/pending_captures.md` for later sync. When no scribe is active, use `/kc:learn "insight"` for automatic routing.
|
|
83
|
+
|
|
84
|
+
## WorkGroup Files
|
|
85
|
+
- Created in `knowzcode/workgroups/` (gitignored)
|
|
86
|
+
- Every todo must start with `KnowzCode:` prefix
|
|
87
|
+
- Track phase history, Change Set, and outstanding work
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## OpenAI Codex (AGENTS.md)
|
|
93
|
+
|
|
94
|
+
Create `AGENTS.md` in project root. Notes: `AGENTS.override.md` can be used for user-local overrides. 32KB file size limit. Plain text format (no YAML frontmatter). Codex (2026) also supports `SKILL.md` files for discoverable skills — these appear as available commands in the Codex UI. `AGENTS.md` remains the primary instruction mechanism for KnowzCode methodology.
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
# KnowzCode Development Methodology
|
|
98
|
+
|
|
99
|
+
This project uses KnowzCode for structured TDD development.
|
|
100
|
+
Read `knowzcode/knowzcode_loop.md` before starting any feature work.
|
|
101
|
+
|
|
102
|
+
## Phase Walkthrough
|
|
103
|
+
|
|
104
|
+
### Before Starting
|
|
105
|
+
1. Read `knowzcode/knowzcode_tracker.md` — check for active WorkGroups
|
|
106
|
+
2. Read `knowzcode/knowzcode_project.md` — understand project context
|
|
107
|
+
3. Read `knowzcode/knowzcode_architecture.md` — understand current architecture
|
|
108
|
+
|
|
109
|
+
### Phase 1A: Impact Analysis
|
|
110
|
+
- Analyze what needs to change for the given goal
|
|
111
|
+
- Create NodeIDs for NEW capabilities only (not per-file)
|
|
112
|
+
- Check `knowzcode/specs/` for existing specs in the same domain
|
|
113
|
+
- Propose a Change Set with NodeIDs, affected files, and risk assessment
|
|
114
|
+
- **STOP**: Present Change Set for user approval before continuing
|
|
115
|
+
|
|
116
|
+
### Phase 1B: Specification
|
|
117
|
+
- Draft specs for each NodeID using the 4-section format:
|
|
118
|
+
- Rules & Decisions, Interfaces, Verification Criteria, Debt & Gaps
|
|
119
|
+
- Minimum: 1+ Rules, 1+ Interface, 2+ VERIFY statements per spec
|
|
120
|
+
- Save to `knowzcode/specs/{NodeID}.md`
|
|
121
|
+
- **STOP**: Present specs for user approval
|
|
122
|
+
- After approval: `git commit` the specs as a checkpoint
|
|
123
|
+
|
|
124
|
+
### Phase 2A: Implementation (TDD MANDATORY)
|
|
125
|
+
- For EACH feature/criterion in the spec:
|
|
126
|
+
1. RED: Write a failing test first
|
|
127
|
+
2. GREEN: Write minimal code to make the test pass
|
|
128
|
+
3. REFACTOR: Clean up while keeping tests green
|
|
129
|
+
- Run full test suite + static analysis + build after all features
|
|
130
|
+
- Maximum 10 verification iterations before pausing
|
|
131
|
+
- **STOP**: Report implementation results
|
|
132
|
+
|
|
133
|
+
### Phase 2B: Completeness Audit
|
|
134
|
+
- READ-ONLY audit — do NOT modify source files
|
|
135
|
+
- Compare implementation against all VERIFY statements in specs
|
|
136
|
+
- Calculate completion percentage
|
|
137
|
+
- Report gaps, security concerns, integration issues
|
|
138
|
+
- **STOP**: Present audit results for user decision
|
|
139
|
+
|
|
140
|
+
### Phase 3: Finalization
|
|
141
|
+
- Update specs to "As-Built" status
|
|
142
|
+
- Check architecture doc for drift
|
|
143
|
+
- Prepend log entry to `knowzcode/knowzcode_log.md`
|
|
144
|
+
- Update tracker statuses to `[VERIFIED]`
|
|
145
|
+
- Create final commit with all changes
|
|
146
|
+
|
|
147
|
+
## Key Rules
|
|
148
|
+
- Always propose a Change Set before implementing
|
|
149
|
+
- Get user approval at every quality gate (STOP points above)
|
|
150
|
+
- TDD is mandatory — no production code without failing tests
|
|
151
|
+
- Log all completions in `knowzcode/knowzcode_log.md`
|
|
152
|
+
- Track work in `knowzcode/knowzcode_tracker.md`
|
|
153
|
+
- Every WorkGroup todo must start with `KnowzCode:` prefix
|
|
154
|
+
- Target <20 specs per project — consolidate when domains overlap
|
|
155
|
+
|
|
156
|
+
## Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
157
|
+
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds — **must** be captured.
|
|
158
|
+
When MCP is connected, write to vaults per `knowzcode/knowzcode_vaults.md` — always pass `vaultId` with `create_knowledge`.
|
|
159
|
+
When MCP is unavailable, capture locally in specs, log entries, or docs. Never let insights die in the conversation.
|
|
160
|
+
Use `/kc:learn "insight"` for automatic routing.
|
|
161
|
+
Vault entries are retrieved via semantic search — write detailed, self-contained content. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
162
|
+
|
|
163
|
+
## Quick Fix (Micro-Fix)
|
|
164
|
+
For single-file, <50 line, no-ripple-effect changes:
|
|
165
|
+
1. Implement the fix
|
|
166
|
+
2. Run targeted tests
|
|
167
|
+
3. Log a MicroFix entry
|
|
168
|
+
4. Commit with `fix:` prefix
|
|
169
|
+
|
|
170
|
+
## Key Files
|
|
171
|
+
- `knowzcode/knowzcode_loop.md` — Complete methodology
|
|
172
|
+
- `knowzcode/knowzcode_project.md` — Project context
|
|
173
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
174
|
+
- `knowzcode/knowzcode_tracker.md` — WorkGroup tracking
|
|
175
|
+
- `knowzcode/specs/` — Component specifications
|
|
176
|
+
- `knowzcode/workgroups/` — Active session data (gitignored)
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Codex Skill Files (`.codex/skills/kc/`)
|
|
180
|
+
|
|
181
|
+
Codex (2026) supports `SKILL.md` files for discoverable skills. Place in `.codex/skills/kc/` for automatic `/kc:` command namespacing in the Codex UI.
|
|
182
|
+
|
|
183
|
+
#### .codex/skills/kc/work.md
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
<!-- Generated by KnowzCode vX.Y.Z -->
|
|
187
|
+
|
|
188
|
+
# /kc:work — Start KnowzCode Workflow
|
|
189
|
+
|
|
190
|
+
Start a structured KnowzCode development workflow for the given goal.
|
|
191
|
+
|
|
192
|
+
## Instructions
|
|
193
|
+
|
|
194
|
+
Read these files for methodology and project context:
|
|
195
|
+
- `knowzcode/knowzcode_loop.md` — Complete methodology
|
|
196
|
+
- `knowzcode/knowzcode_project.md` — Project context
|
|
197
|
+
- `knowzcode/knowzcode_tracker.md` — Active WorkGroups
|
|
198
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
199
|
+
|
|
200
|
+
### Step 1: Classify Tier
|
|
201
|
+
- **Micro** (single file, <50 lines): Use `/kc:fix` instead
|
|
202
|
+
- **Light** (≤3 files): Streamlined 2-phase path
|
|
203
|
+
- **Full** (>3 files or complex): Complete 5-phase workflow
|
|
204
|
+
|
|
205
|
+
### Step 2: Create WorkGroup
|
|
206
|
+
Generate WorkGroupID: `kc-{type}-{slug}-YYYYMMDD-HHMMSS`
|
|
207
|
+
Create `knowzcode/workgroups/{WorkGroupID}.md`
|
|
208
|
+
|
|
209
|
+
### Step 3: Phase 1A — Impact Analysis
|
|
210
|
+
1. Identify affected components
|
|
211
|
+
2. Create NodeIDs for new capabilities (PascalCase)
|
|
212
|
+
3. Check `knowzcode/specs/` for existing domain overlap
|
|
213
|
+
4. Propose Change Set with NodeIDs, affected files, risk assessment
|
|
214
|
+
|
|
215
|
+
**STOP** — Present Change Set for user approval before continuing.
|
|
216
|
+
|
|
217
|
+
After approval, continue through Phase 1B (Specification) → Phase 2A (TDD Implementation) → Phase 2B (Audit) → Phase 3 (Finalization), stopping at each quality gate.
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
#### .codex/skills/kc/plan.md
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
<!-- Generated by KnowzCode vX.Y.Z -->
|
|
224
|
+
|
|
225
|
+
# /kc:plan — Research Before Implementing
|
|
226
|
+
|
|
227
|
+
Investigate a topic in the codebase before implementing changes.
|
|
228
|
+
|
|
229
|
+
## Instructions
|
|
230
|
+
|
|
231
|
+
Read these files for context:
|
|
232
|
+
- `knowzcode/knowzcode_loop.md` — Methodology
|
|
233
|
+
- `knowzcode/knowzcode_project.md` — Project context
|
|
234
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
235
|
+
|
|
236
|
+
1. Explore the codebase for relevant files, patterns, and implementations
|
|
237
|
+
2. Check `knowzcode/specs/` for related component specs
|
|
238
|
+
3. Scan `knowzcode/workgroups/` for past WorkGroups in similar areas
|
|
239
|
+
4. Review `knowzcode/knowzcode_architecture.md` for structural context
|
|
240
|
+
5. Present findings with current state, patterns, options, and recommended approach
|
|
241
|
+
|
|
242
|
+
**STOP** — Present research findings. To implement, use `/kc:work` with the chosen approach.
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
#### .codex/skills/kc/fix.md
|
|
246
|
+
|
|
247
|
+
```markdown
|
|
248
|
+
<!-- Generated by KnowzCode vX.Y.Z -->
|
|
249
|
+
|
|
250
|
+
# /kc:fix — Quick Targeted Fix
|
|
251
|
+
|
|
252
|
+
Apply a targeted fix using the micro-fix protocol.
|
|
253
|
+
|
|
254
|
+
## Scope Guard
|
|
255
|
+
|
|
256
|
+
This workflow is for changes that are:
|
|
257
|
+
- Single file (or minimal multi-file with no ripple effects)
|
|
258
|
+
- <50 lines changed
|
|
259
|
+
- No architectural impact
|
|
260
|
+
|
|
261
|
+
If the fix exceeds this scope, suggest `/kc:work` instead.
|
|
262
|
+
|
|
263
|
+
## Instructions
|
|
264
|
+
|
|
265
|
+
Read `knowzcode/knowzcode_loop.md` section on Micro-Fix.
|
|
266
|
+
|
|
267
|
+
1. Implement the fix
|
|
268
|
+
2. Run targeted tests for the affected code
|
|
269
|
+
3. Prepend a MicroFix entry to `knowzcode/knowzcode_log.md`
|
|
270
|
+
4. Commit with `fix: {description}` message
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
#### .codex/skills/kc/audit.md
|
|
274
|
+
|
|
275
|
+
```markdown
|
|
276
|
+
<!-- Generated by KnowzCode vX.Y.Z -->
|
|
277
|
+
|
|
278
|
+
# /kc:audit — Quality Audit
|
|
279
|
+
|
|
280
|
+
Perform a READ-ONLY audit comparing implementation against specs.
|
|
281
|
+
|
|
282
|
+
## Instructions
|
|
283
|
+
|
|
284
|
+
Read these files:
|
|
285
|
+
- `knowzcode/knowzcode_loop.md` — Phase 2B methodology
|
|
286
|
+
- `knowzcode/knowzcode_tracker.md` — Find active WorkGroups
|
|
287
|
+
|
|
288
|
+
**CRITICAL: This is a READ-ONLY audit. Do NOT modify source files.**
|
|
289
|
+
|
|
290
|
+
1. Compare implementation against all VERIFY statements in specs from `knowzcode/specs/`
|
|
291
|
+
2. Calculate completion percentage per NodeID and overall
|
|
292
|
+
3. Identify gaps: missing features, incomplete criteria, untested paths
|
|
293
|
+
4. Check for security concerns
|
|
294
|
+
5. Assess risk for any gaps found
|
|
295
|
+
|
|
296
|
+
### Standalone Audit Types
|
|
297
|
+
- **spec**: Audit spec quality and VERIFY statement coverage
|
|
298
|
+
- **architecture**: Compare architecture doc against codebase
|
|
299
|
+
- **security**: OWASP top 10, input validation, auth flows
|
|
300
|
+
- **integration**: API contracts, dependency health
|
|
301
|
+
|
|
302
|
+
**STOP** — Present audit results with completion percentage and gap list.
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
#### .codex/skills/kc/learn.md
|
|
306
|
+
|
|
307
|
+
```markdown
|
|
308
|
+
<!-- Generated by KnowzCode vX.Y.Z -->
|
|
309
|
+
|
|
310
|
+
# /kc:learn — Capture Learning
|
|
311
|
+
|
|
312
|
+
Capture a learning, decision, or pattern to the KnowzCode knowledge vault.
|
|
313
|
+
|
|
314
|
+
## Instructions
|
|
315
|
+
|
|
316
|
+
Read `knowzcode/knowzcode_vaults.md` for vault configuration and routing rules.
|
|
317
|
+
|
|
318
|
+
1. Analyze the learning provided
|
|
319
|
+
2. Categorize: Pattern, Workaround, Decision, Convention, Security, Integration, Performance, Completion
|
|
320
|
+
3. Route to the appropriate vault:
|
|
321
|
+
- Pattern/Workaround/Performance → `code` vault
|
|
322
|
+
- Decision/Convention/Security/Integration → `ecosystem` vault
|
|
323
|
+
- Completion → `finalizations` vault
|
|
324
|
+
4. If MCP is connected: call `create_knowledge` with appropriate `vaultId`
|
|
325
|
+
5. If MCP is unavailable: append to `knowzcode/pending_captures.md`
|
|
326
|
+
|
|
327
|
+
Write detailed, self-contained entries — vault entries are retrieved via semantic search.
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
#### .codex/skills/kc/continue.md
|
|
331
|
+
|
|
332
|
+
```markdown
|
|
333
|
+
<!-- Generated by KnowzCode vX.Y.Z -->
|
|
334
|
+
|
|
335
|
+
# /kc:continue — Resume Workflow
|
|
336
|
+
|
|
337
|
+
Resume an interrupted KnowzCode workflow or advance to the next phase.
|
|
338
|
+
|
|
339
|
+
## Instructions
|
|
340
|
+
|
|
341
|
+
Read `knowzcode/knowzcode_tracker.md` to find active `[WIP]` WorkGroups.
|
|
342
|
+
|
|
343
|
+
### Step 1: Find Active WorkGroup
|
|
344
|
+
- One active: use it
|
|
345
|
+
- Multiple active: ask user which to resume
|
|
346
|
+
- None active: suggest `/kc:work`
|
|
347
|
+
|
|
348
|
+
### Step 2: Determine Current Phase
|
|
349
|
+
Read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`.
|
|
350
|
+
Check the Phase History table to determine current state.
|
|
351
|
+
|
|
352
|
+
### Step 3: Resume
|
|
353
|
+
|
|
354
|
+
| State | Action |
|
|
355
|
+
|-------|--------|
|
|
356
|
+
| 1A in progress | Complete impact analysis |
|
|
357
|
+
| 1A approved, specs not started | Begin Phase 1B |
|
|
358
|
+
| 1B approved, not implemented | Begin Phase 2A |
|
|
359
|
+
| 2A complete | Run Phase 2B audit |
|
|
360
|
+
| 2B complete, gaps found | Present fix/accept options |
|
|
361
|
+
| 2B complete, no gaps | Begin Phase 3 |
|
|
362
|
+
|
|
363
|
+
Resume from the appropriate phase following `knowzcode/knowzcode_loop.md`.
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Google Gemini CLI (GEMINI.md)
|
|
369
|
+
|
|
370
|
+
Create `GEMINI.md` in project root. Notes: Gemini CLI supports `@file.md` imports for pulling in methodology files (e.g., `@knowzcode/knowzcode_loop.md`). User-global preferences can be placed in `~/.gemini/GEMINI.md`.
|
|
371
|
+
|
|
372
|
+
### Native Commands (`.gemini/commands/kc/*.toml`)
|
|
373
|
+
|
|
374
|
+
Gemini CLI (2026) supports native custom commands via TOML files in `.gemini/commands/`. Subdirectory namespacing gives the `/kc:` prefix automatically:
|
|
375
|
+
|
|
376
|
+
```toml
|
|
377
|
+
# .gemini/commands/kc/work.toml
|
|
378
|
+
description = "Start a new KnowzCode development workflow"
|
|
379
|
+
prompt = """Read knowzcode/knowzcode_loop.md. Follow Phase 1A→3 workflow for:
|
|
380
|
+
<ARGS/>
|
|
381
|
+
Read knowzcode/knowzcode_project.md for project context.
|
|
382
|
+
Read knowzcode/knowzcode_tracker.md for active work."""
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
```toml
|
|
386
|
+
# .gemini/commands/kc/plan.toml
|
|
387
|
+
description = "Research before implementing"
|
|
388
|
+
prompt = """Read knowzcode/knowzcode_loop.md and knowzcode/knowzcode_project.md.
|
|
389
|
+
Investigate the codebase for: <ARGS/>
|
|
390
|
+
Present findings with options. Say 'implement' to transition to /kc:work."""
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
```toml
|
|
394
|
+
# .gemini/commands/kc/fix.toml
|
|
395
|
+
description = "Quick targeted fix (micro-fix workflow)"
|
|
396
|
+
prompt = """Read knowzcode/knowzcode_loop.md section on Micro-Fix.
|
|
397
|
+
Apply a targeted fix for: <ARGS/>
|
|
398
|
+
Run tests, log a MicroFix entry, commit with fix: prefix."""
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
```toml
|
|
402
|
+
# .gemini/commands/kc/audit.toml
|
|
403
|
+
description = "Run quality audit against specs"
|
|
404
|
+
prompt = """Read knowzcode/knowzcode_loop.md Phase 2B.
|
|
405
|
+
Perform a READ-ONLY audit comparing implementation against specs in knowzcode/specs/.
|
|
406
|
+
Report completion percentage, gaps, and security concerns for: <ARGS/>"""
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
```toml
|
|
410
|
+
# .gemini/commands/kc/learn.toml
|
|
411
|
+
description = "Capture a learning to KnowzCode vault"
|
|
412
|
+
prompt = """Read knowzcode/knowzcode_loop.md section on Knowledge Capture.
|
|
413
|
+
Capture the following learning: <ARGS/>
|
|
414
|
+
Route to the appropriate vault per knowzcode/knowzcode_vaults.md.
|
|
415
|
+
If MCP is unavailable, save to knowzcode/pending_captures.md."""
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
```toml
|
|
419
|
+
# .gemini/commands/kc/status.toml
|
|
420
|
+
description = "Check KnowzCode MCP connection and vault status"
|
|
421
|
+
prompt = """Check the MCP connection status by calling list_vaults.
|
|
422
|
+
Report which vaults are configured in knowzcode/knowzcode_vaults.md.
|
|
423
|
+
Show active WorkGroups from knowzcode/knowzcode_tracker.md."""
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
```toml
|
|
427
|
+
# .gemini/commands/kc/continue.toml
|
|
428
|
+
description = "Resume interrupted KnowzCode workflow"
|
|
429
|
+
prompt = """Read knowzcode/knowzcode_tracker.md to find active [WIP] WorkGroups.
|
|
430
|
+
Read the most recent WorkGroup file from knowzcode/workgroups/.
|
|
431
|
+
Determine the current phase from the Phase History table.
|
|
432
|
+
Resume from where the workflow left off, following knowzcode/knowzcode_loop.md."""
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Gemini also supports extensions (`gemini-extension.json`) for tool integration and `@file.md` imports for including methodology files directly in prompts.
|
|
436
|
+
|
|
437
|
+
```markdown
|
|
438
|
+
# KnowzCode Development Methodology
|
|
439
|
+
|
|
440
|
+
This project uses KnowzCode for structured TDD development.
|
|
441
|
+
|
|
442
|
+
## Required Reading
|
|
443
|
+
Read these files before starting any feature work (use @import syntax for direct inclusion):
|
|
444
|
+
- `knowzcode/knowzcode_loop.md` — Complete workflow methodology
|
|
445
|
+
- `knowzcode/knowzcode_project.md` — Project context and tech stack
|
|
446
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture documentation
|
|
447
|
+
- `knowzcode/knowzcode_tracker.md` — Active WorkGroups
|
|
448
|
+
|
|
449
|
+
## Phase Walkthrough
|
|
450
|
+
|
|
451
|
+
### Phase 1A: Impact Analysis
|
|
452
|
+
- Identify components affected by the goal
|
|
453
|
+
- Create NodeIDs for new capabilities (PascalCase domain concepts)
|
|
454
|
+
- Check existing specs for domain overlap before creating new ones
|
|
455
|
+
- Present Change Set for user approval — STOP until approved
|
|
456
|
+
|
|
457
|
+
### Phase 1B: Specification
|
|
458
|
+
- Draft specs using 4-section format (Rules, Interfaces, Verification Criteria, Debt)
|
|
459
|
+
- Each spec needs 2+ VERIFY statements
|
|
460
|
+
- Present for approval — STOP until approved
|
|
461
|
+
- Commit specs as a pre-implementation checkpoint
|
|
462
|
+
|
|
463
|
+
### Phase 2A: Implementation (TDD Required)
|
|
464
|
+
- Follow Red-Green-Refactor for every feature
|
|
465
|
+
- Write failing test FIRST, then minimal code to pass, then refactor
|
|
466
|
+
- Run full test suite + linter + build when all features done
|
|
467
|
+
- STOP and report results
|
|
468
|
+
|
|
469
|
+
### Phase 2B: Completeness Audit
|
|
470
|
+
- READ-ONLY comparison of implementation vs specs
|
|
471
|
+
- Calculate completion percentage
|
|
472
|
+
- Report gaps and security concerns
|
|
473
|
+
- STOP for user decision
|
|
474
|
+
|
|
475
|
+
### Phase 3: Finalization
|
|
476
|
+
- Update specs to As-Built, update tracker, write log entry
|
|
477
|
+
- Check architecture doc for drift
|
|
478
|
+
- Final commit
|
|
479
|
+
|
|
480
|
+
## Rules
|
|
481
|
+
- Follow quality gates strictly — STOP at each gate for user approval
|
|
482
|
+
- TDD is mandatory for all feature work
|
|
483
|
+
- Propose Change Sets before implementing
|
|
484
|
+
- Update specs and tracker after implementation
|
|
485
|
+
- Log completions in `knowzcode/knowzcode_log.md`
|
|
486
|
+
- Target <20 specs — consolidate when domains overlap >50%
|
|
487
|
+
|
|
488
|
+
## Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
489
|
+
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds — **must** be captured.
|
|
490
|
+
When MCP is connected, write to vaults per `knowzcode/knowzcode_vaults.md` — always pass `vaultId` with `create_knowledge`.
|
|
491
|
+
When MCP is unavailable, capture locally in specs, log entries, or docs. Never let insights die in the conversation.
|
|
492
|
+
Use `/kc:learn "insight"` for automatic routing.
|
|
493
|
+
Vault entries are retrieved via semantic search — write detailed, self-contained content. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
494
|
+
|
|
495
|
+
## Micro-Fix (for small changes)
|
|
496
|
+
Single file, <50 lines, no ripple effects:
|
|
497
|
+
1. Implement fix → 2. Run tests → 3. Log MicroFix → 4. Commit with `fix:`
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
---
|
|
501
|
+
|
|
502
|
+
## Cursor (`.cursor/rules/knowzcode.mdc`)
|
|
503
|
+
|
|
504
|
+
Create `.cursor/rules/knowzcode.mdc` with YAML frontmatter. Notes: Modern Cursor uses `.cursor/rules/*.mdc` files instead of the deprecated `.cursorrules`. Scoped rules can target specific file patterns using the `globs` frontmatter field. Cursor 1.6+ (2026) also supports `.cursor/commands/*.md` for custom slash commands (beta) and reads `AGENTS.md` for agent instructions.
|
|
505
|
+
|
|
506
|
+
```markdown
|
|
507
|
+
---
|
|
508
|
+
description: KnowzCode TDD development methodology
|
|
509
|
+
alwaysApply: true
|
|
510
|
+
---
|
|
511
|
+
|
|
512
|
+
# KnowzCode Rules
|
|
513
|
+
|
|
514
|
+
This project uses KnowzCode for structured TDD development.
|
|
515
|
+
|
|
516
|
+
## Required Reading
|
|
517
|
+
Before any feature work, read:
|
|
518
|
+
- `knowzcode/knowzcode_loop.md` — Complete methodology
|
|
519
|
+
- `knowzcode/knowzcode_project.md` — Project context
|
|
520
|
+
- `knowzcode/knowzcode_tracker.md` — Active WorkGroups
|
|
521
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
522
|
+
|
|
523
|
+
## Phase Rules
|
|
524
|
+
|
|
525
|
+
### Phase 1A: Impact Analysis
|
|
526
|
+
- Identify affected components and propose a Change Set
|
|
527
|
+
- NodeIDs are domain concepts (PascalCase), not tasks
|
|
528
|
+
- Check `knowzcode/specs/` before creating new specs
|
|
529
|
+
- PAUSE for user approval before proceeding
|
|
530
|
+
|
|
531
|
+
### Phase 1B: Specification
|
|
532
|
+
- Use 4-section format: Rules & Decisions, Interfaces, Verification Criteria, Debt & Gaps
|
|
533
|
+
- Minimum: 2+ VERIFY statements per spec
|
|
534
|
+
- PAUSE for user approval, then commit specs
|
|
535
|
+
|
|
536
|
+
### Phase 2A: Implementation
|
|
537
|
+
- TDD is mandatory: write failing test FIRST, then minimal code, then refactor
|
|
538
|
+
- Use Composer for multi-file edits when implementing across components
|
|
539
|
+
- Run full test suite before reporting complete
|
|
540
|
+
- PAUSE after implementation
|
|
541
|
+
|
|
542
|
+
### Phase 2B: Audit
|
|
543
|
+
- READ-ONLY — do not modify source files
|
|
544
|
+
- Compare implementation vs spec VERIFY statements
|
|
545
|
+
- Report completion percentage and gaps
|
|
546
|
+
- PAUSE for user decision
|
|
547
|
+
|
|
548
|
+
### Phase 3: Finalization
|
|
549
|
+
- Update specs to As-Built status
|
|
550
|
+
- Update tracker and log
|
|
551
|
+
- Check architecture for drift
|
|
552
|
+
- Final commit
|
|
553
|
+
|
|
554
|
+
## Enforcement
|
|
555
|
+
- Never skip phases or quality gates
|
|
556
|
+
- TDD is mandatory — no production code without a failing test
|
|
557
|
+
- Every WorkGroup todo starts with `KnowzCode:` prefix
|
|
558
|
+
- Consolidate specs when domains overlap >50%
|
|
559
|
+
- Target <20 specs per project
|
|
560
|
+
- Read `knowzcode/knowzcode_tracker.md` for active work
|
|
561
|
+
- Log completions in `knowzcode/knowzcode_log.md`
|
|
562
|
+
|
|
563
|
+
## Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
564
|
+
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds — **must** be captured.
|
|
565
|
+
When MCP is connected, write to vaults per `knowzcode/knowzcode_vaults.md` — always pass `vaultId` with `create_knowledge`.
|
|
566
|
+
When MCP is unavailable, capture locally in specs, log entries, or docs. Never let insights die in the conversation.
|
|
567
|
+
Use `/kc:learn "insight"` for automatic routing.
|
|
568
|
+
Vault entries are retrieved via semantic search — write detailed, self-contained content. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
---
|
|
572
|
+
|
|
573
|
+
## GitHub Copilot (.github/copilot-instructions.md + .github/prompts/*.prompt.md)
|
|
574
|
+
|
|
575
|
+
GitHub Copilot (2026) supports three instruction mechanisms used by KnowzCode:
|
|
576
|
+
|
|
577
|
+
1. **`.github/copilot-instructions.md`** — Repository-level instructions, always active
|
|
578
|
+
2. **`.github/prompts/*.prompt.md`** — Custom prompts invocable via `#prompt:name` in VS Code
|
|
579
|
+
3. **MCP server tools** (`.vscode/mcp.json`) — Tool access for vault queries
|
|
580
|
+
|
|
581
|
+
Copilot operates as a **single-agent, sequential** platform — no multi-agent orchestration. Users manually transition between phases using prompt files. See `knowzcode/copilot_execution.md` for the full execution model.
|
|
582
|
+
|
|
583
|
+
### A. copilot-instructions.md
|
|
584
|
+
|
|
585
|
+
Create `.github/copilot-instructions.md`:
|
|
586
|
+
|
|
587
|
+
```markdown
|
|
588
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
589
|
+
|
|
590
|
+
# KnowzCode Development Methodology
|
|
591
|
+
|
|
592
|
+
This repository uses KnowzCode for structured TDD development with quality gates.
|
|
593
|
+
|
|
594
|
+
## Required Reading
|
|
595
|
+
- `knowzcode/knowzcode_loop.md` — Complete methodology (read first)
|
|
596
|
+
- `knowzcode/knowzcode_project.md` — Project context and tech stack
|
|
597
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture documentation
|
|
598
|
+
- `knowzcode/knowzcode_tracker.md` — WorkGroup status tracking
|
|
599
|
+
|
|
600
|
+
## Workflow Overview
|
|
601
|
+
|
|
602
|
+
KnowzCode follows a 5-phase development loop with quality gates between each phase.
|
|
603
|
+
Use the prompt files in `.github/prompts/` to invoke each phase:
|
|
604
|
+
|
|
605
|
+
| Phase | Prompt | Description |
|
|
606
|
+
|-------|--------|-------------|
|
|
607
|
+
| Full workflow | `#prompt:kc-work` | Start a new feature — creates WorkGroup, classifies tier, runs Phase 1A |
|
|
608
|
+
| 1A: Analysis | `#prompt:kc-analyze` | Re-run impact analysis on existing WorkGroup |
|
|
609
|
+
| 1B: Specification | `#prompt:kc-specify` | Draft specs from approved Change Set |
|
|
610
|
+
| 2A: Implementation | `#prompt:kc-implement` | TDD implementation with verification loop |
|
|
611
|
+
| 2B: Audit | `#prompt:kc-audit` | READ-ONLY audit against specs |
|
|
612
|
+
| 3: Finalization | `#prompt:kc-finalize` | Update specs, tracker, log, commit |
|
|
613
|
+
| Quick fix | `#prompt:kc-fix` | Micro-fix for small, scoped changes |
|
|
614
|
+
| Research | `#prompt:kc-plan` | Investigate before implementing |
|
|
615
|
+
| Resume | `#prompt:kc-continue` | Resume or advance to next phase |
|
|
616
|
+
|
|
617
|
+
### Typical Flow
|
|
618
|
+
|
|
619
|
+
1. `#prompt:kc-work "Build JWT authentication"` → Creates WorkGroup, proposes Change Set, **STOPs**
|
|
620
|
+
2. Approve Change Set
|
|
621
|
+
3. `#prompt:kc-specify` → Drafts specs, **STOPs**
|
|
622
|
+
4. Approve specs
|
|
623
|
+
5. `#prompt:kc-implement` → TDD Red-Green-Refactor, **STOPs**
|
|
624
|
+
6. `#prompt:kc-audit` → READ-ONLY audit, reports gaps, **STOPs**
|
|
625
|
+
7. `#prompt:kc-finalize` → Updates docs, commits
|
|
626
|
+
|
|
627
|
+
Use `#prompt:kc-continue` at any point to resume where you left off.
|
|
628
|
+
|
|
629
|
+
## Quality Gates
|
|
630
|
+
|
|
631
|
+
STOP and await user approval at each gate:
|
|
632
|
+
- After Change Set proposal (1A)
|
|
633
|
+
- After spec drafts (1B)
|
|
634
|
+
- After implementation complete (2A — awaiting audit)
|
|
635
|
+
- After audit results (2B — user decides on gaps)
|
|
636
|
+
|
|
637
|
+
## TDD Enforcement
|
|
638
|
+
|
|
639
|
+
TDD is mandatory — no production code without a failing test first.
|
|
640
|
+
Follow Red-Green-Refactor for every feature/criterion in the spec.
|
|
641
|
+
|
|
642
|
+
## Key Rules
|
|
643
|
+
- NodeIDs are domain concepts (PascalCase), not tasks
|
|
644
|
+
- Consolidate specs when domains overlap >50%
|
|
645
|
+
- Every WorkGroup todo starts with `KnowzCode:` prefix
|
|
646
|
+
- Target <20 specs per project
|
|
647
|
+
- Log completions in `knowzcode/knowzcode_log.md`
|
|
648
|
+
|
|
649
|
+
## Key Files
|
|
650
|
+
- `knowzcode/knowzcode_loop.md` — Methodology
|
|
651
|
+
- `knowzcode/knowzcode_project.md` — Project context
|
|
652
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
653
|
+
- `knowzcode/knowzcode_tracker.md` — WorkGroup tracking
|
|
654
|
+
- `knowzcode/specs/` — Component specifications
|
|
655
|
+
- `knowzcode/workgroups/` — Active session data (gitignored)
|
|
656
|
+
|
|
657
|
+
## MCP Integration
|
|
658
|
+
|
|
659
|
+
If configured in `.vscode/mcp.json`, use `search_knowledge` and `ask_question` tools
|
|
660
|
+
for enhanced context from knowledge vaults. All prompts work without MCP.
|
|
661
|
+
|
|
662
|
+
## Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
663
|
+
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds — **must** be captured.
|
|
664
|
+
When MCP is connected, write to vaults per `knowzcode/knowzcode_vaults.md` — always pass `vaultId` with `create_knowledge`.
|
|
665
|
+
When MCP is unavailable, capture locally in specs, log entries, or docs. Never let insights die in the conversation.
|
|
666
|
+
Use `/kc:learn "insight"` for automatic routing.
|
|
667
|
+
Vault entries are retrieved via semantic search — write detailed, self-contained content. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
668
|
+
|
|
669
|
+
## Copilot Coding Agent
|
|
670
|
+
|
|
671
|
+
When the Copilot Coding Agent works on GitHub issues for this repository:
|
|
672
|
+
- Read `knowzcode/knowzcode_loop.md` and this file for methodology
|
|
673
|
+
- Follow Phase 1A→3 workflow for any non-trivial change
|
|
674
|
+
- Include the Change Set in the PR description
|
|
675
|
+
- Use TDD — failing test before implementation code
|
|
676
|
+
- Self-audit against spec VERIFY statements before marking PR ready
|
|
677
|
+
- Quality gates are deferred to PR review (no interactive approval in async mode)
|
|
678
|
+
|
|
679
|
+
## Model Selection
|
|
680
|
+
- Complex phases (1A analysis, 1B spec drafting, 2B audit): Use Claude Opus or GPT-4o
|
|
681
|
+
- Implementation (2A): Any capable model with good code generation
|
|
682
|
+
- Quick fixes: Any model
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
### B. Prompt File Templates (.github/prompts/)
|
|
686
|
+
|
|
687
|
+
Each prompt file is invocable via `#prompt:kc-*` in VS Code Copilot Chat. All use `agent: "agent"` for file editing capability.
|
|
688
|
+
|
|
689
|
+
#### kc-work.prompt.md
|
|
690
|
+
|
|
691
|
+
```markdown
|
|
692
|
+
---
|
|
693
|
+
agent: "agent"
|
|
694
|
+
description: "Start a new KnowzCode development workflow"
|
|
695
|
+
argument-hint: "Describe the feature or goal to build"
|
|
696
|
+
---
|
|
697
|
+
|
|
698
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
699
|
+
|
|
700
|
+
# KnowzCode: Start Workflow
|
|
701
|
+
|
|
702
|
+
You are starting a new KnowzCode development workflow. Follow the methodology precisely.
|
|
703
|
+
|
|
704
|
+
## Context
|
|
705
|
+
|
|
706
|
+
Read these files for methodology and project context:
|
|
707
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
708
|
+
- #file:knowzcode/knowzcode_project.md
|
|
709
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
710
|
+
- #file:knowzcode/knowzcode_architecture.md
|
|
711
|
+
|
|
712
|
+
## Instructions
|
|
713
|
+
|
|
714
|
+
The user's goal is provided in the chat message.
|
|
715
|
+
|
|
716
|
+
### Step 1: Classify Tier
|
|
717
|
+
|
|
718
|
+
Based on the goal, classify complexity:
|
|
719
|
+
- **Micro** (single file, <50 lines, no ripple): Redirect to `#prompt:kc-fix`
|
|
720
|
+
- **Light** (≤3 files, straightforward): Streamlined 2-phase path
|
|
721
|
+
- **Full** (>3 files or complex): Complete 5-phase workflow
|
|
722
|
+
|
|
723
|
+
### Step 2: Create Draft WorkGroup
|
|
724
|
+
|
|
725
|
+
Generate a WorkGroupID: `kc-{type}-{slug}-YYYYMMDD-HHMMSS`
|
|
726
|
+
Create a draft WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md` to store the analysis output.
|
|
727
|
+
|
|
728
|
+
### Step 3: Phase 1A — Impact Analysis
|
|
729
|
+
|
|
730
|
+
Follow Phase 1A from `knowzcode/knowzcode_loop.md`:
|
|
731
|
+
1. Identify the Change Set — all components affected by this change
|
|
732
|
+
2. Create NodeIDs for NEW capabilities only (domain concepts, PascalCase)
|
|
733
|
+
3. Check `knowzcode/specs/` for existing specs with domain overlap
|
|
734
|
+
4. Scan `knowzcode/workgroups/` for completed WorkGroups with relevant context
|
|
735
|
+
5. Propose the Change Set with NodeIDs, affected files, and risk assessment
|
|
736
|
+
|
|
737
|
+
## STOP
|
|
738
|
+
|
|
739
|
+
Present the Change Set for user approval. Do NOT proceed until approved.
|
|
740
|
+
|
|
741
|
+
**After approval:** Update `knowzcode/knowzcode_tracker.md` with new NodeIDs as `[WIP]`, then tell the user to invoke `#prompt:kc-specify` to draft specifications.
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
#### kc-analyze.prompt.md
|
|
745
|
+
|
|
746
|
+
```markdown
|
|
747
|
+
---
|
|
748
|
+
agent: "agent"
|
|
749
|
+
description: "Re-run Phase 1A impact analysis on existing WorkGroup"
|
|
750
|
+
---
|
|
751
|
+
|
|
752
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
753
|
+
|
|
754
|
+
# KnowzCode: Phase 1A — Impact Analysis
|
|
755
|
+
|
|
756
|
+
You are re-running impact analysis on an existing WorkGroup.
|
|
757
|
+
|
|
758
|
+
## Context
|
|
759
|
+
|
|
760
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
761
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
762
|
+
|
|
763
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
764
|
+
Then read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`.
|
|
765
|
+
|
|
766
|
+
## Instructions
|
|
767
|
+
|
|
768
|
+
Follow Phase 1A from `knowzcode/knowzcode_loop.md`:
|
|
769
|
+
1. Re-analyze the goal from the WorkGroup file
|
|
770
|
+
2. Identify all affected components — check for changes since last analysis
|
|
771
|
+
3. Update NodeIDs if scope has changed
|
|
772
|
+
4. Check `knowzcode/specs/` for existing specs with domain overlap
|
|
773
|
+
5. Update the Change Set in the WorkGroup file
|
|
774
|
+
|
|
775
|
+
## STOP
|
|
776
|
+
|
|
777
|
+
Present the updated Change Set for user approval.
|
|
778
|
+
|
|
779
|
+
**Next step after approval:** `#prompt:kc-specify`
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
#### kc-specify.prompt.md
|
|
783
|
+
|
|
784
|
+
```markdown
|
|
785
|
+
---
|
|
786
|
+
agent: "agent"
|
|
787
|
+
description: "Draft specifications from approved Change Set (Phase 1B)"
|
|
788
|
+
---
|
|
789
|
+
|
|
790
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
791
|
+
|
|
792
|
+
# KnowzCode: Phase 1B — Specification
|
|
793
|
+
|
|
794
|
+
You are drafting specifications for the approved Change Set.
|
|
795
|
+
|
|
796
|
+
## Context
|
|
797
|
+
|
|
798
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
799
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
800
|
+
|
|
801
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
802
|
+
If no `[WIP]` entries found, scan `knowzcode/workgroups/` for the most recent draft WorkGroup file.
|
|
803
|
+
Then read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md` for the approved Change Set.
|
|
804
|
+
|
|
805
|
+
## Instructions
|
|
806
|
+
|
|
807
|
+
Follow Phase 1B from `knowzcode/knowzcode_loop.md`:
|
|
808
|
+
|
|
809
|
+
For each NodeID in the approved Change Set:
|
|
810
|
+
1. Draft `knowzcode/specs/{NodeID}.md` using the 4-section format:
|
|
811
|
+
- **Rules & Decisions** — Key architectural decisions, business rules, constraints
|
|
812
|
+
- **Interfaces** — Public contracts: inputs, outputs, API signatures, dependencies
|
|
813
|
+
- **Verification Criteria** — Testable `VERIFY:` assertions (minimum 2 per spec)
|
|
814
|
+
- **Debt & Gaps** — Known limitations and future work
|
|
815
|
+
2. Minimum valid spec: 1+ Rules, 1+ Interface, 2+ VERIFY statements
|
|
816
|
+
3. Check existing specs — if >50% domain overlap, UPDATE existing spec instead
|
|
817
|
+
4. Update the WorkGroup file with spec status
|
|
818
|
+
|
|
819
|
+
## STOP
|
|
820
|
+
|
|
821
|
+
Present all drafted specs for user approval. Do NOT proceed until approved.
|
|
822
|
+
|
|
823
|
+
**After approval:** Commit the specs as a pre-implementation checkpoint: `git commit -m "specs: draft specs for {WorkGroupID}"`
|
|
824
|
+
|
|
825
|
+
**Next step:** `#prompt:kc-implement`
|
|
826
|
+
```
|
|
827
|
+
|
|
828
|
+
#### kc-implement.prompt.md
|
|
829
|
+
|
|
830
|
+
```markdown
|
|
831
|
+
---
|
|
832
|
+
agent: "agent"
|
|
833
|
+
description: "TDD implementation with verification loop (Phase 2A)"
|
|
834
|
+
---
|
|
835
|
+
|
|
836
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
837
|
+
|
|
838
|
+
# KnowzCode: Phase 2A — Implementation
|
|
839
|
+
|
|
840
|
+
You are implementing the approved specifications using strict TDD.
|
|
841
|
+
|
|
842
|
+
## Context
|
|
843
|
+
|
|
844
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
845
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
846
|
+
|
|
847
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
848
|
+
Then read:
|
|
849
|
+
- The WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`
|
|
850
|
+
- All spec files listed in the Change Set from `knowzcode/specs/`
|
|
851
|
+
|
|
852
|
+
## Instructions
|
|
853
|
+
|
|
854
|
+
Follow Phase 2A from `knowzcode/knowzcode_loop.md`:
|
|
855
|
+
|
|
856
|
+
For EACH feature/criterion in the specs:
|
|
857
|
+
1. **RED**: Write a failing test that defines expected behavior. Run test → confirm FAIL
|
|
858
|
+
2. **GREEN**: Write MINIMAL code to make the test pass. Run test → confirm PASS
|
|
859
|
+
3. **REFACTOR**: Clean up while keeping all tests green
|
|
860
|
+
|
|
861
|
+
### Verification Loop (must pass before reporting complete)
|
|
862
|
+
|
|
863
|
+
1. Run all tests → if FAIL: fix and restart
|
|
864
|
+
2. Run static analysis → if issues: fix and restart
|
|
865
|
+
3. Run build → if FAIL: fix and restart
|
|
866
|
+
4. Verify all VERIFY: criteria from specs → if unmet: implement and restart
|
|
867
|
+
5. All checks pass → report complete
|
|
868
|
+
|
|
869
|
+
Maximum 10 iterations. If exceeded, report blocker.
|
|
870
|
+
|
|
871
|
+
### Spec Issues
|
|
872
|
+
|
|
873
|
+
If you discover a spec is incorrect during implementation:
|
|
874
|
+
- Tag `[SPEC_ISSUE]` in the WorkGroup file with details
|
|
875
|
+
- Continue with best judgment
|
|
876
|
+
- Report in completion summary
|
|
877
|
+
|
|
878
|
+
## STOP
|
|
879
|
+
|
|
880
|
+
Report implementation results: test counts, verification iterations, criteria status.
|
|
881
|
+
|
|
882
|
+
**Next step:** `#prompt:kc-audit`
|
|
883
|
+
```
|
|
884
|
+
|
|
885
|
+
#### kc-audit.prompt.md
|
|
886
|
+
|
|
887
|
+
```markdown
|
|
888
|
+
---
|
|
889
|
+
agent: "agent"
|
|
890
|
+
description: "READ-ONLY completeness audit against specs (Phase 2B)"
|
|
891
|
+
---
|
|
892
|
+
|
|
893
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
894
|
+
|
|
895
|
+
# KnowzCode: Phase 2B — Completeness Audit
|
|
896
|
+
|
|
897
|
+
You are performing an independent, READ-ONLY audit of the implementation.
|
|
898
|
+
|
|
899
|
+
## Context
|
|
900
|
+
|
|
901
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
902
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
903
|
+
|
|
904
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
905
|
+
Then read:
|
|
906
|
+
- The WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`
|
|
907
|
+
- All spec files listed in the Change Set from `knowzcode/specs/`
|
|
908
|
+
- The implementation files listed in the Change Set
|
|
909
|
+
|
|
910
|
+
## Instructions
|
|
911
|
+
|
|
912
|
+
Follow Phase 2B from `knowzcode/knowzcode_loop.md`:
|
|
913
|
+
|
|
914
|
+
**CRITICAL: This is a READ-ONLY audit. Do NOT modify any source files.**
|
|
915
|
+
|
|
916
|
+
1. For each NodeID, compare implementation against every VERIFY statement in its spec
|
|
917
|
+
2. Calculate objective completion percentage per NodeID and overall
|
|
918
|
+
3. Identify gaps: missing features, incomplete criteria, untested paths
|
|
919
|
+
4. Check for security concerns: input validation, authentication, data exposure
|
|
920
|
+
5. Check for orphan code: implementation not covered by any spec
|
|
921
|
+
6. Assess risk for any gaps found
|
|
922
|
+
|
|
923
|
+
### Standalone Audit Types
|
|
924
|
+
|
|
925
|
+
If the user specifies an audit type instead of a WorkGroup audit:
|
|
926
|
+
- **spec**: Audit spec quality — completeness, VERIFY statement coverage, format compliance
|
|
927
|
+
- **architecture**: Compare architecture doc against actual codebase structure
|
|
928
|
+
- **security**: Focused security review — OWASP top 10, input validation, auth flows
|
|
929
|
+
- **integration**: Check integration points, API contracts, dependency health
|
|
930
|
+
|
|
931
|
+
## STOP
|
|
932
|
+
|
|
933
|
+
Present audit results with completion percentage, gap list, and risk assessment.
|
|
934
|
+
|
|
935
|
+
**User decides:**
|
|
936
|
+
- Return to `#prompt:kc-implement` to fix gaps
|
|
937
|
+
- Accept and proceed to `#prompt:kc-finalize`
|
|
938
|
+
- Modify specs to match implementation
|
|
939
|
+
- Cancel the WorkGroup
|
|
940
|
+
```
|
|
941
|
+
|
|
942
|
+
#### kc-finalize.prompt.md
|
|
943
|
+
|
|
944
|
+
```markdown
|
|
945
|
+
---
|
|
946
|
+
agent: "agent"
|
|
947
|
+
description: "Finalize WorkGroup — update specs, tracker, log, commit (Phase 3)"
|
|
948
|
+
---
|
|
949
|
+
|
|
950
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
951
|
+
|
|
952
|
+
# KnowzCode: Phase 3 — Finalization
|
|
953
|
+
|
|
954
|
+
You are finalizing the WorkGroup after approved implementation and audit.
|
|
955
|
+
|
|
956
|
+
## Context
|
|
957
|
+
|
|
958
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
959
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
960
|
+
- #file:knowzcode/knowzcode_architecture.md
|
|
961
|
+
|
|
962
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
963
|
+
Then read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`.
|
|
964
|
+
|
|
965
|
+
## Instructions
|
|
966
|
+
|
|
967
|
+
Follow Phase 3 from `knowzcode/knowzcode_loop.md`:
|
|
968
|
+
|
|
969
|
+
1. **Finalize Specs**: Update each `knowzcode/specs/{NodeID}.md` to as-built state (Status: As-Built)
|
|
970
|
+
2. **Architecture Check**: Compare `knowzcode/knowzcode_architecture.md` against the Change Set. Fix simple discrepancies directly; document complex ones for user review
|
|
971
|
+
3. **Log Entry**: Prepend an `ARC-Completion` entry to `knowzcode/knowzcode_log.md` with WorkGroupID, NodeIDs, verification summary, architectural learnings, and ripple effects
|
|
972
|
+
4. **Update Tracker**: Change NodeID statuses from `[WIP]` to `[VERIFIED]` in `knowzcode/knowzcode_tracker.md`. Create `REFACTOR_` tasks for significant tech debt
|
|
973
|
+
5. **Final Commit**: Stage and commit all changes (source + knowzcode files)
|
|
974
|
+
6. **Close WorkGroup**: Mark the WorkGroup file as closed
|
|
975
|
+
|
|
976
|
+
## Output
|
|
977
|
+
|
|
978
|
+
Report completion with summary of what was delivered and any `REFACTOR_` tasks created.
|
|
979
|
+
```
|
|
980
|
+
|
|
981
|
+
#### kc-fix.prompt.md
|
|
982
|
+
|
|
983
|
+
```markdown
|
|
984
|
+
---
|
|
985
|
+
agent: "agent"
|
|
986
|
+
description: "Quick targeted fix using micro-fix protocol"
|
|
987
|
+
argument-hint: "Describe the bug or issue to fix"
|
|
988
|
+
---
|
|
989
|
+
|
|
990
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
991
|
+
|
|
992
|
+
# KnowzCode: Micro-Fix
|
|
993
|
+
|
|
994
|
+
You are performing a quick, targeted fix using the micro-fix protocol.
|
|
995
|
+
|
|
996
|
+
## Context
|
|
997
|
+
|
|
998
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
999
|
+
|
|
1000
|
+
## Scope Guard
|
|
1001
|
+
|
|
1002
|
+
This workflow is for changes that are:
|
|
1003
|
+
- **Single file** (or minimal multi-file with no ripple effects)
|
|
1004
|
+
- **<50 lines** changed
|
|
1005
|
+
- **No architectural impact**
|
|
1006
|
+
|
|
1007
|
+
If the fix exceeds this scope, inform the user and suggest `#prompt:kc-work` instead.
|
|
1008
|
+
|
|
1009
|
+
## Instructions
|
|
1010
|
+
|
|
1011
|
+
Follow the Micro-Fix Protocol from `knowzcode/knowzcode_loop.md` Section 4:
|
|
1012
|
+
|
|
1013
|
+
1. **Implement** the fix
|
|
1014
|
+
2. **Test** — run targeted tests for the affected code
|
|
1015
|
+
3. **Log** — prepend a `MicroFix` entry to `knowzcode/knowzcode_log.md`:
|
|
1016
|
+
- Type: MicroFix
|
|
1017
|
+
- File/NodeID affected
|
|
1018
|
+
- User request, action taken, verification outcome
|
|
1019
|
+
4. **Commit** with `fix: {description}` message
|
|
1020
|
+
```
|
|
1021
|
+
|
|
1022
|
+
#### kc-plan.prompt.md
|
|
1023
|
+
|
|
1024
|
+
```markdown
|
|
1025
|
+
---
|
|
1026
|
+
agent: "agent"
|
|
1027
|
+
description: "Research and investigate before implementing"
|
|
1028
|
+
argument-hint: "Describe the topic to research"
|
|
1029
|
+
---
|
|
1030
|
+
|
|
1031
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
1032
|
+
|
|
1033
|
+
# KnowzCode: Plan / Investigate
|
|
1034
|
+
|
|
1035
|
+
You are researching a topic before implementation. This is an investigation workflow, not a build workflow.
|
|
1036
|
+
|
|
1037
|
+
## Context
|
|
1038
|
+
|
|
1039
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
1040
|
+
- #file:knowzcode/knowzcode_project.md
|
|
1041
|
+
- #file:knowzcode/knowzcode_architecture.md
|
|
1042
|
+
|
|
1043
|
+
## Instructions
|
|
1044
|
+
|
|
1045
|
+
The user's research topic is provided in the chat message.
|
|
1046
|
+
|
|
1047
|
+
1. **Explore the codebase** — search for relevant files, patterns, and existing implementations
|
|
1048
|
+
2. **Read existing specs** — check `knowzcode/specs/` for related components
|
|
1049
|
+
3. **Check history** — scan `knowzcode/workgroups/` for past WorkGroups that touched similar areas
|
|
1050
|
+
4. **Analyze architecture** — review `knowzcode/knowzcode_architecture.md` for structural context
|
|
1051
|
+
5. **Present findings** with:
|
|
1052
|
+
- Current state of the relevant code
|
|
1053
|
+
- Existing patterns and conventions
|
|
1054
|
+
- Options for implementation (with trade-offs)
|
|
1055
|
+
- Recommended approach
|
|
1056
|
+
|
|
1057
|
+
## STOP
|
|
1058
|
+
|
|
1059
|
+
Present research findings and recommendations.
|
|
1060
|
+
|
|
1061
|
+
**To implement:** Tell the user to invoke `#prompt:kc-work` with their chosen approach.
|
|
1062
|
+
```
|
|
1063
|
+
|
|
1064
|
+
#### kc-continue.prompt.md
|
|
1065
|
+
|
|
1066
|
+
```markdown
|
|
1067
|
+
---
|
|
1068
|
+
agent: "agent"
|
|
1069
|
+
description: "Resume interrupted work or advance to next phase"
|
|
1070
|
+
---
|
|
1071
|
+
|
|
1072
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
1073
|
+
|
|
1074
|
+
# KnowzCode: Continue / Resume
|
|
1075
|
+
|
|
1076
|
+
You are resuming an interrupted KnowzCode workflow or advancing to the next phase.
|
|
1077
|
+
|
|
1078
|
+
## Context
|
|
1079
|
+
|
|
1080
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
1081
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
1082
|
+
|
|
1083
|
+
## Instructions
|
|
1084
|
+
|
|
1085
|
+
### Step 1: Find Active WorkGroup
|
|
1086
|
+
|
|
1087
|
+
Read `knowzcode/knowzcode_tracker.md` and find entries with `[WIP]` status.
|
|
1088
|
+
|
|
1089
|
+
- **One active WorkGroup**: Use it
|
|
1090
|
+
- **Multiple active**: Present the list and ask the user which to resume
|
|
1091
|
+
- **None active**: Inform the user and suggest `#prompt:kc-work`
|
|
1092
|
+
|
|
1093
|
+
### Step 2: Determine Current Phase
|
|
1094
|
+
|
|
1095
|
+
Read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`.
|
|
1096
|
+
Check the Phase History table to determine the current state.
|
|
1097
|
+
|
|
1098
|
+
### Step 3: Resume or Advance
|
|
1099
|
+
|
|
1100
|
+
| WorkGroup State | Action |
|
|
1101
|
+
|----------------|--------|
|
|
1102
|
+
| Phase 1A in progress | Complete the impact analysis, present Change Set |
|
|
1103
|
+
| Phase 1A complete, awaiting approval | Present Change Set for approval |
|
|
1104
|
+
| Phase 1A approved, specs not started | Begin Phase 1B — draft specs |
|
|
1105
|
+
| Phase 1B in progress | Complete spec drafting |
|
|
1106
|
+
| Phase 1B complete, awaiting approval | Present specs for approval |
|
|
1107
|
+
| Phase 1B approved, implementation not started | Begin Phase 2A — TDD implementation |
|
|
1108
|
+
| Phase 2A in progress | Resume implementation from outstanding todos |
|
|
1109
|
+
| Phase 2A complete | Advise: `#prompt:kc-audit` |
|
|
1110
|
+
| Phase 2B complete, gaps found | Present options: fix gaps or accept |
|
|
1111
|
+
| Phase 2B complete, no gaps | Begin Phase 3 — finalization |
|
|
1112
|
+
| Phase 3 in progress | Complete finalization |
|
|
1113
|
+
|
|
1114
|
+
### Step 4: Present Status
|
|
1115
|
+
|
|
1116
|
+
```
|
|
1117
|
+
## Resuming WorkGroup: {WorkGroupID}
|
|
1118
|
+
|
|
1119
|
+
**Goal**: {primary goal}
|
|
1120
|
+
**Phase**: {current phase}
|
|
1121
|
+
**NodeIDs**: {list}
|
|
1122
|
+
|
|
1123
|
+
**Outstanding Work**:
|
|
1124
|
+
{list from WorkGroup file}
|
|
1125
|
+
|
|
1126
|
+
Continuing from where we left off...
|
|
1127
|
+
```
|
|
1128
|
+
|
|
1129
|
+
Then proceed with the appropriate phase instructions from `knowzcode/knowzcode_loop.md`.
|
|
1130
|
+
```
|
|
1131
|
+
|
|
1132
|
+
### C. .vscode/mcp.json Template
|
|
1133
|
+
|
|
1134
|
+
Optionally generated by `/kc:init` when Copilot is detected and MCP is configured:
|
|
1135
|
+
|
|
1136
|
+
```json
|
|
1137
|
+
{
|
|
1138
|
+
"servers": {
|
|
1139
|
+
"knowz": {
|
|
1140
|
+
"type": "http",
|
|
1141
|
+
"url": "${input:knowz_mcp_url}",
|
|
1142
|
+
"headers": {
|
|
1143
|
+
"x-api-key": "${input:knowz_api_key}"
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
"inputs": [
|
|
1148
|
+
{
|
|
1149
|
+
"id": "knowz_mcp_url",
|
|
1150
|
+
"description": "KnowzCode MCP server URL",
|
|
1151
|
+
"type": "promptString"
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
"id": "knowz_api_key",
|
|
1155
|
+
"description": "KnowzCode API key",
|
|
1156
|
+
"type": "promptString",
|
|
1157
|
+
"password": true
|
|
1158
|
+
}
|
|
1159
|
+
]
|
|
1160
|
+
}
|
|
1161
|
+
```
|
|
1162
|
+
|
|
1163
|
+
### D. Copilot-Specific Notes
|
|
1164
|
+
|
|
1165
|
+
**VS Code usage:**
|
|
1166
|
+
- Invoke prompts via `#prompt:kc-work`, `#prompt:kc-specify`, etc. in Copilot Chat
|
|
1167
|
+
- Add extra files to context with `#file:path/to/file` in the chat message
|
|
1168
|
+
- All prompt files use `agent: "agent"` frontmatter for file editing and terminal access
|
|
1169
|
+
- Model can be selected per session — prefer stronger models for analysis/audit phases
|
|
1170
|
+
|
|
1171
|
+
**Copilot CLI fallback:**
|
|
1172
|
+
- CLI does not support `#prompt:` syntax
|
|
1173
|
+
- Check current CLI documentation for file reference syntax — it may differ from VS Code
|
|
1174
|
+
- Alternatively, reference the methodology directly or paste prompt content into the CLI
|
|
1175
|
+
|
|
1176
|
+
**Copilot Coding Agent:**
|
|
1177
|
+
- Follows `.github/copilot-instructions.md` automatically when processing GitHub issues
|
|
1178
|
+
- Runs all phases autonomously — quality gates deferred to PR review
|
|
1179
|
+
- Does not use prompt files (uses repository instructions only)
|
|
1180
|
+
|
|
1181
|
+
**Execution model:**
|
|
1182
|
+
- See `knowzcode/copilot_execution.md` for the full execution guide
|
|
1183
|
+
- Single-agent, sequential execution — user manually transitions between phases
|
|
1184
|
+
- No multi-agent orchestration (no Parallel Teams, no agent spawning)
|
|
1185
|
+
- WorkGroup files carry state between prompt invocations
|
|
1186
|
+
|
|
1187
|
+
---
|
|
1188
|
+
|
|
1189
|
+
## Windsurf (`.windsurf/rules/knowzcode.md`)
|
|
1190
|
+
|
|
1191
|
+
Create `.windsurf/rules/knowzcode.md`. Notes: Modern Windsurf uses the `.windsurf/rules/` directory instead of the deprecated `.windsurfrules` file. Cascade multi-file editing works well with KnowzCode's cross-component implementation phases. Windsurf also supports `.windsurf/workflows/*.md` for custom commands invoked as `/workflow-name` — KnowzCode workflows can be defined as individual workflow files for each phase.
|
|
1192
|
+
|
|
1193
|
+
```markdown
|
|
1194
|
+
# KnowzCode Development Methodology
|
|
1195
|
+
|
|
1196
|
+
This project uses KnowzCode for structured TDD development.
|
|
1197
|
+
Follow `knowzcode/knowzcode_loop.md` for all feature development.
|
|
1198
|
+
|
|
1199
|
+
## Required Reading
|
|
1200
|
+
- `knowzcode/knowzcode_loop.md` — Complete methodology
|
|
1201
|
+
- `knowzcode/knowzcode_project.md` — Project context
|
|
1202
|
+
- `knowzcode/knowzcode_tracker.md` — Active WorkGroups
|
|
1203
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
1204
|
+
|
|
1205
|
+
## Phase Walkthrough
|
|
1206
|
+
|
|
1207
|
+
### Phase 1A: Impact Analysis
|
|
1208
|
+
- Identify affected components, propose Change Set with NodeIDs
|
|
1209
|
+
- Check existing specs before creating new ones
|
|
1210
|
+
- PAUSE for user approval
|
|
1211
|
+
|
|
1212
|
+
### Phase 1B: Specification
|
|
1213
|
+
- Draft specs with 4-section format and 2+ VERIFY statements
|
|
1214
|
+
- PAUSE for approval, then commit specs
|
|
1215
|
+
|
|
1216
|
+
### Phase 2A: Implementation (TDD Mandatory)
|
|
1217
|
+
- Write failing test FIRST, then minimal code, then refactor
|
|
1218
|
+
- Use Cascade for multi-file edits across components
|
|
1219
|
+
- Run full verification loop (tests + linter + build)
|
|
1220
|
+
- PAUSE after implementation
|
|
1221
|
+
|
|
1222
|
+
### Phase 2B: Audit
|
|
1223
|
+
- READ-ONLY audit against spec VERIFY statements
|
|
1224
|
+
- Report completion %, gaps, security concerns
|
|
1225
|
+
- PAUSE for user decision
|
|
1226
|
+
|
|
1227
|
+
### Phase 3: Finalization
|
|
1228
|
+
- Update specs to As-Built, tracker, log, architecture
|
|
1229
|
+
- Final commit
|
|
1230
|
+
|
|
1231
|
+
## Enforcement Rules
|
|
1232
|
+
- TDD is mandatory — write failing tests before implementation code
|
|
1233
|
+
- Respect quality gates between phases — PAUSE at each gate
|
|
1234
|
+
- Update `knowzcode/knowzcode_tracker.md` when completing work
|
|
1235
|
+
- Log completions in `knowzcode/knowzcode_log.md`
|
|
1236
|
+
- Consolidate specs when domains overlap >50%
|
|
1237
|
+
- Target <20 specs per project
|
|
1238
|
+
- Every WorkGroup todo starts with `KnowzCode:` prefix
|
|
1239
|
+
|
|
1240
|
+
## Knowledge Capture (CRITICAL — DO NOT SKIP)
|
|
1241
|
+
Every piece of durable knowledge — decisions, patterns, gotchas, workarounds — **must** be captured.
|
|
1242
|
+
When MCP is connected, write to vaults per `knowzcode/knowzcode_vaults.md` — always pass `vaultId` with `create_knowledge`.
|
|
1243
|
+
When MCP is unavailable, capture locally in specs, log entries, or docs. Never let insights die in the conversation.
|
|
1244
|
+
Use `/kc:learn "insight"` for automatic routing.
|
|
1245
|
+
Vault entries are retrieved via semantic search — write detailed, self-contained content. See `knowzcode/knowzcode_vaults.md` Content Detail Principle.
|
|
1246
|
+
|
|
1247
|
+
## Micro-Fix (for small changes)
|
|
1248
|
+
Single file, <50 lines, no ripple effects:
|
|
1249
|
+
Implement → Test → Log MicroFix → Commit with `fix:` prefix
|
|
1250
|
+
```
|
|
1251
|
+
|
|
1252
|
+
---
|
|
1253
|
+
|
|
1254
|
+
## OpenAI Codex Agents SDK (Python)
|
|
1255
|
+
|
|
1256
|
+
For teams building custom orchestration with the OpenAI Agents SDK,
|
|
1257
|
+
map KnowzCode's 5 phase agents to SDK Agent definitions. The AGENTS.md
|
|
1258
|
+
file above provides all instructions each agent needs. See the
|
|
1259
|
+
[Agents SDK documentation](https://openai.github.io/openai-agents-python/)
|
|
1260
|
+
for implementation details.
|