@captain_z/zsk 1.8.4 → 1.8.6

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 (129) 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 +4 -3
  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 +14 -1
  16. package/dist/commands/prepare.js.map +1 -1
  17. package/dist/commands/project-init.js +31 -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 +213 -17
  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-lifecycle.d.ts +2 -0
  43. package/dist/core/prepare-lifecycle.js +49 -0
  44. package/dist/core/prepare-lifecycle.js.map +1 -1
  45. package/dist/core/prepare-materialization.d.ts +8 -0
  46. package/dist/core/prepare-materialization.js +26 -0
  47. package/dist/core/prepare-materialization.js.map +1 -0
  48. package/dist/core/prepare-migration.d.ts +6 -0
  49. package/dist/core/prepare-migration.js +57 -0
  50. package/dist/core/prepare-migration.js.map +1 -0
  51. package/dist/core/prepare-reporting.d.ts +5 -0
  52. package/dist/core/prepare-reporting.js +106 -0
  53. package/dist/core/prepare-reporting.js.map +1 -0
  54. package/dist/core/prepare-routing.d.ts +12 -0
  55. package/dist/core/prepare-routing.js +182 -0
  56. package/dist/core/prepare-routing.js.map +1 -0
  57. package/dist/core/prepare-sync.d.ts +11 -22
  58. package/dist/core/prepare-sync.js +811 -260
  59. package/dist/core/prepare-sync.js.map +1 -1
  60. package/dist/core/prepare-utils.d.ts +6 -0
  61. package/dist/core/prepare-utils.js +35 -0
  62. package/dist/core/prepare-utils.js.map +1 -0
  63. package/dist/core/provider-policy.d.ts +26 -0
  64. package/dist/core/provider-policy.js +180 -0
  65. package/dist/core/provider-policy.js.map +1 -0
  66. package/dist/core/provider-readiness.d.ts +39 -0
  67. package/dist/core/provider-readiness.js +78 -0
  68. package/dist/core/provider-readiness.js.map +1 -0
  69. package/dist/core/source-adapter-normalization.d.ts +31 -0
  70. package/dist/core/source-adapter-normalization.js +235 -0
  71. package/dist/core/source-adapter-normalization.js.map +1 -0
  72. package/dist/core/source-snapshot-adapters.d.ts +3 -3
  73. package/dist/core/source-snapshot-adapters.js +2 -24
  74. package/dist/core/source-snapshot-adapters.js.map +1 -1
  75. package/dist/core/staffing-plan.d.ts +1 -0
  76. package/dist/core/staffing-plan.js +61 -3
  77. package/dist/core/staffing-plan.js.map +1 -1
  78. package/dist/core/stage-clarity-verification.js +21 -18
  79. package/dist/core/stage-clarity-verification.js.map +1 -1
  80. package/dist/core/stage-output-quality.d.ts +3 -0
  81. package/dist/core/stage-output-quality.js +122 -0
  82. package/dist/core/stage-output-quality.js.map +1 -0
  83. package/dist/core/stage-quality-contracts.d.ts +19 -0
  84. package/dist/core/stage-quality-contracts.js.map +1 -1
  85. package/dist/core/stage-quality-criteria.js +0 -37
  86. package/dist/core/stage-quality-criteria.js.map +1 -1
  87. package/dist/core/stage-quality-rendering.d.ts +4 -2
  88. package/dist/core/stage-quality-rendering.js +130 -12
  89. package/dist/core/stage-quality-rendering.js.map +1 -1
  90. package/dist/core/stage-quality.js +17 -6
  91. package/dist/core/stage-quality.js.map +1 -1
  92. package/dist/core/template-registry.js +12 -15
  93. package/dist/core/template-registry.js.map +1 -1
  94. package/dist/core/workspace-conformance.d.ts +39 -0
  95. package/dist/core/workspace-conformance.js +603 -0
  96. package/dist/core/workspace-conformance.js.map +1 -0
  97. package/package.json +2 -2
  98. package/schemas/providers.schema.json +74 -0
  99. package/schemas/zsk-config.schema.json +417 -1
  100. package/templates/project-init/.zsk/README.md +57 -0
  101. package/templates/project-init/.zsk/config.yaml +41 -33
  102. package/templates/project-init/.zsk/docs/CONFIG-SCHEMA.md +131 -0
  103. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +49 -28
  104. package/templates/project-init/.zsk/docs/README.md +10 -0
  105. package/templates/project-init/.zsk/docs/SECURITY.md +34 -0
  106. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +26 -9
  107. package/templates/project-init/.zsk/evidence/README.md +21 -0
  108. package/templates/project-init/.zsk/evidence/prepare/README.md +22 -0
  109. package/templates/project-init/.zsk/issues/README.md +10 -0
  110. package/templates/project-init/.zsk/modules/README.md +19 -0
  111. package/templates/project-init/.zsk/modules/index.md +9 -5
  112. package/templates/project-init/.zsk/raws/README.md +39 -0
  113. package/templates/project-init/.zsk/roles.yaml +36 -105
  114. package/templates/project-init/.zsk/templates/config.examples.yaml +104 -0
  115. package/templates/project-init/.zsk/templates/issue-card.md +23 -0
  116. package/templates/project-init/.zsk/templates/module/README.md +13 -0
  117. package/templates/project-init/.zsk/templates/module/design.md +22 -0
  118. package/templates/project-init/.zsk/templates/module/module.yaml +15 -0
  119. package/templates/project-init/.zsk/templates/module/proposal.md +20 -0
  120. package/templates/project-init/.zsk/templates/module/spec.md +22 -0
  121. package/templates/project-init/.zsk/templates/module/tasks.md +16 -0
  122. package/templates/project-init/.zsk/raws/index.md +0 -34
  123. package/templates/project-init/.zsk/raws/manifest.json +0 -4
  124. package/templates/project-init/.zsk/raws/prepare/backend/index.md +0 -4
  125. package/templates/project-init/.zsk/raws/prepare/design/index.md +0 -21
  126. package/templates/project-init/.zsk/raws/prepare/index.md +0 -37
  127. package/templates/project-init/.zsk/raws/prepare/product/index.md +0 -4
  128. package/templates/project-init/.zsk/raws/prepare/qa/index.md +0 -4
  129. package/templates/project-init/.zsk/raws/prepare/ux/index.md +0 -22
@@ -12,40 +12,48 @@ 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. Configure each platform once. Keep credentials
16
+ # out of this file; reference environment variables or global profiles instead.
17
+ providers: {}
18
+
19
+ # Durable entry sources to prepare. Prefer one authority-bearing entry per
20
+ # platform/domain, then let `zsk prepare draft|plan` discover child pages, files,
21
+ # nodes, or issues into .zsk/evidence/prepare/*/config-draft.yaml and
22
+ # source-promotion-suggestions.md. Do not hand-maintain every discovered child
23
+ # in this file.
24
+ resources: []
25
+
26
+ # Routes map prepared resources into controlled consumption surfaces such as
27
+ # .zsk/modules/<module>/_issues or module source references.
28
+ routes: []
29
29
 
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
30
+ modules:
31
+ root: .zsk/modules
32
+ index: .zsk/modules/index.md
33
+ registry: []
34
+
35
+ # Demo login bootstrap. Keep real credentials in local env files; put only env
36
+ # key names here, then run `zsk demo auth -m <module>` once to save storageState.
37
+ # automation:
38
+ # demo:
39
+ # auth:
40
+ # required: true
41
+ # loginUrl: http://localhost:3000/login
42
+ # storageState: .zsk/modules/{module}/_playwright/.auth/user.json
43
+ # envFiles:
44
+ # - ~/.zshrc
45
+ # env:
46
+ # username: DEMO_USERNAME
47
+ # password: DEMO_PASSWORD
48
+ # selectors:
49
+ # username: input[name="username"]
50
+ # password: input[type="password"]
51
+ # submit: button[type="submit"]
52
+
53
+ # Current prepare implementation compatibility tree. Use it for durable
54
+ # grouped prepare entries only. Auto-discovered children should stay in
55
+ # evidence/raw indexes until a human promotes them from config-draft.yaml.
56
+ sources: {}
49
57
 
50
58
  customize:
51
59
  roles: .zsk/roles.yaml
@@ -0,0 +1,131 @@
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` | Durable entry-source intents to prepare, such as repository roots, issue feeds, document entry pages, design entry nodes, 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 for durable grouped prepare entries. Auto-discovered children stay in draft evidence until promoted. |
18
+
19
+ ## Materialization
20
+
21
+ The workspace does not pre-create resource directories.
22
+
23
+ - `resources` or durable `sources` entries produce `.zsk/raws/**` snapshots after sync.
24
+ - `zsk prepare draft` writes candidate entries to
25
+ `.zsk/evidence/prepare/{run}/config-draft.yaml` and review guidance to
26
+ `source-promotion-suggestions.md`; it must not update `.zsk/config.yaml`.
27
+ - `routes` entries may update `.zsk/modules/<module>/_issues/**`,
28
+ `.zsk/modules/<module>/sources.yaml`, or other controlled artifacts.
29
+ - `zsk prepare sync` writes `.zsk/evidence/prepare/sync-report.md`.
30
+ - Missing provider credentials or route conflicts must be visible in the report
31
+ with a clear state, reason, output path, and next action.
32
+
33
+ ## Resource Output
34
+
35
+ Default raw output is derived from `type + id`, but a resource may override it
36
+ with `output.rawPath`. Keep these entries at the authority-entry level; do not
37
+ hand-maintain every child page, issue, Figma node, or file found under the entry.
38
+
39
+ ```yaml
40
+ resources:
41
+ - id: my-bugs
42
+ type: issues
43
+ provider: jira
44
+ ```
45
+
46
+ Default output:
47
+
48
+ ```text
49
+ .zsk/raws/issues/my-bugs/
50
+ ```
51
+
52
+ Only configured resources with produced snapshots create directories.
53
+
54
+ ## Credential References
55
+
56
+ `.zsk/config.yaml` stores env var names only. Put the values in the runtime
57
+ environment, for example by exporting them from `~/.zshrc` before launching the
58
+ shell that runs `zsk`.
59
+
60
+ ```yaml
61
+ providers:
62
+ jira:
63
+ type: issues
64
+ adapter: jira
65
+ baseUrl: https://jira.example.com
66
+ auth:
67
+ env: ACCESS_TOKEN
68
+ confluence:
69
+ type: document
70
+ adapter: confluence
71
+ baseUrl: https://confluence.example.com
72
+ auth:
73
+ usernameEnv: CONFLUENCE_USER
74
+ passwordEnv: CONFLUENCE_PASSWORD
75
+ ```
76
+
77
+ ## Adapter Fallbacks
78
+
79
+ `source.adapter` is reserved for built-in source adapters: `jira`,
80
+ `confluence`, `gitlab`, and `figma`. Runtime tools such as `playwright_cli`,
81
+ `playwright_mcp`, `browser_use`, and `computer_use` are fallback or observation
82
+ surfaces, not provider adapters.
83
+
84
+ Use `fallback` when a source may need a runtime-assisted acquisition path:
85
+
86
+ ```yaml
87
+ sources:
88
+ product:
89
+ prd:
90
+ type: prd
91
+ origin:
92
+ kind: url
93
+ url: https://example.com/prd
94
+ fallback:
95
+ acquisition: [playwright_cli]
96
+ observation: [computer_use]
97
+ ```
98
+
99
+ Compatibility note: if an older config puts `playwright_cli` or `computer_use`
100
+ under `adapter`, config check accepts it with a warning and treats it as a
101
+ fallback alias. `computer_use` remains observation-only; prepare sync will not
102
+ silently launch a Computer Use session.
103
+
104
+ ## Demo Auth
105
+
106
+ Authenticated demos should configure login resources by reference. Keep real
107
+ credentials in local env files such as `~/.zshrc`; put only env key names in
108
+ `.zsk/config.yaml`.
109
+
110
+ ```yaml
111
+ automation:
112
+ demo:
113
+ auth:
114
+ required: true
115
+ loginUrl: http://localhost:3000/login
116
+ storageState: .zsk/modules/{module}/_playwright/.auth/user.json
117
+ envFiles:
118
+ - ~/.zshrc
119
+ env:
120
+ username: DEMO_USERNAME
121
+ password: DEMO_PASSWORD
122
+ selectors:
123
+ username: input[name="username"]
124
+ password: input[type="password"]
125
+ submit: button[type="submit"]
126
+ ```
127
+
128
+ `zsk demo auth -m <module>` writes a module-local Playwright login helper that
129
+ loads those env files, fills configured fields when selectors are available,
130
+ then saves reusable `storageState`. Generated demo specs reuse the same
131
+ `storageState` and fail fast if they are redirected back to a login page.
@@ -19,9 +19,12 @@ 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/` | Entry-driven Resource Snapshot Library |
26
+ | `.zsk/evidence/prepare/{run}/config-draft.yaml` | Auto-discovered source candidate tree for review |
27
+ | `.zsk/evidence/prepare/{run}/source-promotion-suggestions.md` | Human review queue for promoting candidates into config |
25
28
  | `.zsk/modules/{module}/_issues/` | Module-private issue records, created on demand |
26
29
  | `.zsk/modules/{module}/_evidence/` | Module-private evidence, screenshots, traces, logs, and verification artifacts, created on demand |
27
30
  | `.zsk/modules/{module}/_playwright/` | Module-specific Playwright specs, plans, auth state, results, reports, and execution records, created on demand |
@@ -33,12 +36,13 @@ Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are not default write tar
33
36
 
34
37
  1. `.zsk/config.yaml`
35
38
  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`
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`
39
+ 3. Project provider/entry-source/route intent in `.zsk/config.yaml`
40
+ 4. Prepare drafts and promotion suggestions under `.zsk/evidence/prepare/{run}/`
41
+ 5. Materialized resource snapshots under `.zsk/raws/**`
42
+ 6. `.zsk/modules/{module}/module.yaml`
43
+ 7. `.zsk/modules/{module}/spec.md`
44
+ 8. `.zsk/modules/{module}/design.md`
45
+ 9. Runtime evidence under module `_evidence` / `_playwright` or shared `.zsk/evidence` / `.zsk/playwright`
42
46
 
43
47
  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
48
 
@@ -53,21 +57,31 @@ Every module stage document is a handoff contract:
53
57
 
54
58
  If a document cannot answer its stage questions, stop and record the missing source, decision, blocker, or issue instead of filling the template.
55
59
 
56
- ## Preproposal Raw Artifacts
60
+ ## Resource Snapshot Contract
57
61
 
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.
62
+ `prepare sync` materializes configured resources under `.zsk/raws/**`; init does
63
+ not create resource subdirectories or empty indexes.
61
64
 
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}/`.
65
+ Configure durable entry sources in `.zsk/config.yaml`, not every child artifact
66
+ found below an entry. For example, one Confluence space/page entry can be the
67
+ authority for a product area; child pages discovered from that entry first land
68
+ in `.zsk/evidence/prepare/{run}/config-draft.yaml` and
69
+ `source-promotion-suggestions.md`. Promote a child into `.zsk/config.yaml` only
70
+ after a human confirms it is stable, reusable, and worth tracking as an
71
+ authority source.
66
72
 
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.
73
+ Default resource output is derived from `type + id`, for example:
74
+
75
+ | Resource | Default Snapshot Path |
76
+ | --- | --- |
77
+ | `type: repository`, `id: core-api` | `.zsk/raws/repositories/core-api/` |
78
+ | `type: issues`, `id: my-bugs` | `.zsk/raws/issues/my-bugs/` |
79
+ | `type: document`, `id: role-prd` | `.zsk/raws/document/role-prd/` |
80
+
81
+ Each snapshot directory should contain a human-readable `snapshot.md`, redacted
82
+ `metadata.yaml`, ignored `source.json`, and ignored `assets/` when raw payloads
83
+ or exports exist. Directory-style resources such as git submodules may also
84
+ contain a `repository/` checkout.
71
85
 
72
86
  ## Prepare Capture Strategy
73
87
 
@@ -76,16 +90,21 @@ not a requirement author, interaction designer, code designer, or task planner.
76
90
 
77
91
  Use this order for source capture:
78
92
 
79
- 1. Register stable origins in `.zsk/config.yaml#sources`.
80
- 2. Run `zsk prepare plan` to classify ready, stale, blocked, and ambiguous
93
+ 1. Register provider profiles, entry sources, and routes in `.zsk/config.yaml`.
94
+ 2. Run `zsk prepare draft` to write a candidate `config-draft.yaml` and
95
+ `source-promotion-suggestions.md`; review these before applying changes to
96
+ `.zsk/config.yaml`.
97
+ 3. Run `zsk prepare plan` to classify ready, stale, blocked, and ambiguous
81
98
  sources before writing snapshots.
82
- 3. Run `zsk prepare auth-check` for private URLs so credentials are verified
83
- without writing source content.
84
- 4. Run `zsk prepare sync` for local/provider/export sources, adding
99
+ 4. Run `zsk prepare auth-check` for private URLs so credentials are verified
100
+ without writing source content. The command reads exported env vars such as
101
+ `ACCESS_TOKEN`, `CONFLUENCE_USER`, and `CONFLUENCE_PASSWORD`; it never reads
102
+ `~/.zshrc` directly or prints secret values.
103
+ 5. Run `zsk prepare sync` for local/provider/export sources, adding
85
104
  `--allow-network`, `--browser`, and `--auth-state` only when that acquisition
86
105
  is intentional.
87
- 5. Review `.zsk/evidence/prepare/{run}/adapter-results/` and
88
- `downstream-impact.md` before downstream stages consume the snapshot.
106
+ 6. Review `.zsk/evidence/prepare/sync-report.md` before downstream stages
107
+ consume the snapshot.
89
108
 
90
109
  For Figma or similar design tools, prefer provider API/export payloads, raw node
91
110
  exports, screenshots/assets, and local design-source maps over a bare page URL.
@@ -98,7 +117,9 @@ narrower page/frame split is justified in the raw artifact.
98
117
 
99
118
  ## Maintenance Checklist
100
119
 
101
- - Update `.zsk/config.yaml` when paths, tools, or source origins change.
120
+ - Update `.zsk/config.yaml` when providers, durable entry sources, routes, modules, paths, or tools change.
121
+ - Review `config-draft.yaml` and `source-promotion-suggestions.md` before
122
+ promoting discovered child resources into `.zsk/config.yaml`.
102
123
  - Keep project-wide reusable rules in `.zsk/docs/SYSTEM-SPEC.md`.
103
124
  - Keep module-specific decisions in `.zsk/modules/{module}/`.
104
125
  - 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,10 +6,11 @@ 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 entry sources and materialized snapshots under `paths.raws`;
10
10
  - project-wide rules under `paths.docs`;
11
11
  - module-owned stage contracts under `paths.modules`;
12
- - runtime evidence under module `_evidence` or shared `paths.evidence`;
12
+ - prepare drafts/promotion suggestions and runtime evidence under module
13
+ `_evidence` or shared `paths.evidence`;
13
14
  - issue records under module `_issues` or shared/global `paths.issues`;
14
15
  - Playwright plans/specs/results under module `_playwright` or shared `paths.playwright`.
15
16
 
@@ -19,17 +20,21 @@ Agents must use the smallest sufficient lane: read local sources first, run dete
19
20
 
20
21
  - `paths.docs` stores project-level docs only.
21
22
  - `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.
23
+ - `paths.raws` stores shared Resource Snapshots produced from configured entry sources.
24
+ - 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.
25
+ - `paths.evidence/prepare/{run}/config-draft.yaml` and
26
+ `source-promotion-suggestions.md` are the review queue for discovered child
27
+ sources. They do not change `.zsk/config.yaml` until a human promotes selected
28
+ entries.
24
29
  - Module `_issues` stores module-specific actionable issue records; `paths.issues` is created on demand only for shared/global indexes or cross-module issues.
25
30
  - Module `_evidence` stores module-specific runtime evidence and verification artifacts; `paths.evidence` is created on demand only for shared/global evidence.
26
31
  - 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
32
 
28
- Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are legacy or export surfaces, not default zsk write targets.
33
+ Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are export surfaces, not default zsk write targets.
29
34
 
30
35
  ## Testing Assets
31
36
 
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`.
37
+ 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
38
 
34
39
  ## Completion Feedback
35
40
 
@@ -44,9 +49,16 @@ Runtime evidence should be linked from docs, not embedded in docs.
44
49
 
45
50
  ZSK stage documents are decision artifacts. They are complete only when the next stage can act without hidden chat context.
46
51
 
52
+ Every stage document must include `Output Quality Check` near the top, after the
53
+ title/summary and before the body. The block is a compact quality status, not a
54
+ log. It uses stable fields in order: `status`, `owner`, `source_basis`,
55
+ `blocking_items`, and `next_action`; optional fields are `waiver` and
56
+ `updated_at`. Valid statuses are `PASS`, `NEEDS_CLARIFICATION`,
57
+ `NEEDS_REPAIR`, `BLOCKED`, and `WAIVED`.
58
+
47
59
  | Stage | Document Mode | Must Prove |
48
60
  | --- | --- | --- |
49
- | `prepare` | Evidence report | Source origins, freshness, conflicts, and raw snapshot paths are known before planning. |
61
+ | `prepare` | Evidence report | Provider readiness, resource freshness, route results, conflicts, and raw snapshot paths are known before planning. |
50
62
  | `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
63
  | `proposal` | Decision brief | Problem, user/business outcome, scope, non-goals, risks, and success criteria are explicit. |
52
64
  | `spec` | Behavior contract | FR/NFR, scenarios, edge cases, and acceptance criteria are observable and source-linked. |
@@ -61,16 +73,21 @@ ZSK stage documents are decision artifacts. They are complete only when the next
61
73
  Each stage document must separate facts, decisions, assumptions, open questions,
62
74
  evidence, and next action. Do not leave template filler, untraceable "best
63
75
  practice" claims, vague tasks, or unresolved contradictions in a stage artifact.
64
- Each stage challenge must also align terminology against project context,
76
+ Each `Output Quality Check` must also align terminology against project context,
65
77
  configured raw sources, existing artifact IDs, and implementation names when
66
78
  implementation-facing work is touched. Conflicting, overloaded, stale, or
67
79
  translated terms must be recorded as a blocker or repaired by the owning stage.
68
80
 
81
+ When `Output Quality Check` is `NEEDS_CLARIFICATION`, the owning stage uses
82
+ Clarification Prelude: ask one question, show a separate recommendation, refine
83
+ one `待写入确认表达:`, write the accepted expression to `CLAR`, update the stage
84
+ artifact and any reusable `CONTEXT.md` term, then stop after minimal validation.
85
+
69
86
  ## Lifecycle Ownership
70
87
 
71
88
  | Artifact / Decision | Owning Stage | Notes |
72
89
  | --- | --- | --- |
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. |
90
+ | Provider profiles, durable entry-source intents, config drafts, source-promotion suggestions, 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. Auto-discovered children stay advisory until human promotion into config. |
74
91
  | 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
92
  | Scope, non-goals, success criteria, high-level risks | `proposal` | Freezes the smallest useful problem/scope boundary before behavior is specified. |
76
93
  | 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,21 @@
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/<run>/config-draft.yaml
10
+ .zsk/evidence/prepare/<run>/source-promotion-suggestions.md
11
+ .zsk/evidence/prepare/sync-report.md
12
+ .zsk/evidence/prepare/blocked-resources.md
13
+ ```
14
+
15
+ `config-draft.yaml` and `source-promotion-suggestions.md` are review artifacts.
16
+ They do not mutate `.zsk/config.yaml`; selected entries must be applied only
17
+ after human confirmation.
18
+
19
+ Runtime state, temporary files, traces, videos, and raw provider payloads must
20
+ stay out of committed evidence unless a workflow explicitly promotes a redacted
21
+ artifact.
@@ -0,0 +1,22 @@
1
+ # Prepare Evidence
2
+
3
+ Prepare runs write per-run artifacts here:
4
+
5
+ ```text
6
+ .zsk/evidence/prepare/<run>/
7
+ repo-inventory.json
8
+ config-draft.yaml
9
+ source-promotion-suggestions.md
10
+ acquisition-plan.json
11
+ blocked-sources.md
12
+ correspondence-questions.md
13
+ ```
14
+
15
+ Default collaboration rule:
16
+
17
+ - `config-draft.yaml` is a candidate tree, not an applied config.
18
+ - `source-promotion-suggestions.md` explains which candidates are ready or need
19
+ review.
20
+ - `.zsk/config.yaml` changes only after human confirmation.
21
+ - `sync-report.md` summarizes actual materialization results after
22
+ `zsk prepare sync`.
@@ -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,39 @@
1
+ # Raw Resource Snapshots
2
+
3
+ `.zsk/raws` is the Resource Snapshot Library.
4
+
5
+ This directory is entry-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 durable entry source, and
9
+ 2. `zsk prepare sync` produces a snapshot for that resource.
10
+
11
+ Auto-discovered child pages, nodes, issues, and files should first appear in
12
+ `.zsk/evidence/prepare/{run}/config-draft.yaml` and
13
+ `source-promotion-suggestions.md`. Promote only human-confirmed authority
14
+ sources back into `.zsk/config.yaml`.
15
+
16
+ ## Snapshot Contract
17
+
18
+ ```text
19
+ .zsk/raws/<resource-kind>/<resource-key>/
20
+ snapshot.md
21
+ metadata.yaml
22
+ source.json
23
+ assets/
24
+ ```
25
+
26
+ `snapshot.md` is the human-readable summary. `metadata.yaml` stores provenance,
27
+ freshness, hashes, provider readiness, and sync state. `source.json` and
28
+ `assets/` hold raw or semi-raw provider payloads and are ignored by default.
29
+
30
+ Directory-style resources, such as git submodules, may use:
31
+
32
+ ```text
33
+ .zsk/raws/repositories/<resource-key>/
34
+ repository/
35
+ snapshot.md
36
+ metadata.yaml
37
+ ```
38
+
39
+ Generated raw indexes are created by sync only after real snapshots exist.