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,765 @@
1
+ export declare const schemas: {
2
+ readonly handoff: {
3
+ $schema: string;
4
+ $id: string;
5
+ title: string;
6
+ description: string;
7
+ type: string;
8
+ required: string[];
9
+ properties: {
10
+ context: {
11
+ type: string;
12
+ description: string;
13
+ };
14
+ assumptions: {
15
+ type: string;
16
+ items: {
17
+ type: string;
18
+ };
19
+ description: string;
20
+ };
21
+ constraints: {
22
+ type: string;
23
+ items: {
24
+ type: string;
25
+ };
26
+ description: string;
27
+ };
28
+ decision: {
29
+ type: string;
30
+ description: string;
31
+ };
32
+ deliverable: {
33
+ type: string;
34
+ properties: {
35
+ type: {
36
+ type: string;
37
+ enum: string[];
38
+ };
39
+ description: {
40
+ type: string;
41
+ };
42
+ files_changed: {
43
+ type: string;
44
+ items: {
45
+ type: string;
46
+ };
47
+ };
48
+ validation_status: {
49
+ type: string;
50
+ enum: string[];
51
+ };
52
+ };
53
+ required: string[];
54
+ };
55
+ risks: {
56
+ type: string;
57
+ items: {
58
+ type: string;
59
+ properties: {
60
+ description: {
61
+ type: string;
62
+ };
63
+ severity: {
64
+ type: string;
65
+ enum: string[];
66
+ };
67
+ mitigation: {
68
+ type: string;
69
+ };
70
+ };
71
+ required: string[];
72
+ };
73
+ };
74
+ open_questions: {
75
+ type: string;
76
+ items: {
77
+ type: string;
78
+ };
79
+ description: string;
80
+ };
81
+ next_agent: {
82
+ type: string;
83
+ description: string;
84
+ };
85
+ metadata: {
86
+ type: string;
87
+ properties: {
88
+ timestamp: {
89
+ type: string;
90
+ format: string;
91
+ };
92
+ source_agent: {
93
+ type: string;
94
+ };
95
+ command: {
96
+ type: string;
97
+ };
98
+ iteration: {
99
+ type: string;
100
+ minimum: number;
101
+ };
102
+ };
103
+ };
104
+ };
105
+ additionalProperties: boolean;
106
+ };
107
+ readonly task: {
108
+ $schema: string;
109
+ $id: string;
110
+ title: string;
111
+ description: string;
112
+ type: string;
113
+ required: string[];
114
+ properties: {
115
+ id: {
116
+ type: string;
117
+ pattern: string;
118
+ };
119
+ name: {
120
+ type: string;
121
+ minLength: number;
122
+ maxLength: number;
123
+ };
124
+ description: {
125
+ type: string;
126
+ };
127
+ command: {
128
+ type: string;
129
+ enum: string[];
130
+ };
131
+ status: {
132
+ type: string;
133
+ enum: string[];
134
+ };
135
+ context: {
136
+ type: string;
137
+ };
138
+ assumptions: {
139
+ type: string;
140
+ items: {
141
+ type: string;
142
+ };
143
+ };
144
+ constraints: {
145
+ type: string;
146
+ items: {
147
+ type: string;
148
+ };
149
+ };
150
+ acceptance_criteria: {
151
+ type: string;
152
+ items: {
153
+ type: string;
154
+ };
155
+ };
156
+ files_affected: {
157
+ type: string;
158
+ items: {
159
+ type: string;
160
+ };
161
+ };
162
+ assigned_agent: {
163
+ type: string;
164
+ };
165
+ parent_task: {
166
+ type: string;
167
+ };
168
+ dependencies: {
169
+ type: string;
170
+ items: {
171
+ type: string;
172
+ };
173
+ };
174
+ metadata: {
175
+ type: string;
176
+ properties: {
177
+ created_at: {
178
+ type: string;
179
+ format: string;
180
+ };
181
+ updated_at: {
182
+ type: string;
183
+ format: string;
184
+ };
185
+ estimated_tokens: {
186
+ type: string;
187
+ minimum: number;
188
+ };
189
+ actual_tokens: {
190
+ type: string;
191
+ minimum: number;
192
+ };
193
+ };
194
+ };
195
+ };
196
+ additionalProperties: boolean;
197
+ };
198
+ readonly audit: {
199
+ $schema: string;
200
+ $id: string;
201
+ title: string;
202
+ description: string;
203
+ type: string;
204
+ required: string[];
205
+ properties: {
206
+ task_id: {
207
+ type: string;
208
+ };
209
+ auditor: {
210
+ type: string;
211
+ description: string;
212
+ };
213
+ timestamp: {
214
+ type: string;
215
+ format: string;
216
+ };
217
+ verdict: {
218
+ type: string;
219
+ enum: string[];
220
+ };
221
+ findings: {
222
+ type: string;
223
+ items: {
224
+ type: string;
225
+ required: string[];
226
+ properties: {
227
+ category: {
228
+ type: string;
229
+ enum: string[];
230
+ };
231
+ severity: {
232
+ type: string;
233
+ enum: string[];
234
+ };
235
+ description: {
236
+ type: string;
237
+ };
238
+ file: {
239
+ type: string;
240
+ };
241
+ line: {
242
+ type: string;
243
+ };
244
+ suggestion: {
245
+ type: string;
246
+ };
247
+ };
248
+ };
249
+ };
250
+ rubric_scores: {
251
+ type: string;
252
+ properties: {
253
+ execution_quality: {
254
+ type: string;
255
+ minimum: number;
256
+ maximum: number;
257
+ };
258
+ verbosity_score: {
259
+ type: string;
260
+ minimum: number;
261
+ maximum: number;
262
+ };
263
+ architectural_alignment: {
264
+ type: string;
265
+ minimum: number;
266
+ maximum: number;
267
+ };
268
+ };
269
+ };
270
+ open_questions: {
271
+ type: string;
272
+ items: {
273
+ type: string;
274
+ };
275
+ };
276
+ recommendations: {
277
+ type: string;
278
+ items: {
279
+ type: string;
280
+ };
281
+ };
282
+ };
283
+ additionalProperties: boolean;
284
+ };
285
+ readonly checkpoint: {
286
+ $schema: string;
287
+ $id: string;
288
+ title: string;
289
+ description: string;
290
+ type: string;
291
+ required: string[];
292
+ properties: {
293
+ checkpoint_id: {
294
+ type: string;
295
+ pattern: string;
296
+ };
297
+ task_id: {
298
+ type: string;
299
+ };
300
+ timestamp: {
301
+ type: string;
302
+ format: string;
303
+ };
304
+ status: {
305
+ type: string;
306
+ enum: string[];
307
+ };
308
+ stage: {
309
+ type: string;
310
+ enum: string[];
311
+ };
312
+ state: {
313
+ type: string;
314
+ properties: {
315
+ files_changed: {
316
+ type: string;
317
+ items: {
318
+ type: string;
319
+ };
320
+ };
321
+ tests_passing: {
322
+ type: string;
323
+ };
324
+ lint_passing: {
325
+ type: string;
326
+ };
327
+ git_ref: {
328
+ type: string;
329
+ };
330
+ notes: {
331
+ type: string;
332
+ };
333
+ };
334
+ };
335
+ gate_conditions: {
336
+ type: string;
337
+ items: {
338
+ type: string;
339
+ properties: {
340
+ condition: {
341
+ type: string;
342
+ };
343
+ met: {
344
+ type: string;
345
+ };
346
+ };
347
+ required: string[];
348
+ };
349
+ };
350
+ metadata: {
351
+ type: string;
352
+ properties: {
353
+ agent: {
354
+ type: string;
355
+ };
356
+ command: {
357
+ type: string;
358
+ };
359
+ iteration: {
360
+ type: string;
361
+ };
362
+ tokens_used: {
363
+ type: string;
364
+ };
365
+ cost_estimate_usd: {
366
+ type: string;
367
+ };
368
+ };
369
+ };
370
+ };
371
+ additionalProperties: boolean;
372
+ };
373
+ readonly benchmark: {
374
+ $schema: string;
375
+ $id: string;
376
+ title: string;
377
+ description: string;
378
+ type: string;
379
+ required: string[];
380
+ properties: {
381
+ benchmark_id: {
382
+ type: string;
383
+ };
384
+ version: {
385
+ type: string;
386
+ };
387
+ mode: {
388
+ type: string;
389
+ enum: string[];
390
+ description: string;
391
+ };
392
+ task_name: {
393
+ type: string;
394
+ };
395
+ feature_spec: {
396
+ type: string;
397
+ };
398
+ started_at: {
399
+ type: string;
400
+ format: string;
401
+ };
402
+ completed_at: {
403
+ type: string;
404
+ format: string;
405
+ };
406
+ duration_ms: {
407
+ type: string;
408
+ minimum: number;
409
+ };
410
+ status: {
411
+ type: string;
412
+ enum: string[];
413
+ };
414
+ expected_files: {
415
+ type: string;
416
+ items: {
417
+ type: string;
418
+ };
419
+ };
420
+ files_found: {
421
+ type: string;
422
+ items: {
423
+ type: string;
424
+ };
425
+ };
426
+ files_missing: {
427
+ type: string;
428
+ items: {
429
+ type: string;
430
+ };
431
+ };
432
+ acceptance_criteria_results: {
433
+ type: string;
434
+ items: {
435
+ type: string;
436
+ required: string[];
437
+ properties: {
438
+ id: {
439
+ type: string;
440
+ };
441
+ description: {
442
+ type: string;
443
+ };
444
+ status: {
445
+ type: string;
446
+ enum: string[];
447
+ };
448
+ evidence: {
449
+ type: string;
450
+ description: string;
451
+ };
452
+ verification_type: {
453
+ type: string;
454
+ };
455
+ };
456
+ };
457
+ };
458
+ stages: {
459
+ type: string;
460
+ items: {
461
+ type: string;
462
+ required: string[];
463
+ properties: {
464
+ name: {
465
+ type: string;
466
+ };
467
+ status: {
468
+ type: string;
469
+ enum: string[];
470
+ };
471
+ duration_ms: {
472
+ type: string;
473
+ };
474
+ checks_run: {
475
+ type: string;
476
+ minimum: number;
477
+ };
478
+ checks_passed: {
479
+ type: string;
480
+ minimum: number;
481
+ };
482
+ details: {
483
+ type: string;
484
+ items: {
485
+ type: string;
486
+ };
487
+ };
488
+ };
489
+ };
490
+ };
491
+ validation_summary: {
492
+ type: string;
493
+ required: string[];
494
+ properties: {
495
+ total_criteria: {
496
+ type: string;
497
+ };
498
+ criteria_passed: {
499
+ type: string;
500
+ };
501
+ criteria_failed: {
502
+ type: string;
503
+ };
504
+ schemas_valid: {
505
+ type: string;
506
+ };
507
+ examples_valid: {
508
+ type: string;
509
+ };
510
+ };
511
+ };
512
+ telemetry: {
513
+ type: string;
514
+ required: string[];
515
+ properties: {
516
+ estimated: {
517
+ type: string;
518
+ required: string[];
519
+ properties: {
520
+ tokens: {
521
+ type: string;
522
+ };
523
+ cost_usd: {
524
+ type: string;
525
+ };
526
+ basis: {
527
+ type: string;
528
+ description: string;
529
+ };
530
+ };
531
+ };
532
+ actual: {
533
+ oneOf: ({
534
+ type: string;
535
+ required?: undefined;
536
+ properties?: undefined;
537
+ } | {
538
+ type: string;
539
+ required: string[];
540
+ properties: {
541
+ tokens: {
542
+ type: string;
543
+ };
544
+ cost_usd: {
545
+ type: string;
546
+ };
547
+ };
548
+ })[];
549
+ description: string;
550
+ };
551
+ };
552
+ };
553
+ uncertainty: {
554
+ type: string;
555
+ items: {
556
+ type: string;
557
+ };
558
+ description: string;
559
+ };
560
+ limitations: {
561
+ type: string;
562
+ items: {
563
+ type: string;
564
+ };
565
+ description: string;
566
+ };
567
+ };
568
+ additionalProperties: boolean;
569
+ };
570
+ readonly 'feature-spec': {
571
+ $schema: string;
572
+ $id: string;
573
+ title: string;
574
+ description: string;
575
+ type: string;
576
+ required: string[];
577
+ properties: {
578
+ feature_id: {
579
+ type: string;
580
+ pattern: string;
581
+ };
582
+ name: {
583
+ type: string;
584
+ minLength: number;
585
+ };
586
+ description: {
587
+ type: string;
588
+ };
589
+ mode: {
590
+ type: string;
591
+ enum: string[];
592
+ };
593
+ acceptance_criteria: {
594
+ type: string;
595
+ minItems: number;
596
+ items: {
597
+ type: string;
598
+ required: string[];
599
+ properties: {
600
+ id: {
601
+ type: string;
602
+ };
603
+ description: {
604
+ type: string;
605
+ };
606
+ verification: {
607
+ type: string;
608
+ required: string[];
609
+ properties: {
610
+ type: {
611
+ type: string;
612
+ enum: string[];
613
+ };
614
+ path: {
615
+ type: string;
616
+ };
617
+ pattern: {
618
+ type: string;
619
+ };
620
+ command: {
621
+ type: string;
622
+ description: string;
623
+ };
624
+ json_path: {
625
+ type: string;
626
+ description: string;
627
+ };
628
+ equals: {
629
+ description: string;
630
+ };
631
+ expected: {
632
+ type: string;
633
+ };
634
+ };
635
+ };
636
+ };
637
+ };
638
+ };
639
+ constraints: {
640
+ type: string;
641
+ items: {
642
+ type: string;
643
+ };
644
+ };
645
+ expected_files: {
646
+ type: string;
647
+ items: {
648
+ type: string;
649
+ };
650
+ };
651
+ assigned_commands: {
652
+ type: string;
653
+ items: {
654
+ type: string;
655
+ };
656
+ };
657
+ estimated_complexity: {
658
+ type: string;
659
+ enum: string[];
660
+ };
661
+ limitations: {
662
+ type: string;
663
+ minItems: number;
664
+ items: {
665
+ type: string;
666
+ };
667
+ description: string;
668
+ };
669
+ };
670
+ additionalProperties: boolean;
671
+ };
672
+ };
673
+ export type SchemaName = keyof typeof schemas;
674
+ export interface ValidationError {
675
+ path: string;
676
+ message: string;
677
+ keyword: string;
678
+ }
679
+ export interface ValidationResult {
680
+ valid: boolean;
681
+ errors: ValidationError[];
682
+ schemaName: SchemaName;
683
+ }
684
+ /**
685
+ * Validate data against a named ZenKit schema.
686
+ *
687
+ * @example
688
+ * const result = validate('handoff', { context: '...', ... })
689
+ * if (!result.valid) console.error(result.errors)
690
+ */
691
+ export declare function validate(schemaName: SchemaName, data: unknown): ValidationResult;
692
+ /**
693
+ * Get the raw JSON Schema object for a named schema.
694
+ */
695
+ export declare function getSchema(name: SchemaName): object;
696
+ /**
697
+ * List all available schema names.
698
+ */
699
+ export declare function getSchemaNames(): SchemaName[];
700
+ export interface Verification {
701
+ type: string;
702
+ path?: string;
703
+ pattern?: string;
704
+ expected?: number;
705
+ command?: string;
706
+ json_path?: string;
707
+ equals?: unknown;
708
+ }
709
+ export interface AcceptanceCriterion {
710
+ id: string;
711
+ description: string;
712
+ verification: Verification;
713
+ }
714
+ export interface FeatureSpec {
715
+ feature_id: string;
716
+ name: string;
717
+ description: string;
718
+ mode: 'zenkit' | 'baseline';
719
+ acceptance_criteria: AcceptanceCriterion[];
720
+ constraints: string[];
721
+ expected_files: string[];
722
+ assigned_commands: string[];
723
+ estimated_complexity: string;
724
+ limitations: string[];
725
+ }
726
+ /**
727
+ * Load and validate a feature spec from a JSON file.
728
+ * Returns the parsed spec if valid, throws if invalid.
729
+ */
730
+ export declare function loadFeatureSpec(specPath: string): FeatureSpec;
731
+ export interface Deliverable {
732
+ type: 'code' | 'document' | 'schema' | 'plan' | 'review' | 'test' | 'artifact';
733
+ description: string;
734
+ files_changed?: string[];
735
+ validation_status?: 'passed' | 'failed' | 'partial' | 'untested';
736
+ }
737
+ export interface Risk {
738
+ description: string;
739
+ severity: 'low' | 'medium' | 'high' | 'critical';
740
+ mitigation?: string;
741
+ }
742
+ export interface Handoff {
743
+ context: string;
744
+ assumptions: string[];
745
+ constraints?: string[];
746
+ decision: string;
747
+ deliverable: Deliverable;
748
+ risks?: Risk[];
749
+ open_questions?: string[];
750
+ next_agent: string;
751
+ metadata?: {
752
+ timestamp?: string;
753
+ source_agent?: string;
754
+ command?: string;
755
+ iteration?: number;
756
+ };
757
+ }
758
+ /**
759
+ * Create and validate a handoff object.
760
+ * Returns the handoff if valid, throws if invalid.
761
+ */
762
+ export declare function createHandoff(handoff: Handoff): Handoff;
763
+ /** @deprecated Use `validate` instead */
764
+ export declare const validateAgainstSchema: typeof validate;
765
+ //# sourceMappingURL=index.d.ts.map