knowzcode 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/.claude-plugin/marketplace.json +55 -0
  2. package/.claude-plugin/plugin.json +8 -0
  3. package/LICENSE +121 -0
  4. package/README.md +223 -0
  5. package/agents/analyst.md +121 -0
  6. package/agents/architect.md +121 -0
  7. package/agents/builder.md +155 -0
  8. package/agents/closer.md +148 -0
  9. package/agents/knowledge-migrator.md +349 -0
  10. package/agents/microfix-specialist.md +140 -0
  11. package/agents/reviewer.md +220 -0
  12. package/agents/update-coordinator.md +405 -0
  13. package/bin/knowzcode.mjs +869 -0
  14. package/commands/audit.md +108 -0
  15. package/commands/connect-mcp.md +507 -0
  16. package/commands/fix.md +107 -0
  17. package/commands/init.md +320 -0
  18. package/commands/learn.md +308 -0
  19. package/commands/plan.md +125 -0
  20. package/commands/register.md +724 -0
  21. package/commands/status.md +291 -0
  22. package/commands/telemetry-setup.md +368 -0
  23. package/commands/telemetry.md +188 -0
  24. package/commands/work.md +390 -0
  25. package/knowzcode/automation_manifest.md +59 -0
  26. package/knowzcode/claude_code_execution.md +133 -0
  27. package/knowzcode/enterprise/compliance_manifest.md +132 -0
  28. package/knowzcode/enterprise/compliance_status.md +30 -0
  29. package/knowzcode/enterprise/guidelines/code-quality.md +67 -0
  30. package/knowzcode/enterprise/guidelines/custom/.gitkeep +0 -0
  31. package/knowzcode/enterprise/guidelines/security.md +355 -0
  32. package/knowzcode/enterprise/reports/.gitkeep +0 -0
  33. package/knowzcode/enterprise/templates/guideline-template.md +55 -0
  34. package/knowzcode/gitignore.template +13 -0
  35. package/knowzcode/knowzcode_architecture.md +51 -0
  36. package/knowzcode/knowzcode_log.md +142 -0
  37. package/knowzcode/knowzcode_loop.md +515 -0
  38. package/knowzcode/knowzcode_project.md +233 -0
  39. package/knowzcode/knowzcode_tracker.md +40 -0
  40. package/knowzcode/knowzcode_vaults.md +104 -0
  41. package/knowzcode/mcp_config.md +166 -0
  42. package/knowzcode/planning/Readme.md +6 -0
  43. package/knowzcode/platform_adapters.md +388 -0
  44. package/knowzcode/prompts/Execute_Micro_Fix.md +57 -0
  45. package/knowzcode/prompts/Investigate_Codebase.md +227 -0
  46. package/knowzcode/prompts/Migrate_Knowledge.md +301 -0
  47. package/knowzcode/prompts/Refactor_Node.md +72 -0
  48. package/knowzcode/prompts/Spec_Verification_Checkpoint.md +59 -0
  49. package/knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md +52 -0
  50. package/knowzcode/prompts/[LOOP_1B]__Draft_Specs.md +75 -0
  51. package/knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md +55 -0
  52. package/knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md +72 -0
  53. package/knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md +67 -0
  54. package/knowzcode/specs/Readme.md +10 -0
  55. package/knowzcode/telemetry_config.md +89 -0
  56. package/knowzcode/user_preferences.md +120 -0
  57. package/package.json +53 -0
  58. package/skills/alias-resolver.json +15 -0
  59. package/skills/architecture-diff.json +12 -0
  60. package/skills/check-installation-status.json +14 -0
  61. package/skills/continue.md +105 -0
  62. package/skills/environment-guard.json +12 -0
  63. package/skills/generate-workgroup-id.json +25 -0
  64. package/skills/install-knowzcode.json +21 -0
  65. package/skills/load-core-context.json +18 -0
  66. package/skills/log-entry-builder.json +15 -0
  67. package/skills/spec-quality-check.json +14 -0
  68. package/skills/spec-template.json +15 -0
  69. package/skills/spec-validator.json +25 -0
  70. package/skills/start-work.md +224 -0
  71. package/skills/tracker-scan.json +12 -0
  72. package/skills/tracker-update.json +28 -0
  73. package/skills/validate-installation.json +14 -0
@@ -0,0 +1,133 @@
1
+ # Claude Code Execution Model
2
+
3
+ **Purpose:** Defines Agent Teams behavior and inter-agent communication patterns specific to Claude Code. This file supplements the platform-agnostic agent definitions in `agents/`.
4
+
5
+ Agents on other platforms should ignore this file — see `knowzcode/platform_adapters.md` for platform-specific execution instructions.
6
+
7
+ ---
8
+
9
+ ## Agent Teams Overview
10
+
11
+ Agent Teams is an **experimental** Claude Code feature for multi-agent coordination. It requires the environment variable `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` to be enabled.
12
+
13
+ > **Status:** Experimental. The API may change in future releases.
14
+
15
+ ### Prerequisites
16
+
17
+ - Claude Code with Agent Teams support
18
+ - Environment variable: `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`
19
+ - Agent Teams is the preferred execution model when enabled; subagent fallback is used otherwise
20
+
21
+ > **Windows note:** Split-pane mode (`tmux`) is not supported on Windows Terminal. Agent Teams automatically uses `in-process` mode on Windows (the default `auto` mode handles this correctly). No manual configuration is needed.
22
+
23
+ ### Architecture
24
+
25
+ Agent Teams uses a **team lead + teammates** model:
26
+
27
+ - **Team Lead**: Coordinates workflow, delegates tasks, never codes directly (delegate mode)
28
+ - **Teammates**: Specialized agents that receive tasks and report results
29
+ - **Shared Task List**: Structured work tracking with dependencies
30
+ - **Mailbox**: Ad-hoc inter-agent messaging for coordination
31
+
32
+ ### Task Mechanics
33
+
34
+ Tasks follow a lifecycle: `pending` -> `in_progress` -> `completed`
35
+
36
+ - Tasks can have **dependencies** (task B blocked by task A)
37
+ - Tasks can have **blockers** (external impediments)
38
+ - The lead creates tasks and assigns to teammates
39
+ - Teammates update status and report results
40
+
41
+ ### Communication Primitives
42
+
43
+ Agent Teams provides two communication mechanisms:
44
+
45
+ | Mechanism | Purpose | When to Use |
46
+ |-----------|---------|-------------|
47
+ | **Task List** | Structured work with status, dependencies, blockers | Phase delegation, quality gates, handoffs |
48
+ | **Mailbox** | Ad-hoc coordination between teammates | Clarifications, gap details, scope questions |
49
+
50
+ ### Hooks
51
+
52
+ Agent Teams supports event-driven coordination via hooks:
53
+
54
+ - **`TeammateIdle`**: Fires when a teammate finishes its current task — can auto-assign next work
55
+ - **`TaskCompleted`**: Fires when a task is marked complete — can trigger dependent tasks
56
+
57
+ ### Limitations
58
+
59
+ - Experimental feature — API may change
60
+ - Requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1` env var
61
+ - Not available in all Claude Code environments
62
+
63
+ ---
64
+
65
+ ## KnowzCode Agent Teams Behavior
66
+
67
+ When running as teammates in a Claude Code Agent Teams workflow, all agents follow these conventions:
68
+
69
+ ### Task Lifecycle
70
+ - Receive a task from the team lead with subject and description
71
+ - Read context files listed in task description independently (do not duplicate context across agents)
72
+ - Report progress by updating task status
73
+ - When complete: mark task completed with a summary
74
+ - If blocked: keep task in_progress with blocker description
75
+
76
+ ### Plan Approval (architect, builder only)
77
+ - **Architect**: Present spec drafts as a plan for lead review before finalizing. Wait for lead approval before writing final specs
78
+ - **Builder**: Present implementation plan (approach, file changes, test strategy) for lead review before coding. Wait for lead approval before writing code
79
+
80
+ ### Inter-Agent Communication
81
+
82
+ > **Note:** In the default sequential workflow (`/kc:work`), teammates are spawned one at a time and shut down between phases. The messaging patterns below apply when teammates coexist — for example, during `/kc:plan` (3 parallel researchers) or if you keep the builder alive during Phase 2B review for direct gap communication. In sequential mode, inter-phase communication goes through the lead.
83
+
84
+ Use mailbox messaging for coordination between teammates:
85
+
86
+ | From | To | When |
87
+ |------|-----|------|
88
+ | analyst | architect | Scope clarifications, NodeID overlap with existing specs |
89
+ | architect | analyst | Scope adjustments needed |
90
+ | architect | builder | Spec intent and design decisions |
91
+ | builder | analyst | Affected files and dependency questions |
92
+ | builder | architect | Spec intent and design decisions |
93
+ | reviewer | builder | Gap details (file, line, criterion, expected vs actual) |
94
+ | closer | analyst | Change scope for log entry accuracy |
95
+ | closer | architect | Spec format and legacy migration |
96
+
97
+ ### Gap Communication (reviewer -> builder)
98
+ When the reviewer finds gaps during Phase 2B audit, message the builder with specific details:
99
+ - File path and line number
100
+ - Criterion not met (the VERIFY: statement)
101
+ - Expected behavior vs actual behavior
102
+
103
+ The builder addresses these gaps and re-verifies before reporting completion.
104
+
105
+ ---
106
+
107
+ ## Teammate Initialization Protocol
108
+
109
+ When spawned as a teammate in an Agent Teams workflow, follow this sequence:
110
+
111
+ 1. Read your agent definition file (referenced in your spawn prompt, e.g. `agents/analyst.md`)
112
+ 2. Read this file (`knowzcode/claude_code_execution.md`) for team conventions
113
+ 3. Read the WorkGroup file for current state, Change Set, and context
114
+ 4. Read context files listed in your task description
115
+ 5. Begin your phase work as defined by your role
116
+ 6. Update the WorkGroup file with results — prefix all todo entries with `KnowzCode:`
117
+ 7. Mark your task as complete with a summary of what was delivered
118
+
119
+ If you encounter a blocker, keep the task in `in_progress` status with a description of what is blocking you. Do not mark the task as complete until the work is done.
120
+
121
+ ---
122
+
123
+ ## Command References
124
+
125
+ Agents may reference these Claude Code commands as escalation paths:
126
+
127
+ | Command | Used By | Context |
128
+ |---------|---------|---------|
129
+ | `/kc:work` | microfix-specialist | Redirect when fix exceeds scope gate |
130
+ | `/kc:audit security` | reviewer | Full security audit mode |
131
+ | `/kc:audit spec` | knowledge-migrator | Post-migration validation |
132
+
133
+ On other platforms, these commands translate to running the corresponding phase prompts manually.
@@ -0,0 +1,132 @@
1
+ # Enterprise Compliance Manifest
2
+
3
+ **Purpose:** Defines which enterprise guidelines are active and their enforcement level.
4
+
5
+ ---
6
+
7
+ ## Active Guidelines
8
+
9
+ | Guideline File | Enforcement | Applies To | Active |
10
+ |:---------------|:------------|:-----------|:-------|
11
+ | security.md | blocking | both | false |
12
+ | code-quality.md | advisory | implementation | false |
13
+
14
+ > **Note:** Set `Active` to `true` to enable a guideline. Guidelines with empty content are skipped.
15
+
16
+ ---
17
+
18
+ ## Enforcement Levels
19
+
20
+ | Level | Behavior |
21
+ |:------|:---------|
22
+ | **blocking** | Violations STOP workflow progression. Must be resolved before proceeding. |
23
+ | **advisory** | Violations are REPORTED but workflow can continue with documented acceptance. |
24
+
25
+ ---
26
+
27
+ ## Applies-To Scope
28
+
29
+ | Scope | When Checked | What Is Validated |
30
+ |:------|:-------------|:------------------|
31
+ | **spec** | Phase 1B (Specification) | Specs address required concerns, ARC criteria included |
32
+ | **implementation** | Phase 2B (Verification) | Code meets requirements, patterns compliant |
33
+ | **both** | Phase 1B AND Phase 2B | Full coverage at both stages |
34
+
35
+ ---
36
+
37
+ ## Custom Guidelines
38
+
39
+ Add custom guidelines to `knowzcode/enterprise/guidelines/custom/` following the template in `templates/guideline-template.md`.
40
+
41
+ To activate a custom guideline, add it to the Active Guidelines table above.
42
+
43
+ ---
44
+
45
+ ## Configuration
46
+
47
+ ```yaml
48
+ # Enable/disable compliance checking globally (default: false)
49
+ compliance_enabled: false
50
+
51
+ # Auto-run compliance during /kc:audit when enabled
52
+ include_in_audit: true
53
+
54
+ # Require compliance sign-off before Phase 3 finalization
55
+ require_signoff_for_finalization: false
56
+
57
+ # Show advisory issues in workflow output
58
+ show_advisory_issues: true
59
+
60
+ # Skip guidelines with empty content (default: true)
61
+ skip_empty_guidelines: true
62
+ ```
63
+
64
+ ---
65
+
66
+ ## MCP-Based Compliance (Optional)
67
+
68
+ When MCP is configured with an enterprise vault, compliance can be enhanced with vault-based standards and audit trails.
69
+
70
+ ```yaml
71
+ # Enable MCP-based compliance features (default: false)
72
+ mcp_compliance_enabled: false
73
+
74
+ # Enterprise vault ID for standards and audit trails
75
+ compliance_vault_id: ""
76
+
77
+ # Audit trail vault ID (can be same as compliance vault)
78
+ audit_trail_vault_id: ""
79
+
80
+ # Pull team-wide standards from enterprise vault at workflow start
81
+ pull_standards_at_start: true
82
+
83
+ # Push audit results to enterprise vault after Phase 2B
84
+ push_audit_results: true
85
+
86
+ # Push WorkGroup completion records to enterprise vault after Phase 3
87
+ push_completion_records: true
88
+ ```
89
+
90
+ ### How It Works
91
+
92
+ When `mcp_compliance_enabled: true`:
93
+
94
+ **At workflow start (before Phase 1A):**
95
+ - Query enterprise vault for team-wide standards: `ask_question(compliance_vault, "team standards for {project_type}")`
96
+ - Merge returned standards into quality gate criteria for the WorkGroup
97
+
98
+ **After Phase 2B audit:**
99
+ - Push audit results to enterprise vault: `create_knowledge(audit_trail_vault, "Audit: {wgid} - {score}%")`
100
+ - Include security findings, compliance status, and gap summary
101
+
102
+ **After Phase 3 finalization:**
103
+ - Push completion record: `create_knowledge(audit_trail_vault, "Completion: {wgid}")`
104
+ - Include goal, NodeIDs, audit score, key decisions, and architecture changes
105
+
106
+ ### Agent-to-Enterprise-Vault Operations
107
+
108
+ | Agent | Operation | When | Content |
109
+ |-------|-----------|------|---------|
110
+ | analyst | create_knowledge | After 1A approval | Scope decisions, risk assessment |
111
+ | reviewer | create_knowledge | After 2B audit | Audit findings, security posture |
112
+ | closer | create_knowledge | After Phase 3 | Completion record, architecture changes |
113
+
114
+ ---
115
+
116
+ ## Usage
117
+
118
+ ### Check Compliance Status
119
+ ```bash
120
+ /kc:audit compliance # Full review (spec + implementation)
121
+ /kc:audit compliance spec # Review specs only
122
+ /kc:audit compliance impl # Review implementation only
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Adding New Guidelines
128
+
129
+ 1. Create guideline file in `guidelines/` or `guidelines/custom/`
130
+ 2. Use `templates/guideline-template.md` as starting point
131
+ 3. Add entry to Active Guidelines table above
132
+ 4. Run `/kc:audit compliance` to verify guideline loads correctly
@@ -0,0 +1,30 @@
1
+ # Enterprise Compliance Status
2
+
3
+ **Purpose:** Track compliance review status per WorkGroup.
4
+
5
+ ---
6
+
7
+ ## Current WorkGroup
8
+
9
+ **WorkGroupID:** (none active)
10
+ **Last Review:** N/A
11
+ **Status:** N/A
12
+
13
+ ---
14
+
15
+ ## Review History
16
+
17
+ | Timestamp | WorkGroupID | Scope | Guidelines | Blocking | Advisory | Result |
18
+ |:----------|:------------|:------|:-----------|:---------|:---------|:-------|
19
+ | | | | | | | |
20
+
21
+ ---
22
+
23
+ ## Notes
24
+
25
+ This file is automatically updated by the reviewer agent during:
26
+ - Phase 1B spec compliance checks
27
+ - Phase 2B implementation compliance audits
28
+ - Standalone `/kc:audit compliance` reviews
29
+
30
+ Review history entries are appended chronologically with most recent at top.
@@ -0,0 +1,67 @@
1
+ ---
2
+ guideline_id: CQ-001
3
+ name: Code Quality Guidelines
4
+ enforcement: advisory
5
+ applies_to: implementation
6
+ priority: high
7
+ ---
8
+
9
+ # Code Quality Guidelines
10
+
11
+ **Purpose:** Ensure code meets enterprise quality standards and design patterns.
12
+
13
+ > **Note:** This is a template. Add your organization's code quality requirements below.
14
+ > Empty sections are skipped during compliance review.
15
+
16
+ ---
17
+
18
+ ## 1. Design Patterns
19
+
20
+ <!-- Add required design patterns here -->
21
+ <!-- Example:
22
+ ### CQ-PATTERN-01: Repository Pattern for Data Access
23
+
24
+ **Requirement:** All database access SHOULD use the Repository pattern.
25
+
26
+ **Applies To:** implementation
27
+
28
+ **Severity:** medium
29
+
30
+ **ARC Verification:**
31
+ - ARC_CQ_PATTERN_01a: Verify data access is encapsulated in repository classes
32
+ - ARC_CQ_PATTERN_01b: Verify controllers do not directly access database
33
+ -->
34
+
35
+ ---
36
+
37
+ ## 2. Error Handling
38
+
39
+ <!-- Add error handling standards here -->
40
+
41
+ ---
42
+
43
+ ## 3. Naming Conventions
44
+
45
+ <!-- Add naming convention requirements here -->
46
+
47
+ ---
48
+
49
+ ## 4. Code Structure
50
+
51
+ <!-- Add code structure requirements here -->
52
+
53
+ ---
54
+
55
+ ## 5. Testing Standards
56
+
57
+ <!-- Add testing requirements here -->
58
+
59
+ ---
60
+
61
+ ## Compliance Summary
62
+
63
+ | ID | Requirement | Severity | Scope |
64
+ |:---|:------------|:---------|:------|
65
+ <!-- Add your requirements summary here -->
66
+
67
+ ---