knowzcode 0.3.3 → 0.3.7
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +1 -1
- package/agents/closer.md +102 -15
- package/agents/knowz-scribe.md +60 -35
- package/agents/project-advisor.md +4 -3
- package/commands/connect-mcp.md +5 -5
- package/commands/learn.md +6 -1
- package/commands/register.md +5 -5
- package/commands/status.md +1 -1
- package/commands/work.md +58 -14
- package/knowzcode/knowzcode_loop.md +16 -3
- package/knowzcode/knowzcode_vaults.md +37 -13
- package/knowzcode/platform_adapters.md +55 -29
- package/package.json +1 -1
- package/skills/alias-resolver.json +15 -15
- package/skills/architecture-diff.json +12 -12
- package/skills/check-installation-status.json +14 -14
- package/skills/environment-guard.json +12 -12
- package/skills/generate-workgroup-id.json +25 -25
- package/skills/install-knowzcode.json +21 -21
- package/skills/load-core-context.json +18 -18
- package/skills/log-entry-builder.json +15 -15
- package/skills/spec-quality-check.json +14 -14
- package/skills/spec-template.json +15 -15
- package/skills/spec-validator.json +25 -25
- package/skills/tracker-scan.json +12 -12
- package/skills/tracker-update.json +28 -28
- package/skills/validate-installation.json +14 -14
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "spec-quality-check",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Validates KnowzCode spec files for mandatory sections. Supports new 4-section format and legacy numbered format.",
|
|
5
|
-
"parameters": [
|
|
6
|
-
{"name": "node_id", "type": "string", "required": true}
|
|
7
|
-
],
|
|
8
|
-
"actions": [
|
|
9
|
-
{
|
|
10
|
-
"type": "python",
|
|
11
|
-
"code": "from pathlib import Path\nimport re\nnode_id = inputs['node_id']\npath = Path('knowzcode/specs') / f'{node_id}.md'\nif not path.exists():\n raise FileNotFoundError(f'Spec for {node_id} not found')\ntext = path.read_text()\n\n# Check new format first\nnew_sections = ['## Rules & Decisions', '## Interfaces', '## Verification Criteria', '## Debt & Gaps']\nlegacy_sections = ['## 1. Purpose', '## 2. Dependencies & Triggers', '## 3. Interfaces', '## 4. Core Logic & Processing Steps', '## 5. Data Structures', '## 6. ARC Verification Criteria', '## 7. Technical Debt']\n\nnew_missing = [s for s in new_sections if s not in text]\nlegacy_missing = [s for s in legacy_sections if s not in text]\n\n# Use whichever format has fewer missing sections\nif len(new_missing) <= len(legacy_missing):\n outputs['format'] = 'v2'\n outputs['missing_sections'] = new_missing\nelse:\n outputs['format'] = 'legacy'\n outputs['missing_sections'] = legacy_missing\n outputs['deprecation_warning'] = 'Spec uses old numbered format. New specs should use: Rules & Decisions, Interfaces, Verification Criteria, Debt & Gaps'\n"
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "spec-quality-check",
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Validates KnowzCode spec files for mandatory sections. Supports new 4-section format and legacy numbered format.",
|
|
5
|
+
"parameters": [
|
|
6
|
+
{"name": "node_id", "type": "string", "required": true}
|
|
7
|
+
],
|
|
8
|
+
"actions": [
|
|
9
|
+
{
|
|
10
|
+
"type": "python",
|
|
11
|
+
"code": "from pathlib import Path\nimport re\nnode_id = inputs['node_id']\npath = Path('knowzcode/specs') / f'{node_id}.md'\nif not path.exists():\n raise FileNotFoundError(f'Spec for {node_id} not found')\ntext = path.read_text()\n\n# Check new format first\nnew_sections = ['## Rules & Decisions', '## Interfaces', '## Verification Criteria', '## Debt & Gaps']\nlegacy_sections = ['## 1. Purpose', '## 2. Dependencies & Triggers', '## 3. Interfaces', '## 4. Core Logic & Processing Steps', '## 5. Data Structures', '## 6. ARC Verification Criteria', '## 7. Technical Debt']\n\nnew_missing = [s for s in new_sections if s not in text]\nlegacy_missing = [s for s in legacy_sections if s not in text]\n\n# Use whichever format has fewer missing sections\nif len(new_missing) <= len(legacy_missing):\n outputs['format'] = 'v2'\n outputs['missing_sections'] = new_missing\nelse:\n outputs['format'] = 'legacy'\n outputs['missing_sections'] = legacy_missing\n outputs['deprecation_warning'] = 'Spec uses old numbered format. New specs should use: Rules & Decisions, Interfaces, Verification Criteria, Debt & Gaps'\n"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "spec-template",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Seeds or repairs KnowzCode spec files with the lean 4-section template.",
|
|
5
|
-
"parameters": [
|
|
6
|
-
{"name": "node_id", "type": "string", "required": true},
|
|
7
|
-
{"name": "label", "type": "string", "required": true}
|
|
8
|
-
],
|
|
9
|
-
"actions": [
|
|
10
|
-
{
|
|
11
|
-
"type": "python",
|
|
12
|
-
"code": "from pathlib import Path\nfrom datetime import datetime\nnode_id = inputs['node_id']\nlabel = inputs['label']\npath = Path('knowzcode/specs') / f'{node_id}.md'\nnow = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%SZ')\ntemplate_lines = [\n f'# {node_id}: {label}',\n '',\n f'**Updated:** {now}',\n '**Status:** Draft',\n '',\n '## Rules & Decisions',\n '- [Key architectural decisions, business rules, constraints, and purpose]',\n '',\n '## Interfaces',\n '- [Public contracts: inputs, outputs, API signatures, dependencies, events]',\n '',\n '## Verification Criteria',\n '- VERIFY: [testable assertion 1]',\n '- VERIFY: [testable assertion 2]',\n '',\n '## Debt & Gaps',\n '- [Known limitations and future work, or \"None\"]',\n ''\n]\ntemplate = '\\n'.join(template_lines)\nif not path.exists():\n path.write_text(template + '\\n')\n outputs['created'] = True\nelse:\n text = path.read_text()\n new_sections = ['## Rules & Decisions', '## Interfaces', '## Verification Criteria', '## Debt & Gaps']\n if all(section in text for section in new_sections):\n outputs['created'] = False\n else:\n merged = text.strip() + '\\n\\n<!-- Template sections restored -->\\n' + template + '\\n'\n path.write_text(merged)\n outputs['created'] = False"
|
|
13
|
-
}
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "spec-template",
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Seeds or repairs KnowzCode spec files with the lean 4-section template.",
|
|
5
|
+
"parameters": [
|
|
6
|
+
{"name": "node_id", "type": "string", "required": true},
|
|
7
|
+
{"name": "label", "type": "string", "required": true}
|
|
8
|
+
],
|
|
9
|
+
"actions": [
|
|
10
|
+
{
|
|
11
|
+
"type": "python",
|
|
12
|
+
"code": "from pathlib import Path\nfrom datetime import datetime\nnode_id = inputs['node_id']\nlabel = inputs['label']\npath = Path('knowzcode/specs') / f'{node_id}.md'\nnow = datetime.utcnow().strftime('%Y-%m-%d %H:%M:%SZ')\ntemplate_lines = [\n f'# {node_id}: {label}',\n '',\n f'**Updated:** {now}',\n '**Status:** Draft',\n '',\n '## Rules & Decisions',\n '- [Key architectural decisions, business rules, constraints, and purpose]',\n '',\n '## Interfaces',\n '- [Public contracts: inputs, outputs, API signatures, dependencies, events]',\n '',\n '## Verification Criteria',\n '- VERIFY: [testable assertion 1]',\n '- VERIFY: [testable assertion 2]',\n '',\n '## Debt & Gaps',\n '- [Known limitations and future work, or \"None\"]',\n ''\n]\ntemplate = '\\n'.join(template_lines)\nif not path.exists():\n path.write_text(template + '\\n')\n outputs['created'] = True\nelse:\n text = path.read_text()\n new_sections = ['## Rules & Decisions', '## Interfaces', '## Verification Criteria', '## Debt & Gaps']\n if all(section in text for section in new_sections):\n outputs['created'] = False\n else:\n merged = text.strip() + '\\n\\n<!-- Template sections restored -->\\n' + template + '\\n'\n path.write_text(merged)\n outputs['created'] = False"
|
|
13
|
+
}
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "spec-validator",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Validates NodeID specification completeness and quality. Supports new 4-section format (preferred) and legacy numbered sections (deprecated).",
|
|
5
|
-
"parameters": [
|
|
6
|
-
{
|
|
7
|
-
"name": "spec_path",
|
|
8
|
-
"type": "string",
|
|
9
|
-
"required": true,
|
|
10
|
-
"description": "Absolute path to the spec file to validate"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"name": "node_id",
|
|
14
|
-
"type": "string",
|
|
15
|
-
"required": true,
|
|
16
|
-
"description": "NodeID being validated (for error reporting)"
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
"actions": [
|
|
20
|
-
{
|
|
21
|
-
"type": "python",
|
|
22
|
-
"code": "from pathlib import Path\nimport re\n\nspec_path = Path(inputs['spec_path'])\nnode_id = inputs['node_id']\n\nif not spec_path.exists():\n outputs['valid'] = False\n outputs['errors'] = [f'Spec file does not exist: {spec_path}']\n outputs['warnings'] = []\n outputs['score'] = 0\n outputs['node_id'] = node_id\n outputs['format'] = 'missing'\n exit()\n\ncontent = spec_path.read_text()\n\nerrors = []\nwarnings = []\nscore = 100\n\n# Detect format: new 4-section or legacy numbered\nnew_sections = {\n 'rules': r'##\\s*Rules\\s*(&|and)\\s*Decisions',\n 'interfaces': r'##\\s*Interfaces',\n 'verification': r'##\\s*Verification\\s*Criteria',\n 'debt': r'##\\s*Debt\\s*(&|and)\\s*Gaps'\n}\nlegacy_sections = {\n 'purpose': r'##\\s*1\\.\\s*Purpose',\n 'deps': r'##\\s*2\\.\\s*Dependencies',\n 'interfaces': r'##\\s*3\\.\\s*Interfaces',\n 'logic': r'##\\s*4\\.\\s*Core\\s*Logic',\n 'arc': r'##\\s*(6\\.\\s*Error\\s*Handling|7\\.\\s*ARC\\s*Verification)'\n}\n\nnew_count = sum(1 for p in new_sections.values() if re.search(p, content, re.IGNORECASE))\nlegacy_count = sum(1 for p in legacy_sections.values() if re.search(p, content, re.IGNORECASE))\n\nif new_count >= legacy_count:\n spec_format = 'v2'\n # Validate new 4-section format\n required = [\n (new_sections['rules'], 'Missing \"Rules & Decisions\" section'),\n (new_sections['interfaces'], 'Missing \"Interfaces\" section'),\n (new_sections['verification'], 'Missing \"Verification Criteria\" section'),\n (new_sections['debt'], 'Missing \"Debt & Gaps\" section')\n ]\n for pattern, error_msg in required:\n if not re.search(pattern, content, re.IGNORECASE):\n errors.append(error_msg)\n score -= 15\n \n # Check VERIFY: statements (minimum 2)\n verify_section = re.search(r'##\\s*Verification\\s*Criteria(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if verify_section:\n verify_content = verify_section.group(1)\n verify_count = len(re.findall(r'VERIFY:', verify_content))\n if verify_count < 2:\n errors.append(f'Only {verify_count} VERIFY: statements found (minimum 2 required)')\n score -= 15\n else:\n errors.append('Verification Criteria section is empty or malformed')\n score -= 20\n \n # Check Rules has content\n rules_section = re.search(r'##\\s*Rules\\s*(&|and)\\s*Decisions(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if rules_section:\n rules_content = rules_section.group(2).strip()\n if len(rules_content) < 20 or re.search(r'^\\s*-\\s*\\[', rules_content):\n warnings.append('Rules & Decisions section appears to have only placeholder content')\n score -= 10\n \n # Check Interfaces has content\n iface_section = re.search(r'##\\s*Interfaces(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if iface_section:\n iface_content = iface_section.group(1).strip()\n if len(iface_content) < 20 or re.search(r'^\\s*-\\s*\\[', iface_content):\n warnings.append('Interfaces section appears to have only placeholder content')\n score -= 10\nelse:\n spec_format = 'legacy'\n warnings.append('DEPRECATED: Spec uses old numbered format. Will be migrated when next touched during finalization.')\n \n # Validate legacy format\n required = [\n (legacy_sections['purpose'], 'Missing \"1. Purpose\" section'),\n (legacy_sections['deps'], 'Missing \"2. Dependencies\" section'),\n (legacy_sections['interfaces'], 'Missing \"3. Interfaces\" section'),\n (legacy_sections['logic'], 'Missing \"4. Core Logic\" section'),\n (legacy_sections['arc'], 'Missing ARC/Error Handling section')\n ]\n for pattern, error_msg in required:\n if not re.search(pattern, content, re.IGNORECASE):\n errors.append(error_msg)\n score -= 15\n \n # Check ARC criteria (legacy format)\n arc_section = re.search(r'##\\s*7\\.\\s*ARC\\s*Verification\\s*Criteria(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if arc_section:\n arc_content = arc_section.group(1)\n criteria_count = len(re.findall(r'ARC_[A-Z]+_\\d+:', arc_content))\n if criteria_count < 3:\n errors.append(f'Only {criteria_count} testable ARC criteria found (minimum 3 required)')\n score -= 15\n else:\n errors.append('ARC Verification Criteria section is empty or malformed')\n score -= 20\n\n# Check for placeholder text (both formats)\nplaceholder_patterns = [\n (r'\\[Agent:', 'Contains [Agent: placeholder'),\n (r'\\[TODO', 'Contains [TODO] placeholder'),\n (r'\\[FILL', 'Contains [FILL] placeholder'),\n (r'\\[TBD\\]', 'Contains [TBD] placeholder'),\n (r'\\[INSERT', 'Contains [INSERT] placeholder')\n]\nfor pattern, msg in placeholder_patterns:\n if re.search(pattern, content, re.IGNORECASE):\n errors.append(msg)\n score -= 20\n break\n\n# Calculate final validation\noutputs['valid'] = (score >= 70 and len(errors) == 0)\noutputs['score'] = max(0, score)\noutputs['errors'] = errors\noutputs['warnings'] = warnings\noutputs['node_id'] = node_id\noutputs['spec_path'] = str(spec_path)\noutputs['format'] = spec_format"
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "spec-validator",
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Validates NodeID specification completeness and quality. Supports new 4-section format (preferred) and legacy numbered sections (deprecated).",
|
|
5
|
+
"parameters": [
|
|
6
|
+
{
|
|
7
|
+
"name": "spec_path",
|
|
8
|
+
"type": "string",
|
|
9
|
+
"required": true,
|
|
10
|
+
"description": "Absolute path to the spec file to validate"
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
"name": "node_id",
|
|
14
|
+
"type": "string",
|
|
15
|
+
"required": true,
|
|
16
|
+
"description": "NodeID being validated (for error reporting)"
|
|
17
|
+
}
|
|
18
|
+
],
|
|
19
|
+
"actions": [
|
|
20
|
+
{
|
|
21
|
+
"type": "python",
|
|
22
|
+
"code": "from pathlib import Path\nimport re\n\nspec_path = Path(inputs['spec_path'])\nnode_id = inputs['node_id']\n\nif not spec_path.exists():\n outputs['valid'] = False\n outputs['errors'] = [f'Spec file does not exist: {spec_path}']\n outputs['warnings'] = []\n outputs['score'] = 0\n outputs['node_id'] = node_id\n outputs['format'] = 'missing'\n exit()\n\ncontent = spec_path.read_text()\n\nerrors = []\nwarnings = []\nscore = 100\n\n# Detect format: new 4-section or legacy numbered\nnew_sections = {\n 'rules': r'##\\s*Rules\\s*(&|and)\\s*Decisions',\n 'interfaces': r'##\\s*Interfaces',\n 'verification': r'##\\s*Verification\\s*Criteria',\n 'debt': r'##\\s*Debt\\s*(&|and)\\s*Gaps'\n}\nlegacy_sections = {\n 'purpose': r'##\\s*1\\.\\s*Purpose',\n 'deps': r'##\\s*2\\.\\s*Dependencies',\n 'interfaces': r'##\\s*3\\.\\s*Interfaces',\n 'logic': r'##\\s*4\\.\\s*Core\\s*Logic',\n 'arc': r'##\\s*(6\\.\\s*Error\\s*Handling|7\\.\\s*ARC\\s*Verification)'\n}\n\nnew_count = sum(1 for p in new_sections.values() if re.search(p, content, re.IGNORECASE))\nlegacy_count = sum(1 for p in legacy_sections.values() if re.search(p, content, re.IGNORECASE))\n\nif new_count >= legacy_count:\n spec_format = 'v2'\n # Validate new 4-section format\n required = [\n (new_sections['rules'], 'Missing \"Rules & Decisions\" section'),\n (new_sections['interfaces'], 'Missing \"Interfaces\" section'),\n (new_sections['verification'], 'Missing \"Verification Criteria\" section'),\n (new_sections['debt'], 'Missing \"Debt & Gaps\" section')\n ]\n for pattern, error_msg in required:\n if not re.search(pattern, content, re.IGNORECASE):\n errors.append(error_msg)\n score -= 15\n \n # Check VERIFY: statements (minimum 2)\n verify_section = re.search(r'##\\s*Verification\\s*Criteria(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if verify_section:\n verify_content = verify_section.group(1)\n verify_count = len(re.findall(r'VERIFY:', verify_content))\n if verify_count < 2:\n errors.append(f'Only {verify_count} VERIFY: statements found (minimum 2 required)')\n score -= 15\n else:\n errors.append('Verification Criteria section is empty or malformed')\n score -= 20\n \n # Check Rules has content\n rules_section = re.search(r'##\\s*Rules\\s*(&|and)\\s*Decisions(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if rules_section:\n rules_content = rules_section.group(2).strip()\n if len(rules_content) < 20 or re.search(r'^\\s*-\\s*\\[', rules_content):\n warnings.append('Rules & Decisions section appears to have only placeholder content')\n score -= 10\n \n # Check Interfaces has content\n iface_section = re.search(r'##\\s*Interfaces(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if iface_section:\n iface_content = iface_section.group(1).strip()\n if len(iface_content) < 20 or re.search(r'^\\s*-\\s*\\[', iface_content):\n warnings.append('Interfaces section appears to have only placeholder content')\n score -= 10\nelse:\n spec_format = 'legacy'\n warnings.append('DEPRECATED: Spec uses old numbered format. Will be migrated when next touched during finalization.')\n \n # Validate legacy format\n required = [\n (legacy_sections['purpose'], 'Missing \"1. Purpose\" section'),\n (legacy_sections['deps'], 'Missing \"2. Dependencies\" section'),\n (legacy_sections['interfaces'], 'Missing \"3. Interfaces\" section'),\n (legacy_sections['logic'], 'Missing \"4. Core Logic\" section'),\n (legacy_sections['arc'], 'Missing ARC/Error Handling section')\n ]\n for pattern, error_msg in required:\n if not re.search(pattern, content, re.IGNORECASE):\n errors.append(error_msg)\n score -= 15\n \n # Check ARC criteria (legacy format)\n arc_section = re.search(r'##\\s*7\\.\\s*ARC\\s*Verification\\s*Criteria(.+?)(?=##|$)', content, re.DOTALL | re.IGNORECASE)\n if arc_section:\n arc_content = arc_section.group(1)\n criteria_count = len(re.findall(r'ARC_[A-Z]+_\\d+:', arc_content))\n if criteria_count < 3:\n errors.append(f'Only {criteria_count} testable ARC criteria found (minimum 3 required)')\n score -= 15\n else:\n errors.append('ARC Verification Criteria section is empty or malformed')\n score -= 20\n\n# Check for placeholder text (both formats)\nplaceholder_patterns = [\n (r'\\[Agent:', 'Contains [Agent: placeholder'),\n (r'\\[TODO', 'Contains [TODO] placeholder'),\n (r'\\[FILL', 'Contains [FILL] placeholder'),\n (r'\\[TBD\\]', 'Contains [TBD] placeholder'),\n (r'\\[INSERT', 'Contains [INSERT] placeholder')\n]\nfor pattern, msg in placeholder_patterns:\n if re.search(pattern, content, re.IGNORECASE):\n errors.append(msg)\n score -= 20\n break\n\n# Calculate final validation\noutputs['valid'] = (score >= 70 and len(errors) == 0)\noutputs['score'] = max(0, score)\noutputs['errors'] = errors\noutputs['warnings'] = warnings\noutputs['node_id'] = node_id\noutputs['spec_path'] = str(spec_path)\noutputs['format'] = spec_format"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
package/skills/tracker-scan.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tracker-scan",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Extracts NodeID statuses and WorkGroup assignments from the KnowzCode tracker.",
|
|
5
|
-
"parameters": [],
|
|
6
|
-
"actions": [
|
|
7
|
-
{
|
|
8
|
-
"type": "python",
|
|
9
|
-
"code": "from pathlib import Path\ntext = Path('knowzcode/knowzcode_tracker.md').read_text()\nrows = []\nfor line in text.splitlines():\n if line.startswith('|') and '`' in line:\n cols = [c.strip() for c in line.strip('|').split('|')]\n if len(cols) >= 9 and cols[2] != 'Node ID':\n rows.append({'status': cols[0], 'workgroup_id': cols[1], 'node_id': cols[2].strip('`'), 'notes': cols[8]})\noutputs['rows'] = rows\n"
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "tracker-scan",
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Extracts NodeID statuses and WorkGroup assignments from the KnowzCode tracker.",
|
|
5
|
+
"parameters": [],
|
|
6
|
+
"actions": [
|
|
7
|
+
{
|
|
8
|
+
"type": "python",
|
|
9
|
+
"code": "from pathlib import Path\ntext = Path('knowzcode/knowzcode_tracker.md').read_text()\nrows = []\nfor line in text.splitlines():\n if line.startswith('|') and '`' in line:\n cols = [c.strip() for c in line.strip('|').split('|')]\n if len(cols) >= 9 and cols[2] != 'Node ID':\n rows.append({'status': cols[0], 'workgroup_id': cols[1], 'node_id': cols[2].strip('`'), 'notes': cols[8]})\noutputs['rows'] = rows\n"
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "tracker-update",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Applies validated updates to knowzcode/knowzcode_tracker.md while preserving table structure.",
|
|
5
|
-
"parameters": [
|
|
6
|
-
{
|
|
7
|
-
"name": "updates",
|
|
8
|
-
"type": "array",
|
|
9
|
-
"items": {
|
|
10
|
-
"type": "object",
|
|
11
|
-
"properties": {
|
|
12
|
-
"node_id": {"type": "string"},
|
|
13
|
-
"status": {"type": "string"},
|
|
14
|
-
"workgroup_id": {"type": "string"},
|
|
15
|
-
"notes": {"type": "string"}
|
|
16
|
-
},
|
|
17
|
-
"required": ["node_id"]
|
|
18
|
-
},
|
|
19
|
-
"required": true
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"actions": [
|
|
23
|
-
{
|
|
24
|
-
"type": "python",
|
|
25
|
-
"code": "from pathlib import Path\npath = Path('knowzcode/knowzcode_tracker.md')\ntext = path.read_text()\nlines = text.splitlines()\nheader_idx = next(i for i, line in enumerate(lines) if line.startswith('| Status |'))\ntable = lines[header_idx:]\nrows = [line for line in table if line.startswith('|')]\nupdates = {u['node_id']: u for u in inputs['updates']}\nnew_rows = []\nfor row in rows:\n parts = [p.strip() for p in row.strip('|').split('|')]\n if not parts or parts[2] == 'Node ID':\n new_rows.append(row)\n continue\n node_id = parts[2].strip('`')\n if node_id in updates:\n upd = updates[node_id]\n status = upd.get('status', parts[0].strip())\n workgroup = upd.get('workgroup_id', parts[1].strip())\n notes = upd.get('notes', parts[8].strip())\n new_row = f\"| {status} | {workgroup} | `{node_id}` | {parts[3]} | {parts[4]} | {parts[5]} | {parts[6]} | {parts[7]} | {notes} |\"\n new_rows.append(new_row)\n updates.pop(node_id)\n else:\n new_rows.append(row)\nif updates:\n missing = ', '.join(sorted(updates.keys()))\n raise ValueError(f\"NodeIDs {missing} not found in tracker table\")\nlines[header_idx:] = new_rows + lines[header_idx + len(rows):]\npath.write_text('\\n'.join(lines) + '\\n')"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "tracker-update",
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Applies validated updates to knowzcode/knowzcode_tracker.md while preserving table structure.",
|
|
5
|
+
"parameters": [
|
|
6
|
+
{
|
|
7
|
+
"name": "updates",
|
|
8
|
+
"type": "array",
|
|
9
|
+
"items": {
|
|
10
|
+
"type": "object",
|
|
11
|
+
"properties": {
|
|
12
|
+
"node_id": {"type": "string"},
|
|
13
|
+
"status": {"type": "string"},
|
|
14
|
+
"workgroup_id": {"type": "string"},
|
|
15
|
+
"notes": {"type": "string"}
|
|
16
|
+
},
|
|
17
|
+
"required": ["node_id"]
|
|
18
|
+
},
|
|
19
|
+
"required": true
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"actions": [
|
|
23
|
+
{
|
|
24
|
+
"type": "python",
|
|
25
|
+
"code": "from pathlib import Path\npath = Path('knowzcode/knowzcode_tracker.md')\ntext = path.read_text()\nlines = text.splitlines()\nheader_idx = next(i for i, line in enumerate(lines) if line.startswith('| Status |'))\ntable = lines[header_idx:]\nrows = [line for line in table if line.startswith('|')]\nupdates = {u['node_id']: u for u in inputs['updates']}\nnew_rows = []\nfor row in rows:\n parts = [p.strip() for p in row.strip('|').split('|')]\n if not parts or parts[2] == 'Node ID':\n new_rows.append(row)\n continue\n node_id = parts[2].strip('`')\n if node_id in updates:\n upd = updates[node_id]\n status = upd.get('status', parts[0].strip())\n workgroup = upd.get('workgroup_id', parts[1].strip())\n notes = upd.get('notes', parts[8].strip())\n new_row = f\"| {status} | {workgroup} | `{node_id}` | {parts[3]} | {parts[4]} | {parts[5]} | {parts[6]} | {parts[7]} | {notes} |\"\n new_rows.append(new_row)\n updates.pop(node_id)\n else:\n new_rows.append(row)\nif updates:\n missing = ', '.join(sorted(updates.keys()))\n raise ValueError(f\"NodeIDs {missing} not found in tracker table\")\nlines[header_idx:] = new_rows + lines[header_idx + len(rows):]\npath.write_text('\\n'.join(lines) + '\\n')"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "validate-installation",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Validates that KnowzCode installation completed successfully with required directories and files",
|
|
5
|
-
|
|
6
|
-
"parameters": [],
|
|
7
|
-
|
|
8
|
-
"actions": [
|
|
9
|
-
{
|
|
10
|
-
"type": "python",
|
|
11
|
-
"code": "from pathlib import Path\nimport json\n\n# Check for knowzcode directory (the primary installation target)\nknowzcode_dir = Path('knowzcode')\nerrors = []\nwarnings = []\n\n# Check directory exists\nif not knowzcode_dir.exists():\n errors.append('knowzcode/ directory not found')\n outputs['valid'] = False\n outputs['errors'] = errors\n outputs['warnings'] = warnings\n outputs['commands_count'] = 0\n outputs['skills_count'] = 0\n outputs['agents_count'] = 0\n exit()\n\n# Check required knowzcode files\nrequired_files = [\n 'knowzcode_loop.md',\n 'knowzcode_tracker.md',\n 'knowzcode_project.md',\n 'knowzcode_architecture.md'\n]\n\nfor required_file in required_files:\n if not (knowzcode_dir / required_file).exists():\n errors.append(f'Missing required file: knowzcode/{required_file}')\n\n# Check required subdirectories\nrequired_dirs = [\n 'specs',\n 'workgroups',\n 'prompts'\n]\n\nfor subdir in required_dirs:\n if not (knowzcode_dir / subdir).exists():\n warnings.append(f'Missing directory: knowzcode/{subdir}')\n\n# Check .claude directory for commands/agents (plugin or local installation)\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 commands/skills/agents (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\n# Expected minimums\nif commands_count < 5:\n warnings.append(f'Expected at least 5 commands, found {commands_count}')\nif agents_count < 10:\n warnings.append(f'Expected at least 10 agents, found {agents_count}')\n\noutputs['valid'] = len(errors) == 0\noutputs['errors'] = errors\noutputs['warnings'] = warnings\noutputs['commands_count'] = commands_count\noutputs['skills_count'] = skills_count\noutputs['agents_count'] = agents_count"
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "validate-installation",
|
|
3
|
+
"version": "0.3.7",
|
|
4
|
+
"description": "Validates that KnowzCode installation completed successfully with required directories and files",
|
|
5
|
+
|
|
6
|
+
"parameters": [],
|
|
7
|
+
|
|
8
|
+
"actions": [
|
|
9
|
+
{
|
|
10
|
+
"type": "python",
|
|
11
|
+
"code": "from pathlib import Path\nimport json\n\n# Check for knowzcode directory (the primary installation target)\nknowzcode_dir = Path('knowzcode')\nerrors = []\nwarnings = []\n\n# Check directory exists\nif not knowzcode_dir.exists():\n errors.append('knowzcode/ directory not found')\n outputs['valid'] = False\n outputs['errors'] = errors\n outputs['warnings'] = warnings\n outputs['commands_count'] = 0\n outputs['skills_count'] = 0\n outputs['agents_count'] = 0\n exit()\n\n# Check required knowzcode files\nrequired_files = [\n 'knowzcode_loop.md',\n 'knowzcode_tracker.md',\n 'knowzcode_project.md',\n 'knowzcode_architecture.md'\n]\n\nfor required_file in required_files:\n if not (knowzcode_dir / required_file).exists():\n errors.append(f'Missing required file: knowzcode/{required_file}')\n\n# Check required subdirectories\nrequired_dirs = [\n 'specs',\n 'workgroups',\n 'prompts'\n]\n\nfor subdir in required_dirs:\n if not (knowzcode_dir / subdir).exists():\n warnings.append(f'Missing directory: knowzcode/{subdir}')\n\n# Check .claude directory for commands/agents (plugin or local installation)\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 commands/skills/agents (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\n# Expected minimums\nif commands_count < 5:\n warnings.append(f'Expected at least 5 commands, found {commands_count}')\nif agents_count < 10:\n warnings.append(f'Expected at least 10 agents, found {agents_count}')\n\noutputs['valid'] = len(errors) == 0\noutputs['errors'] = errors\noutputs['warnings'] = warnings\noutputs['commands_count'] = commands_count\noutputs['skills_count'] = skills_count\noutputs['agents_count'] = agents_count"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
}
|