knowzcode 0.1.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +9 -3
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +170 -73
- package/agents/analyst.md +24 -62
- package/agents/architect.md +60 -48
- package/agents/builder.md +35 -86
- package/agents/closer.md +29 -87
- package/agents/context-scout.md +54 -0
- package/agents/knowledge-migrator.md +7 -7
- package/agents/knowz-scout.md +83 -0
- package/agents/knowz-scribe.md +155 -0
- package/agents/microfix-specialist.md +1 -6
- package/agents/project-advisor.md +110 -0
- package/agents/reviewer.md +43 -91
- package/agents/security-officer.md +194 -0
- package/agents/test-advisor.md +162 -0
- package/agents/update-coordinator.md +7 -18
- package/bin/knowzcode.mjs +94 -7
- package/commands/audit.md +245 -25
- package/commands/connect-mcp.md +525 -507
- package/commands/fix.md +8 -8
- package/commands/init.md +125 -6
- package/commands/learn.md +327 -308
- package/commands/plan.md +173 -26
- package/commands/register.md +21 -12
- package/commands/status.md +309 -291
- package/commands/telemetry.md +188 -188
- package/commands/work.md +764 -114
- package/knowzcode/automation_manifest.md +59 -59
- package/knowzcode/claude_code_execution.md +291 -22
- package/knowzcode/copilot_execution.md +231 -0
- package/knowzcode/enterprise/compliance_manifest.md +5 -0
- package/knowzcode/knowzcode_loop.md +114 -46
- package/knowzcode/knowzcode_orchestration.md +66 -0
- package/knowzcode/knowzcode_project.md +48 -233
- package/knowzcode/knowzcode_vaults.md +183 -54
- package/knowzcode/mcp_config.md +72 -47
- package/knowzcode/platform_adapters.md +630 -29
- package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
- package/knowzcode/prompts/Investigate_Codebase.md +227 -227
- package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
- package/knowzcode/prompts/Refactor_Node.md +72 -72
- package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
- package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
- package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
- package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
- package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
- package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
- package/package.json +1 -1
- package/skills/alias-resolver.json +1 -1
- package/skills/architecture-diff.json +1 -1
- package/skills/check-installation-status.json +1 -1
- package/skills/continue.md +25 -4
- package/skills/environment-guard.json +1 -1
- package/skills/generate-workgroup-id.json +1 -1
- package/skills/install-knowzcode.json +1 -1
- package/skills/load-core-context.json +1 -1
- package/skills/log-entry-builder.json +1 -1
- package/skills/spec-quality-check.json +1 -1
- package/skills/spec-template.json +1 -1
- package/skills/spec-validator.json +1 -1
- package/skills/tracker-scan.json +1 -1
- package/skills/tracker-update.json +1 -1
- package/skills/validate-installation.json +1 -1
|
@@ -68,7 +68,7 @@ All commands work without MCP — it enhances but never blocks.
|
|
|
68
68
|
|
|
69
69
|
## OpenAI Codex (AGENTS.md)
|
|
70
70
|
|
|
71
|
-
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).
|
|
71
|
+
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.
|
|
72
72
|
|
|
73
73
|
```markdown
|
|
74
74
|
# KnowzCode Development Methodology
|
|
@@ -152,6 +152,45 @@ For single-file, <50 line, no-ripple-effect changes:
|
|
|
152
152
|
|
|
153
153
|
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`.
|
|
154
154
|
|
|
155
|
+
### Native Commands (`.gemini/commands/kc/*.toml`)
|
|
156
|
+
|
|
157
|
+
Gemini CLI (2026) supports native custom commands via TOML files in `.gemini/commands/`. Subdirectory namespacing gives the `/kc:` prefix automatically:
|
|
158
|
+
|
|
159
|
+
```toml
|
|
160
|
+
# .gemini/commands/kc/work.toml
|
|
161
|
+
description = "Start a new KnowzCode development workflow"
|
|
162
|
+
prompt = """Read knowzcode/knowzcode_loop.md. Follow Phase 1A→3 workflow for:
|
|
163
|
+
<ARGS/>
|
|
164
|
+
Read knowzcode/knowzcode_project.md for project context.
|
|
165
|
+
Read knowzcode/knowzcode_tracker.md for active work."""
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
```toml
|
|
169
|
+
# .gemini/commands/kc/plan.toml
|
|
170
|
+
description = "Research before implementing"
|
|
171
|
+
prompt = """Read knowzcode/knowzcode_loop.md and knowzcode/knowzcode_project.md.
|
|
172
|
+
Investigate the codebase for: <ARGS/>
|
|
173
|
+
Present findings with options. Say 'implement' to transition to /kc:work."""
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
```toml
|
|
177
|
+
# .gemini/commands/kc/fix.toml
|
|
178
|
+
description = "Quick targeted fix (micro-fix workflow)"
|
|
179
|
+
prompt = """Read knowzcode/knowzcode_loop.md section on Micro-Fix.
|
|
180
|
+
Apply a targeted fix for: <ARGS/>
|
|
181
|
+
Run tests, log a MicroFix entry, commit with fix: prefix."""
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```toml
|
|
185
|
+
# .gemini/commands/kc/audit.toml
|
|
186
|
+
description = "Run quality audit against specs"
|
|
187
|
+
prompt = """Read knowzcode/knowzcode_loop.md Phase 2B.
|
|
188
|
+
Perform a READ-ONLY audit comparing implementation against specs in knowzcode/specs/.
|
|
189
|
+
Report completion percentage, gaps, and security concerns for: <ARGS/>"""
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Gemini also supports extensions (`gemini-extension.json`) for tool integration and `@file.md` imports for including methodology files directly in prompts.
|
|
193
|
+
|
|
155
194
|
```markdown
|
|
156
195
|
# KnowzCode Development Methodology
|
|
157
196
|
|
|
@@ -212,7 +251,7 @@ Single file, <50 lines, no ripple effects:
|
|
|
212
251
|
|
|
213
252
|
## Cursor (`.cursor/rules/knowzcode.mdc`)
|
|
214
253
|
|
|
215
|
-
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.
|
|
254
|
+
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.
|
|
216
255
|
|
|
217
256
|
```markdown
|
|
218
257
|
---
|
|
@@ -274,56 +313,618 @@ Before any feature work, read:
|
|
|
274
313
|
|
|
275
314
|
---
|
|
276
315
|
|
|
277
|
-
## GitHub Copilot (.github/copilot-instructions.md)
|
|
316
|
+
## GitHub Copilot (.github/copilot-instructions.md + .github/prompts/*.prompt.md)
|
|
317
|
+
|
|
318
|
+
GitHub Copilot (2026) supports three instruction mechanisms used by KnowzCode:
|
|
319
|
+
|
|
320
|
+
1. **`.github/copilot-instructions.md`** — Repository-level instructions, always active
|
|
321
|
+
2. **`.github/prompts/*.prompt.md`** — Custom prompts invocable via `#prompt:name` in VS Code
|
|
322
|
+
3. **MCP server tools** (`.vscode/mcp.json`) — Tool access for vault queries
|
|
323
|
+
|
|
324
|
+
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.
|
|
325
|
+
|
|
326
|
+
### A. copilot-instructions.md
|
|
278
327
|
|
|
279
|
-
Create `.github/copilot-instructions.md
|
|
328
|
+
Create `.github/copilot-instructions.md`:
|
|
280
329
|
|
|
281
330
|
```markdown
|
|
331
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
332
|
+
|
|
282
333
|
# KnowzCode Development Methodology
|
|
283
334
|
|
|
284
|
-
This repository uses KnowzCode for structured TDD development.
|
|
335
|
+
This repository uses KnowzCode for structured TDD development with quality gates.
|
|
336
|
+
|
|
337
|
+
## Required Reading
|
|
338
|
+
- `knowzcode/knowzcode_loop.md` — Complete methodology (read first)
|
|
339
|
+
- `knowzcode/knowzcode_project.md` — Project context and tech stack
|
|
340
|
+
- `knowzcode/knowzcode_architecture.md` — Architecture documentation
|
|
341
|
+
- `knowzcode/knowzcode_tracker.md` — WorkGroup status tracking
|
|
342
|
+
|
|
343
|
+
## Workflow Overview
|
|
344
|
+
|
|
345
|
+
KnowzCode follows a 5-phase development loop with quality gates between each phase.
|
|
346
|
+
Use the prompt files in `.github/prompts/` to invoke each phase:
|
|
347
|
+
|
|
348
|
+
| Phase | Prompt | Description |
|
|
349
|
+
|-------|--------|-------------|
|
|
350
|
+
| Full workflow | `#prompt:kc-work` | Start a new feature — creates WorkGroup, classifies tier, runs Phase 1A |
|
|
351
|
+
| 1A: Analysis | `#prompt:kc-analyze` | Re-run impact analysis on existing WorkGroup |
|
|
352
|
+
| 1B: Specification | `#prompt:kc-specify` | Draft specs from approved Change Set |
|
|
353
|
+
| 2A: Implementation | `#prompt:kc-implement` | TDD implementation with verification loop |
|
|
354
|
+
| 2B: Audit | `#prompt:kc-audit` | READ-ONLY audit against specs |
|
|
355
|
+
| 3: Finalization | `#prompt:kc-finalize` | Update specs, tracker, log, commit |
|
|
356
|
+
| Quick fix | `#prompt:kc-fix` | Micro-fix for small, scoped changes |
|
|
357
|
+
| Research | `#prompt:kc-plan` | Investigate before implementing |
|
|
358
|
+
| Resume | `#prompt:kc-continue` | Resume or advance to next phase |
|
|
285
359
|
|
|
286
|
-
|
|
287
|
-
- Write failing tests BEFORE implementation code
|
|
288
|
-
- Follow Red-Green-Refactor cycle for every feature
|
|
289
|
-
- No production code without corresponding test coverage
|
|
360
|
+
### Typical Flow
|
|
290
361
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
362
|
+
1. `#prompt:kc-work "Build JWT authentication"` → Creates WorkGroup, proposes Change Set, **STOPs**
|
|
363
|
+
2. Approve Change Set
|
|
364
|
+
3. `#prompt:kc-specify` → Drafts specs, **STOPs**
|
|
365
|
+
4. Approve specs
|
|
366
|
+
5. `#prompt:kc-implement` → TDD Red-Green-Refactor, **STOPs**
|
|
367
|
+
6. `#prompt:kc-audit` → READ-ONLY audit, reports gaps, **STOPs**
|
|
368
|
+
7. `#prompt:kc-finalize` → Updates docs, commits
|
|
294
369
|
|
|
295
|
-
|
|
296
|
-
2. **Specification** — Draft specs with VERIFY statements, get user approval
|
|
297
|
-
3. **Implementation** — Strict TDD, verification loop
|
|
298
|
-
4. **Audit** — READ-ONLY comparison against specs
|
|
299
|
-
5. **Finalization** — Update docs, tracker, log, commit
|
|
370
|
+
Use `#prompt:kc-continue` at any point to resume where you left off.
|
|
300
371
|
|
|
301
372
|
## Quality Gates
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
- After
|
|
305
|
-
- After
|
|
306
|
-
- After
|
|
373
|
+
|
|
374
|
+
STOP and await user approval at each gate:
|
|
375
|
+
- After Change Set proposal (1A)
|
|
376
|
+
- After spec drafts (1B)
|
|
377
|
+
- After implementation complete (2A — awaiting audit)
|
|
378
|
+
- After audit results (2B — user decides on gaps)
|
|
379
|
+
|
|
380
|
+
## TDD Enforcement
|
|
381
|
+
|
|
382
|
+
TDD is mandatory — no production code without a failing test first.
|
|
383
|
+
Follow Red-Green-Refactor for every feature/criterion in the spec.
|
|
384
|
+
|
|
385
|
+
## Key Rules
|
|
386
|
+
- NodeIDs are domain concepts (PascalCase), not tasks
|
|
387
|
+
- Consolidate specs when domains overlap >50%
|
|
388
|
+
- Every WorkGroup todo starts with `KnowzCode:` prefix
|
|
389
|
+
- Target <20 specs per project
|
|
390
|
+
- Log completions in `knowzcode/knowzcode_log.md`
|
|
307
391
|
|
|
308
392
|
## Key Files
|
|
309
|
-
- `knowzcode/knowzcode_loop.md` — Methodology
|
|
393
|
+
- `knowzcode/knowzcode_loop.md` — Methodology
|
|
310
394
|
- `knowzcode/knowzcode_project.md` — Project context
|
|
311
395
|
- `knowzcode/knowzcode_architecture.md` — Architecture docs
|
|
312
396
|
- `knowzcode/knowzcode_tracker.md` — WorkGroup tracking
|
|
313
397
|
- `knowzcode/specs/` — Component specifications
|
|
398
|
+
- `knowzcode/workgroups/` — Active session data (gitignored)
|
|
314
399
|
|
|
315
|
-
##
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
400
|
+
## MCP Integration (Optional)
|
|
401
|
+
|
|
402
|
+
If configured in `.vscode/mcp.json`, use `search_knowledge` and `ask_question` tools
|
|
403
|
+
for enhanced context from knowledge vaults. All prompts work without MCP.
|
|
404
|
+
|
|
405
|
+
## Copilot Coding Agent
|
|
406
|
+
|
|
407
|
+
When the Copilot Coding Agent works on GitHub issues for this repository:
|
|
408
|
+
- Read `knowzcode/knowzcode_loop.md` and this file for methodology
|
|
409
|
+
- Follow Phase 1A→3 workflow for any non-trivial change
|
|
410
|
+
- Include the Change Set in the PR description
|
|
411
|
+
- Use TDD — failing test before implementation code
|
|
412
|
+
- Self-audit against spec VERIFY statements before marking PR ready
|
|
413
|
+
- Quality gates are deferred to PR review (no interactive approval in async mode)
|
|
414
|
+
|
|
415
|
+
## Model Selection
|
|
416
|
+
- Complex phases (1A analysis, 1B spec drafting, 2B audit): Use Claude Opus or GPT-4o
|
|
417
|
+
- Implementation (2A): Any capable model with good code generation
|
|
418
|
+
- Quick fixes: Any model
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### B. Prompt File Templates (.github/prompts/)
|
|
422
|
+
|
|
423
|
+
Each prompt file is invocable via `#prompt:kc-*` in VS Code Copilot Chat. All use `agent: "agent"` for file editing capability.
|
|
424
|
+
|
|
425
|
+
#### kc-work.prompt.md
|
|
426
|
+
|
|
427
|
+
```markdown
|
|
428
|
+
---
|
|
429
|
+
agent: "agent"
|
|
430
|
+
description: "Start a new KnowzCode development workflow"
|
|
431
|
+
argument-hint: "Describe the feature or goal to build"
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
435
|
+
|
|
436
|
+
# KnowzCode: Start Workflow
|
|
437
|
+
|
|
438
|
+
You are starting a new KnowzCode development workflow. Follow the methodology precisely.
|
|
439
|
+
|
|
440
|
+
## Context
|
|
441
|
+
|
|
442
|
+
Read these files for methodology and project context:
|
|
443
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
444
|
+
- #file:knowzcode/knowzcode_project.md
|
|
445
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
446
|
+
- #file:knowzcode/knowzcode_architecture.md
|
|
447
|
+
|
|
448
|
+
## Instructions
|
|
449
|
+
|
|
450
|
+
The user's goal is provided in the chat message.
|
|
451
|
+
|
|
452
|
+
### Step 1: Classify Tier
|
|
453
|
+
|
|
454
|
+
Based on the goal, classify complexity:
|
|
455
|
+
- **Micro** (single file, <50 lines, no ripple): Redirect to `#prompt:kc-fix`
|
|
456
|
+
- **Light** (≤3 files, straightforward): Streamlined 2-phase path
|
|
457
|
+
- **Full** (>3 files or complex): Complete 5-phase workflow
|
|
458
|
+
|
|
459
|
+
### Step 2: Create Draft WorkGroup
|
|
460
|
+
|
|
461
|
+
Generate a WorkGroupID: `kc-{type}-{slug}-YYYYMMDD-HHMMSS`
|
|
462
|
+
Create a draft WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md` to store the analysis output.
|
|
463
|
+
|
|
464
|
+
### Step 3: Phase 1A — Impact Analysis
|
|
465
|
+
|
|
466
|
+
Follow Phase 1A from `knowzcode/knowzcode_loop.md`:
|
|
467
|
+
1. Identify the Change Set — all components affected by this change
|
|
468
|
+
2. Create NodeIDs for NEW capabilities only (domain concepts, PascalCase)
|
|
469
|
+
3. Check `knowzcode/specs/` for existing specs with domain overlap
|
|
470
|
+
4. Scan `knowzcode/workgroups/` for completed WorkGroups with relevant context
|
|
471
|
+
5. Propose the Change Set with NodeIDs, affected files, and risk assessment
|
|
472
|
+
|
|
473
|
+
## STOP
|
|
474
|
+
|
|
475
|
+
Present the Change Set for user approval. Do NOT proceed until approved.
|
|
476
|
+
|
|
477
|
+
**After approval:** Update `knowzcode/knowzcode_tracker.md` with new NodeIDs as `[WIP]`, then tell the user to invoke `#prompt:kc-specify` to draft specifications.
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
#### kc-analyze.prompt.md
|
|
481
|
+
|
|
482
|
+
```markdown
|
|
483
|
+
---
|
|
484
|
+
agent: "agent"
|
|
485
|
+
description: "Re-run Phase 1A impact analysis on existing WorkGroup"
|
|
486
|
+
---
|
|
487
|
+
|
|
488
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
489
|
+
|
|
490
|
+
# KnowzCode: Phase 1A — Impact Analysis
|
|
491
|
+
|
|
492
|
+
You are re-running impact analysis on an existing WorkGroup.
|
|
493
|
+
|
|
494
|
+
## Context
|
|
495
|
+
|
|
496
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
497
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
498
|
+
|
|
499
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
500
|
+
Then read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`.
|
|
501
|
+
|
|
502
|
+
## Instructions
|
|
503
|
+
|
|
504
|
+
Follow Phase 1A from `knowzcode/knowzcode_loop.md`:
|
|
505
|
+
1. Re-analyze the goal from the WorkGroup file
|
|
506
|
+
2. Identify all affected components — check for changes since last analysis
|
|
507
|
+
3. Update NodeIDs if scope has changed
|
|
508
|
+
4. Check `knowzcode/specs/` for existing specs with domain overlap
|
|
509
|
+
5. Update the Change Set in the WorkGroup file
|
|
510
|
+
|
|
511
|
+
## STOP
|
|
512
|
+
|
|
513
|
+
Present the updated Change Set for user approval.
|
|
514
|
+
|
|
515
|
+
**Next step after approval:** `#prompt:kc-specify`
|
|
516
|
+
```
|
|
517
|
+
|
|
518
|
+
#### kc-specify.prompt.md
|
|
519
|
+
|
|
520
|
+
```markdown
|
|
521
|
+
---
|
|
522
|
+
agent: "agent"
|
|
523
|
+
description: "Draft specifications from approved Change Set (Phase 1B)"
|
|
524
|
+
---
|
|
525
|
+
|
|
526
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
527
|
+
|
|
528
|
+
# KnowzCode: Phase 1B — Specification
|
|
529
|
+
|
|
530
|
+
You are drafting specifications for the approved Change Set.
|
|
531
|
+
|
|
532
|
+
## Context
|
|
533
|
+
|
|
534
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
535
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
536
|
+
|
|
537
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
538
|
+
If no `[WIP]` entries found, scan `knowzcode/workgroups/` for the most recent draft WorkGroup file.
|
|
539
|
+
Then read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md` for the approved Change Set.
|
|
540
|
+
|
|
541
|
+
## Instructions
|
|
542
|
+
|
|
543
|
+
Follow Phase 1B from `knowzcode/knowzcode_loop.md`:
|
|
544
|
+
|
|
545
|
+
For each NodeID in the approved Change Set:
|
|
546
|
+
1. Draft `knowzcode/specs/{NodeID}.md` using the 4-section format:
|
|
547
|
+
- **Rules & Decisions** — Key architectural decisions, business rules, constraints
|
|
548
|
+
- **Interfaces** — Public contracts: inputs, outputs, API signatures, dependencies
|
|
549
|
+
- **Verification Criteria** — Testable `VERIFY:` assertions (minimum 2 per spec)
|
|
550
|
+
- **Debt & Gaps** — Known limitations and future work
|
|
551
|
+
2. Minimum valid spec: 1+ Rules, 1+ Interface, 2+ VERIFY statements
|
|
552
|
+
3. Check existing specs — if >50% domain overlap, UPDATE existing spec instead
|
|
553
|
+
4. Update the WorkGroup file with spec status
|
|
554
|
+
|
|
555
|
+
## STOP
|
|
556
|
+
|
|
557
|
+
Present all drafted specs for user approval. Do NOT proceed until approved.
|
|
558
|
+
|
|
559
|
+
**After approval:** Commit the specs as a pre-implementation checkpoint: `git commit -m "specs: draft specs for {WorkGroupID}"`
|
|
560
|
+
|
|
561
|
+
**Next step:** `#prompt:kc-implement`
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
#### kc-implement.prompt.md
|
|
565
|
+
|
|
566
|
+
```markdown
|
|
567
|
+
---
|
|
568
|
+
agent: "agent"
|
|
569
|
+
description: "TDD implementation with verification loop (Phase 2A)"
|
|
570
|
+
---
|
|
571
|
+
|
|
572
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
573
|
+
|
|
574
|
+
# KnowzCode: Phase 2A — Implementation
|
|
575
|
+
|
|
576
|
+
You are implementing the approved specifications using strict TDD.
|
|
577
|
+
|
|
578
|
+
## Context
|
|
579
|
+
|
|
580
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
581
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
582
|
+
|
|
583
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
584
|
+
Then read:
|
|
585
|
+
- The WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`
|
|
586
|
+
- All spec files listed in the Change Set from `knowzcode/specs/`
|
|
587
|
+
|
|
588
|
+
## Instructions
|
|
589
|
+
|
|
590
|
+
Follow Phase 2A from `knowzcode/knowzcode_loop.md`:
|
|
591
|
+
|
|
592
|
+
For EACH feature/criterion in the specs:
|
|
593
|
+
1. **RED**: Write a failing test that defines expected behavior. Run test → confirm FAIL
|
|
594
|
+
2. **GREEN**: Write MINIMAL code to make the test pass. Run test → confirm PASS
|
|
595
|
+
3. **REFACTOR**: Clean up while keeping all tests green
|
|
596
|
+
|
|
597
|
+
### Verification Loop (must pass before reporting complete)
|
|
598
|
+
|
|
599
|
+
1. Run all tests → if FAIL: fix and restart
|
|
600
|
+
2. Run static analysis → if issues: fix and restart
|
|
601
|
+
3. Run build → if FAIL: fix and restart
|
|
602
|
+
4. Verify all VERIFY: criteria from specs → if unmet: implement and restart
|
|
603
|
+
5. All checks pass → report complete
|
|
604
|
+
|
|
605
|
+
Maximum 10 iterations. If exceeded, report blocker.
|
|
606
|
+
|
|
607
|
+
### Spec Issues
|
|
608
|
+
|
|
609
|
+
If you discover a spec is incorrect during implementation:
|
|
610
|
+
- Tag `[SPEC_ISSUE]` in the WorkGroup file with details
|
|
611
|
+
- Continue with best judgment
|
|
612
|
+
- Report in completion summary
|
|
613
|
+
|
|
614
|
+
## STOP
|
|
615
|
+
|
|
616
|
+
Report implementation results: test counts, verification iterations, criteria status.
|
|
617
|
+
|
|
618
|
+
**Next step:** `#prompt:kc-audit`
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
#### kc-audit.prompt.md
|
|
622
|
+
|
|
623
|
+
```markdown
|
|
624
|
+
---
|
|
625
|
+
agent: "agent"
|
|
626
|
+
description: "READ-ONLY completeness audit against specs (Phase 2B)"
|
|
627
|
+
---
|
|
628
|
+
|
|
629
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
630
|
+
|
|
631
|
+
# KnowzCode: Phase 2B — Completeness Audit
|
|
632
|
+
|
|
633
|
+
You are performing an independent, READ-ONLY audit of the implementation.
|
|
634
|
+
|
|
635
|
+
## Context
|
|
636
|
+
|
|
637
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
638
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
639
|
+
|
|
640
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
641
|
+
Then read:
|
|
642
|
+
- The WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`
|
|
643
|
+
- All spec files listed in the Change Set from `knowzcode/specs/`
|
|
644
|
+
- The implementation files listed in the Change Set
|
|
645
|
+
|
|
646
|
+
## Instructions
|
|
647
|
+
|
|
648
|
+
Follow Phase 2B from `knowzcode/knowzcode_loop.md`:
|
|
649
|
+
|
|
650
|
+
**CRITICAL: This is a READ-ONLY audit. Do NOT modify any source files.**
|
|
651
|
+
|
|
652
|
+
1. For each NodeID, compare implementation against every VERIFY statement in its spec
|
|
653
|
+
2. Calculate objective completion percentage per NodeID and overall
|
|
654
|
+
3. Identify gaps: missing features, incomplete criteria, untested paths
|
|
655
|
+
4. Check for security concerns: input validation, authentication, data exposure
|
|
656
|
+
5. Check for orphan code: implementation not covered by any spec
|
|
657
|
+
6. Assess risk for any gaps found
|
|
658
|
+
|
|
659
|
+
### Standalone Audit Types
|
|
660
|
+
|
|
661
|
+
If the user specifies an audit type instead of a WorkGroup audit:
|
|
662
|
+
- **spec**: Audit spec quality — completeness, VERIFY statement coverage, format compliance
|
|
663
|
+
- **architecture**: Compare architecture doc against actual codebase structure
|
|
664
|
+
- **security**: Focused security review — OWASP top 10, input validation, auth flows
|
|
665
|
+
- **integration**: Check integration points, API contracts, dependency health
|
|
666
|
+
|
|
667
|
+
## STOP
|
|
668
|
+
|
|
669
|
+
Present audit results with completion percentage, gap list, and risk assessment.
|
|
670
|
+
|
|
671
|
+
**User decides:**
|
|
672
|
+
- Return to `#prompt:kc-implement` to fix gaps
|
|
673
|
+
- Accept and proceed to `#prompt:kc-finalize`
|
|
674
|
+
- Modify specs to match implementation
|
|
675
|
+
- Cancel the WorkGroup
|
|
676
|
+
```
|
|
677
|
+
|
|
678
|
+
#### kc-finalize.prompt.md
|
|
679
|
+
|
|
680
|
+
```markdown
|
|
681
|
+
---
|
|
682
|
+
agent: "agent"
|
|
683
|
+
description: "Finalize WorkGroup — update specs, tracker, log, commit (Phase 3)"
|
|
684
|
+
---
|
|
685
|
+
|
|
686
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
687
|
+
|
|
688
|
+
# KnowzCode: Phase 3 — Finalization
|
|
689
|
+
|
|
690
|
+
You are finalizing the WorkGroup after approved implementation and audit.
|
|
691
|
+
|
|
692
|
+
## Context
|
|
693
|
+
|
|
694
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
695
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
696
|
+
- #file:knowzcode/knowzcode_architecture.md
|
|
697
|
+
|
|
698
|
+
Read `knowzcode/knowzcode_tracker.md` to find the active `[WIP]` WorkGroup.
|
|
699
|
+
Then read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`.
|
|
700
|
+
|
|
701
|
+
## Instructions
|
|
702
|
+
|
|
703
|
+
Follow Phase 3 from `knowzcode/knowzcode_loop.md`:
|
|
704
|
+
|
|
705
|
+
1. **Finalize Specs**: Update each `knowzcode/specs/{NodeID}.md` to as-built state (Status: As-Built)
|
|
706
|
+
2. **Architecture Check**: Compare `knowzcode/knowzcode_architecture.md` against the Change Set. Fix simple discrepancies directly; document complex ones for user review
|
|
707
|
+
3. **Log Entry**: Prepend an `ARC-Completion` entry to `knowzcode/knowzcode_log.md` with WorkGroupID, NodeIDs, verification summary, architectural learnings, and ripple effects
|
|
708
|
+
4. **Update Tracker**: Change NodeID statuses from `[WIP]` to `[VERIFIED]` in `knowzcode/knowzcode_tracker.md`. Create `REFACTOR_` tasks for significant tech debt
|
|
709
|
+
5. **Final Commit**: Stage and commit all changes (source + knowzcode files)
|
|
710
|
+
6. **Close WorkGroup**: Mark the WorkGroup file as closed
|
|
711
|
+
|
|
712
|
+
## Output
|
|
713
|
+
|
|
714
|
+
Report completion with summary of what was delivered and any `REFACTOR_` tasks created.
|
|
320
715
|
```
|
|
321
716
|
|
|
717
|
+
#### kc-fix.prompt.md
|
|
718
|
+
|
|
719
|
+
```markdown
|
|
720
|
+
---
|
|
721
|
+
agent: "agent"
|
|
722
|
+
description: "Quick targeted fix using micro-fix protocol"
|
|
723
|
+
argument-hint: "Describe the bug or issue to fix"
|
|
724
|
+
---
|
|
725
|
+
|
|
726
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
727
|
+
|
|
728
|
+
# KnowzCode: Micro-Fix
|
|
729
|
+
|
|
730
|
+
You are performing a quick, targeted fix using the micro-fix protocol.
|
|
731
|
+
|
|
732
|
+
## Context
|
|
733
|
+
|
|
734
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
735
|
+
|
|
736
|
+
## Scope Guard
|
|
737
|
+
|
|
738
|
+
This workflow is for changes that are:
|
|
739
|
+
- **Single file** (or minimal multi-file with no ripple effects)
|
|
740
|
+
- **<50 lines** changed
|
|
741
|
+
- **No architectural impact**
|
|
742
|
+
|
|
743
|
+
If the fix exceeds this scope, inform the user and suggest `#prompt:kc-work` instead.
|
|
744
|
+
|
|
745
|
+
## Instructions
|
|
746
|
+
|
|
747
|
+
Follow the Micro-Fix Protocol from `knowzcode/knowzcode_loop.md` Section 4:
|
|
748
|
+
|
|
749
|
+
1. **Implement** the fix
|
|
750
|
+
2. **Test** — run targeted tests for the affected code
|
|
751
|
+
3. **Log** — prepend a `MicroFix` entry to `knowzcode/knowzcode_log.md`:
|
|
752
|
+
- Type: MicroFix
|
|
753
|
+
- File/NodeID affected
|
|
754
|
+
- User request, action taken, verification outcome
|
|
755
|
+
4. **Commit** with `fix: {description}` message
|
|
756
|
+
```
|
|
757
|
+
|
|
758
|
+
#### kc-plan.prompt.md
|
|
759
|
+
|
|
760
|
+
```markdown
|
|
761
|
+
---
|
|
762
|
+
agent: "agent"
|
|
763
|
+
description: "Research and investigate before implementing"
|
|
764
|
+
argument-hint: "Describe the topic to research"
|
|
765
|
+
---
|
|
766
|
+
|
|
767
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
768
|
+
|
|
769
|
+
# KnowzCode: Plan / Investigate
|
|
770
|
+
|
|
771
|
+
You are researching a topic before implementation. This is an investigation workflow, not a build workflow.
|
|
772
|
+
|
|
773
|
+
## Context
|
|
774
|
+
|
|
775
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
776
|
+
- #file:knowzcode/knowzcode_project.md
|
|
777
|
+
- #file:knowzcode/knowzcode_architecture.md
|
|
778
|
+
|
|
779
|
+
## Instructions
|
|
780
|
+
|
|
781
|
+
The user's research topic is provided in the chat message.
|
|
782
|
+
|
|
783
|
+
1. **Explore the codebase** — search for relevant files, patterns, and existing implementations
|
|
784
|
+
2. **Read existing specs** — check `knowzcode/specs/` for related components
|
|
785
|
+
3. **Check history** — scan `knowzcode/workgroups/` for past WorkGroups that touched similar areas
|
|
786
|
+
4. **Analyze architecture** — review `knowzcode/knowzcode_architecture.md` for structural context
|
|
787
|
+
5. **Present findings** with:
|
|
788
|
+
- Current state of the relevant code
|
|
789
|
+
- Existing patterns and conventions
|
|
790
|
+
- Options for implementation (with trade-offs)
|
|
791
|
+
- Recommended approach
|
|
792
|
+
|
|
793
|
+
## STOP
|
|
794
|
+
|
|
795
|
+
Present research findings and recommendations.
|
|
796
|
+
|
|
797
|
+
**To implement:** Tell the user to invoke `#prompt:kc-work` with their chosen approach.
|
|
798
|
+
```
|
|
799
|
+
|
|
800
|
+
#### kc-continue.prompt.md
|
|
801
|
+
|
|
802
|
+
```markdown
|
|
803
|
+
---
|
|
804
|
+
agent: "agent"
|
|
805
|
+
description: "Resume interrupted work or advance to next phase"
|
|
806
|
+
---
|
|
807
|
+
|
|
808
|
+
<!-- Generated by KnowzCode vX.Y.Z /kc:init -->
|
|
809
|
+
|
|
810
|
+
# KnowzCode: Continue / Resume
|
|
811
|
+
|
|
812
|
+
You are resuming an interrupted KnowzCode workflow or advancing to the next phase.
|
|
813
|
+
|
|
814
|
+
## Context
|
|
815
|
+
|
|
816
|
+
- #file:knowzcode/knowzcode_loop.md
|
|
817
|
+
- #file:knowzcode/knowzcode_tracker.md
|
|
818
|
+
|
|
819
|
+
## Instructions
|
|
820
|
+
|
|
821
|
+
### Step 1: Find Active WorkGroup
|
|
822
|
+
|
|
823
|
+
Read `knowzcode/knowzcode_tracker.md` and find entries with `[WIP]` status.
|
|
824
|
+
|
|
825
|
+
- **One active WorkGroup**: Use it
|
|
826
|
+
- **Multiple active**: Present the list and ask the user which to resume
|
|
827
|
+
- **None active**: Inform the user and suggest `#prompt:kc-work`
|
|
828
|
+
|
|
829
|
+
### Step 2: Determine Current Phase
|
|
830
|
+
|
|
831
|
+
Read the WorkGroup file at `knowzcode/workgroups/{WorkGroupID}.md`.
|
|
832
|
+
Check the Phase History table to determine the current state.
|
|
833
|
+
|
|
834
|
+
### Step 3: Resume or Advance
|
|
835
|
+
|
|
836
|
+
| WorkGroup State | Action |
|
|
837
|
+
|----------------|--------|
|
|
838
|
+
| Phase 1A in progress | Complete the impact analysis, present Change Set |
|
|
839
|
+
| Phase 1A complete, awaiting approval | Present Change Set for approval |
|
|
840
|
+
| Phase 1A approved, specs not started | Begin Phase 1B — draft specs |
|
|
841
|
+
| Phase 1B in progress | Complete spec drafting |
|
|
842
|
+
| Phase 1B complete, awaiting approval | Present specs for approval |
|
|
843
|
+
| Phase 1B approved, implementation not started | Begin Phase 2A — TDD implementation |
|
|
844
|
+
| Phase 2A in progress | Resume implementation from outstanding todos |
|
|
845
|
+
| Phase 2A complete | Advise: `#prompt:kc-audit` |
|
|
846
|
+
| Phase 2B complete, gaps found | Present options: fix gaps or accept |
|
|
847
|
+
| Phase 2B complete, no gaps | Begin Phase 3 — finalization |
|
|
848
|
+
| Phase 3 in progress | Complete finalization |
|
|
849
|
+
|
|
850
|
+
### Step 4: Present Status
|
|
851
|
+
|
|
852
|
+
```
|
|
853
|
+
## Resuming WorkGroup: {WorkGroupID}
|
|
854
|
+
|
|
855
|
+
**Goal**: {primary goal}
|
|
856
|
+
**Phase**: {current phase}
|
|
857
|
+
**NodeIDs**: {list}
|
|
858
|
+
|
|
859
|
+
**Outstanding Work**:
|
|
860
|
+
{list from WorkGroup file}
|
|
861
|
+
|
|
862
|
+
Continuing from where we left off...
|
|
863
|
+
```
|
|
864
|
+
|
|
865
|
+
Then proceed with the appropriate phase instructions from `knowzcode/knowzcode_loop.md`.
|
|
866
|
+
```
|
|
867
|
+
|
|
868
|
+
### C. .vscode/mcp.json Template
|
|
869
|
+
|
|
870
|
+
Optionally generated by `/kc:init` when Copilot is detected and MCP is configured:
|
|
871
|
+
|
|
872
|
+
```json
|
|
873
|
+
{
|
|
874
|
+
"servers": {
|
|
875
|
+
"knowzcode": {
|
|
876
|
+
"type": "http",
|
|
877
|
+
"url": "${input:knowzcode_mcp_url}",
|
|
878
|
+
"headers": {
|
|
879
|
+
"x-api-key": "${input:knowzcode_api_key}"
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
},
|
|
883
|
+
"inputs": [
|
|
884
|
+
{
|
|
885
|
+
"id": "knowzcode_mcp_url",
|
|
886
|
+
"description": "KnowzCode MCP server URL",
|
|
887
|
+
"type": "promptString"
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
"id": "knowzcode_api_key",
|
|
891
|
+
"description": "KnowzCode API key",
|
|
892
|
+
"type": "promptString",
|
|
893
|
+
"password": true
|
|
894
|
+
}
|
|
895
|
+
]
|
|
896
|
+
}
|
|
897
|
+
```
|
|
898
|
+
|
|
899
|
+
### D. Copilot-Specific Notes
|
|
900
|
+
|
|
901
|
+
**VS Code usage:**
|
|
902
|
+
- Invoke prompts via `#prompt:kc-work`, `#prompt:kc-specify`, etc. in Copilot Chat
|
|
903
|
+
- Add extra files to context with `#file:path/to/file` in the chat message
|
|
904
|
+
- All prompt files use `agent: "agent"` frontmatter for file editing and terminal access
|
|
905
|
+
- Model can be selected per session — prefer stronger models for analysis/audit phases
|
|
906
|
+
|
|
907
|
+
**Copilot CLI fallback:**
|
|
908
|
+
- CLI does not support `#prompt:` syntax
|
|
909
|
+
- Check current CLI documentation for file reference syntax — it may differ from VS Code
|
|
910
|
+
- Alternatively, reference the methodology directly or paste prompt content into the CLI
|
|
911
|
+
|
|
912
|
+
**Copilot Coding Agent:**
|
|
913
|
+
- Follows `.github/copilot-instructions.md` automatically when processing GitHub issues
|
|
914
|
+
- Runs all phases autonomously — quality gates deferred to PR review
|
|
915
|
+
- Does not use prompt files (uses repository instructions only)
|
|
916
|
+
|
|
917
|
+
**Execution model:**
|
|
918
|
+
- See `knowzcode/copilot_execution.md` for the full execution guide
|
|
919
|
+
- Single-agent, sequential execution — user manually transitions between phases
|
|
920
|
+
- No multi-agent orchestration (no Parallel Teams, no agent spawning)
|
|
921
|
+
- WorkGroup files carry state between prompt invocations
|
|
922
|
+
|
|
322
923
|
---
|
|
323
924
|
|
|
324
925
|
## Windsurf (`.windsurf/rules/knowzcode.md`)
|
|
325
926
|
|
|
326
|
-
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.
|
|
927
|
+
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.
|
|
327
928
|
|
|
328
929
|
```markdown
|
|
329
930
|
# KnowzCode Development Methodology
|