@captain_z/zsk 1.8.3 → 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 (143) hide show
  1. package/dist/bin.js +13 -0
  2. package/dist/bin.js.map +1 -1
  3. package/dist/commands/add-flow.d.ts +3 -7
  4. package/dist/commands/add-flow.js +7 -59
  5. package/dist/commands/add-flow.js.map +1 -1
  6. package/dist/commands/add.js +25 -104
  7. package/dist/commands/add.js.map +1 -1
  8. package/dist/commands/check.js +14 -575
  9. package/dist/commands/check.js.map +1 -1
  10. package/dist/commands/config.js +1 -1
  11. package/dist/commands/config.js.map +1 -1
  12. package/dist/commands/demo.d.ts +5 -0
  13. package/dist/commands/demo.js +70 -297
  14. package/dist/commands/demo.js.map +1 -1
  15. package/dist/commands/doctor.js +9 -4
  16. package/dist/commands/doctor.js.map +1 -1
  17. package/dist/commands/gate.d.ts +1 -0
  18. package/dist/commands/gate.js +8 -2
  19. package/dist/commands/gate.js.map +1 -1
  20. package/dist/commands/prepare.js +7 -1
  21. package/dist/commands/prepare.js.map +1 -1
  22. package/dist/commands/project-init.js +30 -8
  23. package/dist/commands/project-init.js.map +1 -1
  24. package/dist/core/config.d.ts +68 -0
  25. package/dist/core/config.js +198 -15
  26. package/dist/core/config.js.map +1 -1
  27. package/dist/core/demo-auth.d.ts +30 -0
  28. package/dist/core/demo-auth.js +213 -0
  29. package/dist/core/demo-auth.js.map +1 -0
  30. package/dist/core/demo-scenarios.d.ts +62 -0
  31. package/dist/core/demo-scenarios.js +276 -0
  32. package/dist/core/demo-scenarios.js.map +1 -0
  33. package/dist/core/demo-sources.d.ts +37 -0
  34. package/dist/core/demo-sources.js +198 -0
  35. package/dist/core/demo-sources.js.map +1 -0
  36. package/dist/core/mcp-registry-discovery.d.ts +16 -0
  37. package/dist/core/mcp-registry-discovery.js +187 -0
  38. package/dist/core/mcp-registry-discovery.js.map +1 -0
  39. package/dist/core/origin-detection.js +1 -1
  40. package/dist/core/origin-detection.js.map +1 -1
  41. package/dist/core/prepare-artifacts.d.ts +16 -0
  42. package/dist/core/prepare-artifacts.js +25 -0
  43. package/dist/core/prepare-artifacts.js.map +1 -0
  44. package/dist/core/prepare-auth-helper.d.ts +8 -0
  45. package/dist/core/prepare-auth-helper.js +32 -0
  46. package/dist/core/prepare-auth-helper.js.map +1 -0
  47. package/dist/core/prepare-materialization.d.ts +8 -0
  48. package/dist/core/prepare-materialization.js +26 -0
  49. package/dist/core/prepare-materialization.js.map +1 -0
  50. package/dist/core/prepare-migration.d.ts +6 -0
  51. package/dist/core/prepare-migration.js +57 -0
  52. package/dist/core/prepare-migration.js.map +1 -0
  53. package/dist/core/prepare-reporting.d.ts +5 -0
  54. package/dist/core/prepare-reporting.js +106 -0
  55. package/dist/core/prepare-reporting.js.map +1 -0
  56. package/dist/core/prepare-routing.d.ts +12 -0
  57. package/dist/core/prepare-routing.js +182 -0
  58. package/dist/core/prepare-routing.js.map +1 -0
  59. package/dist/core/prepare-sync.d.ts +13 -53
  60. package/dist/core/prepare-sync.js +878 -359
  61. package/dist/core/prepare-sync.js.map +1 -1
  62. package/dist/core/prepare-utils.d.ts +6 -0
  63. package/dist/core/prepare-utils.js +35 -0
  64. package/dist/core/prepare-utils.js.map +1 -0
  65. package/dist/core/profile-bundle-installation.d.ts +55 -0
  66. package/dist/core/profile-bundle-installation.js +170 -0
  67. package/dist/core/profile-bundle-installation.js.map +1 -0
  68. package/dist/core/provider-policy.d.ts +26 -0
  69. package/dist/core/provider-policy.js +180 -0
  70. package/dist/core/provider-policy.js.map +1 -0
  71. package/dist/core/provider-readiness.d.ts +39 -0
  72. package/dist/core/provider-readiness.js +78 -0
  73. package/dist/core/provider-readiness.js.map +1 -0
  74. package/dist/core/source-adapter-normalization.d.ts +31 -0
  75. package/dist/core/source-adapter-normalization.js +235 -0
  76. package/dist/core/source-adapter-normalization.js.map +1 -0
  77. package/dist/core/source-snapshot-adapters.d.ts +59 -0
  78. package/dist/core/source-snapshot-adapters.js +60 -0
  79. package/dist/core/source-snapshot-adapters.js.map +1 -0
  80. package/dist/core/staffing-plan.d.ts +1 -0
  81. package/dist/core/staffing-plan.js +113 -21
  82. package/dist/core/staffing-plan.js.map +1 -1
  83. package/dist/core/stage-clarity-verification.d.ts +31 -0
  84. package/dist/core/stage-clarity-verification.js +316 -0
  85. package/dist/core/stage-clarity-verification.js.map +1 -0
  86. package/dist/core/stage-output-quality.d.ts +3 -0
  87. package/dist/core/stage-output-quality.js +122 -0
  88. package/dist/core/stage-output-quality.js.map +1 -0
  89. package/dist/core/stage-quality-artifacts.d.ts +15 -0
  90. package/dist/core/stage-quality-artifacts.js +421 -0
  91. package/dist/core/stage-quality-artifacts.js.map +1 -0
  92. package/dist/core/stage-quality-contracts.d.ts +105 -0
  93. package/dist/core/stage-quality-contracts.js +2 -0
  94. package/dist/core/stage-quality-contracts.js.map +1 -0
  95. package/dist/core/stage-quality-criteria.d.ts +9 -0
  96. package/dist/core/stage-quality-criteria.js +286 -0
  97. package/dist/core/stage-quality-criteria.js.map +1 -0
  98. package/dist/core/stage-quality-rendering.d.ts +15 -0
  99. package/dist/core/stage-quality-rendering.js +240 -0
  100. package/dist/core/stage-quality-rendering.js.map +1 -0
  101. package/dist/core/stage-quality.d.ts +4 -59
  102. package/dist/core/stage-quality.js +54 -795
  103. package/dist/core/stage-quality.js.map +1 -1
  104. package/dist/core/template-registry.js +12 -15
  105. package/dist/core/template-registry.js.map +1 -1
  106. package/dist/core/workspace-conformance.d.ts +39 -0
  107. package/dist/core/workspace-conformance.js +603 -0
  108. package/dist/core/workspace-conformance.js.map +1 -0
  109. package/package.json +2 -2
  110. package/schemas/providers.schema.json +74 -0
  111. package/schemas/zsk-config.schema.json +417 -1
  112. package/templates/module/frontend-module/design.md +10 -0
  113. package/templates/module/frontend-module/proposal.md +8 -0
  114. package/templates/module/frontend-module/spec.md +7 -0
  115. package/templates/project-init/.zsk/README.md +48 -0
  116. package/templates/project-init/.zsk/config.yaml +37 -0
  117. package/templates/project-init/.zsk/docs/CONFIG-SCHEMA.md +127 -0
  118. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +53 -5
  119. package/templates/project-init/.zsk/docs/README.md +10 -0
  120. package/templates/project-init/.zsk/docs/SECURITY.md +34 -0
  121. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +39 -7
  122. package/templates/project-init/.zsk/evidence/README.md +15 -0
  123. package/templates/project-init/.zsk/issues/README.md +10 -0
  124. package/templates/project-init/.zsk/modules/README.md +19 -0
  125. package/templates/project-init/.zsk/modules/index.md +9 -5
  126. package/templates/project-init/.zsk/raws/README.md +34 -0
  127. package/templates/project-init/.zsk/roles.yaml +36 -105
  128. package/templates/project-init/.zsk/templates/config.examples.yaml +83 -0
  129. package/templates/project-init/.zsk/templates/issue-card.md +23 -0
  130. package/templates/project-init/.zsk/templates/module/README.md +13 -0
  131. package/templates/project-init/.zsk/templates/module/design.md +22 -0
  132. package/templates/project-init/.zsk/templates/module/module.yaml +15 -0
  133. package/templates/project-init/.zsk/templates/module/proposal.md +20 -0
  134. package/templates/project-init/.zsk/templates/module/spec.md +22 -0
  135. package/templates/project-init/.zsk/templates/module/tasks.md +16 -0
  136. package/templates/project-init/.zsk/raws/index.md +0 -18
  137. package/templates/project-init/.zsk/raws/manifest.json +0 -4
  138. package/templates/project-init/.zsk/raws/prepare/backend/index.md +0 -4
  139. package/templates/project-init/.zsk/raws/prepare/design/index.md +0 -3
  140. package/templates/project-init/.zsk/raws/prepare/index.md +0 -4
  141. package/templates/project-init/.zsk/raws/prepare/product/index.md +0 -4
  142. package/templates/project-init/.zsk/raws/prepare/qa/index.md +0 -4
  143. package/templates/project-init/.zsk/raws/prepare/ux/index.md +0 -3
@@ -12,6 +12,43 @@ template:
12
12
  mode: standard
13
13
  scale: auto
14
14
 
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: []
26
+
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.
15
52
  sources: {}
16
53
 
17
54
  customize:
@@ -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,9 +54,56 @@ 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
 
57
+ ## Resource Snapshot Contract
58
+
59
+ `prepare sync` materializes configured resources under `.zsk/raws/**`; init does
60
+ not create resource subdirectories or empty indexes.
61
+
62
+ Default resource output is derived from `type + id`, for example:
63
+
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.
74
+
75
+ ## Prepare Capture Strategy
76
+
77
+ `prepare` records where facts come from and whether they can be acquired. It is
78
+ not a requirement author, interaction designer, code designer, or task planner.
79
+
80
+ Use this order for source capture:
81
+
82
+ 1. Register provider profiles, resource intents, and routes in `.zsk/config.yaml`.
83
+ 2. Run `zsk prepare plan` to classify ready, stale, blocked, and ambiguous
84
+ sources before writing snapshots.
85
+ 3. Run `zsk prepare auth-check` for private URLs so credentials are verified
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.
89
+ 4. Run `zsk prepare sync` for local/provider/export sources, adding
90
+ `--allow-network`, `--browser`, and `--auth-state` only when that acquisition
91
+ is intentional.
92
+ 5. Review `.zsk/evidence/prepare/sync-report.md` before downstream stages
93
+ consume the snapshot.
94
+
95
+ For Figma or similar design tools, prefer provider API/export payloads, raw node
96
+ exports, screenshots/assets, and local design-source maps over a bare page URL.
97
+ Browser-rendered capture is useful evidence, but it is not complete interaction
98
+ truth. Pair design snapshots with a reviewed
99
+ `.zsk/raws/prepare/ux/{topic}/interaction-handoff.md` when page/module behavior,
100
+ states, empty/error/loading flows, or accessibility rules are needed. For
101
+ module-targeted preproposal work, `{topic}` defaults to the module id unless a
102
+ narrower page/frame split is justified in the raw artifact.
103
+
56
104
  ## Maintenance Checklist
57
105
 
58
- - 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.
59
107
  - Keep project-wide reusable rules in `.zsk/docs/SYSTEM-SPEC.md`.
60
108
  - Keep module-specific decisions in `.zsk/modules/{module}/`.
61
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.
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. |
@@ -58,4 +65,29 @@ ZSK stage documents are decision artifacts. They are complete only when the next
58
65
  | `ready` | Verification handoff | Fixed issues, AC, evidence, replay steps, version, and residual risks are mapped. |
59
66
  | `verify` | Independent evidence | The ready claim is replayed with fresh evidence and pass/fail issue status updates. |
60
67
 
61
- 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.
68
+ Each stage document must separate facts, decisions, assumptions, open questions,
69
+ evidence, and next action. Do not leave template filler, untraceable "best
70
+ practice" claims, vague tasks, or unresolved contradictions in a stage artifact.
71
+ Each `Output Quality Check` must also align terminology against project context,
72
+ configured raw sources, existing artifact IDs, and implementation names when
73
+ implementation-facing work is touched. Conflicting, overloaded, stale, or
74
+ translated terms must be recorded as a blocker or repaired by the owning stage.
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
+
81
+ ## Lifecycle Ownership
82
+
83
+ | Artifact / Decision | Owning Stage | Notes |
84
+ | --- | --- | --- |
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. |
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. |
87
+ | Scope, non-goals, success criteria, high-level risks | `proposal` | Freezes the smallest useful problem/scope boundary before behavior is specified. |
88
+ | FR, NFR, acceptance criteria, scenarios, edge cases | `spec` | Creates observable behavior contracts from proposal/source evidence. Missing quality targets remain `未指定` instead of invented. |
89
+ | ADR / decision records for architecture, interfaces, state/data flow, storage, migration, dependency, rollback, integration, security, permission, privacy, or public API decisions | `design` | Required only for design-significant decisions. N/A must cite why no such decision exists. |
90
+ | Proposal/spec/design/ADR alignment and executable work | `task` | Preserves FR/AC/NFR/ADR traceability into task groups, subtasks, evidence, and stop conditions. |
91
+
92
+ Downstream stages consume reviewed upstream revisions. They may report gaps, but
93
+ must not silently rewrite another stage's source of truth.
@@ -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.
@@ -1,129 +1,60 @@
1
- # ZSK role resource pool.
2
- # Skills dispatch work to these roles as needed; stages and lanes are routing
3
- # hints, not hard limits. Projects may add roles or lane aliases freely.
1
+ # ZSK role pool.
2
+ #
3
+ # This file declares reusable staffing policy. It does not describe a specific
4
+ # run's chosen subagents; dispatch writes run-specific staffing evidence under
5
+ # .zsk/evidence/**.
4
6
 
5
7
  version: 1
6
8
 
7
9
  roles:
8
- lead-integrator:
10
+ leader:
9
11
  subagentType: planner
10
12
  required: true
11
13
  activation: required
12
- reason: Own stage scope, dispatch boundaries, integration, and final evidence.
13
-
14
- product-owner:
15
- subagentType: analyst
16
- stages: [prepare, preproposal, proposal, spec, review, verify, acceptance]
17
- lanes: [product, pm, requirement, requirements, srs, prd]
18
- activation: when product or requirement evidence is configured or in scope
19
- reason: Interpret product scope, requirement semantics, priorities, and acceptance gaps.
20
-
21
- business-analyst:
22
- subagentType: analyst
23
- stages: [preproposal, proposal, spec]
24
- lanes: [business, domain, process, rules]
25
- activation: when domain process or business-rule evidence is configured or in scope
26
- reason: Map domain process, terminology, business rules, and edge cases.
27
-
28
- architect:
29
- subagentType: architect
30
- stages: [preproposal, proposal, spec, design, review]
31
- activation: when architecture, API, system-boundary, or dependency decisions are in scope
32
- reason: Review system boundaries, module relationships, contracts, and technical risks.
33
-
34
- backend-engineer:
35
- subagentType: executor
36
- stages: [prepare, design]
37
- lanes: [backend, api, service, server, repository, repo, repos]
38
- activation: when backend, API, service, repository, or data sources are configured
39
- reason: Inspect backend sources, API contracts, data models, and service-boundary gaps.
40
-
41
- frontend-engineer:
42
- subagentType: executor
43
- stages: [design]
44
- lanes: [frontend, web, client, mobile]
45
- activation: when frontend implementation, routing, state, or UI integration is in scope
46
- reason: Map UI implementation, routing, state, and component integration risk.
47
-
48
- design-specialist:
49
- subagentType: designer
50
- stages: [prepare, preproposal, design]
51
- lanes: [design, ui, visual]
52
- activation: when design, UI, visual, prototype, or asset sources are configured
53
- reason: Inspect design assets, screens, visual states, and design-source gaps.
54
-
55
- ux-specialist:
56
- subagentType: designer
57
- stages: [prepare, preproposal]
58
- lanes: [ux, ue, user-experience, research]
59
- activation: when UX, UE, user-flow, or research sources are configured
60
- reason: Inspect user flows, interaction constraints, and usability ambiguity.
61
-
62
- qa-engineer:
63
- subagentType: test-engineer
64
- stages: [prepare, preproposal, spec, task, coding, fix, review, verify]
65
- lanes: [qa, test, testing, quality]
66
- activation: when QA, test, acceptance, or quality evidence is configured or in scope
67
- reason: Connect requirements to acceptance scenarios, test coverage, and verification evidence.
68
-
69
- security-reviewer:
70
- subagentType: security-reviewer
71
- stages: [spec, design, review]
72
- lanes: [security, sec, auth]
73
- activation: when auth, permission, privacy, or data-safety boundaries are in scope
74
- reason: Review trust boundaries, credentials, privacy, and abuse cases.
75
-
76
- operations-engineer:
77
- subagentType: executor
78
- lanes: [ops, devops, release, deploy, platform]
79
- activation: when environment, CI/CD, deployment, or platform risks are configured or in scope
80
- reason: Review release, deployment, rollback, and operational risks.
81
-
82
- auth-fetch-agent:
83
- subagentType: researcher
84
- stages: [prepare]
85
- remoteSources: true
86
- activation: when remote or provider-managed sources are configured
87
- reason: Materialize remote/provider sources through explicit auth, session, and fetch contracts.
14
+ reason: Owns scope, sequencing, integration, and final evidence.
88
15
 
89
16
  researcher:
90
17
  subagentType: researcher
91
18
  stages: [prepare, preproposal]
92
- activation: optional when current official or external evidence is required
93
- reason: Collect official/current external references only when configured local sources are insufficient.
19
+ activation: when current external or provider evidence is required
20
+ reason: Fetches and validates source evidence without owning stage docs.
94
21
 
95
- planner:
96
- subagentType: planner
97
- stages: [preproposal, task]
98
- activation: when task sequencing, dependencies, and risk flags are in scope
99
- reason: Sequence implementation tasks, dependencies, ownership, and evidence hooks.
22
+ architect:
23
+ subagentType: architect
24
+ stages: [proposal, spec, design, review]
25
+ activation: when Module, Interface, Implementation, dependency, or system-boundary decisions are in scope
26
+ reason: Challenges Module/Interface/Implementation fit and long-horizon tradeoffs.
100
27
 
101
28
  executor:
102
29
  subagentType: executor
103
30
  stages: [task, coding, fix]
104
- activation: when implementation ownership, write scope, or scoped code changes are in scope
105
- reason: Implement or estimate scoped code ownership and write boundaries.
31
+ activation: when scoped implementation changes are approved
32
+ reason: Applies bounded implementation changes inside assigned write scopes.
106
33
 
107
- technical-writer:
108
- subagentType: writer
109
- stages: [proposal, archive]
110
- activation: when documentation structure, decision records, or handoff clarity are in scope
111
- reason: Preserve traceable docs, decisions, and reusable learning.
112
-
113
- senior-engineering-reviewer:
34
+ reviewer:
114
35
  subagentType: code-reviewer
115
36
  stages: [review]
116
- activation: when execution-path correctness, maintainability, regressions, or API compatibility need review
117
- reason: Review execution-path correctness, maintainability, regressions, and API boundaries.
118
-
119
- ue-a11y-reviewer:
120
- subagentType: designer
121
- stages: [review]
122
- activation: when UI, UX, accessibility, i18n, or visual behavior is touched
123
- reason: Review UX, accessibility, i18n, and visual impacts when UI is touched.
37
+ activation: when risks, regressions, maintainability, or missing evidence need independent review
38
+ reason: Reviews behavioral risk, regressions, and missing tests or evidence.
124
39
 
125
40
  verifier:
126
41
  subagentType: verifier
127
42
  required: true
128
43
  activation: required
129
- reason: Verify stage outputs against source authority and command evidence.
44
+ reason: Proves completion against acceptance criteria and fresh evidence.
45
+
46
+ # Project-specific examples:
47
+ #
48
+ # issue-curator:
49
+ # extends: reviewer
50
+ # stages: [prepare, triage]
51
+ # resources: [issues]
52
+ # artifacts: [issues]
53
+ # writeScopes:
54
+ # - .zsk/modules/*/_issues/**
55
+ # - .zsk/issues/**
56
+ #
57
+ # confluence-researcher:
58
+ # extends: researcher
59
+ # stages: [prepare]
60
+ # resources: [document]