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.
Files changed (64) hide show
  1. package/.claude-plugin/marketplace.json +9 -3
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/README.md +170 -73
  4. package/agents/analyst.md +24 -62
  5. package/agents/architect.md +60 -48
  6. package/agents/builder.md +35 -86
  7. package/agents/closer.md +29 -87
  8. package/agents/context-scout.md +54 -0
  9. package/agents/knowledge-migrator.md +7 -7
  10. package/agents/knowz-scout.md +83 -0
  11. package/agents/knowz-scribe.md +155 -0
  12. package/agents/microfix-specialist.md +1 -6
  13. package/agents/project-advisor.md +110 -0
  14. package/agents/reviewer.md +43 -91
  15. package/agents/security-officer.md +194 -0
  16. package/agents/test-advisor.md +162 -0
  17. package/agents/update-coordinator.md +7 -18
  18. package/bin/knowzcode.mjs +94 -7
  19. package/commands/audit.md +245 -25
  20. package/commands/connect-mcp.md +525 -507
  21. package/commands/fix.md +8 -8
  22. package/commands/init.md +125 -6
  23. package/commands/learn.md +327 -308
  24. package/commands/plan.md +173 -26
  25. package/commands/register.md +21 -12
  26. package/commands/status.md +309 -291
  27. package/commands/telemetry.md +188 -188
  28. package/commands/work.md +764 -114
  29. package/knowzcode/automation_manifest.md +59 -59
  30. package/knowzcode/claude_code_execution.md +291 -22
  31. package/knowzcode/copilot_execution.md +231 -0
  32. package/knowzcode/enterprise/compliance_manifest.md +5 -0
  33. package/knowzcode/knowzcode_loop.md +114 -46
  34. package/knowzcode/knowzcode_orchestration.md +66 -0
  35. package/knowzcode/knowzcode_project.md +48 -233
  36. package/knowzcode/knowzcode_vaults.md +183 -54
  37. package/knowzcode/mcp_config.md +72 -47
  38. package/knowzcode/platform_adapters.md +630 -29
  39. package/knowzcode/prompts/Execute_Micro_Fix.md +57 -57
  40. package/knowzcode/prompts/Investigate_Codebase.md +227 -227
  41. package/knowzcode/prompts/Migrate_Knowledge.md +301 -301
  42. package/knowzcode/prompts/Refactor_Node.md +72 -72
  43. package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -59
  44. package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -52
  45. package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -75
  46. package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -55
  47. package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -72
  48. package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -67
  49. package/package.json +1 -1
  50. package/skills/alias-resolver.json +1 -1
  51. package/skills/architecture-diff.json +1 -1
  52. package/skills/check-installation-status.json +1 -1
  53. package/skills/continue.md +25 -4
  54. package/skills/environment-guard.json +1 -1
  55. package/skills/generate-workgroup-id.json +1 -1
  56. package/skills/install-knowzcode.json +1 -1
  57. package/skills/load-core-context.json +1 -1
  58. package/skills/log-entry-builder.json +1 -1
  59. package/skills/spec-quality-check.json +1 -1
  60. package/skills/spec-template.json +1 -1
  61. package/skills/spec-validator.json +1 -1
  62. package/skills/tracker-scan.json +1 -1
  63. package/skills/tracker-update.json +1 -1
  64. package/skills/validate-installation.json +1 -1
@@ -1,55 +1,55 @@
1
- # KnowzCode: [LOOP 2A] Authorize Implementation
2
-
3
- **WorkGroupID for Implementation:**
4
- [Orchestrator: Re-state the `WorkGroupID` that you have reviewed and are now approving for implementation. This confirms all associated specs are approved.]
5
-
6
- > **Automation Path:** Use `/kc-step phase=2A workgroup_id=<ID>` to activate the `builder` subagent. The command enforces the `environment-guard` skill and writes back tracker updates once the loop instructions are complete.
7
-
8
- **Remember:**
9
- - Cross-check code updates against the latest specs and refresh them if implementation diverges.
10
- - Record in-progress work and emerging tasks in `knowzcode/workgroups/<WorkGroupID>.md`, keeping every todo prefixed with `KnowzCode:`.
11
-
12
- **WorkGroupID:** `[wip-timestamp-to-implement]`
13
-
14
- ---
15
-
16
- ## Your Mission
17
- You are authorized to begin the core development phase for the specified `WorkGroupID`. All associated specifications are approved.
18
-
19
- Your task is to autonomously execute the planning, committing, implementation, and initial verification cycle. Your work on this prompt begins at **Step 4** of the `knowzcode_loop.md` and is considered complete only after **Step 6A** has passed successfully.
20
-
21
- **NOTE:** Your implementation will be independently audited for completeness in Loop 2B after you report success here.
22
-
23
- **Reference:** Your actions are governed by `knowzcode_loop.md`, executing the sequence from **Step 4 (ARC-Principle-Based Planning)** through to the completion of **Step 6A (Implementation & Initial Verification)**.
24
-
25
- ---
26
-
27
- ### Execution Protocol
28
-
29
- 1. **Plan & Commit (Step 4):**
30
- * Develop your internal implementation plan for the entire Change Set.
31
- * **CRITICAL CHECKPOINT:** After developing your plan, evaluate its complexity. If the plan is exceptionally complex or high-risk, you **MUST PAUSE** now and present the plan for Orchestrator review as per Step 4.2 of the loop. If the plan is straightforward, proceed.
32
- * Perform the **Pre-Implementation Commit** as per Step 4.3.
33
-
34
- 2. **Implement (Step 5):**
35
- * Execute your plan, creating and modifying all necessary code to fulfill the specs for the *entire* Change Set.
36
-
37
- 3. **Verify (Step 6A):**
38
- * Conduct a full initial verification of the *entire* Change Set, following the iterative "fix and re-verify" cycle as detailed in `knowzcode_loop.md`.
39
-
40
- ### Reporting
41
-
42
- * **On Success:** Once the entire Change Set has passed all verification steps defined in Step 6A, report your success and readiness for the audit.
43
- * **Success Report:**
44
- > "Implementation and Initial Verification for `WorkGroupID: [ID]` (Steps 4-6A) is complete. All code has been written, and all self-conducted tests and ARC criteria have passed. The Change Set is now ready for the Loop 2B Implementation Completeness Audit. Awaiting the `[LOOP_2B]__Verify_Implementation.md` command."
45
-
46
- * **On Blocker:** If you pause at the planning checkpoint, or encounter an unresolvable issue, report the specific blocker.
47
- * **Blocker Report:**
48
- > "Execution paused for `WorkGroupID: [ID]`. [Clearly describe the blocker...]"
49
-
50
- ### Final State & Next Prompt
51
-
52
- * Upon successful completion, you will **PAUSE**.
53
- * The next command from the Orchestrator for this `WorkGroupID` will be **`[LOOP_2B]__Verify_Implementation.md`**.
54
-
55
- ---
1
+ # KnowzCode: [LOOP 2A] Authorize Implementation
2
+
3
+ **WorkGroupID for Implementation:**
4
+ [Orchestrator: Re-state the `WorkGroupID` that you have reviewed and are now approving for implementation. This confirms all associated specs are approved.]
5
+
6
+ > **Automation Path:** Use `/kc-step phase=2A workgroup_id=<ID>` to activate the `builder` subagent. The command enforces the `environment-guard` skill and writes back tracker updates once the loop instructions are complete.
7
+
8
+ **Remember:**
9
+ - Cross-check code updates against the latest specs and refresh them if implementation diverges.
10
+ - Record in-progress work and emerging tasks in `knowzcode/workgroups/<WorkGroupID>.md`, keeping every todo prefixed with `KnowzCode:`.
11
+
12
+ **WorkGroupID:** `[wip-timestamp-to-implement]`
13
+
14
+ ---
15
+
16
+ ## Your Mission
17
+ You are authorized to begin the core development phase for the specified `WorkGroupID`. All associated specifications are approved.
18
+
19
+ Your task is to autonomously execute the planning, committing, implementation, and initial verification cycle. Your work on this prompt begins at **Step 4** of the `knowzcode_loop.md` and is considered complete only after **Step 6A** has passed successfully.
20
+
21
+ **NOTE:** Your implementation will be independently audited for completeness in Loop 2B after you report success here.
22
+
23
+ **Reference:** Your actions are governed by `knowzcode_loop.md`, executing the sequence from **Step 4 (ARC-Principle-Based Planning)** through to the completion of **Step 6A (Implementation & Initial Verification)**.
24
+
25
+ ---
26
+
27
+ ### Execution Protocol
28
+
29
+ 1. **Plan & Commit (Step 4):**
30
+ * Develop your internal implementation plan for the entire Change Set.
31
+ * **CRITICAL CHECKPOINT:** After developing your plan, evaluate its complexity. If the plan is exceptionally complex or high-risk, you **MUST PAUSE** now and present the plan for Orchestrator review as per Step 4.2 of the loop. If the plan is straightforward, proceed.
32
+ * Perform the **Pre-Implementation Commit** as per Step 4.3.
33
+
34
+ 2. **Implement (Step 5):**
35
+ * Execute your plan, creating and modifying all necessary code to fulfill the specs for the *entire* Change Set.
36
+
37
+ 3. **Verify (Step 6A):**
38
+ * Conduct a full initial verification of the *entire* Change Set, following the iterative "fix and re-verify" cycle as detailed in `knowzcode_loop.md`.
39
+
40
+ ### Reporting
41
+
42
+ * **On Success:** Once the entire Change Set has passed all verification steps defined in Step 6A, report your success and readiness for the audit.
43
+ * **Success Report:**
44
+ > "Implementation and Initial Verification for `WorkGroupID: [ID]` (Steps 4-6A) is complete. All code has been written, and all self-conducted tests and ARC criteria have passed. The Change Set is now ready for the Loop 2B Implementation Completeness Audit. Awaiting the `[LOOP_2B]__Verify_Implementation.md` command."
45
+
46
+ * **On Blocker:** If you pause at the planning checkpoint, or encounter an unresolvable issue, report the specific blocker.
47
+ * **Blocker Report:**
48
+ > "Execution paused for `WorkGroupID: [ID]`. [Clearly describe the blocker...]"
49
+
50
+ ### Final State & Next Prompt
51
+
52
+ * Upon successful completion, you will **PAUSE**.
53
+ * The next command from the Orchestrator for this `WorkGroupID` will be **`[LOOP_2B]__Verify_Implementation.md`**.
54
+
55
+ ---
@@ -1,72 +1,72 @@
1
- # KnowzCode: [LOOP 2B] Verify Implementation Completeness
2
-
3
- **WorkGroupID for Audit:**
4
- [Orchestrator: Re-state the `WorkGroupID` that has completed Loop 2A and requires an implementation audit.]
5
-
6
- > **Automation Path:** Trigger `/kc-step phase=2B workgroup_id=<ID>` or `/kc-audit audit=implementation workgroup_id=<ID>` to run the `reviewer` subagent in read-only mode. It utilizes `spec-quality-check`, `tracker-scan`, and `log-entry-builder` skills to compute the completion percentage.
7
-
8
- **Remember:**
9
- - Flag any spec discrepancies you uncover and update the relevant files in `knowzcode/specs/`.
10
- - Add follow-up todos to `knowzcode/workgroups/<WorkGroupID>.md` (each entry prefixed `KnowzCode:`) so unresolved work is obvious.
11
-
12
- **WorkGroupID:** `[wip-timestamp-to-audit]`
13
-
14
- ---
15
-
16
- ## Your Mission
17
- This is a **READ-ONLY** quality gate to audit the completeness of the implementation for the given `WorkGroupID`. You will compare the work done against the approved specifications and report an objective completion percentage.
18
-
19
- **CRITICAL RULE: You MUST NOT modify any files. This is a verification step, not a correction step.**
20
-
21
- **Reference:** Your actions are governed by `knowzcode_loop.md`, executing the audit defined in **Step 6B**.
22
-
23
- ---
24
-
25
- ### Execution Protocol
26
-
27
- #### Phase 0: Reconnaissance (READ-ONLY)
28
- 1. **Identify Audit Scope:** Get all `NodeID`s associated with the `WorkGroupID` from `knowzcode_tracker.md`.
29
- 2. **List Artifacts:** List all source code files that were created or modified for this `WorkGroupID`.
30
- 3. **Map Built Features:** Briefly map what was built (e.g., components, functions, features, tests).
31
-
32
- #### Phase 1: Specification-to-Code Audit
33
- 1. **Load Specs:** For each `NodeID` in your scope, load its approved specification from `specs/`.
34
- 2. **Verify Spec-to-Code:** For each spec, systematically verify that every requirement, function, and error handling case listed in the spec has been implemented in the code.
35
- 3. **Verify Code-to-Spec:** Check for any "orphan" code—features or functions that were implemented but are not described in any specification.
36
- 4. **Calculate Completion:** Based on your findings, calculate an objective, quantitative **completion percentage**. (e.g., "8 of 10 requirements implemented = 80% complete").
37
-
38
- #### Phase 2: Synthesize Findings & Report
39
- * Compile a single, comprehensive audit report.
40
-
41
- ### Audit Report Structure
42
-
43
- Your report **must** include the following sections:
44
- > **WorkGroupID:** `[ID]`
45
- > **Overall Implementation Completion:** [Calculated Percentage]%
46
- >
47
- > **1. Fully Implemented Requirements:**
48
- > * [List of spec requirements that are 100% complete]
49
- >
50
- > **2. Partially Implemented Requirements:**
51
- > * [Requirement X]: Implemented basic case, but missing error handling for [condition].
52
- > * [Requirement Y]: Feature exists, but is missing [specific part].
53
- >
54
- > **3. Not Implemented Requirements:**
55
- > * [List of spec requirements that were not implemented at all]
56
- >
57
- > **4. Orphan Code (Not in Specs):**
58
- > * [Function `calculate_extra_value()` in `file.py` has no corresponding spec requirement.]
59
- >
60
- > **5. Risk Assessment:**
61
- > * [Brief assessment of the risk of proceeding with the current implementation state. e.g., "Low risk, missing features are non-critical." or "High risk, core security function is incomplete."]
62
- >
63
- > **Awaiting Orchestrator decision.**
64
-
65
- ### Orchestrator Decision Points
66
- Based on your report, the Orchestrator will choose one of the following paths:
67
- * **(A) Complete Gaps:** Return to implementation (Step 5) to address the identified gaps.
68
- * **(B) Accept & Proceed:** Accept the current implementation as-is and proceed to Loop 3 for finalization.
69
- * **(C) Modify Specs:** Update the specifications to match the "as-built" code, formally accepting the deviations.
70
- * **(D) Cancel:** Cancel the WorkGroupID and potentially revert the changes.
71
-
72
- ---
1
+ # KnowzCode: [LOOP 2B] Verify Implementation Completeness
2
+
3
+ **WorkGroupID for Audit:**
4
+ [Orchestrator: Re-state the `WorkGroupID` that has completed Loop 2A and requires an implementation audit.]
5
+
6
+ > **Automation Path:** Trigger `/kc-step phase=2B workgroup_id=<ID>` or `/kc-audit audit=implementation workgroup_id=<ID>` to run the `reviewer` subagent in read-only mode. It utilizes `spec-quality-check`, `tracker-scan`, and `log-entry-builder` skills to compute the completion percentage.
7
+
8
+ **Remember:**
9
+ - Flag any spec discrepancies you uncover and update the relevant files in `knowzcode/specs/`.
10
+ - Add follow-up todos to `knowzcode/workgroups/<WorkGroupID>.md` (each entry prefixed `KnowzCode:`) so unresolved work is obvious.
11
+
12
+ **WorkGroupID:** `[wip-timestamp-to-audit]`
13
+
14
+ ---
15
+
16
+ ## Your Mission
17
+ This is a **READ-ONLY** quality gate to audit the completeness of the implementation for the given `WorkGroupID`. You will compare the work done against the approved specifications and report an objective completion percentage.
18
+
19
+ **CRITICAL RULE: You MUST NOT modify any files. This is a verification step, not a correction step.**
20
+
21
+ **Reference:** Your actions are governed by `knowzcode_loop.md`, executing the audit defined in **Step 6B**.
22
+
23
+ ---
24
+
25
+ ### Execution Protocol
26
+
27
+ #### Phase 0: Reconnaissance (READ-ONLY)
28
+ 1. **Identify Audit Scope:** Get all `NodeID`s associated with the `WorkGroupID` from `knowzcode_tracker.md`.
29
+ 2. **List Artifacts:** List all source code files that were created or modified for this `WorkGroupID`.
30
+ 3. **Map Built Features:** Briefly map what was built (e.g., components, functions, features, tests).
31
+
32
+ #### Phase 1: Specification-to-Code Audit
33
+ 1. **Load Specs:** For each `NodeID` in your scope, load its approved specification from `specs/`.
34
+ 2. **Verify Spec-to-Code:** For each spec, systematically verify that every requirement, function, and error handling case listed in the spec has been implemented in the code.
35
+ 3. **Verify Code-to-Spec:** Check for any "orphan" code—features or functions that were implemented but are not described in any specification.
36
+ 4. **Calculate Completion:** Based on your findings, calculate an objective, quantitative **completion percentage**. (e.g., "8 of 10 requirements implemented = 80% complete").
37
+
38
+ #### Phase 2: Synthesize Findings & Report
39
+ * Compile a single, comprehensive audit report.
40
+
41
+ ### Audit Report Structure
42
+
43
+ Your report **must** include the following sections:
44
+ > **WorkGroupID:** `[ID]`
45
+ > **Overall Implementation Completion:** [Calculated Percentage]%
46
+ >
47
+ > **1. Fully Implemented Requirements:**
48
+ > * [List of spec requirements that are 100% complete]
49
+ >
50
+ > **2. Partially Implemented Requirements:**
51
+ > * [Requirement X]: Implemented basic case, but missing error handling for [condition].
52
+ > * [Requirement Y]: Feature exists, but is missing [specific part].
53
+ >
54
+ > **3. Not Implemented Requirements:**
55
+ > * [List of spec requirements that were not implemented at all]
56
+ >
57
+ > **4. Orphan Code (Not in Specs):**
58
+ > * [Function `calculate_extra_value()` in `file.py` has no corresponding spec requirement.]
59
+ >
60
+ > **5. Risk Assessment:**
61
+ > * [Brief assessment of the risk of proceeding with the current implementation state. e.g., "Low risk, missing features are non-critical." or "High risk, core security function is incomplete."]
62
+ >
63
+ > **Awaiting Orchestrator decision.**
64
+
65
+ ### Orchestrator Decision Points
66
+ Based on your report, the Orchestrator will choose one of the following paths:
67
+ * **(A) Complete Gaps:** Return to implementation (Step 5) to address the identified gaps.
68
+ * **(B) Accept & Proceed:** Accept the current implementation as-is and proceed to Loop 3 for finalization.
69
+ * **(C) Modify Specs:** Update the specifications to match the "as-built" code, formally accepting the deviations.
70
+ * **(D) Cancel:** Cancel the WorkGroupID and potentially revert the changes.
71
+
72
+ ---
@@ -1,67 +1,67 @@
1
- # KnowzCode: [LOOP 3] Finalize & Commit Change Set
2
-
3
- **WorkGroupID for Finalization:**
4
- [Orchestrator: Re-state the `WorkGroupID` that has passed implementation and verification, authorizing its finalization and commit.]
5
-
6
- > **Automation Path:** Execute `/kc-step phase=3 workgroup_id=<ID>` to hand off to the `closer` subagent. It chains `tracker-update`, `log-entry-builder`, and `architecture-diff` skills to wrap up the loop.
7
-
8
- **Remember:**
9
- - Finalize every spec in `knowzcode/specs/` to reflect the as-built system.
10
- - Close or add remaining todos in `knowzcode/workgroups/<WorkGroupID>.md`, ensuring all entries keep the `KnowzCode:` prefix.
11
-
12
- **WorkGroupID:** `[wip-timestamp-to-finalize]`
13
-
14
- ---
15
-
16
- ## Your Mission
17
- The implementation and verification for the specified `WorkGroupID` is complete. You are now authorized to execute the final phase of the KnowzCode loop: documentation, logging, and committing.
18
-
19
- **CRITICAL RULE: The implementation phase is complete. Your work in this phase is strictly limited to updating KnowzCode's own project and specification files (`.md` files) to reflect the finished work. You MUST NOT write or modify any more application source code (e.g., `.js`, `.py`, `.html` files).**
20
-
21
- **Reference:** Your actions are governed by `knowzcode_loop.md`, executing the sequence from **Step 7 through Step 10**.
22
-
23
- ---
24
-
25
- ### Execution Protocol
26
-
27
- 1. **Finalize Specifications (Step 7):**
28
- * For **each** `NodeID` in the `WorkGroupID`, update its spec file in `specs/` to the "as-built" state, ensuring it perfectly reflects the verified code.
29
-
30
- 2. **Check Architecture (Step 8):**
31
- * Conduct the Flowchart Consistency Check. If you find a simple discrepancy, fix `knowzcode_architecture.md` directly. If it's complex, document it in the log.
32
-
33
- 3. **Log Operation (Step 9):**
34
- * Create the single, comprehensive `ARC-Completion` log entry in `knowzcode_log.md`. Ensure it includes the flowchart check outcome, any unforeseen ripple effects, and project overview updates. Use an environment-sourced timestamp.
35
-
36
- 4. **Update Tracker, Schedule Debt, & Check Project Overview (Step 10):**
37
- * **Update Tracker:** In `knowzcode_tracker.md`, mark all nodes in the `WorkGroupID` as `[VERIFIED]` and clear their `WorkGroupID`.
38
- * **Schedule Debt:** Perform the "Technical Debt Scheduling" step. For any nodes with documented debt, create new `REFACTOR_` tasks in the tracker.
39
- * **Update Project Overview:** Check if this Change Set impacts `knowzcode_project.md`:
40
- - New major features → Update "Key Features" section
41
- - New libraries/tools → Update "Technology Stack" table
42
- - Architecture changes → Update "Architecture Decisions"
43
- - Scope expansion → Update "Scope & Key Features"
44
- * **Final Commit:** Stage ALL changes using `git add -A` (this includes source code from implementation AND knowzcode/ files), then commit with a descriptive `feat:` message.
45
-
46
- ### Final Report
47
-
48
- * Once all steps above are complete, provide a final confirmation report.
49
-
50
- **Example Response Format:**
51
- > "Finalization for `WorkGroupID: [ID]` is complete.
52
- >
53
- > * All specifications have been updated to the 'as-built' state.
54
- > * The architecture flowchart has been checked and updated.
55
- > * A complete `ARC-Completion` entry has been logged.
56
- > * The tracker is updated, and all nodes are now `[VERIFIED]`.
57
- > * **Project Overview Updates:** [None | Updated sections: Technology Stack, Key Features]
58
- > * The final `feat:` commit has been made to version control.
59
- > * **New Refactor Tasks Created:** [List any REFACTOR_ nodes created, or 'None'].
60
- >
61
- > This Change Set is now fully complete and documented. Awaiting next `PrimaryGoal` via a new Work Session."
62
-
63
- ### Final State
64
-
65
- * Upon successful completion, the KnowzCode loop for this `WorkGroupID` is **finished**. You will return to an idle state.
66
-
67
- ---
1
+ # KnowzCode: [LOOP 3] Finalize & Commit Change Set
2
+
3
+ **WorkGroupID for Finalization:**
4
+ [Orchestrator: Re-state the `WorkGroupID` that has passed implementation and verification, authorizing its finalization and commit.]
5
+
6
+ > **Automation Path:** Execute `/kc-step phase=3 workgroup_id=<ID>` to hand off to the `closer` subagent. It chains `tracker-update`, `log-entry-builder`, and `architecture-diff` skills to wrap up the loop.
7
+
8
+ **Remember:**
9
+ - Finalize every spec in `knowzcode/specs/` to reflect the as-built system.
10
+ - Close or add remaining todos in `knowzcode/workgroups/<WorkGroupID>.md`, ensuring all entries keep the `KnowzCode:` prefix.
11
+
12
+ **WorkGroupID:** `[wip-timestamp-to-finalize]`
13
+
14
+ ---
15
+
16
+ ## Your Mission
17
+ The implementation and verification for the specified `WorkGroupID` is complete. You are now authorized to execute the final phase of the KnowzCode loop: documentation, logging, and committing.
18
+
19
+ **CRITICAL RULE: The implementation phase is complete. Your work in this phase is strictly limited to updating KnowzCode's own project and specification files (`.md` files) to reflect the finished work. You MUST NOT write or modify any more application source code (e.g., `.js`, `.py`, `.html` files).**
20
+
21
+ **Reference:** Your actions are governed by `knowzcode_loop.md`, executing the sequence from **Step 7 through Step 10**.
22
+
23
+ ---
24
+
25
+ ### Execution Protocol
26
+
27
+ 1. **Finalize Specifications (Step 7):**
28
+ * For **each** `NodeID` in the `WorkGroupID`, update its spec file in `specs/` to the "as-built" state, ensuring it perfectly reflects the verified code.
29
+
30
+ 2. **Check Architecture (Step 8):**
31
+ * Conduct the Flowchart Consistency Check. If you find a simple discrepancy, fix `knowzcode_architecture.md` directly. If it's complex, document it in the log.
32
+
33
+ 3. **Log Operation (Step 9):**
34
+ * Create the single, comprehensive `ARC-Completion` log entry in `knowzcode_log.md`. Ensure it includes the flowchart check outcome, any unforeseen ripple effects, and project overview updates. Use an environment-sourced timestamp.
35
+
36
+ 4. **Update Tracker, Schedule Debt, & Check Project Overview (Step 10):**
37
+ * **Update Tracker:** In `knowzcode_tracker.md`, mark all nodes in the `WorkGroupID` as `[VERIFIED]` and clear their `WorkGroupID`.
38
+ * **Schedule Debt:** Perform the "Technical Debt Scheduling" step. For any nodes with documented debt, create new `REFACTOR_` tasks in the tracker.
39
+ * **Update Project Overview:** Check if this Change Set impacts `knowzcode_project.md`:
40
+ - New major features → Update "Key Features" section
41
+ - New libraries/tools → Update "Technology Stack" table
42
+ - Architecture changes → Update "Architecture Decisions"
43
+ - Scope expansion → Update "Scope & Key Features"
44
+ * **Final Commit:** Stage ALL changes using `git add -A` (this includes source code from implementation AND knowzcode/ files), then commit with a descriptive `feat:` message.
45
+
46
+ ### Final Report
47
+
48
+ * Once all steps above are complete, provide a final confirmation report.
49
+
50
+ **Example Response Format:**
51
+ > "Finalization for `WorkGroupID: [ID]` is complete.
52
+ >
53
+ > * All specifications have been updated to the 'as-built' state.
54
+ > * The architecture flowchart has been checked and updated.
55
+ > * A complete `ARC-Completion` entry has been logged.
56
+ > * The tracker is updated, and all nodes are now `[VERIFIED]`.
57
+ > * **Project Overview Updates:** [None | Updated sections: Technology Stack, Key Features]
58
+ > * The final `feat:` commit has been made to version control.
59
+ > * **New Refactor Tasks Created:** [List any REFACTOR_ nodes created, or 'None'].
60
+ >
61
+ > This Change Set is now fully complete and documented. Awaiting next `PrimaryGoal` via a new Work Session."
62
+
63
+ ### Final State
64
+
65
+ * Upon successful completion, the KnowzCode loop for this `WorkGroupID` is **finished**. You will return to an idle state.
66
+
67
+ ---
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knowzcode",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Platform-agnostic AI development methodology with TDD, quality gates, and structured workflows",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "alias-resolver",
3
- "version": "1.0.0",
3
+ "version": "0.3.1",
4
4
  "description": "Resolves friendly natural-language aliases to KnowzCode canonical values (phase, audit, plan, workgroup_type).",
5
5
  "parameters": [
6
6
  {"name": "domain", "type": "string", "required": true},
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architecture-diff",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Highlights differences between specs and the Mermaid flowchart in knowzcode_architecture.md.",
5
5
  "parameters": [],
6
6
  "actions": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "check-installation-status",
3
- "version": "2.0.0",
3
+ "version": "0.3.1",
4
4
  "description": "Checks if KnowzCode is initialized in the current project and reports current status",
5
5
 
6
6
  "parameters": [],
@@ -51,12 +51,34 @@ Read `knowzcode/workgroups/{WorkGroupID}.md` to determine:
51
51
  - Primary goal
52
52
  - Change Set
53
53
  - Outstanding todos
54
+ - **Autonomous Mode**: If the WorkGroup file contains `**Autonomous Mode**: Active`, restore `AUTONOMOUS_MODE = true` and announce: `> **Autonomous Mode: RESTORED** — continuing with auto-approved gates.`
55
+ - **Orchestration Config**: If `knowzcode/knowzcode_orchestration.md` exists, parse and restore `MAX_BUILDERS`, `SCOUT_MODE`, `MCP_AGENTS_ENABLED`, `DEFAULT_SPECIALISTS` (same logic as work.md Step 2.4). Defaults apply if file is absent.
54
56
 
55
57
  ### Step 3: Resume at Current Phase
56
58
 
57
59
  Read `knowzcode/knowzcode_loop.md` and resume the workflow at the detected phase.
58
60
 
59
- Create tasks only for the **remaining** phases (not completed ones):
61
+ #### Parallel Mode Detection
62
+
63
+ If the WorkGroup file contains a `## Current Stage` section (instead of `Current Phase`):
64
+ - This is a **parallel-mode WorkGroup**
65
+ - Read the per-NodeID phase table to determine what's in progress
66
+ - Resume by recreating the team and spawning agents appropriate for the current stage:
67
+ - **Stage 0/1**: Spawn analyst + architect. If `SCOUT_MODE != "none"` and context is stale, re-spawn scout(s) per SCOUT_MODE.
68
+ - **Stage 2**: Spawn builder(s) per the dependency map + reviewer if any NodeIDs are past implementation
69
+ - **Stage 3**: Spawn closer
70
+ - Builders and reviewer persist through gap loops (don't respawn per iteration)
71
+ - Announce: `**Resuming Parallel Teams** — Stage {N}: {description}`
72
+
73
+ If resuming mid-Stage-2 (e.g., builder was implementing, reviewer had started auditing):
74
+ - Read the per-NodeID status table to determine which NodeIDs need builders and which need reviewer
75
+ - Carry forward existing context by reading the WorkGroup file
76
+
77
+ #### Sequential Mode Detection
78
+
79
+ If the WorkGroup file contains `Current Phase:` (standard format):
80
+ - This is a **sequential-mode WorkGroup**
81
+ - Create tasks only for the **remaining** phases (not completed ones):
60
82
 
61
83
  | Detected Phase | Remaining Work |
62
84
  |----------------|----------------|
@@ -66,10 +88,9 @@ Create tasks only for the **remaining** phases (not completed ones):
66
88
  | 2B | Audit + finalization |
67
89
  | 3 | Finalization only |
68
90
 
69
- **Detect execution mode** — check if you have Agent Teams capabilities (spawn/create teammate tools, requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`):
91
+ **Set up execution mode** — check `~/.claude/settings.json` and `.claude/settings.json` for `"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"` in the `env` block. If found, Agent Teams is available — create a team named `kc-{wgid}` and activate delegate mode (you coordinate only, never write code directly). Read `knowzcode/claude_code_execution.md` for team conventions. For each remaining phase, spawn one teammate with the spawn prompt from the corresponding phase section of `/kc:work`, create a task, wait for completion, present quality gate, shut down teammate. Shut down all teammates when done or on cancel.
70
92
 
71
- - **If Agent Teams is available**: Read `knowzcode/claude_code_execution.md` for team conventions. Activate delegate mode you coordinate only, never write code directly. For each remaining phase, spawn one teammate with the spawn prompt defined in the corresponding phase section of `/kc:work`, create a task, wait for completion, present quality gate, shut down teammate before the next phase. Shut down all teammates when done or on cancel.
72
- - **If Agent Teams is NOT available**: Use `Task()` calls to delegate each remaining phase to the named agent (subagent fallback).
93
+ If Agent Teams is not available, announce `**Execution Mode: Subagent Delegation**Agent Teams not available (add "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1" to the env block in settings.json, then restart Claude Code)` and use `Task()` calls to delegate each remaining phase to the named agent.
73
94
 
74
95
  Follow the same phase delegation patterns (spawn prompts, quality gates, gap loop) as `/kc:work`.
75
96
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "environment-guard",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Verifies that knowzcode/environment_context.md no longer contains placeholder brackets.",
5
5
  "parameters": [],
6
6
  "actions": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generate-workgroup-id",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Generates a WorkGroupID following the KnowzCode convention [type]-[slug]-YYYYMMDD-HHMMSS. The slug is a 2-4 word descriptor extracted from the goal.",
5
5
  "parameters": [
6
6
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "install-knowzcode",
3
- "version": "2.0.0",
3
+ "version": "0.3.1",
4
4
  "description": "Initializes KnowzCode directory structure and required files in the current project",
5
5
 
6
6
  "parameters": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "load-core-context",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Loads the KnowzCode project overview, architecture, tracker, log header, and automation manifest for downstream steps.",
5
5
  "parameters": [],
6
6
  "actions": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "log-entry-builder",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Appends structured entries to knowzcode/knowzcode_log.md with KnowzCode formatting.",
5
5
  "parameters": [
6
6
  {"name": "entry_type", "type": "string", "required": true},
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-quality-check",
3
- "version": "2.0.0",
3
+ "version": "0.3.1",
4
4
  "description": "Validates KnowzCode spec files for mandatory sections. Supports new 4-section format and legacy numbered format.",
5
5
  "parameters": [
6
6
  {"name": "node_id", "type": "string", "required": true}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-template",
3
- "version": "2.0.0",
3
+ "version": "0.3.1",
4
4
  "description": "Seeds or repairs KnowzCode spec files with the lean 4-section template.",
5
5
  "parameters": [
6
6
  {"name": "node_id", "type": "string", "required": true},
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spec-validator",
3
- "version": "2.0.0",
3
+ "version": "0.3.1",
4
4
  "description": "Validates NodeID specification completeness and quality. Supports new 4-section format (preferred) and legacy numbered sections (deprecated).",
5
5
  "parameters": [
6
6
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tracker-scan",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Extracts NodeID statuses and WorkGroup assignments from the KnowzCode tracker.",
5
5
  "parameters": [],
6
6
  "actions": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tracker-update",
3
- "version": "0.1.0",
3
+ "version": "0.3.1",
4
4
  "description": "Applies validated updates to knowzcode/knowzcode_tracker.md while preserving table structure.",
5
5
  "parameters": [
6
6
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "validate-installation",
3
- "version": "2.0.0",
3
+ "version": "0.3.1",
4
4
  "description": "Validates that KnowzCode installation completed successfully with required directories and files",
5
5
 
6
6
  "parameters": [],