@captain_z/zsk 1.7.0 → 1.8.2

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 (93) hide show
  1. package/dist/bin.js +196 -12
  2. package/dist/bin.js.map +1 -1
  3. package/dist/commands/check.js +107 -16
  4. package/dist/commands/check.js.map +1 -1
  5. package/dist/commands/config.d.ts +11 -0
  6. package/dist/commands/config.js +132 -3
  7. package/dist/commands/config.js.map +1 -1
  8. package/dist/commands/demo.js +2 -2
  9. package/dist/commands/demo.js.map +1 -1
  10. package/dist/commands/dispatch.d.ts +11 -0
  11. package/dist/commands/dispatch.js +69 -0
  12. package/dist/commands/dispatch.js.map +1 -0
  13. package/dist/commands/doctor.d.ts +4 -0
  14. package/dist/commands/doctor.js +102 -0
  15. package/dist/commands/doctor.js.map +1 -0
  16. package/dist/commands/gate.d.ts +9 -0
  17. package/dist/commands/gate.js +48 -0
  18. package/dist/commands/gate.js.map +1 -0
  19. package/dist/commands/issue.d.ts +2 -1
  20. package/dist/commands/issue.js +72 -27
  21. package/dist/commands/issue.js.map +1 -1
  22. package/dist/commands/module.js +32 -0
  23. package/dist/commands/module.js.map +1 -1
  24. package/dist/commands/prep.d.ts +2 -4
  25. package/dist/commands/prep.js +1 -37
  26. package/dist/commands/prep.js.map +1 -1
  27. package/dist/commands/prepare.d.ts +17 -0
  28. package/dist/commands/prepare.js +259 -0
  29. package/dist/commands/prepare.js.map +1 -0
  30. package/dist/commands/project-init.d.ts +1 -0
  31. package/dist/commands/project-init.js +28 -24
  32. package/dist/commands/project-init.js.map +1 -1
  33. package/dist/commands/template.d.ts +2 -0
  34. package/dist/commands/template.js +34 -0
  35. package/dist/commands/template.js.map +1 -0
  36. package/dist/core/config.d.ts +86 -1
  37. package/dist/core/config.js +181 -21
  38. package/dist/core/config.js.map +1 -1
  39. package/dist/core/origin-detection.d.ts +10 -0
  40. package/dist/core/origin-detection.js +135 -0
  41. package/dist/core/origin-detection.js.map +1 -0
  42. package/dist/core/prepare-lifecycle.d.ts +54 -0
  43. package/dist/core/prepare-lifecycle.js +302 -0
  44. package/dist/core/prepare-lifecycle.js.map +1 -0
  45. package/dist/core/prepare-sync.d.ts +82 -0
  46. package/dist/core/prepare-sync.js +1499 -0
  47. package/dist/core/prepare-sync.js.map +1 -0
  48. package/dist/core/raw-manifest.d.ts +20 -0
  49. package/dist/core/raw-manifest.js +105 -4
  50. package/dist/core/raw-manifest.js.map +1 -1
  51. package/dist/core/source-draft.d.ts +14 -0
  52. package/dist/core/source-draft.js +251 -0
  53. package/dist/core/source-draft.js.map +1 -0
  54. package/dist/core/staffing-plan.d.ts +206 -0
  55. package/dist/core/staffing-plan.js +1115 -0
  56. package/dist/core/staffing-plan.js.map +1 -0
  57. package/dist/core/stage-quality.d.ts +56 -0
  58. package/dist/core/stage-quality.js +487 -0
  59. package/dist/core/stage-quality.js.map +1 -0
  60. package/dist/core/template-registry.d.ts +29 -0
  61. package/dist/core/template-registry.js +289 -0
  62. package/dist/core/template-registry.js.map +1 -0
  63. package/dist/core/workspace-layout.d.ts +5 -3
  64. package/dist/core/workspace-layout.js +34 -20
  65. package/dist/core/workspace-layout.js.map +1 -1
  66. package/package.json +2 -2
  67. package/schemas/zsk-config.schema.json +257 -111
  68. package/templates/issue/default/issue.md +5 -1
  69. package/templates/module/frontend-module/design.md +93 -0
  70. package/templates/module/frontend-module/proposal.md +43 -1
  71. package/templates/module/frontend-module/spec.md +30 -0
  72. package/templates/module/frontend-module/tasks.md +43 -0
  73. package/templates/project-init/.zsk/config.yaml +8 -94
  74. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +34 -11
  75. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +37 -5
  76. package/templates/project-init/.zsk/modules/index.md +7 -0
  77. package/templates/project-init/.zsk/raws/index.md +15 -0
  78. package/templates/project-init/.zsk/raws/manifest.json +4 -0
  79. package/templates/project-init/.zsk/raws/prepare/backend/index.md +4 -0
  80. package/templates/project-init/.zsk/raws/prepare/design/index.md +3 -0
  81. package/templates/project-init/.zsk/raws/prepare/index.md +4 -0
  82. package/templates/project-init/.zsk/raws/prepare/product/index.md +4 -0
  83. package/templates/project-init/.zsk/raws/prepare/qa/index.md +4 -0
  84. package/templates/project-init/.zsk/raws/prepare/ux/index.md +3 -0
  85. package/templates/project-init/.zsk/roles.yaml +129 -0
  86. package/templates/project-init/.zsk/evidence/.gitkeep +0 -1
  87. package/templates/project-init/.zsk/issues/README.md +0 -58
  88. package/templates/project-init/.zsk/issues/_taxonomy.md +0 -35
  89. package/templates/project-init/.zsk/issues/index.md +0 -7
  90. package/templates/project-init/.zsk/modules/.gitkeep +0 -1
  91. package/templates/project-init/.zsk/plans/.gitkeep +0 -1
  92. package/templates/project-init/.zsk/playwright/.gitkeep +0 -1
  93. package/templates/project-init/.zsk/resources/.gitkeep +0 -1
@@ -2,10 +2,10 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema#",
3
3
  "$id": "https://unpkg.com/@captain_z/zsk/schemas/zsk-config.schema.json",
4
4
  "title": "ZSK Project Config",
5
- "description": "Project-level configuration for ZSK resource origins, workspace paths, tools, and module index locations.",
5
+ "description": "Project-level configuration for ZSK raw source origins, template defaults, workspace paths, tools, and module index locations.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
- "required": ["project", "paths", "sources", "tools", "modules"],
8
+ "required": ["project", "sources"],
9
9
  "properties": {
10
10
  "project": {
11
11
  "description": "Project identity used in generated docs and resource manifests.",
@@ -29,15 +29,91 @@
29
29
  }
30
30
  },
31
31
  "layoutVersion": {
32
- "description": "Workspace layout version. Version 2 keeps all zsk-managed outputs under .zsk/ by default.",
32
+ "description": "Workspace layout version. Version 2 keeps all zsk-managed outputs under .zsk/ by default and prefers paths.raws for fact sources.",
33
33
  "type": "integer",
34
34
  "minimum": 2
35
35
  },
36
+ "template": {
37
+ "description": "Template preset used to resolve omitted defaults. The default init template is founder-os.",
38
+ "oneOf": [
39
+ {
40
+ "type": "string",
41
+ "minLength": 1
42
+ },
43
+ {
44
+ "type": "object",
45
+ "additionalProperties": false,
46
+ "required": ["id"],
47
+ "properties": {
48
+ "id": {
49
+ "type": "string",
50
+ "minLength": 1
51
+ },
52
+ "version": {
53
+ "type": "integer",
54
+ "minimum": 1
55
+ },
56
+ "metadata": {
57
+ "$ref": "#/$defs/metadata"
58
+ }
59
+ }
60
+ }
61
+ ]
62
+ },
63
+ "mode": {
64
+ "description": "Template-specific operating mode. Keep as a string so projects can define their own modes without schema churn.",
65
+ "type": "string",
66
+ "minLength": 1
67
+ },
68
+ "scale": {
69
+ "description": "Template-specific project/team scale. Keep as a string so projects can define their own scales without schema churn.",
70
+ "type": "string",
71
+ "minLength": 1
72
+ },
73
+ "workflow": {
74
+ "description": "Optional explicit workflow profile selection. Detailed workflow rules can be ejected into .zsk/workflow.yaml.",
75
+ "type": "object",
76
+ "additionalProperties": false,
77
+ "properties": {
78
+ "profile": {
79
+ "type": "string",
80
+ "minLength": 1
81
+ },
82
+ "metadata": {
83
+ "$ref": "#/$defs/metadata"
84
+ }
85
+ }
86
+ },
87
+ "gates": {
88
+ "description": "Optional project-level quality gate policy. Omit to use template defaults; configure only when the project needs custom thresholds.",
89
+ "$ref": "#/$defs/gatesConfig"
90
+ },
91
+ "customize": {
92
+ "description": "Compact pointers to ejected project-local customization files.",
93
+ "type": "object",
94
+ "additionalProperties": true,
95
+ "properties": {
96
+ "roles": {
97
+ "$ref": "#/$defs/pathRef"
98
+ },
99
+ "workflow": {
100
+ "$ref": "#/$defs/pathRef"
101
+ },
102
+ "providers": {
103
+ "$ref": "#/$defs/pathRef"
104
+ },
105
+ "gates": {
106
+ "$ref": "#/$defs/pathRef"
107
+ },
108
+ "metadata": {
109
+ "$ref": "#/$defs/metadata"
110
+ }
111
+ }
112
+ },
36
113
  "paths": {
37
114
  "description": "Top-level project knowledge workspace paths.",
38
115
  "type": "object",
39
116
  "additionalProperties": false,
40
- "required": ["docs", "modules", "resources", "issues", "evidence", "playwright"],
41
117
  "properties": {
42
118
  "docs": {
43
119
  "$ref": "#/$defs/pathRef"
@@ -46,10 +122,11 @@
46
122
  "$ref": "#/$defs/pathRef"
47
123
  },
48
124
  "resources": {
125
+ "description": "Deprecated compatibility alias for paths.raws.",
49
126
  "$ref": "#/$defs/pathRef"
50
127
  },
51
128
  "raws": {
52
- "description": "Legacy resource root accepted only for compatibility with older workspaces.",
129
+ "description": "Preferred immutable raw fact-source root.",
53
130
  "$ref": "#/$defs/pathRef"
54
131
  },
55
132
  "issues": {
@@ -70,10 +147,10 @@
70
147
  }
71
148
  },
72
149
  "sources": {
73
- "description": "Project-level resource origins. May be empty after init and filled by AI or zsk config setup.",
150
+ "description": "Project-level raw source origins. Keep this concise: configure source roots or provider entry points, then let prepare materialize snapshots and indexes under paths.raws.",
74
151
  "type": "object",
75
152
  "additionalProperties": {
76
- "$ref": "#/$defs/sourceRef"
153
+ "$ref": "#/$defs/sourceTree"
77
154
  },
78
155
  "properties": {
79
156
  "metadata": {
@@ -85,7 +162,6 @@
85
162
  "description": "Preferred AI/tool capabilities for project-level workflows.",
86
163
  "type": "object",
87
164
  "additionalProperties": false,
88
- "required": ["runtime_ui", "design"],
89
165
  "properties": {
90
166
  "runtime_ui": {
91
167
  "description": "Preferred tools for runtime UI verification.",
@@ -96,7 +172,7 @@
96
172
  "uniqueItems": true
97
173
  },
98
174
  "design": {
99
- "description": "Preferred tools for design and Figma resource capture.",
175
+ "description": "Preferred tools for design source and asset capture.",
100
176
  "type": "array",
101
177
  "items": {
102
178
  "$ref": "#/$defs/toolName"
@@ -112,7 +188,6 @@
112
188
  "description": "Module discovery and module config locations.",
113
189
  "type": "object",
114
190
  "additionalProperties": false,
115
- "required": ["index", "root"],
116
191
  "properties": {
117
192
  "index": {
118
193
  "$ref": "#/$defs/pathRef"
@@ -224,8 +299,12 @@
224
299
  }
225
300
  }
226
301
  },
302
+ "staffing": {
303
+ "description": "Project-local role pool used by dispatch/staffing. Keep config.yaml concise by pointing rolePool at a .zsk YAML file, or define small inline overrides under roles.",
304
+ "$ref": "#/$defs/staffingConfig"
305
+ },
227
306
  "sync": {
228
- "description": "Optional deterministic or AI-assisted raw resource sync configuration.",
307
+ "description": "Optional deterministic or AI-assisted raw source sync configuration.",
229
308
  "type": "object",
230
309
  "additionalProperties": {
231
310
  "$ref": "#/$defs/syncRef"
@@ -242,9 +321,9 @@
242
321
  "minLength": 1
243
322
  },
244
323
  "toolName": {
245
- "description": "Known tool or capability name.",
324
+ "description": "Project-specific tool or capability name. ZSK does not restrict this to a fixed platform list.",
246
325
  "type": "string",
247
- "enum": ["computer_use", "browser_use", "playwright", "playwright_cli", "playwright_mcp", "figma_mcp", "script", "manual", "skill"]
326
+ "minLength": 1
248
327
  },
249
328
  "commandStage": {
250
329
  "description": "Automation command list for a workflow stage.",
@@ -268,12 +347,12 @@
268
347
  }
269
348
  },
270
349
  "sourceType": {
271
- "description": "Resource role.",
350
+ "description": "Raw source role. Common examples include srs, prd, design, api_contract, backend_repo, test_case, design_asset, vendor_doc, and manual, but projects may define their own roles.",
272
351
  "type": "string",
273
- "enum": ["srs", "prd", "design", "api_contract", "backend_repo", "test_case", "design_asset", "vendor_doc", "manual"]
352
+ "minLength": 1
274
353
  },
275
354
  "sourceRef": {
276
- "description": "Resource source reference.",
355
+ "description": "Raw source reference. `snapshot` is optional; when omitted, ZSK derives paths.raws/<source-path>/source.md and maintains index.md files in the raw source directories.",
277
356
  "type": "object",
278
357
  "additionalProperties": false,
279
358
  "required": ["type", "origin"],
@@ -285,6 +364,7 @@
285
364
  "$ref": "#/$defs/originRef"
286
365
  },
287
366
  "snapshot": {
367
+ "description": "Optional explicit materialized snapshot path. Omit this for entry-point sources such as a Figma file, Confluence space, repository, or issue query.",
288
368
  "$ref": "#/$defs/pathRef"
289
369
  },
290
370
  "metadata": {
@@ -292,75 +372,64 @@
292
372
  }
293
373
  }
294
374
  },
295
- "originRef": {
296
- "description": "Online or local source origin.",
375
+ "sourceTree": {
376
+ "description": "A raw source reference or a grouping object whose keys mirror .zsk/raws/prepare responsibility lanes.",
297
377
  "oneOf": [
298
378
  {
299
- "$ref": "#/$defs/urlOrigin"
300
- },
301
- {
302
- "$ref": "#/$defs/localOrigin"
303
- },
304
- {
305
- "$ref": "#/$defs/gitOrigin"
306
- },
307
- {
308
- "$ref": "#/$defs/figmaOrigin"
379
+ "$ref": "#/$defs/sourceRef"
309
380
  },
310
381
  {
311
- "$ref": "#/$defs/modaoOrigin"
312
- },
313
- {
314
- "$ref": "#/$defs/openapiOrigin"
315
- },
316
- {
317
- "$ref": "#/$defs/manualOrigin"
382
+ "$ref": "#/$defs/sourceGroup"
318
383
  }
319
384
  ]
320
385
  },
321
- "urlOrigin": {
386
+ "sourceGroup": {
387
+ "description": "Nested source grouping object.",
322
388
  "type": "object",
323
- "additionalProperties": false,
324
- "required": ["kind", "url"],
389
+ "additionalProperties": {
390
+ "$ref": "#/$defs/sourceTree"
391
+ },
325
392
  "properties": {
326
- "kind": {
327
- "type": "string",
328
- "const": "url"
329
- },
330
- "url": {
331
- "type": "string",
332
- "minLength": 1
333
- },
334
393
  "metadata": {
335
394
  "$ref": "#/$defs/metadata"
336
395
  }
337
396
  }
338
397
  },
339
- "localOrigin": {
398
+ "originRef": {
399
+ "description": "Generic online, local, or provider-managed source origin. `kind` names the acquisition mode, while fields such as provider, path, url, repository, query, jql, id, ref, and note are intentionally extensible.",
340
400
  "type": "object",
341
- "additionalProperties": false,
342
- "required": ["kind", "path"],
401
+ "additionalProperties": true,
402
+ "required": ["kind"],
343
403
  "properties": {
344
404
  "kind": {
345
405
  "type": "string",
346
- "const": "local"
406
+ "minLength": 1
407
+ },
408
+ "provider": {
409
+ "type": "string",
410
+ "minLength": 1
347
411
  },
348
412
  "path": {
349
413
  "$ref": "#/$defs/pathRef"
350
414
  },
351
- "metadata": {
352
- "$ref": "#/$defs/metadata"
353
- }
354
- }
355
- },
356
- "gitOrigin": {
357
- "type": "object",
358
- "additionalProperties": false,
359
- "required": ["kind", "repository"],
360
- "properties": {
361
- "kind": {
415
+ "csvPath": {
416
+ "$ref": "#/$defs/pathRef"
417
+ },
418
+ "csv": {
419
+ "$ref": "#/$defs/pathRef"
420
+ },
421
+ "exportPath": {
422
+ "$ref": "#/$defs/pathRef"
423
+ },
424
+ "assetPath": {
425
+ "$ref": "#/$defs/pathRef"
426
+ },
427
+ "filePath": {
428
+ "$ref": "#/$defs/pathRef"
429
+ },
430
+ "url": {
362
431
  "type": "string",
363
- "const": "git"
432
+ "minLength": 1
364
433
  },
365
434
  "repository": {
366
435
  "type": "string",
@@ -370,32 +439,19 @@
370
439
  "type": "string",
371
440
  "minLength": 1
372
441
  },
373
- "path": {
374
- "$ref": "#/$defs/pathRef"
375
- },
376
- "metadata": {
377
- "$ref": "#/$defs/metadata"
378
- }
379
- }
380
- },
381
- "figmaOrigin": {
382
- "type": "object",
383
- "additionalProperties": false,
384
- "required": ["kind", "url"],
385
- "properties": {
386
- "kind": {
442
+ "query": {
387
443
  "type": "string",
388
- "const": "figma"
444
+ "minLength": 1
389
445
  },
390
- "url": {
446
+ "jql": {
391
447
  "type": "string",
392
448
  "minLength": 1
393
449
  },
394
- "file_key": {
450
+ "id": {
395
451
  "type": "string",
396
452
  "minLength": 1
397
453
  },
398
- "node_id": {
454
+ "note": {
399
455
  "type": "string",
400
456
  "minLength": 1
401
457
  },
@@ -404,63 +460,145 @@
404
460
  }
405
461
  }
406
462
  },
407
- "modaoOrigin": {
463
+ "staffingConfig": {
408
464
  "type": "object",
409
465
  "additionalProperties": false,
410
- "required": ["kind", "url"],
411
466
  "properties": {
412
- "kind": {
413
- "type": "string",
414
- "const": "modao"
467
+ "rolePool": {
468
+ "$ref": "#/$defs/pathRef"
415
469
  },
416
- "url": {
417
- "type": "string",
418
- "minLength": 1
470
+ "timeoutPolicy": {
471
+ "$ref": "#/$defs/staffingTimeoutPolicy"
472
+ },
473
+ "roles": {
474
+ "$ref": "#/$defs/rolePoolRoles"
419
475
  },
420
476
  "metadata": {
421
477
  "$ref": "#/$defs/metadata"
422
478
  }
423
479
  }
424
480
  },
425
- "openapiOrigin": {
481
+ "gatesConfig": {
426
482
  "type": "object",
427
483
  "additionalProperties": false,
428
- "required": ["kind"],
429
484
  "properties": {
430
- "kind": {
431
- "type": "string",
432
- "const": "openapi"
485
+ "defaultThreshold": {
486
+ "type": "number",
487
+ "minimum": 0,
488
+ "maximum": 10
433
489
  },
434
- "url": {
435
- "type": "string",
436
- "minLength": 1
437
- },
438
- "path": {
439
- "$ref": "#/$defs/pathRef"
490
+ "thresholds": {
491
+ "type": "object",
492
+ "additionalProperties": {
493
+ "type": "number",
494
+ "minimum": 0,
495
+ "maximum": 10
496
+ }
440
497
  },
441
498
  "metadata": {
442
499
  "$ref": "#/$defs/metadata"
443
500
  }
444
- },
445
- "anyOf": [
446
- {
447
- "required": ["url"]
501
+ }
502
+ },
503
+ "staffingTimeoutPolicy": {
504
+ "type": "object",
505
+ "additionalProperties": false,
506
+ "properties": {
507
+ "heartbeatIntervalMs": {
508
+ "type": "integer",
509
+ "minimum": 1000
448
510
  },
449
- {
450
- "required": ["path"]
511
+ "staleAfterMs": {
512
+ "type": "integer",
513
+ "minimum": 1000
514
+ },
515
+ "maxAttempts": {
516
+ "type": "integer",
517
+ "minimum": 1
518
+ },
519
+ "onTimeout": {
520
+ "type": "string",
521
+ "enum": ["fallback-to-leader-sequential"]
522
+ },
523
+ "metadata": {
524
+ "$ref": "#/$defs/metadata"
451
525
  }
452
- ]
526
+ }
453
527
  },
454
- "manualOrigin": {
528
+ "rolePoolRoles": {
529
+ "type": "object",
530
+ "additionalProperties": {
531
+ "$ref": "#/$defs/rolePoolRole"
532
+ }
533
+ },
534
+ "rolePoolRole": {
455
535
  "type": "object",
456
536
  "additionalProperties": false,
457
- "required": ["kind", "note"],
458
537
  "properties": {
459
- "kind": {
538
+ "subagentType": {
460
539
  "type": "string",
461
- "const": "manual"
540
+ "minLength": 1
462
541
  },
463
- "note": {
542
+ "stages": {
543
+ "type": "array",
544
+ "items": {
545
+ "type": "string",
546
+ "minLength": 1
547
+ },
548
+ "uniqueItems": true
549
+ },
550
+ "skills": {
551
+ "type": "array",
552
+ "items": {
553
+ "type": "string",
554
+ "minLength": 1
555
+ },
556
+ "uniqueItems": true
557
+ },
558
+ "lanes": {
559
+ "type": "array",
560
+ "items": {
561
+ "type": "string",
562
+ "minLength": 1
563
+ },
564
+ "uniqueItems": true
565
+ },
566
+ "required": {
567
+ "type": "boolean"
568
+ },
569
+ "remoteSources": {
570
+ "type": "boolean"
571
+ },
572
+ "activation": {
573
+ "type": "string",
574
+ "minLength": 1
575
+ },
576
+ "reason": {
577
+ "type": "string",
578
+ "minLength": 1
579
+ },
580
+ "owns": {
581
+ "$ref": "#/$defs/stringList"
582
+ },
583
+ "doesNotOwn": {
584
+ "$ref": "#/$defs/stringList"
585
+ },
586
+ "inputs": {
587
+ "$ref": "#/$defs/stringList"
588
+ },
589
+ "writeScope": {
590
+ "$ref": "#/$defs/stringList"
591
+ },
592
+ "outputs": {
593
+ "$ref": "#/$defs/stringList"
594
+ },
595
+ "evidenceRequired": {
596
+ "$ref": "#/$defs/stringList"
597
+ },
598
+ "forbiddenDecisions": {
599
+ "$ref": "#/$defs/stringList"
600
+ },
601
+ "stopCondition": {
464
602
  "type": "string",
465
603
  "minLength": 1
466
604
  },
@@ -469,6 +607,14 @@
469
607
  }
470
608
  }
471
609
  },
610
+ "stringList": {
611
+ "type": "array",
612
+ "items": {
613
+ "type": "string",
614
+ "minLength": 1
615
+ },
616
+ "uniqueItems": true
617
+ },
472
618
  "scriptSync": {
473
619
  "description": "Resource produced by a deterministic script command.",
474
620
  "type": "object",
@@ -4,6 +4,10 @@
4
4
 
5
5
  __ISSUE_TYPE__
6
6
 
7
+ ## 作用域
8
+
9
+ __ISSUE_SCOPE__
10
+
7
11
  ## 问题级别
8
12
 
9
13
  __SEVERITY__
@@ -66,7 +70,7 @@ __SEVERITY__
66
70
  - [ ] `.zsk/modules/{module}/design.md`
67
71
  - [ ] `.zsk/modules/{module}/tasks.md`
68
72
  - [ ] `.zsk/docs/SYSTEM-SPEC.md`
69
- - [ ] `.zsk/resources`
73
+ - [ ] `.zsk/raws`
70
74
  - 更新内容或 no-update rationale:
71
75
  - 反哺时机:修复通过 verify 且经用户/产品确认后执行
72
76
 
@@ -1,5 +1,88 @@
1
1
  # __MODULE_NAME__ Design
2
2
 
3
+ ## Project Rules Gate
4
+
5
+ | Rule Source | Rule / Constraint | Design Impact | Status |
6
+ | --- | --- | --- | --- |
7
+ | `.zsk/docs/PROJECT-CONFIG.md` | | | TODO |
8
+ | `.zsk/docs/SYSTEM-SPEC.md` | | | TODO |
9
+
10
+ Do not approve this design until project-level path boundaries, evidence routing, issue routing, source priority, and stage-document rules are mapped to implementation surfaces or recorded as blockers.
11
+
12
+ ## Implementation Map
13
+
14
+ | Requirement / AC | Surface | Files / Modules | Interface / State / Data Flow | Risk |
15
+ | --- | --- | --- | --- | --- |
16
+ | FR-001 / AC-001 | | | | |
17
+
18
+ ## Design Views
19
+
20
+ Use Mermaid or linked configured design-source evidence to make boundaries, flows, states, and dependencies reviewable. Keep a view N/A only with rationale.
21
+
22
+ ### Context / Container View
23
+
24
+ ```mermaid
25
+ flowchart LR
26
+ User[User / Actor] --> App[Module / Application]
27
+ App --> API[API / Service]
28
+ API --> Data[(Data Store)]
29
+ ```
30
+
31
+ Clarifies:
32
+ - Spec / AC:
33
+ - Decision / risk / verification path:
34
+
35
+ ### Sequence / Flow View
36
+
37
+ ```mermaid
38
+ sequenceDiagram
39
+ actor User
40
+ participant UI as UI
41
+ participant API as API
42
+ User->>UI: Trigger scenario
43
+ UI->>API: Request
44
+ API-->>UI: Response
45
+ UI-->>User: Observable result
46
+ ```
47
+
48
+ Clarifies:
49
+ - Spec / AC:
50
+ - Decision / risk / verification path:
51
+
52
+ ### State View
53
+
54
+ ```mermaid
55
+ stateDiagram-v2
56
+ [*] --> Loading
57
+ Loading --> Success
58
+ Loading --> Error
59
+ Error --> Retry
60
+ Retry --> Loading
61
+ ```
62
+
63
+ Clarifies:
64
+ - Spec / AC:
65
+ - Decision / risk / verification path:
66
+
67
+ ### Data Flow / UX Flow View
68
+
69
+ N/A rationale or diagram:
70
+
71
+ ## Decisions
72
+
73
+ | Decision | Alternatives Rejected | Rationale / Evidence | Rollback / Migration Note |
74
+ | --- | --- | --- | --- |
75
+ | | | | |
76
+
77
+ ## States And Failure Modes
78
+
79
+ | State | User/System Observable Behavior | Test / Demo Evidence |
80
+ | --- | --- | --- |
81
+ | loading | | |
82
+ | empty | | |
83
+ | error | | |
84
+ | permission | | |
85
+
3
86
  ## Playwright Locator And State Strategy
4
87
 
5
88
  | Scenario | Page / Route | Preferred Locator Strategy | State Coverage | API / Mock | Auth / Storage | Evidence |
@@ -11,6 +94,16 @@ Guidelines:
11
94
  - Prefer user-facing locators: `getByRole`, `getByLabel`, `getByPlaceholder`, `getByTestId`.
12
95
  - Add implementation tasks for missing accessible names, labels, or stable test ids.
13
96
  - Define auth/storage reuse before demo so Playwright can run repeatably.
97
+ - Keep generated docs, issues, evidence, and Playwright assets inside the `.zsk` paths required by `PROJECT-CONFIG.md` and `SYSTEM-SPEC.md`.
98
+ - Route unclear behavior back to spec instead of redesigning requirements here.
99
+
100
+ ## Best-Practice Checklist
101
+
102
+ - [ ] Behavior maps to files/modules/interfaces/state/data flow without changing approved requirements.
103
+ - [ ] Design includes useful diagrams/charts for context, flow, state, data, dependency, or UX where complexity requires them; otherwise N/A rationale is explicit.
104
+ - [ ] Security/auth/privacy, migration/rollback, performance, and rollout risks are recorded when touched.
105
+ - [ ] UI work includes accessible locator/state strategy and Playwright evidence needs.
106
+ - [ ] Project military rules from `PROJECT-CONFIG.md` and `SYSTEM-SPEC.md` are enforced or blocked.
14
107
 
15
108
  ## Documentation Feedback
16
109