@captain_z/zsk 1.7.0 → 1.8.1

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 (56) hide show
  1. package/dist/bin.js +16 -11
  2. package/dist/bin.js.map +1 -1
  3. package/dist/commands/check.js +32 -12
  4. package/dist/commands/check.js.map +1 -1
  5. package/dist/commands/config.js +2 -2
  6. package/dist/commands/config.js.map +1 -1
  7. package/dist/commands/demo.js +2 -2
  8. package/dist/commands/demo.js.map +1 -1
  9. package/dist/commands/doctor.d.ts +4 -0
  10. package/dist/commands/doctor.js +102 -0
  11. package/dist/commands/doctor.js.map +1 -0
  12. package/dist/commands/issue.d.ts +2 -1
  13. package/dist/commands/issue.js +72 -27
  14. package/dist/commands/issue.js.map +1 -1
  15. package/dist/commands/module.js +32 -0
  16. package/dist/commands/module.js.map +1 -1
  17. package/dist/commands/prep.js +97 -3
  18. package/dist/commands/prep.js.map +1 -1
  19. package/dist/commands/project-init.js +23 -21
  20. package/dist/commands/project-init.js.map +1 -1
  21. package/dist/core/config.d.ts +1 -0
  22. package/dist/core/config.js +40 -14
  23. package/dist/core/config.js.map +1 -1
  24. package/dist/core/raw-manifest.d.ts +10 -0
  25. package/dist/core/raw-manifest.js +48 -1
  26. package/dist/core/raw-manifest.js.map +1 -1
  27. package/dist/core/workspace-layout.d.ts +2 -3
  28. package/dist/core/workspace-layout.js +21 -20
  29. package/dist/core/workspace-layout.js.map +1 -1
  30. package/package.json +2 -2
  31. package/schemas/zsk-config.schema.json +122 -13
  32. package/templates/issue/default/issue.md +5 -1
  33. package/templates/module/frontend-module/design.md +22 -0
  34. package/templates/module/frontend-module/proposal.md +26 -1
  35. package/templates/module/frontend-module/spec.md +13 -0
  36. package/templates/module/frontend-module/tasks.md +13 -0
  37. package/templates/project-init/.zsk/config.yaml +20 -18
  38. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +34 -11
  39. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +37 -5
  40. package/templates/project-init/.zsk/modules/index.md +7 -0
  41. package/templates/project-init/.zsk/raws/backend/index.md +3 -0
  42. package/templates/project-init/.zsk/raws/index.md +7 -0
  43. package/templates/project-init/.zsk/raws/jira/index.md +3 -0
  44. package/templates/project-init/.zsk/raws/manifest.json +4 -0
  45. package/templates/project-init/.zsk/raws/manual/index.md +3 -0
  46. package/templates/project-init/.zsk/raws/product/index.md +3 -0
  47. package/templates/project-init/.zsk/raws/qa/index.md +3 -0
  48. package/templates/project-init/.zsk/raws/ue/index.md +3 -0
  49. package/templates/project-init/.zsk/evidence/.gitkeep +0 -1
  50. package/templates/project-init/.zsk/issues/README.md +0 -58
  51. package/templates/project-init/.zsk/issues/_taxonomy.md +0 -35
  52. package/templates/project-init/.zsk/issues/index.md +0 -7
  53. package/templates/project-init/.zsk/modules/.gitkeep +0 -1
  54. package/templates/project-init/.zsk/plans/.gitkeep +0 -1
  55. package/templates/project-init/.zsk/playwright/.gitkeep +0 -1
  56. package/templates/project-init/.zsk/resources/.gitkeep +0 -1
@@ -2,7 +2,7 @@
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, workspace paths, tools, and module index locations.",
6
6
  "type": "object",
7
7
  "additionalProperties": false,
8
8
  "required": ["project", "paths", "sources", "tools", "modules"],
@@ -29,7 +29,7 @@
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
  },
@@ -37,7 +37,15 @@
37
37
  "description": "Top-level project knowledge workspace paths.",
38
38
  "type": "object",
39
39
  "additionalProperties": false,
40
- "required": ["docs", "modules", "resources", "issues", "evidence", "playwright"],
40
+ "required": ["docs", "modules", "issues", "evidence", "playwright"],
41
+ "anyOf": [
42
+ {
43
+ "required": ["raws"]
44
+ },
45
+ {
46
+ "required": ["resources"]
47
+ }
48
+ ],
41
49
  "properties": {
42
50
  "docs": {
43
51
  "$ref": "#/$defs/pathRef"
@@ -46,10 +54,11 @@
46
54
  "$ref": "#/$defs/pathRef"
47
55
  },
48
56
  "resources": {
57
+ "description": "Deprecated compatibility alias for paths.raws.",
49
58
  "$ref": "#/$defs/pathRef"
50
59
  },
51
60
  "raws": {
52
- "description": "Legacy resource root accepted only for compatibility with older workspaces.",
61
+ "description": "Preferred immutable raw fact-source root.",
53
62
  "$ref": "#/$defs/pathRef"
54
63
  },
55
64
  "issues": {
@@ -61,16 +70,13 @@
61
70
  "playwright": {
62
71
  "$ref": "#/$defs/pathRef"
63
72
  },
64
- "plans": {
65
- "$ref": "#/$defs/pathRef"
66
- },
67
73
  "metadata": {
68
74
  "$ref": "#/$defs/metadata"
69
75
  }
70
76
  }
71
77
  },
72
78
  "sources": {
73
- "description": "Project-level resource origins. May be empty after init and filled by AI or zsk config setup.",
79
+ "description": "Project-level raw source origins. May be empty after init and filled by AI or zsk config setup.",
74
80
  "type": "object",
75
81
  "additionalProperties": {
76
82
  "$ref": "#/$defs/sourceRef"
@@ -96,7 +102,7 @@
96
102
  "uniqueItems": true
97
103
  },
98
104
  "design": {
99
- "description": "Preferred tools for design and Figma resource capture.",
105
+ "description": "Preferred tools for design source and asset capture.",
100
106
  "type": "array",
101
107
  "items": {
102
108
  "$ref": "#/$defs/toolName"
@@ -225,7 +231,7 @@
225
231
  }
226
232
  },
227
233
  "sync": {
228
- "description": "Optional deterministic or AI-assisted raw resource sync configuration.",
234
+ "description": "Optional deterministic or AI-assisted raw source sync configuration.",
229
235
  "type": "object",
230
236
  "additionalProperties": {
231
237
  "$ref": "#/$defs/syncRef"
@@ -268,12 +274,12 @@
268
274
  }
269
275
  },
270
276
  "sourceType": {
271
- "description": "Resource role.",
277
+ "description": "Raw source role.",
272
278
  "type": "string",
273
279
  "enum": ["srs", "prd", "design", "api_contract", "backend_repo", "test_case", "design_asset", "vendor_doc", "manual"]
274
280
  },
275
281
  "sourceRef": {
276
- "description": "Resource source reference.",
282
+ "description": "Raw source reference.",
277
283
  "type": "object",
278
284
  "additionalProperties": false,
279
285
  "required": ["type", "origin"],
@@ -310,9 +316,18 @@
310
316
  {
311
317
  "$ref": "#/$defs/modaoOrigin"
312
318
  },
319
+ {
320
+ "$ref": "#/$defs/designOrigin"
321
+ },
313
322
  {
314
323
  "$ref": "#/$defs/openapiOrigin"
315
324
  },
325
+ {
326
+ "$ref": "#/$defs/jiraOrigin"
327
+ },
328
+ {
329
+ "$ref": "#/$defs/srsOrigin"
330
+ },
316
331
  {
317
332
  "$ref": "#/$defs/manualOrigin"
318
333
  }
@@ -360,7 +375,7 @@
360
375
  "properties": {
361
376
  "kind": {
362
377
  "type": "string",
363
- "const": "git"
378
+ "enum": ["git", "git-submodule"]
364
379
  },
365
380
  "repository": {
366
381
  "type": "string",
@@ -422,6 +437,35 @@
422
437
  }
423
438
  }
424
439
  },
440
+ "designOrigin": {
441
+ "type": "object",
442
+ "additionalProperties": false,
443
+ "required": ["kind", "provider"],
444
+ "properties": {
445
+ "kind": {
446
+ "type": "string",
447
+ "const": "design"
448
+ },
449
+ "provider": {
450
+ "type": "string",
451
+ "minLength": 1
452
+ },
453
+ "url": {
454
+ "type": "string",
455
+ "minLength": 1
456
+ },
457
+ "path": {
458
+ "$ref": "#/$defs/pathRef"
459
+ },
460
+ "id": {
461
+ "type": "string",
462
+ "minLength": 1
463
+ },
464
+ "metadata": {
465
+ "$ref": "#/$defs/metadata"
466
+ }
467
+ }
468
+ },
425
469
  "openapiOrigin": {
426
470
  "type": "object",
427
471
  "additionalProperties": false,
@@ -451,6 +495,71 @@
451
495
  }
452
496
  ]
453
497
  },
498
+ "jiraOrigin": {
499
+ "type": "object",
500
+ "additionalProperties": false,
501
+ "required": ["kind"],
502
+ "properties": {
503
+ "kind": {
504
+ "type": "string",
505
+ "const": "jira"
506
+ },
507
+ "url": {
508
+ "type": "string",
509
+ "minLength": 1
510
+ },
511
+ "path": {
512
+ "$ref": "#/$defs/pathRef"
513
+ },
514
+ "jql": {
515
+ "type": "string",
516
+ "minLength": 1
517
+ },
518
+ "metadata": {
519
+ "$ref": "#/$defs/metadata"
520
+ }
521
+ },
522
+ "anyOf": [
523
+ {
524
+ "required": ["url"]
525
+ },
526
+ {
527
+ "required": ["path"]
528
+ },
529
+ {
530
+ "required": ["jql"]
531
+ }
532
+ ]
533
+ },
534
+ "srsOrigin": {
535
+ "type": "object",
536
+ "additionalProperties": false,
537
+ "required": ["kind"],
538
+ "properties": {
539
+ "kind": {
540
+ "type": "string",
541
+ "const": "srs"
542
+ },
543
+ "url": {
544
+ "type": "string",
545
+ "minLength": 1
546
+ },
547
+ "path": {
548
+ "$ref": "#/$defs/pathRef"
549
+ },
550
+ "metadata": {
551
+ "$ref": "#/$defs/metadata"
552
+ }
553
+ },
554
+ "anyOf": [
555
+ {
556
+ "required": ["url"]
557
+ },
558
+ {
559
+ "required": ["path"]
560
+ }
561
+ ]
562
+ },
454
563
  "manualOrigin": {
455
564
  "type": "object",
456
565
  "additionalProperties": false,
@@ -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,26 @@
1
1
  # __MODULE_NAME__ Design
2
2
 
3
+ ## Implementation Map
4
+
5
+ | Requirement / AC | Surface | Files / Modules | Interface / State / Data Flow | Risk |
6
+ | --- | --- | --- | --- | --- |
7
+ | FR-001 / AC-001 | | | | |
8
+
9
+ ## Decisions
10
+
11
+ | Decision | Alternatives Rejected | Rationale / Evidence | Rollback / Migration Note |
12
+ | --- | --- | --- | --- |
13
+ | | | | |
14
+
15
+ ## States And Failure Modes
16
+
17
+ | State | User/System Observable Behavior | Test / Demo Evidence |
18
+ | --- | --- | --- |
19
+ | loading | | |
20
+ | empty | | |
21
+ | error | | |
22
+ | permission | | |
23
+
3
24
  ## Playwright Locator And State Strategy
4
25
 
5
26
  | Scenario | Page / Route | Preferred Locator Strategy | State Coverage | API / Mock | Auth / Storage | Evidence |
@@ -11,6 +32,7 @@ Guidelines:
11
32
  - Prefer user-facing locators: `getByRole`, `getByLabel`, `getByPlaceholder`, `getByTestId`.
12
33
  - Add implementation tasks for missing accessible names, labels, or stable test ids.
13
34
  - Define auth/storage reuse before demo so Playwright can run repeatably.
35
+ - Route unclear behavior back to spec instead of redesigning requirements here.
14
36
 
15
37
  ## Documentation Feedback
16
38
 
@@ -1,7 +1,32 @@
1
1
  # __MODULE_NAME__ Proposal
2
2
 
3
+ ## Problem
4
+
5
+ - Target user / stakeholder:
6
+ - Problem:
7
+ - Why now:
8
+ - Source evidence:
9
+
10
+ ## Scope
11
+
12
+ - In scope:
13
+ - Out of scope:
14
+ - Assumptions:
15
+ - Open questions / blockers:
16
+
17
+ ## Success Criteria
18
+
19
+ | Criterion | Evidence Source | Owner / Next Stage |
20
+ | --- | --- | --- |
21
+ | | | |
22
+
23
+ ## Risks And Rejected Alternatives
24
+
25
+ | Item | Decision | Rationale / Evidence |
26
+ | --- | --- | --- |
27
+ | | | |
28
+
3
29
  ## Documentation Feedback
4
30
 
5
31
  - No-update rationale:
6
32
  - Created from the ZSK module template; no proposal has been drafted yet.
7
-
@@ -1,5 +1,17 @@
1
1
  # __MODULE_NAME__ Spec
2
2
 
3
+ ## Behavior Contract
4
+
5
+ | ID | Requirement | Type | Source / Decision | Priority | Observable Outcome |
6
+ | --- | --- | --- | --- | --- | --- |
7
+ | FR-001 | | FR | | P0 | |
8
+
9
+ ## Acceptance Criteria
10
+
11
+ | AC | Linked Requirement | Given / When / Then | Evidence Route |
12
+ | --- | --- | --- | --- |
13
+ | AC-001 | FR-001 | Given / When / Then | |
14
+
3
15
  ## Scenario Contracts
4
16
 
5
17
  | Scenario | User Goal | Entry | Preconditions | Observable Result | PRD/SRS / FR/AC | Automate |
@@ -13,6 +25,7 @@ Rules:
13
25
  - Mark unclear or conflicting facts as blockers instead of choosing behavior silently.
14
26
  - Do not write brittle selectors in spec.
15
27
  - Mark which P0/P1 scenarios must become Playwright cases.
28
+ - Keep implementation choices out unless they are part of the product contract.
16
29
 
17
30
  ## Documentation Feedback
18
31
 
@@ -1,5 +1,17 @@
1
1
  # __MODULE_NAME__ Tasks
2
2
 
3
+ ## Execution Plan
4
+
5
+ | ID | Task | Depends On | Scope / Files | Linked FR/AC | Evidence Hook | Status |
6
+ | --- | --- | --- | --- | --- | --- | --- |
7
+ | T-001 | | | | FR-001 / AC-001 | | TODO |
8
+
9
+ ## Coverage Matrix
10
+
11
+ | FR/AC | Implementation Task | Test / Scenario Task | Docs / Issue / Evidence Task |
12
+ | --- | --- | --- | --- |
13
+ | FR-001 / AC-001 | T-001 | | |
14
+
3
15
  ## Playwright Case Tasks
4
16
 
5
17
  | Task | Scenario Contract | Case File | Fixture/Auth | Reuse Target | Status |
@@ -12,6 +24,7 @@ Rules:
12
24
  - Create or update source-aligned tests/scenarios before implementation for testable behavior changes.
13
25
  - Tag cases as smoke/demo/verify/regression.
14
26
  - Include tasks for labels/test ids required by stable locators.
27
+ - Do not create vague tasks such as "implement feature"; each task needs scope, dependency, and evidence.
15
28
 
16
29
  ## Documentation Feedback
17
30
 
@@ -8,15 +8,15 @@ project:
8
8
  paths:
9
9
  docs: .zsk/docs
10
10
  modules: .zsk/modules
11
- resources: .zsk/resources
11
+ raws: .zsk/raws
12
12
  issues: .zsk/issues
13
13
  evidence: .zsk/evidence
14
14
  playwright: .zsk/playwright
15
- plans: .zsk/plans
16
15
 
17
- # Resource origins. AI or zsk config setup should fill these with online URLs,
18
- # git repositories, Figma/Modao links, OpenAPI locations, or local files.
19
- # Optional snapshots should land under paths.resources, for example:
16
+ # Raw source origins. AI or zsk config setup should fill these with online URLs,
17
+ # git repositories, design-platform links/assets, OpenAPI locations, or local files.
18
+ # Optional snapshots should land under paths.raws with stable role/provider paths.
19
+ # Dates belong in manifest metadata such as syncedAt, not in path authority.
20
20
  #
21
21
  # sources:
22
22
  # srs:
@@ -24,26 +24,27 @@ paths:
24
24
  # origin:
25
25
  # kind: url
26
26
  # url: https://example.com/srs
27
- # snapshot: .zsk/resources/requirements/srs.md
28
- # figma_main:
27
+ # snapshot: .zsk/raws/product/srs.md
28
+ # design_main:
29
29
  # type: design
30
30
  # origin:
31
- # kind: figma
31
+ # kind: design
32
+ # provider: figma
32
33
  # url: https://www.figma.com/file/...
33
- # snapshot: .zsk/resources/design-sources/figma-main.json
34
+ # snapshot: .zsk/raws/ue/design-main.json
34
35
  # backend_api:
35
- # type: backend_repo
36
+ # type: api_contract
36
37
  # origin:
37
38
  # kind: git
38
39
  # repository: https://github.com/example/backend-api.git
39
40
  # path: openapi.yaml
40
- # snapshot: .zsk/resources/backend-repositories/backend-openapi.yaml
41
+ # snapshot: .zsk/raws/backend/api-contract.yaml
41
42
  # acceptance_cases:
42
43
  # type: test_case
43
44
  # origin:
44
45
  # kind: url
45
46
  # url: https://example.com/qa-cases
46
- # snapshot: .zsk/resources/testing/acceptance-cases.md
47
+ # snapshot: .zsk/raws/qa/testing/acceptance-cases.md
47
48
  sources: {}
48
49
 
49
50
  tools:
@@ -54,10 +55,11 @@ tools:
54
55
  - computer_use
55
56
  - browser_use
56
57
  design:
58
+ - manual
57
59
  - figma_mcp
58
60
 
59
61
  modules:
60
- index: .zsk/modules/_module-index.md
62
+ index: .zsk/modules/index.md
61
63
  root: .zsk/modules
62
64
 
63
65
  automation:
@@ -70,7 +72,7 @@ automation:
70
72
  command: pnpm deploy:staging
71
73
  demo:
72
74
  # Default optimized lane:
73
- # - Formal test cases come from module tests.raw_cases or sources.testing, normally snapshots under .zsk/resources/testing.
75
+ # - Formal test cases come from module tests.raw_cases or sources.testing, normally snapshots under .zsk/raws/qa/testing.
74
76
  # - Playwright storageState is the preferred way to reuse login/session state without stopping on login pages.
75
77
  # - Computer Use is the preferred visual/current-page observation lane when it is available and authorized.
76
78
  # - Browser Use is optional and runtime-specific; use it only where the agent platform supports it and permissions are available.
@@ -81,8 +83,8 @@ automation:
81
83
  defaultMode: optimized
82
84
  baseUrl: http://localhost:3000
83
85
  command: pnpm dev
84
- evidenceDir: .zsk/evidence/{module}/demo
85
- scenarioDir: .zsk/playwright/{module}/specs
86
+ evidenceDir: .zsk/modules/{module}/_evidence/demo
87
+ scenarioDir: .zsk/modules/{module}/_playwright/specs
86
88
  playwright:
87
89
  config: playwright.config.ts
88
90
  project: chromium
@@ -97,8 +99,8 @@ automation:
97
99
  # Fall back to playwright_mcp for structured accessibility snapshots, or browser_use only on runtimes that support it.
98
100
  decisionTool: playwright_mcp
99
101
  executionTool: playwright
100
- planFile: .zsk/playwright/{module}/execution/operation-plan.json
101
- executionFile: .zsk/playwright/{module}/execution/playwright-execution.json
102
+ planFile: .zsk/modules/{module}/_playwright/execution/operation-plan.json
103
+ executionFile: .zsk/modules/{module}/_playwright/execution/playwright-execution.json
102
104
  verify:
103
105
  commands:
104
106
  - pnpm test:e2e
@@ -2,6 +2,16 @@
2
2
 
3
3
  This file is the human-readable companion to `.zsk/config.yaml`.
4
4
 
5
+ ## Halcyon Layer
6
+
7
+ This `.zsk/` workspace is project-specific. It is the Halcyon operating layer for this project: the place where AI agents read raw facts, produce stage documents, route issues/evidence, and prove stage completion. It is not a generic docs folder and it is not a replacement for the application's source tree.
8
+
9
+ Use this layer to answer three questions before execution:
10
+
11
+ - What facts and decisions are authoritative for this project?
12
+ - Which module/stage owns the next artifact?
13
+ - What evidence or issue update proves the stage is complete?
14
+
5
15
  ## Workspace Layout
6
16
 
7
17
  `zsk init` owns only the `.zsk/` workspace by default:
@@ -11,10 +21,11 @@ This file is the human-readable companion to `.zsk/config.yaml`.
11
21
  | `.zsk/config.yaml` | Machine-readable project config and path authority |
12
22
  | `.zsk/docs/` | Project-level docs such as this file and `SYSTEM-SPEC.md` |
13
23
  | `.zsk/modules/{module}/` | Module `module.yaml`, `proposal.md`, `spec.md`, `design.md`, `tasks.md` |
14
- | `.zsk/resources/` | Shared source snapshots and manually provided resources |
15
- | `.zsk/issues/` | Issues and issue indexes created on demand |
16
- | `.zsk/evidence/` | Runtime evidence, screenshots, traces, logs, and verification artifacts |
17
- | `.zsk/playwright/{module}/` | Playwright specs, plans, auth state, results, reports, and execution records |
24
+ | `.zsk/raws/` | Immutable raw fact sources and manifest/index files |
25
+ | `.zsk/modules/{module}/_issues/` | Module-private issue records, created on demand |
26
+ | `.zsk/modules/{module}/_evidence/` | Module-private evidence, screenshots, traces, logs, and verification artifacts, created on demand |
27
+ | `.zsk/modules/{module}/_playwright/` | Module-specific Playwright specs, plans, auth state, results, reports, and execution records, created on demand |
28
+ | `.zsk/playwright/` | Shared Playwright config/auth/helpers only, created on demand |
18
29
 
19
30
  Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are not default write targets. Use explicit export or migration tooling when you need project-root copies.
20
31
 
@@ -23,17 +34,29 @@ Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are not default write tar
23
34
  1. `.zsk/config.yaml`
24
35
  2. `.zsk/docs/SYSTEM-SPEC.md`
25
36
  3. Project resource origins listed under `.zsk/config.yaml#sources`
26
- 4. `.zsk/modules/{module}/module.yaml`
27
- 5. `.zsk/modules/{module}/spec.md`
28
- 6. `.zsk/modules/{module}/design.md`
29
- 7. Runtime evidence under `.zsk/evidence/` and `.zsk/playwright/`
37
+ 4. `.zsk/raws/manifest.json` and `.zsk/raws/index.md`
38
+ 5. `.zsk/modules/{module}/module.yaml`
39
+ 6. `.zsk/modules/{module}/spec.md`
40
+ 7. `.zsk/modules/{module}/design.md`
41
+ 8. Runtime evidence under module `_evidence` / `_playwright` or shared `.zsk/evidence` / `.zsk/playwright`
42
+
43
+ When sources conflict, record the conflict under the module `_issues` directory, or shared `.zsk/issues` only for cross-module/global issues, and update the affected module docs with a Documentation Feedback note or an explicit no-update rationale.
44
+
45
+ ## Authoring Rule
46
+
47
+ Every module stage document is a handoff contract:
48
+
49
+ - `proposal.md` explains why the work exists, who it serves, what is in scope, what is out of scope, and how success will be recognized.
50
+ - `spec.md` defines observable behavior, scenarios, acceptance criteria, edge cases, and source-linked assumptions.
51
+ - `design.md` maps approved behavior to implementation surfaces, interfaces, state, data flow, risks, and verification strategy.
52
+ - `tasks.md` breaks the design into ordered work with owners/scope, dependencies, FR/AC coverage, and evidence hooks.
30
53
 
31
- When sources conflict, record the conflict under `.zsk/issues/{module}/` and update the affected module docs with a Documentation Feedback note or an explicit no-update rationale.
54
+ If a document cannot answer its stage questions, stop and record the missing source, decision, blocker, or issue instead of filling the template.
32
55
 
33
56
  ## Maintenance Checklist
34
57
 
35
58
  - Update `.zsk/config.yaml` when paths, tools, or source origins change.
36
59
  - Keep project-wide reusable rules in `.zsk/docs/SYSTEM-SPEC.md`.
37
60
  - Keep module-specific decisions in `.zsk/modules/{module}/`.
38
- - Keep shared raw resources under `.zsk/resources/`.
39
- - Keep runtime outputs out of docs and under `.zsk/evidence/` or `.zsk/playwright/`.
61
+ - Keep shared raw source facts under `.zsk/raws/`.
62
+ - Keep runtime outputs out of docs and under module-private `_evidence` / `_playwright` unless they are deliberately shared under `.zsk/evidence` / `.zsk/playwright`.
@@ -2,20 +2,33 @@
2
2
 
3
3
  This document captures project-wide rules that should guide module work.
4
4
 
5
+ ## Operating Model
6
+
7
+ The `.zsk/` workspace is this project's Halcyon layer. It keeps AI execution grounded by separating:
8
+
9
+ - raw facts under `paths.raws`;
10
+ - project-wide rules under `paths.docs`;
11
+ - module-owned stage contracts under `paths.modules`;
12
+ - runtime evidence under module `_evidence` or shared `paths.evidence`;
13
+ - issue records under module `_issues` or shared/global `paths.issues`;
14
+ - Playwright plans/specs/results under module `_playwright` or shared `paths.playwright`.
15
+
16
+ Agents must use the smallest sufficient lane: read local sources first, run deterministic CLI checks when possible, delegate only when the work has independent expert lanes, and record blockers instead of filling missing facts from chat memory.
17
+
5
18
  ## Path Boundaries
6
19
 
7
20
  - `paths.docs` stores project-level docs only.
8
21
  - `paths.modules` stores module source-of-truth docs.
9
- - `paths.resources` stores shared source snapshots and manually provided resources.
10
- - `paths.issues` stores actionable issue records and indexes created on demand.
11
- - `paths.evidence` stores runtime evidence and verification artifacts.
12
- - `paths.playwright` stores Playwright specs, plans, auth state, results, reports, and execution records.
22
+ - `paths.raws` stores immutable shared source snapshots and manually provided fact sources.
23
+ - Module `_issues` stores module-specific actionable issue records; `paths.issues` is created on demand only for shared/global indexes or cross-module issues.
24
+ - Module `_evidence` stores module-specific runtime evidence and verification artifacts; `paths.evidence` is created on demand only for shared/global evidence.
25
+ - Module `_playwright` stores module-specific Playwright specs, plans, auth state, results, reports, and execution records; `paths.playwright` is created on demand only for shared Playwright assets.
13
26
 
14
27
  Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are legacy or export surfaces, not default zsk write targets.
15
28
 
16
29
  ## Testing Assets
17
30
 
18
- Original QA, acceptance, release, and manually supplied test cases belong in configured project sources and may be snapshotted under `paths.resources`. Module-derived test plans and Playwright specs belong under `paths.playwright/{module}`.
31
+ Original QA, acceptance, release, and manually supplied test cases belong in configured project sources and may be snapshotted under `paths.raws`, normally `.zsk/raws/qa/testing`. Module-derived test plans and Playwright specs belong under module `_playwright` unless they are intentionally shared under `paths.playwright`.
19
32
 
20
33
  ## Completion Feedback
21
34
 
@@ -25,3 +38,22 @@ Every stage document that changes durable behavior should include Documentation
25
38
  - an explicit no-update rationale.
26
39
 
27
40
  Runtime evidence should be linked from docs, not embedded in docs.
41
+
42
+ ## Stage Document Standards
43
+
44
+ ZSK stage documents are decision artifacts. They are complete only when the next stage can act without hidden chat context.
45
+
46
+ | Stage | Document Mode | Must Prove |
47
+ | --- | --- | --- |
48
+ | `prepare` | Evidence report | Source origins, freshness, conflicts, and raw snapshot paths are known before planning. |
49
+ | `proposal` | Decision brief | Problem, user/business outcome, scope, non-goals, risks, and success criteria are explicit. |
50
+ | `spec` | Behavior contract | FR/NFR, scenarios, edge cases, and acceptance criteria are observable and source-linked. |
51
+ | `design` | Implementation contract | Behavior maps to files/modules/interfaces/state/data flow, with risks and verification strategy. |
52
+ | `task` | Execution plan | Work is ordered, owned, independently reviewable, and tied to FR/AC plus evidence hooks. |
53
+ | `coding` | Implementation evidence | Changed files, behavior, tests, and residual risks are tied back to tasks. |
54
+ | `smoke` | Evidence report | Local proof names the claim, command/scenario, result, artifacts, and failures. |
55
+ | `review` | Evidence report | Findings are severity-ranked, traceable, and cover scope, correctness, tests, risk, and harness compliance. |
56
+ | `ready` | Verification handoff | Fixed issues, AC, evidence, replay steps, version, and residual risks are mapped. |
57
+ | `verify` | Independent evidence | The ready claim is replayed with fresh evidence and pass/fail issue status updates. |
58
+
59
+ Each stage document must separate facts, decisions, assumptions, open questions, evidence, and next action. Do not leave template filler, untraceable "best practice" claims, vague tasks, or unresolved contradictions in a stage artifact.
@@ -0,0 +1,7 @@
1
+ # Module Index
2
+
3
+ Generated and refreshed as modules are added.
4
+
5
+ | Module | Status | Notes |
6
+ | --- | --- | --- |
7
+ | | | |
@@ -0,0 +1,3 @@
1
+ # Backend Sources
2
+
3
+ Backend repositories, API contracts, OpenAPI files, and integration notes.
@@ -0,0 +1,7 @@
1
+ # Raw Source Index
2
+
3
+ Immutable fact sources for this project. Generated and refreshed by `zsk prep`.
4
+
5
+ | Provider | Type | Status | Snapshot / Origin |
6
+ | --- | --- | --- | --- |
7
+ | | | | |
@@ -0,0 +1,3 @@
1
+ # Jira Sources
2
+
3
+ Jira exports, linked issue references, and ticket snapshots.
@@ -0,0 +1,4 @@
1
+ {
2
+ "version": 1,
3
+ "resources": []
4
+ }
@@ -0,0 +1,3 @@
1
+ # Manual Sources
2
+
3
+ Manually supplied notes, local files, and ad hoc source material.
@@ -0,0 +1,3 @@
1
+ # Product Sources
2
+
3
+ SRS, PRD, requirements, release notes, and customer/product feedback.
@@ -0,0 +1,3 @@
1
+ # QA Sources
2
+
3
+ QA cases, acceptance cases, test data, and verification source material.
@@ -0,0 +1,3 @@
1
+ # UE Sources
2
+
3
+ Design handoff, Figma/Modao references, UX notes, and interaction assets.