@captain_z/zsk 1.8.4 → 1.8.5

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 (125) hide show
  1. package/dist/bin.js +13 -0
  2. package/dist/bin.js.map +1 -1
  3. package/dist/commands/check.js +14 -575
  4. package/dist/commands/check.js.map +1 -1
  5. package/dist/commands/config.js +1 -1
  6. package/dist/commands/config.js.map +1 -1
  7. package/dist/commands/demo.d.ts +5 -0
  8. package/dist/commands/demo.js +70 -297
  9. package/dist/commands/demo.js.map +1 -1
  10. package/dist/commands/doctor.js +9 -4
  11. package/dist/commands/doctor.js.map +1 -1
  12. package/dist/commands/gate.d.ts +1 -0
  13. package/dist/commands/gate.js +8 -2
  14. package/dist/commands/gate.js.map +1 -1
  15. package/dist/commands/prepare.js +7 -1
  16. package/dist/commands/prepare.js.map +1 -1
  17. package/dist/commands/project-init.js +30 -8
  18. package/dist/commands/project-init.js.map +1 -1
  19. package/dist/core/config.d.ts +68 -0
  20. package/dist/core/config.js +198 -15
  21. package/dist/core/config.js.map +1 -1
  22. package/dist/core/demo-auth.d.ts +30 -0
  23. package/dist/core/demo-auth.js +213 -0
  24. package/dist/core/demo-auth.js.map +1 -0
  25. package/dist/core/demo-scenarios.d.ts +62 -0
  26. package/dist/core/demo-scenarios.js +276 -0
  27. package/dist/core/demo-scenarios.js.map +1 -0
  28. package/dist/core/demo-sources.d.ts +37 -0
  29. package/dist/core/demo-sources.js +198 -0
  30. package/dist/core/demo-sources.js.map +1 -0
  31. package/dist/core/mcp-registry-discovery.d.ts +16 -0
  32. package/dist/core/mcp-registry-discovery.js +187 -0
  33. package/dist/core/mcp-registry-discovery.js.map +1 -0
  34. package/dist/core/origin-detection.js +1 -1
  35. package/dist/core/origin-detection.js.map +1 -1
  36. package/dist/core/prepare-artifacts.d.ts +16 -0
  37. package/dist/core/prepare-artifacts.js +25 -0
  38. package/dist/core/prepare-artifacts.js.map +1 -0
  39. package/dist/core/prepare-auth-helper.d.ts +8 -0
  40. package/dist/core/prepare-auth-helper.js +32 -0
  41. package/dist/core/prepare-auth-helper.js.map +1 -0
  42. package/dist/core/prepare-materialization.d.ts +8 -0
  43. package/dist/core/prepare-materialization.js +26 -0
  44. package/dist/core/prepare-materialization.js.map +1 -0
  45. package/dist/core/prepare-migration.d.ts +6 -0
  46. package/dist/core/prepare-migration.js +57 -0
  47. package/dist/core/prepare-migration.js.map +1 -0
  48. package/dist/core/prepare-reporting.d.ts +5 -0
  49. package/dist/core/prepare-reporting.js +106 -0
  50. package/dist/core/prepare-reporting.js.map +1 -0
  51. package/dist/core/prepare-routing.d.ts +12 -0
  52. package/dist/core/prepare-routing.js +182 -0
  53. package/dist/core/prepare-routing.js.map +1 -0
  54. package/dist/core/prepare-sync.d.ts +11 -22
  55. package/dist/core/prepare-sync.js +811 -260
  56. package/dist/core/prepare-sync.js.map +1 -1
  57. package/dist/core/prepare-utils.d.ts +6 -0
  58. package/dist/core/prepare-utils.js +35 -0
  59. package/dist/core/prepare-utils.js.map +1 -0
  60. package/dist/core/provider-policy.d.ts +26 -0
  61. package/dist/core/provider-policy.js +180 -0
  62. package/dist/core/provider-policy.js.map +1 -0
  63. package/dist/core/provider-readiness.d.ts +39 -0
  64. package/dist/core/provider-readiness.js +78 -0
  65. package/dist/core/provider-readiness.js.map +1 -0
  66. package/dist/core/source-adapter-normalization.d.ts +31 -0
  67. package/dist/core/source-adapter-normalization.js +235 -0
  68. package/dist/core/source-adapter-normalization.js.map +1 -0
  69. package/dist/core/source-snapshot-adapters.d.ts +3 -3
  70. package/dist/core/source-snapshot-adapters.js +2 -24
  71. package/dist/core/source-snapshot-adapters.js.map +1 -1
  72. package/dist/core/staffing-plan.d.ts +1 -0
  73. package/dist/core/staffing-plan.js +61 -3
  74. package/dist/core/staffing-plan.js.map +1 -1
  75. package/dist/core/stage-clarity-verification.js +21 -18
  76. package/dist/core/stage-clarity-verification.js.map +1 -1
  77. package/dist/core/stage-output-quality.d.ts +3 -0
  78. package/dist/core/stage-output-quality.js +122 -0
  79. package/dist/core/stage-output-quality.js.map +1 -0
  80. package/dist/core/stage-quality-contracts.d.ts +19 -0
  81. package/dist/core/stage-quality-contracts.js.map +1 -1
  82. package/dist/core/stage-quality-criteria.js +0 -37
  83. package/dist/core/stage-quality-criteria.js.map +1 -1
  84. package/dist/core/stage-quality-rendering.d.ts +4 -2
  85. package/dist/core/stage-quality-rendering.js +130 -12
  86. package/dist/core/stage-quality-rendering.js.map +1 -1
  87. package/dist/core/stage-quality.js +17 -6
  88. package/dist/core/stage-quality.js.map +1 -1
  89. package/dist/core/template-registry.js +12 -15
  90. package/dist/core/template-registry.js.map +1 -1
  91. package/dist/core/workspace-conformance.d.ts +39 -0
  92. package/dist/core/workspace-conformance.js +603 -0
  93. package/dist/core/workspace-conformance.js.map +1 -0
  94. package/package.json +2 -2
  95. package/schemas/providers.schema.json +74 -0
  96. package/schemas/zsk-config.schema.json +417 -1
  97. package/templates/project-init/.zsk/README.md +48 -0
  98. package/templates/project-init/.zsk/config.yaml +37 -33
  99. package/templates/project-init/.zsk/docs/CONFIG-SCHEMA.md +127 -0
  100. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +26 -21
  101. package/templates/project-init/.zsk/docs/README.md +10 -0
  102. package/templates/project-init/.zsk/docs/SECURITY.md +34 -0
  103. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +20 -8
  104. package/templates/project-init/.zsk/evidence/README.md +15 -0
  105. package/templates/project-init/.zsk/issues/README.md +10 -0
  106. package/templates/project-init/.zsk/modules/README.md +19 -0
  107. package/templates/project-init/.zsk/modules/index.md +9 -5
  108. package/templates/project-init/.zsk/raws/README.md +34 -0
  109. package/templates/project-init/.zsk/roles.yaml +36 -105
  110. package/templates/project-init/.zsk/templates/config.examples.yaml +83 -0
  111. package/templates/project-init/.zsk/templates/issue-card.md +23 -0
  112. package/templates/project-init/.zsk/templates/module/README.md +13 -0
  113. package/templates/project-init/.zsk/templates/module/design.md +22 -0
  114. package/templates/project-init/.zsk/templates/module/module.yaml +15 -0
  115. package/templates/project-init/.zsk/templates/module/proposal.md +20 -0
  116. package/templates/project-init/.zsk/templates/module/spec.md +22 -0
  117. package/templates/project-init/.zsk/templates/module/tasks.md +16 -0
  118. package/templates/project-init/.zsk/raws/index.md +0 -34
  119. package/templates/project-init/.zsk/raws/manifest.json +0 -4
  120. package/templates/project-init/.zsk/raws/prepare/backend/index.md +0 -4
  121. package/templates/project-init/.zsk/raws/prepare/design/index.md +0 -21
  122. package/templates/project-init/.zsk/raws/prepare/index.md +0 -37
  123. package/templates/project-init/.zsk/raws/prepare/product/index.md +0 -4
  124. package/templates/project-init/.zsk/raws/prepare/qa/index.md +0 -4
  125. package/templates/project-init/.zsk/raws/prepare/ux/index.md +0 -22
@@ -12,40 +12,44 @@ template:
12
12
  mode: standard
13
13
  scale: auto
14
14
 
15
- # Prepare source capture strategy:
16
- # - Register source origins under sources.prepare.<lane>.<source-id>.
17
- # - Prefer stable local exports or provider API/export URLs over bare browser
18
- # pages when fidelity matters.
19
- # - Keep credentials out of config; reference env names under origin.auth or use
20
- # .zsk/playwright/.auth storageState created by `zsk prepare auth`.
21
- # - Run `zsk prepare plan` before acquisition, `zsk prepare auth-check` for
22
- # remote/private URLs, then `zsk prepare sync --source=<id> --allow-network`
23
- # when acquisition is intentionally allowed.
24
- # - Design/Figma sources are evidence only. Pair them with
25
- # .zsk/raws/prepare/ux/{topic}/interaction-handoff.md for page/module
26
- # interaction details before proposal/spec/design consume them. In
27
- # module-targeted preproposal runs, {topic} defaults to the module id.
28
- sources: {}
15
+ # Provider connection profiles. Keep credentials out of this file; reference
16
+ # environment variables or global profiles instead.
17
+ providers: {}
18
+
19
+ # Resource intents to prepare. Directories under .zsk/raws/** are created only
20
+ # for configured resources that actually produce snapshots.
21
+ resources: []
22
+
23
+ # Routes map prepared resources into controlled consumption surfaces such as
24
+ # .zsk/modules/<module>/_issues or module source references.
25
+ routes: []
29
26
 
30
- # Example source shape:
31
- # sources:
32
- # prepare:
33
- # product:
34
- # prd:
35
- # type: prd
36
- # origin:
37
- # kind: local
38
- # path: docs/PRD.md
39
- # snapshot: .zsk/raws/prepare/product/prd.md
40
- # design:
41
- # figma-product:
42
- # type: design-source
43
- # origin:
44
- # kind: url
45
- # provider: figma
46
- # url: https://www.figma.com/file/<file-id>/<name>
47
- # exportPath: exports/figma-product.json
48
- # snapshot: .zsk/raws/prepare/design/figma-product/source.md
27
+ modules:
28
+ root: .zsk/modules
29
+ index: .zsk/modules/index.md
30
+ registry: []
31
+
32
+ # Demo login bootstrap. Keep real credentials in local env files; put only env
33
+ # key names here, then run `zsk demo auth -m <module>` once to save storageState.
34
+ # automation:
35
+ # demo:
36
+ # auth:
37
+ # required: true
38
+ # loginUrl: http://localhost:3000/login
39
+ # storageState: .zsk/modules/{module}/_playwright/.auth/user.json
40
+ # envFiles:
41
+ # - ~/.zshrc
42
+ # env:
43
+ # username: DEMO_USERNAME
44
+ # password: DEMO_PASSWORD
45
+ # selectors:
46
+ # username: input[name="username"]
47
+ # password: input[type="password"]
48
+ # submit: button[type="submit"]
49
+
50
+ # Current prepare implementation compatibility tree. New resource preparation
51
+ # should prefer providers/resources/routes above as the stable config surface.
52
+ sources: {}
49
53
 
50
54
  customize:
51
55
  roles: .zsk/roles.yaml
@@ -0,0 +1,127 @@
1
+ # Config Schema
2
+
3
+ `.zsk/config.yaml` is the project control surface. It should describe intent,
4
+ not runtime results.
5
+
6
+ ## Top-Level Blocks
7
+
8
+ | Block | Purpose |
9
+ | --- | --- |
10
+ | `project` | Stable project identity. |
11
+ | `template` | ZSK template id and version. |
12
+ | `providers` | Connection profiles such as Jira, Confluence, GitHub, GitLab, Figma, or MCP-backed tools. |
13
+ | `resources` | Resource intents to prepare, such as repositories, issues, documents, designs, or command/MCP outputs. |
14
+ | `routes` | Delivery rules from prepared resources to module or shared consumption surfaces. |
15
+ | `modules` | Module discovery settings and optional module registry entries. |
16
+ | `customize` / `staffing` | Pointers to role, workflow, provider, or gate policy files. |
17
+ | `sources` | Compatibility source tree used by the current prepare implementation until the Resource Preparation Module fully owns `resources`. |
18
+
19
+ ## Materialization
20
+
21
+ The workspace does not pre-create resource directories.
22
+
23
+ - `resources` entries produce `.zsk/raws/**` snapshots after sync.
24
+ - `routes` entries may update `.zsk/modules/<module>/_issues/**`,
25
+ `.zsk/modules/<module>/sources.yaml`, or other controlled artifacts.
26
+ - `zsk prepare sync` writes `.zsk/evidence/prepare/sync-report.md`.
27
+ - Missing provider credentials or route conflicts must be visible in the report
28
+ with a clear state, reason, output path, and next action.
29
+
30
+ ## Resource Output
31
+
32
+ Default raw output is derived from `type + id`, but a resource may override it
33
+ with `output.rawPath`.
34
+
35
+ ```yaml
36
+ resources:
37
+ - id: my-bugs
38
+ type: issues
39
+ provider: jira
40
+ ```
41
+
42
+ Default output:
43
+
44
+ ```text
45
+ .zsk/raws/issues/my-bugs/
46
+ ```
47
+
48
+ Only configured resources with produced snapshots create directories.
49
+
50
+ ## Credential References
51
+
52
+ `.zsk/config.yaml` stores env var names only. Put the values in the runtime
53
+ environment, for example by exporting them from `~/.zshrc` before launching the
54
+ shell that runs `zsk`.
55
+
56
+ ```yaml
57
+ providers:
58
+ jira:
59
+ type: issues
60
+ adapter: jira
61
+ baseUrl: https://jira.example.com
62
+ auth:
63
+ env: ACCESS_TOKEN
64
+ confluence:
65
+ type: document
66
+ adapter: confluence
67
+ baseUrl: https://confluence.example.com
68
+ auth:
69
+ usernameEnv: CONFLUENCE_USER
70
+ passwordEnv: CONFLUENCE_PASSWORD
71
+ ```
72
+
73
+ ## Adapter Fallbacks
74
+
75
+ `source.adapter` is reserved for built-in source adapters: `jira`,
76
+ `confluence`, `gitlab`, and `figma`. Runtime tools such as `playwright_cli`,
77
+ `playwright_mcp`, `browser_use`, and `computer_use` are fallback or observation
78
+ surfaces, not provider adapters.
79
+
80
+ Use `fallback` when a source may need a runtime-assisted acquisition path:
81
+
82
+ ```yaml
83
+ sources:
84
+ product:
85
+ prd:
86
+ type: prd
87
+ origin:
88
+ kind: url
89
+ url: https://example.com/prd
90
+ fallback:
91
+ acquisition: [playwright_cli]
92
+ observation: [computer_use]
93
+ ```
94
+
95
+ Compatibility note: if an older config puts `playwright_cli` or `computer_use`
96
+ under `adapter`, config check accepts it with a warning and treats it as a
97
+ fallback alias. `computer_use` remains observation-only; prepare sync will not
98
+ silently launch a Computer Use session.
99
+
100
+ ## Demo Auth
101
+
102
+ Authenticated demos should configure login resources by reference. Keep real
103
+ credentials in local env files such as `~/.zshrc`; put only env key names in
104
+ `.zsk/config.yaml`.
105
+
106
+ ```yaml
107
+ automation:
108
+ demo:
109
+ auth:
110
+ required: true
111
+ loginUrl: http://localhost:3000/login
112
+ storageState: .zsk/modules/{module}/_playwright/.auth/user.json
113
+ envFiles:
114
+ - ~/.zshrc
115
+ env:
116
+ username: DEMO_USERNAME
117
+ password: DEMO_PASSWORD
118
+ selectors:
119
+ username: input[name="username"]
120
+ password: input[type="password"]
121
+ submit: button[type="submit"]
122
+ ```
123
+
124
+ `zsk demo auth -m <module>` writes a module-local Playwright login helper that
125
+ loads those env files, fills configured fields when selectors are available,
126
+ then saves reusable `storageState`. Generated demo specs reuse the same
127
+ `storageState` and fail fast if they are redirected back to a login page.
@@ -19,9 +19,10 @@ Use this layer to answer three questions before execution:
19
19
  | Path | Purpose |
20
20
  | --- | --- |
21
21
  | `.zsk/config.yaml` | Machine-readable project config and path authority |
22
- | `.zsk/docs/` | Project-level docs such as this file and `SYSTEM-SPEC.md` |
22
+ | `.zsk/roles.yaml` | Project staffing policy and role pool overrides |
23
+ | `.zsk/docs/` | Project-level docs such as this file, `SYSTEM-SPEC.md`, `CONFIG-SCHEMA.md`, and `SECURITY.md` |
23
24
  | `.zsk/modules/{module}/` | Module `module.yaml`, `proposal.md`, `spec.md`, `design.md`, `tasks.md` |
24
- | `.zsk/raws/` | Immutable raw fact sources and manifest/index files |
25
+ | `.zsk/raws/` | Config-driven Resource Snapshot Library |
25
26
  | `.zsk/modules/{module}/_issues/` | Module-private issue records, created on demand |
26
27
  | `.zsk/modules/{module}/_evidence/` | Module-private evidence, screenshots, traces, logs, and verification artifacts, created on demand |
27
28
  | `.zsk/modules/{module}/_playwright/` | Module-specific Playwright specs, plans, auth state, results, reports, and execution records, created on demand |
@@ -33,8 +34,8 @@ Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are not default write tar
33
34
 
34
35
  1. `.zsk/config.yaml`
35
36
  2. `.zsk/docs/SYSTEM-SPEC.md`
36
- 3. Project resource origins listed under `.zsk/config.yaml#sources`
37
- 4. `.zsk/raws/manifest.json` and `.zsk/raws/index.md`
37
+ 3. Project provider/resource/route intent in `.zsk/config.yaml`
38
+ 4. Materialized resource snapshots under `.zsk/raws/**`
38
39
  5. `.zsk/modules/{module}/module.yaml`
39
40
  6. `.zsk/modules/{module}/spec.md`
40
41
  7. `.zsk/modules/{module}/design.md`
@@ -53,21 +54,23 @@ Every module stage document is a handoff contract:
53
54
 
54
55
  If a document cannot answer its stage questions, stop and record the missing source, decision, blocker, or issue instead of filling the template.
55
56
 
56
- ## Preproposal Raw Artifacts
57
+ ## Resource Snapshot Contract
57
58
 
58
- `preproposal` may create living raw artifacts under `.zsk/raws/prepare/**` when a
59
- brief request lacks reviewed product, roadmap, UX, design-source, or source
60
- readiness material.
59
+ `prepare sync` materializes configured resources under `.zsk/raws/**`; init does
60
+ not create resource subdirectories or empty indexes.
61
61
 
62
- - Product direction and roadmap seeds live under `.zsk/raws/prepare/product/**`.
63
- - UX readiness and interaction handoff live under `.zsk/raws/prepare/ux/**`.
64
- - Design-source needs and provider source maps live under `.zsk/raws/prepare/design/**`.
65
- - Checkpoint review evidence lives under `.zsk/evidence/preproposal/{run}/`.
62
+ Default resource output is derived from `type + id`, for example:
66
63
 
67
- Module `proposal.md`, `spec.md`, `design.md`, and `tasks.md` should reference
68
- reviewed revisions from these raw artifacts instead of copying their full
69
- contents. A later interaction change updates the raw artifact first, then routes
70
- impact to the affected module stage.
64
+ | Resource | Default Snapshot Path |
65
+ | --- | --- |
66
+ | `type: repository`, `id: core-api` | `.zsk/raws/repositories/core-api/` |
67
+ | `type: issues`, `id: my-bugs` | `.zsk/raws/issues/my-bugs/` |
68
+ | `type: document`, `id: role-prd` | `.zsk/raws/document/role-prd/` |
69
+
70
+ Each snapshot directory should contain a human-readable `snapshot.md`, redacted
71
+ `metadata.yaml`, ignored `source.json`, and ignored `assets/` when raw payloads
72
+ or exports exist. Directory-style resources such as git submodules may also
73
+ contain a `repository/` checkout.
71
74
 
72
75
  ## Prepare Capture Strategy
73
76
 
@@ -76,16 +79,18 @@ not a requirement author, interaction designer, code designer, or task planner.
76
79
 
77
80
  Use this order for source capture:
78
81
 
79
- 1. Register stable origins in `.zsk/config.yaml#sources`.
82
+ 1. Register provider profiles, resource intents, and routes in `.zsk/config.yaml`.
80
83
  2. Run `zsk prepare plan` to classify ready, stale, blocked, and ambiguous
81
84
  sources before writing snapshots.
82
85
  3. Run `zsk prepare auth-check` for private URLs so credentials are verified
83
- without writing source content.
86
+ without writing source content. The command reads exported env vars such as
87
+ `ACCESS_TOKEN`, `CONFLUENCE_USER`, and `CONFLUENCE_PASSWORD`; it never reads
88
+ `~/.zshrc` directly or prints secret values.
84
89
  4. Run `zsk prepare sync` for local/provider/export sources, adding
85
90
  `--allow-network`, `--browser`, and `--auth-state` only when that acquisition
86
91
  is intentional.
87
- 5. Review `.zsk/evidence/prepare/{run}/adapter-results/` and
88
- `downstream-impact.md` before downstream stages consume the snapshot.
92
+ 5. Review `.zsk/evidence/prepare/sync-report.md` before downstream stages
93
+ consume the snapshot.
89
94
 
90
95
  For Figma or similar design tools, prefer provider API/export payloads, raw node
91
96
  exports, screenshots/assets, and local design-source maps over a bare page URL.
@@ -98,7 +103,7 @@ narrower page/frame split is justified in the raw artifact.
98
103
 
99
104
  ## Maintenance Checklist
100
105
 
101
- - Update `.zsk/config.yaml` when paths, tools, or source origins change.
106
+ - Update `.zsk/config.yaml` when providers, resources, routes, modules, paths, or tools change.
102
107
  - Keep project-wide reusable rules in `.zsk/docs/SYSTEM-SPEC.md`.
103
108
  - Keep module-specific decisions in `.zsk/modules/{module}/`.
104
109
  - Keep shared raw source facts under `.zsk/raws/`.
@@ -0,0 +1,10 @@
1
+ # ZSK Docs
2
+
3
+ Project-wide governance documents live here.
4
+
5
+ - `PROJECT-CONFIG.md` explains workspace layout and source authority.
6
+ - `SYSTEM-SPEC.md` records project-wide operating rules.
7
+ - `CONFIG-SCHEMA.md` explains the local config shape used by this project.
8
+ - `SECURITY.md` records raw payload, credential, and commit policy.
9
+
10
+ Keep module-specific proposal/spec/design/tasks under `.zsk/modules/<module>/`.
@@ -0,0 +1,34 @@
1
+ # Security
2
+
3
+ `prepare sync` can touch private provider data. Keep security rules visible in
4
+ the project, not only in implementation.
5
+
6
+ ## Credentials
7
+
8
+ - Do not write tokens, cookies, passwords, or authorization headers in
9
+ `.zsk/config.yaml`.
10
+ - Reference credentials by environment variable or global profile.
11
+ - Shell startup files such as `~/.zshrc` may export those variables, but ZSK
12
+ only reads the already exported `process.env` values. It does not parse shell
13
+ startup files or persist their values.
14
+ - For Jira, use a token env such as `ACCESS_TOKEN`.
15
+ - For Confluence instances that do not support access tokens, use Basic auth
16
+ env names such as `CONFLUENCE_USER` and `CONFLUENCE_PASSWORD`.
17
+ - Readiness reports may say that an env var or profile is present, but must not
18
+ print secret values.
19
+
20
+ ## Raw Payloads
21
+
22
+ - `source.json` is ignored by default.
23
+ - `assets/` is ignored by default.
24
+ - `snapshot.md`, `metadata.yaml`, and `sync-report.md` must be redacted before
25
+ write.
26
+ - `output.commitRaw: true` is required before raw payloads become commit
27
+ candidates.
28
+
29
+ ## Redaction
30
+
31
+ Provider payloads must pass through a sanitizer before writing `source.json`,
32
+ `snapshot.md`, `metadata.yaml`, or reports. At minimum, redact credential-shaped
33
+ fields such as `token`, `cookie`, `authorization`, `password`, and provider
34
+ session headers.
@@ -6,7 +6,7 @@ This document captures project-wide rules that should guide module work.
6
6
 
7
7
  The `.zsk/` workspace is this project's Halcyon layer. It keeps AI execution grounded by separating:
8
8
 
9
- - raw facts under `paths.raws`;
9
+ - config-declared resource snapshots under `paths.raws`;
10
10
  - project-wide rules under `paths.docs`;
11
11
  - module-owned stage contracts under `paths.modules`;
12
12
  - runtime evidence under module `_evidence` or shared `paths.evidence`;
@@ -19,17 +19,17 @@ Agents must use the smallest sufficient lane: read local sources first, run dete
19
19
 
20
20
  - `paths.docs` stores project-level docs only.
21
21
  - `paths.modules` stores module source-of-truth docs.
22
- - `paths.raws` stores immutable shared source snapshots and manually provided fact sources.
23
- - `preproposal` may add candidate/generated product, roadmap, UX, and design-source readiness resources under `paths.raws` only when provenance, assumptions, review checkpoint status, and blockers are explicit. When a target module is specified, raw topics default to the module id and must name any narrower page/frame split rationale.
22
+ - `paths.raws` stores shared Resource Snapshots produced from configured resources.
23
+ - Raw resource directories are not pre-created. A child directory under `paths.raws` must correspond to a configured resource output and a real sync result.
24
24
  - Module `_issues` stores module-specific actionable issue records; `paths.issues` is created on demand only for shared/global indexes or cross-module issues.
25
25
  - Module `_evidence` stores module-specific runtime evidence and verification artifacts; `paths.evidence` is created on demand only for shared/global evidence.
26
26
  - 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.
27
27
 
28
- Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are legacy or export surfaces, not default zsk write targets.
28
+ Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are export surfaces, not default zsk write targets.
29
29
 
30
30
  ## Testing Assets
31
31
 
32
- 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`.
32
+ Original QA, acceptance, release, and manually supplied test cases belong in configured resources and may be snapshotted under `paths.raws`. Module-derived test plans and Playwright specs belong under module `_playwright` unless they are intentionally shared under `paths.playwright`.
33
33
 
34
34
  ## Completion Feedback
35
35
 
@@ -44,9 +44,16 @@ Runtime evidence should be linked from docs, not embedded in docs.
44
44
 
45
45
  ZSK stage documents are decision artifacts. They are complete only when the next stage can act without hidden chat context.
46
46
 
47
+ Every stage document must include `Output Quality Check` near the top, after the
48
+ title/summary and before the body. The block is a compact quality status, not a
49
+ log. It uses stable fields in order: `status`, `owner`, `source_basis`,
50
+ `blocking_items`, and `next_action`; optional fields are `waiver` and
51
+ `updated_at`. Valid statuses are `PASS`, `NEEDS_CLARIFICATION`,
52
+ `NEEDS_REPAIR`, `BLOCKED`, and `WAIVED`.
53
+
47
54
  | Stage | Document Mode | Must Prove |
48
55
  | --- | --- | --- |
49
- | `prepare` | Evidence report | Source origins, freshness, conflicts, and raw snapshot paths are known before planning. |
56
+ | `prepare` | Evidence report | Provider readiness, resource freshness, route results, conflicts, and raw snapshot paths are known before planning. |
50
57
  | `preproposal` | Decision brief | Product direction, MVP/phase split, UX/design readiness, assumptions, risks, and readiness review are complete before proposal when no reviewed source pack exists. |
51
58
  | `proposal` | Decision brief | Problem, user/business outcome, scope, non-goals, risks, and success criteria are explicit. |
52
59
  | `spec` | Behavior contract | FR/NFR, scenarios, edge cases, and acceptance criteria are observable and source-linked. |
@@ -61,16 +68,21 @@ ZSK stage documents are decision artifacts. They are complete only when the next
61
68
  Each stage document must separate facts, decisions, assumptions, open questions,
62
69
  evidence, and next action. Do not leave template filler, untraceable "best
63
70
  practice" claims, vague tasks, or unresolved contradictions in a stage artifact.
64
- Each stage challenge must also align terminology against project context,
71
+ Each `Output Quality Check` must also align terminology against project context,
65
72
  configured raw sources, existing artifact IDs, and implementation names when
66
73
  implementation-facing work is touched. Conflicting, overloaded, stale, or
67
74
  translated terms must be recorded as a blocker or repaired by the owning stage.
68
75
 
76
+ When `Output Quality Check` is `NEEDS_CLARIFICATION`, the owning stage uses
77
+ Clarification Prelude: ask one question, show a separate recommendation, refine
78
+ one `待写入确认表达:`, write the accepted expression to `CLAR`, update the stage
79
+ artifact and any reusable `CONTEXT.md` term, then stop after minimal validation.
80
+
69
81
  ## Lifecycle Ownership
70
82
 
71
83
  | Artifact / Decision | Owning Stage | Notes |
72
84
  | --- | --- | --- |
73
- | Source origins, acquisition plan, auth readiness, raw snapshots, manifest/index, adapter results, downstream impact evidence | `prepare` | Capture-only stage. It may classify sources as ready/stale/blocked/gap, but it does not invent requirements, interactions, architecture, or tasks. |
85
+ | Provider profiles, resource intents, acquisition plan, auth readiness, raw snapshots, route results, sync report, and downstream impact evidence | `prepare` | Capture-only stage. It may classify resources as ready/stale/blocked/conflict/gap, but it does not invent requirements, interactions, architecture, or tasks. |
74
86
  | Product direction, roadmap, UX readiness, interaction handoff, design-source map | `preproposal` | Living raw artifacts. They may change after initial review, but each revision records source, status, impact, and affected downstream stages. |
75
87
  | Scope, non-goals, success criteria, high-level risks | `proposal` | Freezes the smallest useful problem/scope boundary before behavior is specified. |
76
88
  | FR, NFR, acceptance criteria, scenarios, edge cases | `spec` | Creates observable behavior contracts from proposal/source evidence. Missing quality targets remain `未指定` instead of invented. |
@@ -0,0 +1,15 @@
1
+ # Shared Evidence
2
+
3
+ Use this directory for shared evidence and reports that are not owned by a single
4
+ module.
5
+
6
+ `zsk prepare sync` writes human-readable preparation reports here, such as:
7
+
8
+ ```text
9
+ .zsk/evidence/prepare/sync-report.md
10
+ .zsk/evidence/prepare/blocked-resources.md
11
+ ```
12
+
13
+ Runtime state, temporary files, traces, videos, and raw provider payloads must
14
+ stay out of committed evidence unless a workflow explicitly promotes a redacted
15
+ artifact.
@@ -0,0 +1,10 @@
1
+ # Global Issues
2
+
3
+ Use this directory for global or cross-module issues:
4
+
5
+ - missing provider credentials;
6
+ - blocked resource preparation;
7
+ - route conflicts across multiple modules;
8
+ - architecture or governance blockers that are not owned by one module.
9
+
10
+ Module-specific work belongs in `.zsk/modules/<module>/_issues/**`.
@@ -0,0 +1,19 @@
1
+ # Modules
2
+
3
+ Modules are explicit business or delivery surfaces. `zsk init` does not create a
4
+ fake default module.
5
+
6
+ Create a module with:
7
+
8
+ ```bash
9
+ zsk module init -m <module-id> --name "<Module Name>"
10
+ ```
11
+
12
+ Module-local generated/manual artifacts use controlled underscore directories:
13
+
14
+ - `_issues/` for module task cards and routed external issues.
15
+ - `_evidence/` for module verification evidence.
16
+ - `_playwright/` for module UI automation plans, specs, auth state, results, and
17
+ reports.
18
+
19
+ These directories are created only when a real module and artifact exist.
@@ -1,7 +1,11 @@
1
- # Module Index
1
+ # Modules
2
2
 
3
- Generated and refreshed as modules are added.
3
+ No modules are declared yet.
4
4
 
5
- | Module | Status | Notes |
6
- | --- | --- | --- |
7
- | | | |
5
+ Add modules in `.zsk/config.yaml` or run:
6
+
7
+ ```bash
8
+ zsk module init -m <module-id> --name "<Module Name>"
9
+ ```
10
+
11
+ This file is the module registry view. It is not a placeholder module.
@@ -0,0 +1,34 @@
1
+ # Raw Resource Snapshots
2
+
3
+ `.zsk/raws` is the Resource Snapshot Library.
4
+
5
+ This directory is config-driven. Do not create empty resource type directories
6
+ because an adapter exists. A child directory is created only when:
7
+
8
+ 1. `.zsk/config.yaml` declares a resource, and
9
+ 2. `zsk prepare sync` produces a snapshot for that resource.
10
+
11
+ ## Snapshot Contract
12
+
13
+ ```text
14
+ .zsk/raws/<resource-kind>/<resource-key>/
15
+ snapshot.md
16
+ metadata.yaml
17
+ source.json
18
+ assets/
19
+ ```
20
+
21
+ `snapshot.md` is the human-readable summary. `metadata.yaml` stores provenance,
22
+ freshness, hashes, provider readiness, and sync state. `source.json` and
23
+ `assets/` hold raw or semi-raw provider payloads and are ignored by default.
24
+
25
+ Directory-style resources, such as git submodules, may use:
26
+
27
+ ```text
28
+ .zsk/raws/repositories/<resource-key>/
29
+ repository/
30
+ snapshot.md
31
+ metadata.yaml
32
+ ```
33
+
34
+ Generated raw indexes are created by sync only after real snapshots exist.