zenkit 0.5.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 (84) hide show
  1. package/CONTRIBUTING.md +63 -0
  2. package/LICENSE +21 -0
  3. package/README.md +242 -0
  4. package/agents/backend-architect.md +19 -0
  5. package/agents/frontend-architect.md +19 -0
  6. package/agents/implementation-auditor.md +19 -0
  7. package/agents/product-manager.md +19 -0
  8. package/agents/qa-test-engineer.md +19 -0
  9. package/agents/security-specialist.md +19 -0
  10. package/agents/system-architect.md +19 -0
  11. package/agents/technical-writer.md +19 -0
  12. package/agents/ux-engineer.md +19 -0
  13. package/benchmark/feature-specs/cli-tool.json +58 -0
  14. package/benchmark/feature-specs/handoff-system.json +69 -0
  15. package/benchmark/feature-specs/protocol-completeness.json +85 -0
  16. package/benchmark/feature-specs/schema-validator-baseline.json +93 -0
  17. package/benchmark/feature-specs/schema-validator-playground.json +92 -0
  18. package/benchmark/feature-specs/self-audit.json +76 -0
  19. package/benchmark/fixtures/valid-handoff.json +13 -0
  20. package/benchmark/scripts/compare.ts +172 -0
  21. package/benchmark/scripts/report.ts +102 -0
  22. package/benchmark/scripts/run-all.ts +125 -0
  23. package/benchmark/scripts/run.ts +595 -0
  24. package/benchmark/scripts/visualize.ts +120 -0
  25. package/bin/zenkit.js +24 -0
  26. package/commands/audit.md +28 -0
  27. package/commands/build.md +26 -0
  28. package/commands/checkpoint.md +28 -0
  29. package/commands/handoff.md +28 -0
  30. package/commands/plan.md +27 -0
  31. package/commands/refactor.md +27 -0
  32. package/commands/ship.md +28 -0
  33. package/commands/spec.md +26 -0
  34. package/dist/cli.d.ts +2 -0
  35. package/dist/cli.d.ts.map +1 -0
  36. package/dist/cli.js +174 -0
  37. package/dist/cli.js.map +1 -0
  38. package/dist/index.d.ts +765 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +121 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/schemas/audit.schema.json +63 -0
  43. package/dist/schemas/benchmark.schema.json +118 -0
  44. package/dist/schemas/checkpoint.schema.json +64 -0
  45. package/dist/schemas/feature-spec.schema.json +76 -0
  46. package/dist/schemas/handoff.schema.json +78 -0
  47. package/dist/schemas/schemas/audit.schema.json +63 -0
  48. package/dist/schemas/schemas/benchmark.schema.json +118 -0
  49. package/dist/schemas/schemas/checkpoint.schema.json +64 -0
  50. package/dist/schemas/schemas/feature-spec.schema.json +76 -0
  51. package/dist/schemas/schemas/handoff.schema.json +78 -0
  52. package/dist/schemas/schemas/task.schema.json +69 -0
  53. package/dist/schemas/task.schema.json +69 -0
  54. package/docs/agent-contract.md +36 -0
  55. package/docs/architecture.md +88 -0
  56. package/docs/benchmarking.md +51 -0
  57. package/docs/command-model.md +43 -0
  58. package/docs/philosophy.md +35 -0
  59. package/docs/roadmap.md +43 -0
  60. package/docs/self-audit.md +29 -0
  61. package/hooks/post-change.md +30 -0
  62. package/hooks/pre-change.md +27 -0
  63. package/hooks/pre-ship.md +30 -0
  64. package/package.json +92 -0
  65. package/rubrics/architectural-alignment.md +26 -0
  66. package/rubrics/execution-quality.md +26 -0
  67. package/rubrics/verbosity-score.md +26 -0
  68. package/schemas/audit.schema.json +63 -0
  69. package/schemas/benchmark.schema.json +118 -0
  70. package/schemas/checkpoint.schema.json +64 -0
  71. package/schemas/feature-spec.schema.json +76 -0
  72. package/schemas/handoff.schema.json +78 -0
  73. package/schemas/task.schema.json +69 -0
  74. package/skills/architecture-review.md +17 -0
  75. package/skills/backend-change.md +17 -0
  76. package/skills/bug-triage.md +17 -0
  77. package/skills/frontend-change.md +17 -0
  78. package/skills/prompt-pruning.md +17 -0
  79. package/skills/release-check.md +17 -0
  80. package/skills/security-review.md +17 -0
  81. package/templates/agent.template.md +18 -0
  82. package/templates/command.template.md +21 -0
  83. package/templates/skill.template.md +15 -0
  84. package/templates/task.template.md +19 -0
@@ -0,0 +1,64 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://zenkit.dev/schemas/checkpoint.schema.json",
4
+ "title": "ZenKit Checkpoint",
5
+ "description": "A snapshot of workflow state at a specific point in execution.",
6
+ "type": "object",
7
+ "required": ["checkpoint_id", "task_id", "status", "timestamp"],
8
+ "properties": {
9
+ "checkpoint_id": {
10
+ "type": "string",
11
+ "pattern": "^chk-[a-z0-9-]+$"
12
+ },
13
+ "task_id": {
14
+ "type": "string"
15
+ },
16
+ "timestamp": {
17
+ "type": "string",
18
+ "format": "date-time"
19
+ },
20
+ "status": {
21
+ "type": "string",
22
+ "enum": ["snapshot", "gate", "rollback_point"]
23
+ },
24
+ "stage": {
25
+ "type": "string",
26
+ "enum": ["plan", "build", "audit", "ship"]
27
+ },
28
+ "state": {
29
+ "type": "object",
30
+ "properties": {
31
+ "files_changed": {
32
+ "type": "array",
33
+ "items": { "type": "string" }
34
+ },
35
+ "tests_passing": { "type": "boolean" },
36
+ "lint_passing": { "type": "boolean" },
37
+ "git_ref": { "type": "string" },
38
+ "notes": { "type": "string" }
39
+ }
40
+ },
41
+ "gate_conditions": {
42
+ "type": "array",
43
+ "items": {
44
+ "type": "object",
45
+ "properties": {
46
+ "condition": { "type": "string" },
47
+ "met": { "type": "boolean" }
48
+ },
49
+ "required": ["condition", "met"]
50
+ }
51
+ },
52
+ "metadata": {
53
+ "type": "object",
54
+ "properties": {
55
+ "agent": { "type": "string" },
56
+ "command": { "type": "string" },
57
+ "iteration": { "type": "integer" },
58
+ "tokens_used": { "type": "integer" },
59
+ "cost_estimate_usd": { "type": "number" }
60
+ }
61
+ }
62
+ },
63
+ "additionalProperties": false
64
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://zenkit.dev/schemas/feature-spec.schema.json",
4
+ "title": "ZenKit Feature Spec",
5
+ "description": "Machine-readable feature specification for ZenKit benchmarks.",
6
+ "type": "object",
7
+ "required": ["feature_id", "name", "description", "mode", "acceptance_criteria", "constraints", "expected_files", "limitations"],
8
+ "properties": {
9
+ "feature_id": {
10
+ "type": "string",
11
+ "pattern": "^[a-z0-9-]+$"
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "minLength": 1
16
+ },
17
+ "description": {
18
+ "type": "string"
19
+ },
20
+ "mode": {
21
+ "type": "string",
22
+ "enum": ["zenkit", "baseline"]
23
+ },
24
+ "acceptance_criteria": {
25
+ "type": "array",
26
+ "minItems": 1,
27
+ "items": {
28
+ "type": "object",
29
+ "required": ["id", "description", "verification"],
30
+ "properties": {
31
+ "id": { "type": "string" },
32
+ "description": { "type": "string" },
33
+ "verification": {
34
+ "type": "object",
35
+ "required": ["type"],
36
+ "properties": {
37
+ "type": {
38
+ "type": "string",
39
+ "enum": ["file_exists", "file_contains", "schema_count", "examples_valid", "schemas_consistent", "test_passes", "json_path_equals"]
40
+ },
41
+ "path": { "type": "string" },
42
+ "pattern": { "type": "string" },
43
+ "command": { "type": "string", "description": "Shell command to run for test_passes verification." },
44
+ "json_path": { "type": "string", "description": "Dot-separated path into JSON for json_path_equals." },
45
+ "equals": { "description": "Expected value for json_path_equals." },
46
+ "expected": { "type": "integer" }
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "constraints": {
53
+ "type": "array",
54
+ "items": { "type": "string" }
55
+ },
56
+ "expected_files": {
57
+ "type": "array",
58
+ "items": { "type": "string" }
59
+ },
60
+ "assigned_commands": {
61
+ "type": "array",
62
+ "items": { "type": "string" }
63
+ },
64
+ "estimated_complexity": {
65
+ "type": "string",
66
+ "enum": ["low", "medium", "high"]
67
+ },
68
+ "limitations": {
69
+ "type": "array",
70
+ "minItems": 1,
71
+ "items": { "type": "string" },
72
+ "description": "What this spec does NOT verify. Required — specs must be honest about scope."
73
+ }
74
+ },
75
+ "additionalProperties": false
76
+ }
@@ -0,0 +1,78 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://zenkit.dev/schemas/handoff.schema.json",
4
+ "title": "ZenKit Handoff Contract",
5
+ "description": "Structured handoff between agents or workflow stages in ZenKit.",
6
+ "type": "object",
7
+ "required": ["context", "assumptions", "decision", "deliverable", "next_agent"],
8
+ "properties": {
9
+ "context": {
10
+ "type": "string",
11
+ "description": "What is the current situation? What has happened so far?"
12
+ },
13
+ "assumptions": {
14
+ "type": "array",
15
+ "items": { "type": "string" },
16
+ "description": "Explicit assumptions made during this stage."
17
+ },
18
+ "constraints": {
19
+ "type": "array",
20
+ "items": { "type": "string" },
21
+ "description": "Hard constraints that bound this work."
22
+ },
23
+ "decision": {
24
+ "type": "string",
25
+ "description": "What was decided and why."
26
+ },
27
+ "deliverable": {
28
+ "type": "object",
29
+ "properties": {
30
+ "type": {
31
+ "type": "string",
32
+ "enum": ["code", "document", "schema", "plan", "review", "test", "artifact"]
33
+ },
34
+ "description": { "type": "string" },
35
+ "files_changed": {
36
+ "type": "array",
37
+ "items": { "type": "string" }
38
+ },
39
+ "validation_status": {
40
+ "type": "string",
41
+ "enum": ["passed", "failed", "partial", "untested"]
42
+ }
43
+ },
44
+ "required": ["type", "description"]
45
+ },
46
+ "risks": {
47
+ "type": "array",
48
+ "items": {
49
+ "type": "object",
50
+ "properties": {
51
+ "description": { "type": "string" },
52
+ "severity": { "type": "string", "enum": ["low", "medium", "high", "critical"] },
53
+ "mitigation": { "type": "string" }
54
+ },
55
+ "required": ["description", "severity"]
56
+ }
57
+ },
58
+ "open_questions": {
59
+ "type": "array",
60
+ "items": { "type": "string" },
61
+ "description": "Unresolved questions that the next agent should address."
62
+ },
63
+ "next_agent": {
64
+ "type": "string",
65
+ "description": "The agent or role that should receive this handoff."
66
+ },
67
+ "metadata": {
68
+ "type": "object",
69
+ "properties": {
70
+ "timestamp": { "type": "string", "format": "date-time" },
71
+ "source_agent": { "type": "string" },
72
+ "command": { "type": "string" },
73
+ "iteration": { "type": "integer", "minimum": 0 }
74
+ }
75
+ }
76
+ },
77
+ "additionalProperties": false
78
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://zenkit.dev/schemas/task.schema.json",
4
+ "title": "ZenKit Task",
5
+ "description": "A discrete unit of work within a ZenKit workflow.",
6
+ "type": "object",
7
+ "required": ["id", "name", "status", "command"],
8
+ "properties": {
9
+ "id": {
10
+ "type": "string",
11
+ "pattern": "^[a-z0-9-]+$"
12
+ },
13
+ "name": {
14
+ "type": "string",
15
+ "minLength": 1,
16
+ "maxLength": 200
17
+ },
18
+ "description": {
19
+ "type": "string"
20
+ },
21
+ "command": {
22
+ "type": "string",
23
+ "enum": ["plan", "build", "audit", "refactor", "spec", "handoff", "checkpoint", "ship"]
24
+ },
25
+ "status": {
26
+ "type": "string",
27
+ "enum": ["pending", "in_progress", "blocked", "completed", "failed", "skipped"]
28
+ },
29
+ "context": {
30
+ "type": "string"
31
+ },
32
+ "assumptions": {
33
+ "type": "array",
34
+ "items": { "type": "string" }
35
+ },
36
+ "constraints": {
37
+ "type": "array",
38
+ "items": { "type": "string" }
39
+ },
40
+ "acceptance_criteria": {
41
+ "type": "array",
42
+ "items": { "type": "string" }
43
+ },
44
+ "files_affected": {
45
+ "type": "array",
46
+ "items": { "type": "string" }
47
+ },
48
+ "assigned_agent": {
49
+ "type": "string"
50
+ },
51
+ "parent_task": {
52
+ "type": "string"
53
+ },
54
+ "dependencies": {
55
+ "type": "array",
56
+ "items": { "type": "string" }
57
+ },
58
+ "metadata": {
59
+ "type": "object",
60
+ "properties": {
61
+ "created_at": { "type": "string", "format": "date-time" },
62
+ "updated_at": { "type": "string", "format": "date-time" },
63
+ "estimated_tokens": { "type": "integer", "minimum": 0 },
64
+ "actual_tokens": { "type": "integer", "minimum": 0 }
65
+ }
66
+ }
67
+ },
68
+ "additionalProperties": false
69
+ }
@@ -0,0 +1,17 @@
1
+ # Architecture Review
2
+
3
+ > Review system architecture for coherence, scalability, and alignment with project constraints.
4
+
5
+ **When to use:**
6
+ - New service/module/feature is being designed or a PR introduces major structural changes
7
+ - Scaling, reliability, or maintainability issues in an existing system
8
+ - Tech-debt audit or migration planning underway
9
+
10
+ **Input:** System description or codebase reference, requirements/constraints, ADRs if available, and specific concerns from the requester.
11
+
12
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions). Deliverable is a ranked list of findings with severity, affected components, and concrete recommendations.
13
+
14
+ **Watch for:**
15
+ - Reviewing in a vacuum without understanding the team's actual constraints and timeline
16
+ - Recommending full rewrites when incremental improvements suffice
17
+ - Ignoring failure modes and operational concerns (observability, deployment, rollback)
@@ -0,0 +1,17 @@
1
+ # Backend Change
2
+
3
+ > Implement backend changes (API endpoints, data models, business logic) following existing patterns.
4
+
5
+ **When to use:**
6
+ - New API endpoint/route needs to be created or an existing one modified
7
+ - Data model or schema needs to be added or altered
8
+ - Business logic or third-party integration needs implementation
9
+
10
+ **Input:** Description of the desired change and motivation, affected files/modules, API contract or data model specs if applicable, and acceptance criteria.
11
+
12
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions). Deliverable is the code changes -- new/modified files, migrations, and tests.
13
+
14
+ **Watch for:**
15
+ - Introducing new patterns when established ones already exist in the codebase
16
+ - Writing migrations unsafe for zero-downtime deployments
17
+ - Handling only the success case and leaving error paths incomplete
@@ -0,0 +1,17 @@
1
+ # Bug Triage
2
+
3
+ > Investigate and classify bugs, identify root cause, propose fix strategy.
4
+
5
+ **When to use:**
6
+ - Bug report filed by a user, QA, or automated monitoring
7
+ - Unexpected test failure not caused by an intentional change
8
+ - Production incident needs rapid diagnosis
9
+
10
+ **Input:** Bug report or description of unexpected behavior, reproduction steps, environment details, relevant logs/errors/screenshots, and recent related changes.
11
+
12
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions). Deliverable is a triage report: confirmed/not-confirmed status, severity classification, root cause analysis, affected components, and proposed fix with estimated effort.
13
+
14
+ **Watch for:**
15
+ - Fixing the symptom without understanding the underlying root cause
16
+ - Classifying severity based on reporter loudness rather than actual impact
17
+ - Skipping reproduction and jumping straight to a fix based on guesswork
@@ -0,0 +1,17 @@
1
+ # Frontend Change
2
+
3
+ > Implement frontend changes (components, pages, styles) following existing patterns and design system.
4
+
5
+ **When to use:**
6
+ - New UI component, page, or feature needs to be built
7
+ - Existing component requires visual or behavioral modification
8
+ - Accessibility or responsive layout improvements needed
9
+
10
+ **Input:** Description of the UI/UX change with visual references when available, affected components/pages, design system specs, and acceptance criteria including breakpoints and a11y requirements.
11
+
12
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions). Deliverable is the code changes -- components, styles, tests, and storybook entries where applicable.
13
+
14
+ **Watch for:**
15
+ - Hardcoding values instead of using design system tokens or theme variables
16
+ - Creating one-off components when a shared component could be extended
17
+ - Neglecting keyboard navigation, focus management, and cross-browser/viewport testing
@@ -0,0 +1,17 @@
1
+ # Prompt Pruning
2
+
3
+ > Reduce prompt verbosity and token waste while preserving instruction quality and coverage.
4
+
5
+ **When to use:**
6
+ - Prompt or system instruction exceeds its token budget
7
+ - Response quality degraded due to overly long context
8
+ - Multiple prompts need consolidation or adaptation for a new model's context limits
9
+
10
+ **Input:** The prompt(s) to prune, token budget or reduction target, priority ranking of instructions (must-keep vs. nice-to-have), and example outputs to validate against.
11
+
12
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions). Deliverable is the pruned prompt(s) with before/after token counts and a change log of what was removed, merged, or rewritten.
13
+
14
+ **Watch for:**
15
+ - Removing "redundant" instructions that actually reinforce model compliance
16
+ - Over-compressing nuanced instructions into ambiguous shorthand
17
+ - Pruning safety or guardrail instructions because they seem verbose
@@ -0,0 +1,17 @@
1
+ # Release Check
2
+
3
+ > Pre-release validation: tests pass, no regressions, docs updated, changelog current, deploy gates met.
4
+
5
+ **When to use:**
6
+ - Release branch or tag is being prepared, or deploy to staging/production is imminent
7
+ - Sprint or milestone is being closed out
8
+ - Hotfix or previously blocked release needs validated release
9
+
10
+ **Input:** Branch/tag/commit range to validate, deployment gate requirements, list of changes included (PRs, commits, tickets), and target environment.
11
+
12
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions). Deliverable is a completed checklist with pass/fail per gate: test results, regression check, docs review, changelog verification, dependency audit, and environment readiness. Verdict: go, no-go, or conditional-go.
13
+
14
+ **Watch for:**
15
+ - Treating the release check as a formality and rubber-stamping items
16
+ - Validating only the happy path without checking error handling and edge cases
17
+ - Missing environment-specific config differences between staging and production
@@ -0,0 +1,17 @@
1
+ # Security Review
2
+
3
+ > Audit code for OWASP top 10 vulnerabilities, auth issues, data exposure, and injection risks.
4
+
5
+ **When to use:**
6
+ - New code handles user input, authentication, authorization, or sensitive data
7
+ - Feature touches payment processing, PII, or external integrations
8
+ - Pre-release security gate or dependency update with new/major packages
9
+
10
+ **Input:** Code to review (files, PR, or module reference), description of security-relevant behavior, threat model if available, and compliance requirements (SOC 2, GDPR, HIPAA, PCI-DSS).
11
+
12
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions). Deliverable is a list of findings with vulnerability type (CWE), severity (Critical/High/Medium/Low/Info), affected location, proof-of-concept, and remediation steps.
13
+
14
+ **Watch for:**
15
+ - Reporting only injection flaws while ignoring authorization and business logic issues
16
+ - Providing generic remediation ("sanitize input") instead of specific contextual fixes
17
+ - Missing security issues in config files, env vars, or build pipelines
@@ -0,0 +1,18 @@
1
+ # {{Agent Role}}
2
+
3
+ > {{one_line_description}}
4
+
5
+ **Owns:** {{what this agent is responsible for}}
6
+ **Receives from:** {{upstream agent}}
7
+ **Hands off to:** {{downstream agent}}
8
+
9
+ **Must produce:** context, assumptions, constraints, decision, deliverable, risks, open_questions, next_agent
10
+
11
+ **Must NOT:**
12
+ - {{boundary_1}}
13
+ - {{boundary_2}}
14
+ - {{boundary_3}}
15
+
16
+ **Quality bar:**
17
+ - {{standard_1}}
18
+ - {{standard_2}}
@@ -0,0 +1,21 @@
1
+ # /{{command_name}}
2
+
3
+ > {{one_line_description}}
4
+
5
+ **Position:** {{where in spec → plan → build → audit → checkpoint → ship}}
6
+ **Input:** {{what this command expects}}
7
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions, next_agent).
8
+
9
+ **When to use:**
10
+ - {{scenario_1}}
11
+ - {{scenario_2}}
12
+ - {{scenario_3}}
13
+
14
+ **Example:**
15
+ ```
16
+ > /{{command_name}} "{{brief_example}}"
17
+ context: {{example_context}}
18
+ decision: {{example_decision}}
19
+ deliverable: {{example_deliverable}}
20
+ next_agent: {{example_next}}
21
+ ```
@@ -0,0 +1,15 @@
1
+ # {{Skill Name}}
2
+
3
+ > {{one_line_description}}
4
+
5
+ **When to use:**
6
+ - {{trigger_1}}
7
+ - {{trigger_2}}
8
+
9
+ **Input:** {{what the skill expects}}
10
+
11
+ **Output:** Structured per ZenKit contract (context, assumptions, constraints, decision, deliverable, risks, open_questions).
12
+
13
+ **Watch for:**
14
+ - {{pitfall_1}}
15
+ - {{pitfall_2}}
@@ -0,0 +1,19 @@
1
+ # {{Task Name}}
2
+
3
+ **ID:** {{task_id}}
4
+ **Command:** {{spec|plan|build|audit|refactor|handoff|checkpoint|ship}}
5
+ **Status:** {{pending|in_progress|blocked|completed|failed|skipped}}
6
+ **Agent:** {{assigned_agent}}
7
+
8
+ ## Context
9
+ {{what_is_being_done_and_why}}
10
+
11
+ ## Acceptance Criteria
12
+ - {{criterion_1}}
13
+ - {{criterion_2}}
14
+
15
+ ## Constraints
16
+ - {{constraint_1}}
17
+
18
+ ## Dependencies
19
+ - {{dependency_task_id}}