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,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
+ ---
@@ -0,0 +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
+ ---
@@ -0,0 +1,10 @@
1
+ \# Component Specifications
2
+
3
+
4
+
5
+ This directory will contain specification files for each component (NodeID) in your project.
6
+
7
+
8
+
9
+ Files will be named like: `API\_UserAuth.md`, `UI\_Dashboard.md`, etc.
10
+
@@ -0,0 +1,89 @@
1
+ # Telemetry Configuration
2
+
3
+ > **This file configures telemetry sources for `/kc:telemetry` investigations.**
4
+ >
5
+ > Run `/kc:telemetry-setup` to auto-discover and configure sources.
6
+
7
+ ---
8
+
9
+ ## Sentry
10
+
11
+ | Field | Value |
12
+ |-------|-------|
13
+ | Enabled | false |
14
+ | Method | |
15
+ | Organization | |
16
+
17
+ ### Environment Mapping
18
+
19
+ | Environment | Project |
20
+ |-------------|---------|
21
+ | production | |
22
+ | staging | |
23
+ | dev | |
24
+
25
+ ---
26
+
27
+ ## Azure Application Insights
28
+
29
+ | Field | Value |
30
+ |-------|-------|
31
+ | Enabled | false |
32
+ | Subscription | |
33
+ | Resource Group | |
34
+
35
+ ### Environment Mapping
36
+
37
+ | Environment | App Name | App ID |
38
+ |-------------|----------|--------|
39
+ | production | | |
40
+ | staging | | |
41
+ | dev | | |
42
+
43
+ ---
44
+
45
+ ## Configuration Notes
46
+
47
+ - **Sentry Method**: How to connect to Sentry (`cli` for Sentry CLI, `mcp` for MCP tools)
48
+ - **Sentry Organization**: Your Sentry organization slug (e.g., `my-company`)
49
+ - **Sentry Project**: Format is `org-slug/project-slug` (e.g., `my-company/backend-api`)
50
+ - **App Insights App ID**: The Application ID from Azure portal (GUID format)
51
+ - **Subscription**: Your Azure subscription ID (optional, uses default if not set)
52
+
53
+ ### Auto-Discovery
54
+
55
+ Run `/kc:telemetry-setup` to:
56
+ 1. Detect installed telemetry tools (sentry-cli, az CLI)
57
+ 2. Verify authentication status
58
+ 3. Auto-discover available resources
59
+ 4. Interactively configure environment mappings
60
+ 5. Update this file with discovered values
61
+
62
+ ### Manual Configuration
63
+
64
+ Edit the tables above directly to configure telemetry sources:
65
+
66
+ ```markdown
67
+ ## Sentry
68
+
69
+ | Field | Value |
70
+ |-------|-------|
71
+ | Enabled | true |
72
+ | Method | cli |
73
+ | Organization | my-company |
74
+
75
+ ### Environment Mapping
76
+
77
+ | Environment | Project |
78
+ |-------------|---------|
79
+ | production | my-company/backend-prod |
80
+ | staging | my-company/backend-staging |
81
+ | dev | my-company/backend-dev |
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Last Updated
87
+
88
+ - **Date**: (not configured)
89
+ - **By**: (not configured)
@@ -0,0 +1,120 @@
1
+ # User Development Preferences
2
+
3
+ ---
4
+
5
+ **Purpose:** This document captures your personal development preferences and coding standards. These preferences integrate with KnowzCode's workflow while respecting your style and approach.
6
+
7
+ **Last Updated:** [ISO timestamp - to be filled during init]
8
+ **Source:** User-provided during initialization
9
+
10
+ ---
11
+
12
+ ## Core Principles
13
+
14
+ [User-provided principles, or "Not configured"]
15
+
16
+ *Examples:*
17
+ - Test-Driven Development (TDD mandatory)
18
+ - Immutable data structures preferred
19
+ - Functional programming patterns
20
+ - Domain-Driven Design (DDD)
21
+ - SOLID principles
22
+
23
+ ---
24
+
25
+ ## Testing Approach
26
+
27
+ [User-provided testing preferences, or "Follows KnowzCode TDD requirements"]
28
+
29
+ *Examples:*
30
+ - **Framework:** XUnit / Jest / PyTest / Playwright
31
+ - **Style:** Behavior-driven / Unit-first / Integration-focused
32
+ - **Coverage:** Minimum 80% / All public APIs / Critical paths only
33
+ - **Patterns:** AAA (Arrange-Act-Assert) / Given-When-Then
34
+ - **Mocking:** Moq / Jest mocks / unittest.mock
35
+
36
+ ---
37
+
38
+ ## Code Style
39
+
40
+ [User-provided style preferences, or "Standard for language/framework"]
41
+
42
+ *Examples:*
43
+ - **Naming:** PascalCase for methods, camelCase for variables
44
+ - **Structure:** Small functions (max 20 lines), single responsibility
45
+ - **Comments:** Self-documenting code, minimal comments
46
+ - **Formatting:** Prettier / Black / Standard formatter
47
+ - **Linting:** ESLint / Flake8 / Custom rules
48
+
49
+ ---
50
+
51
+ ## Language-Specific Patterns
52
+
53
+ [User-provided language-specific preferences, or "N/A"]
54
+
55
+ *Examples (C#):*
56
+ - Nullable reference types always enabled
57
+ - Records for immutable DTOs
58
+ - No null-suppression operators
59
+ - FluentValidation for schema validation
60
+
61
+ *Examples (JavaScript/TypeScript):*
62
+ - Strict TypeScript mode
63
+ - Functional components with hooks (React)
64
+ - Async/await over promises
65
+ - ESM imports
66
+
67
+ *Examples (Python):*
68
+ - Type hints for all public functions
69
+ - Dataclasses for structured data
70
+ - f-strings for formatting
71
+ - PEP 8 compliance
72
+
73
+ ---
74
+
75
+ ## Quality Priorities
76
+
77
+ [User-provided quality focus areas, or "Standard KnowzCode priorities"]
78
+
79
+ *Rank your top priorities (1-5):*
80
+ 1. [e.g., Reliability / Security / Performance / Maintainability / Testability]
81
+ 2. [...]
82
+ 3. [...]
83
+ 4. [...]
84
+ 5. [...]
85
+
86
+ ---
87
+
88
+ ## Project-Specific Conventions
89
+
90
+ [Any project-specific rules or patterns, or "See project CLAUDE.md"]
91
+
92
+ *Examples:*
93
+ - Database migrations must be reviewed before merge
94
+ - All API endpoints require OpenAPI documentation
95
+ - Error handling uses Result types (no exceptions)
96
+ - Logging format: structured JSON with correlation IDs
97
+
98
+ ---
99
+
100
+ ## Integration with KnowzCode
101
+
102
+ **Non-Negotiable (KnowzCode Framework):**
103
+ - Test-Driven Development (TDD) is mandatory
104
+ - Quality gates must pass at each phase
105
+ - Living documentation must be maintained
106
+ - Incremental verified progress required
107
+
108
+ **Flexible (Your Preferences):**
109
+ - Testing framework choice (as long as TDD followed)
110
+ - Code style and naming conventions
111
+ - Language-specific patterns
112
+ - Quality priority ranking
113
+ - Project-specific conventions
114
+
115
+ **Conflict Resolution:**
116
+ When your preferences conflict with KnowzCode requirements, the framework takes precedence for workflow aspects (TDD, quality gates), but your preferences apply for implementation style (naming, patterns, tools).
117
+
118
+ ---
119
+
120
+ *This document should be reviewed and updated as project conventions evolve.*
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "knowzcode",
3
+ "version": "0.1.0",
4
+ "description": "Platform-agnostic AI development methodology with TDD, quality gates, and structured workflows",
5
+ "type": "module",
6
+ "bin": {
7
+ "knowzcode": "./bin/knowzcode.mjs"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "knowzcode/",
12
+ "agents/",
13
+ "commands/",
14
+ "skills/",
15
+ ".claude-plugin/"
16
+ ],
17
+ "scripts": {
18
+ "prepublishOnly": "node bin/knowzcode.mjs --version"
19
+ },
20
+ "keywords": [
21
+ "ai",
22
+ "tdd",
23
+ "workflow",
24
+ "methodology",
25
+ "quality-gates",
26
+ "platform-agnostic",
27
+ "claude",
28
+ "codex",
29
+ "gemini",
30
+ "cursor",
31
+ "copilot",
32
+ "windsurf",
33
+ "development"
34
+ ],
35
+ "author": {
36
+ "name": "Alex Headscarf"
37
+ },
38
+ "homepage": "https://github.com/knowz-io/knowzcode",
39
+ "bugs": {
40
+ "url": "https://github.com/knowz-io/knowzcode/issues"
41
+ },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/knowz-io/knowzcode.git"
45
+ },
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "license": "MIT",
50
+ "engines": {
51
+ "node": ">=18"
52
+ }
53
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "name": "alias-resolver",
3
+ "version": "1.0.0",
4
+ "description": "Resolves friendly natural-language aliases to KnowzCode canonical values (phase, audit, plan, workgroup_type).",
5
+ "parameters": [
6
+ {"name": "domain", "type": "string", "required": true},
7
+ {"name": "text", "type": "string", "required": false}
8
+ ],
9
+ "actions": [
10
+ {
11
+ "type": "python",
12
+ "code": "domain = (inputs.get('domain') or '').strip().lower()\ntext = (inputs.get('text') or '').strip().lower()\nresult = {'value': None}\nphase_map = {\n '1a': {'agent': 'analyst', 'prompt': 'knowzcode/prompts/[LOOP_1A]__Propose_Change_Set.md'},\n '1b': {'agent': 'architect', 'prompt': 'knowzcode/prompts/[LOOP_1B]__Draft_Specs.md'},\n '2a': {'agent': 'builder', 'prompt': 'knowzcode/prompts/[LOOP_2A]__Implement_Change_Set.md'},\n '2b': {'agent': 'reviewer', 'prompt': 'knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md'},\n '3': {'agent': 'closer', 'prompt': 'knowzcode/prompts/[LOOP_3]__Finalize_And_Commit.md'}\n}\nphase_synonyms = {\n '1a': ['1a','loop 1a','analyze','analysis','impact','scope','change set','proposal'],\n '1b': ['1b','loop 1b','spec','specs','draft','design','blueprint'],\n '2a': ['2a','loop 2a','implement','implementation','build','code','develop'],\n '2b': ['2b','loop 2b','verify','verification','audit','test','qa','review'],\n '3': ['3','loop 3','final','finalize','finalization','commit','wrap up','close']\n}\naudit_map = {\n 'spec': 'knowzcode/prompts/Spec_Verification_Checkpoint.md',\n 'implementation': 'knowzcode/prompts/[LOOP_2B]__Verify_Implementation.md',\n 'architecture': None,\n 'security': None,\n 'integration': None\n}\naudit_synonyms = {\n 'spec': ['spec','specs','specification','checkpoint'],\n 'implementation': ['implementation','code','verify implementation','loop 2b'],\n 'architecture': ['architecture','arch','diagram','flowchart','structure'],\n 'security': ['security','sec','owasp','vulnerability'],\n 'integration': ['integration','holistic','system','end to end','e2e']\n}\nworkgroup_map = {'feat': 'feat','feature': 'feat','fix': 'fix','bug': 'fix','bugfix': 'fix','refactor': 'refactor','cleanup': 'refactor','issue': 'issue','incident': 'issue'}\nif domain == 'phase':\n if not text:\n key = '1a'\n else:\n key = None\n for canonical, synonyms in phase_synonyms.items():\n if text == canonical or text in synonyms or any(s in text for s in synonyms):\n key = canonical\n break\n if key is None:\n for canonical in phase_map.keys():\n if text.replace(' ','') == canonical:\n key = canonical\n break\n if key is None:\n key = '1a'\n data = phase_map[key]\n result['value'] = key.upper()\n result['prompt'] = data['prompt']\n result['agent'] = data['agent']\n result['requires_workgroup'] = data['agent'] != 'analyst'\nelif domain == 'audit':\n if not text:\n key = 'spec'\n else:\n key = None\n for canonical, synonyms in audit_synonyms.items():\n if text == canonical or text in synonyms or any(s in text for s in synonyms):\n key = canonical\n break\n if key is None:\n key = 'spec'\n result['value'] = key\n result['prompt'] = audit_map.get(key)\n result['agent'] = 'reviewer'\nelif domain == 'plan':\n result['value'] = text or ''\n result['prompt'] = None\nelif domain == 'workgroup_type':\n if not text:\n value = 'feat'\n else:\n value = None\n for key, mapped in workgroup_map.items():\n if text == key or key in text:\n value = mapped\n break\n if value is None:\n value = workgroup_map.get(text, 'feat')\n result['value'] = value\nelse:\n result['value'] = text or ''\noutputs.update(result)\n"
13
+ }
14
+ ]
15
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "architecture-diff",
3
+ "version": "0.1.0",
4
+ "description": "Highlights differences between specs and the Mermaid flowchart in knowzcode_architecture.md.",
5
+ "parameters": [],
6
+ "actions": [
7
+ {
8
+ "type": "python",
9
+ "code": "from pathlib import Path\nimport re\narch = Path('knowzcode/knowzcode_architecture.md').read_text()\nspec_paths = list(Path('knowzcode/specs').glob('*.md'))\nnode_ids = {p.stem for p in spec_paths}\nmermaid_nodes = set(re.findall(r'([A-Z]{2,}_[A-Za-z0-9]+)', arch))\nmissing_in_arch = sorted(node_ids - mermaid_nodes)\nmissing_in_specs = sorted(mermaid_nodes - node_ids)\noutputs['missing_in_architecture'] = missing_in_arch\noutputs['missing_specs'] = missing_in_specs\n"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "name": "check-installation-status",
3
+ "version": "2.0.0",
4
+ "description": "Checks if KnowzCode is initialized in the current project and reports current status",
5
+
6
+ "parameters": [],
7
+
8
+ "actions": [
9
+ {
10
+ "type": "python",
11
+ "code": "from pathlib import Path\n\nknowzcode_dir = Path('knowzcode')\n\nif not knowzcode_dir.exists():\n outputs['initialized'] = False\n outputs['commands_count'] = 0\n outputs['skills_count'] = 0\n outputs['agents_count'] = 0\n outputs['has_required_files'] = False\n exit()\n\n# Check required files exist\nrequired_files = [\n 'knowzcode_loop.md',\n 'knowzcode_tracker.md',\n 'knowzcode_project.md',\n 'knowzcode_architecture.md'\n]\n\nmissing_files = [f for f in required_files if not (knowzcode_dir / f).exists()]\nhas_required_files = len(missing_files) == 0\n\n# Count components from various possible locations\n\n# Check .claude directory\nclaude_dir = Path('.claude')\ncommands_count = 0\nskills_count = 0\nagents_count = 0\n\nif claude_dir.exists():\n if (claude_dir / 'commands').exists():\n commands_count = len(list((claude_dir / 'commands').glob('*.md')))\n if (claude_dir / 'skills').exists():\n skills_count = len(list((claude_dir / 'skills').glob('*.json')))\n if (claude_dir / 'agents').exists():\n agents_count = len(list((claude_dir / 'agents').glob('*.md')))\n if (claude_dir / 'subagents').exists():\n agents_count += len(list((claude_dir / 'subagents').glob('*.yaml')))\n\n# Also check top-level directories (plugin installation)\nif Path('commands').exists():\n commands_count = max(commands_count, len(list(Path('commands').glob('*.md'))))\nif Path('skills').exists():\n skills_count = max(skills_count, len(list(Path('skills').glob('*.json'))))\nif Path('agents').exists():\n agents_count = max(agents_count, len(list(Path('agents').glob('*.md'))))\n\noutputs['initialized'] = has_required_files\noutputs['commands_count'] = commands_count\noutputs['skills_count'] = skills_count\noutputs['agents_count'] = agents_count\noutputs['has_required_files'] = has_required_files\noutputs['missing_files'] = missing_files if missing_files else None"
12
+ }
13
+ ]
14
+ }
@@ -0,0 +1,105 @@
1
+ ---
2
+ name: continue
3
+ description: Detect continuation intent and resume active WorkGroup workflow
4
+ trigger: User says "continue", "keep going", "resume", or similar continuation intent
5
+ ---
6
+
7
+ # Continue Skill
8
+
9
+ **Purpose**: Detect when user wants to continue work and resume the active WorkGroup with proper context restoration.
10
+
11
+ ## Trigger Patterns
12
+
13
+ Activate when user message matches ANY of these patterns:
14
+ - "continue"
15
+ - "keep going"
16
+ - "resume"
17
+ - "carry on"
18
+ - "next"
19
+ - "continue with this"
20
+ - "let's continue"
21
+ - "keep working"
22
+
23
+ **Context Requirements**:
24
+ - Must be in a KnowzCode-initialized project (knowzcode/ directory exists)
25
+ - Should NOT trigger if user is clearly giving new instructions
26
+ - Should NOT trigger during explicit command execution
27
+
28
+ ## When NOT to Trigger
29
+
30
+ - User is giving specific new instructions
31
+ - User is asking a question
32
+ - Already executing a /kc:* command
33
+ - knowzcode/ directory doesn't exist
34
+
35
+ ## Skill Behavior
36
+
37
+ When triggered:
38
+
39
+ ### Step 1: Find Active WorkGroup
40
+
41
+ Search `knowzcode/knowzcode_tracker.md` for `[WIP]` entries.
42
+
43
+ - **One active WorkGroup**: Use it automatically
44
+ - **Multiple active**: Present options to user
45
+ - **None active**: Inform user and suggest `/kc:work`
46
+
47
+ ### Step 2: Load WorkGroup Context
48
+
49
+ Read `knowzcode/workgroups/{WorkGroupID}.md` to determine:
50
+ - Current phase
51
+ - Primary goal
52
+ - Change Set
53
+ - Outstanding todos
54
+
55
+ ### Step 3: Resume at Current Phase
56
+
57
+ Read `knowzcode/knowzcode_loop.md` and resume the workflow at the detected phase.
58
+
59
+ Create tasks only for the **remaining** phases (not completed ones):
60
+
61
+ | Detected Phase | Remaining Work |
62
+ |----------------|----------------|
63
+ | 1A | All phases (1A → 1B → 2A → 2B → 3) |
64
+ | 1B | Specs + implementation + audit + finalization |
65
+ | 2A | Implementation + audit + finalization |
66
+ | 2B | Audit + finalization |
67
+ | 3 | Finalization only |
68
+
69
+ **Detect execution mode** — check if you have Agent Teams capabilities (spawn/create teammate tools, requires `CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1`):
70
+
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).
73
+
74
+ Follow the same phase delegation patterns (spawn prompts, quality gates, gap loop) as `/kc:work`.
75
+
76
+ ### Step 4: Present Status
77
+
78
+ ```markdown
79
+ ## Resuming WorkGroup: {wgid}
80
+
81
+ **Goal**: {primary goal}
82
+ **Phase**: {current phase}
83
+ **NodeIDs**: {list}
84
+
85
+ **Outstanding Todos**:
86
+ {list from WorkGroup file}
87
+
88
+ Continuing from where we left off...
89
+ ```
90
+
91
+ Then proceed with the appropriate phase using the same agents as `/kc:work`.
92
+
93
+ ## Logging
94
+
95
+ ```markdown
96
+ ---
97
+ **Type:** SkillActivation
98
+ **Timestamp:** [timestamp]
99
+ **Skill:** continue
100
+ **Trigger:** User said "{user_message}"
101
+ **WorkGroup:** {wgid}
102
+ **Phase:** {current phase}
103
+ **Logged By:** AI-Agent
104
+ ---
105
+ ```
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "environment-guard",
3
+ "version": "0.1.0",
4
+ "description": "Verifies that knowzcode/environment_context.md no longer contains placeholder brackets.",
5
+ "parameters": [],
6
+ "actions": [
7
+ {
8
+ "type": "python",
9
+ "code": "from pathlib import Path\ntext = Path('knowzcode/environment_context.md').read_text()\nplaceholders = [line.strip() for line in text.splitlines() if '[' in line and ']' in line]\nif placeholders:\n raise ValueError('environment_context.md still contains placeholders: ' + ', '.join(placeholders[:5]))\n"
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "generate-workgroup-id",
3
+ "version": "0.2.0",
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
+ "parameters": [
6
+ {
7
+ "name": "type",
8
+ "type": "string",
9
+ "required": true,
10
+ "description": "One of feat, fix, refactor, issue"
11
+ },
12
+ {
13
+ "name": "slug",
14
+ "type": "string",
15
+ "required": false,
16
+ "description": "A 2-4 word kebab-case descriptor (e.g., 'auth-jwt', 'dark-mode'). If not provided, generates ID without slug."
17
+ }
18
+ ],
19
+ "actions": [
20
+ {
21
+ "type": "python",
22
+ "code": "import datetime\nimport re\nallowed = {'feat', 'fix', 'refactor', 'issue'}\nwg_type = inputs['type']\nif wg_type not in allowed:\n raise ValueError(f'Invalid type {wg_type!r}, expected one of {sorted(allowed)}')\ntimestamp = datetime.datetime.utcnow().strftime('%Y%m%d-%H%M%S')\nslug = inputs.get('slug', '')\nif slug:\n # Sanitize slug: lowercase, replace spaces with hyphens, remove non-alphanumeric\n slug = re.sub(r'[^a-z0-9-]', '', slug.lower().replace(' ', '-'))\n slug = re.sub(r'-+', '-', slug).strip('-')[:25] # Max 25 chars\n outputs['workgroup_id'] = f'{wg_type}-{slug}-{timestamp}'\nelse:\n outputs['workgroup_id'] = f'{wg_type}-{timestamp}'"
23
+ }
24
+ ]
25
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "name": "install-knowzcode",
3
+ "version": "2.0.0",
4
+ "description": "Initializes KnowzCode directory structure and required files in the current project",
5
+
6
+ "parameters": [
7
+ {
8
+ "name": "force",
9
+ "type": "boolean",
10
+ "required": false,
11
+ "description": "Force reinstall even if knowzcode/ exists"
12
+ }
13
+ ],
14
+
15
+ "actions": [
16
+ {
17
+ "type": "python",
18
+ "code": "import os\nimport json\nfrom pathlib import Path\nfrom datetime import datetime\n\n# Configuration\ntarget_dir = Path('knowzcode')\nforce = inputs.get('force', False)\n\n# Check if target exists\nif target_dir.exists() and not force:\n outputs['success'] = False\n outputs['error'] = 'knowzcode/ already exists. Use force=true to reinitialize'\n outputs['already_installed'] = True\n exit()\n\n# Create directory structure\ntarget_dir.mkdir(exist_ok=True)\n(target_dir / 'specs').mkdir(exist_ok=True)\n(target_dir / 'workgroups').mkdir(exist_ok=True)\n(target_dir / 'prompts').mkdir(exist_ok=True)\n(target_dir / 'planning').mkdir(exist_ok=True)\n\n# Create .gitignore if it doesn't exist\ngitignore_path = target_dir / '.gitignore'\nif not gitignore_path.exists():\n gitignore_content = '''# KnowzCode gitignore - protects environment-specific files\n\n# Environment-specific (contains local paths, commands)\nenvironment_context.md\n\n# Session-specific work (can be regenerated)\nworkgroups/\n\n# Personal notes and scratch files\n*.local.md\n.scratch/\n'''\n with open(gitignore_path, 'w') as f:\n f.write(gitignore_content)\n\n# Note: The actual template files (knowzcode_loop.md, etc.) should be copied\n# from the plugin template directory or created by the /kc:init command.\n# This skill creates the structure; the command copies the content.\n\noutputs['success'] = True\noutputs['target_dir'] = str(target_dir)\noutputs['directories_created'] = ['specs', 'workgroups', 'prompts', 'planning']\noutputs['gitignore_created'] = not gitignore_path.exists()\noutputs['message'] = f'KnowzCode directory structure created at {target_dir}/'"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "name": "load-core-context",
3
+ "version": "0.1.0",
4
+ "description": "Loads the KnowzCode project overview, architecture, tracker, log header, and automation manifest for downstream steps.",
5
+ "parameters": [],
6
+ "actions": [
7
+ {
8
+ "type": "read_file",
9
+ "paths": [
10
+ "knowzcode/knowzcode_project.md",
11
+ "knowzcode/knowzcode_architecture.md",
12
+ "knowzcode/knowzcode_tracker.md",
13
+ "knowzcode/knowzcode_log.md",
14
+ "knowzcode/automation_manifest.md"
15
+ ]
16
+ }
17
+ ]
18
+ }