@captain_z/zsk 1.8.2 → 1.8.4

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 (57) hide show
  1. package/dist/bin.js +4 -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 +184 -8
  9. package/dist/commands/check.js.map +1 -1
  10. package/dist/commands/gate.d.ts +2 -0
  11. package/dist/commands/gate.js +2 -0
  12. package/dist/commands/gate.js.map +1 -1
  13. package/dist/core/prepare-sync.d.ts +2 -31
  14. package/dist/core/prepare-sync.js +119 -136
  15. package/dist/core/prepare-sync.js.map +1 -1
  16. package/dist/core/profile-bundle-installation.d.ts +55 -0
  17. package/dist/core/profile-bundle-installation.js +170 -0
  18. package/dist/core/profile-bundle-installation.js.map +1 -0
  19. package/dist/core/source-snapshot-adapters.d.ts +59 -0
  20. package/dist/core/source-snapshot-adapters.js +82 -0
  21. package/dist/core/source-snapshot-adapters.js.map +1 -0
  22. package/dist/core/staffing-plan.d.ts +7 -1
  23. package/dist/core/staffing-plan.js +186 -29
  24. package/dist/core/staffing-plan.js.map +1 -1
  25. package/dist/core/stage-clarity-verification.d.ts +31 -0
  26. package/dist/core/stage-clarity-verification.js +313 -0
  27. package/dist/core/stage-clarity-verification.js.map +1 -0
  28. package/dist/core/stage-quality-artifacts.d.ts +15 -0
  29. package/dist/core/stage-quality-artifacts.js +421 -0
  30. package/dist/core/stage-quality-artifacts.js.map +1 -0
  31. package/dist/core/stage-quality-contracts.d.ts +86 -0
  32. package/dist/core/stage-quality-contracts.js +2 -0
  33. package/dist/core/stage-quality-contracts.js.map +1 -0
  34. package/dist/core/stage-quality-criteria.d.ts +9 -0
  35. package/dist/core/stage-quality-criteria.js +323 -0
  36. package/dist/core/stage-quality-criteria.js.map +1 -0
  37. package/dist/core/stage-quality-rendering.d.ts +13 -0
  38. package/dist/core/stage-quality-rendering.js +122 -0
  39. package/dist/core/stage-quality-rendering.js.map +1 -0
  40. package/dist/core/stage-quality.d.ts +5 -52
  41. package/dist/core/stage-quality.js +40 -432
  42. package/dist/core/stage-quality.js.map +1 -1
  43. package/dist/core/template-registry.js +6 -0
  44. package/dist/core/template-registry.js.map +1 -1
  45. package/package.json +2 -2
  46. package/templates/module/frontend-module/design.md +25 -3
  47. package/templates/module/frontend-module/proposal.md +8 -0
  48. package/templates/module/frontend-module/spec.md +16 -0
  49. package/templates/module/frontend-module/tasks.md +23 -7
  50. package/templates/project-init/.zsk/config.yaml +33 -0
  51. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +43 -0
  52. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +23 -1
  53. package/templates/project-init/.zsk/raws/index.md +19 -0
  54. package/templates/project-init/.zsk/raws/prepare/design/index.md +18 -0
  55. package/templates/project-init/.zsk/raws/prepare/index.md +33 -0
  56. package/templates/project-init/.zsk/raws/prepare/ux/index.md +19 -0
  57. package/templates/project-init/.zsk/roles.yaml +11 -11
@@ -15,6 +15,22 @@ Do not approve this design until project-level path boundaries, evidence routing
15
15
  | --- | --- | --- | --- | --- |
16
16
  | FR-001 / AC-001 | | | | |
17
17
 
18
+ ## Accepted Upstream Inputs
19
+
20
+ | Source | Reviewed Revision / Evidence | Design Use |
21
+ | --- | --- | --- |
22
+ | `.zsk/modules/{module}/spec.md` | | Required behavior and acceptance contract |
23
+ | `.zsk/raws/prepare/ux/{topic}/interaction-handoff.md` | N/A or reviewed revision | Accepted UI/interaction facts only; missing behavior routes back to `preproposal` or `spec`. |
24
+ | `.zsk/raws/prepare/design/{topic}/design-source-map.md` | N/A or reviewed revision | Visual/source evidence and gaps only; not a substitute for code design. |
25
+
26
+ ## Control Traceability Matrix When Triggered
27
+
28
+ Use this table when the module touches auth, permissions, roles, tenancy, data access, compliance, audit, privacy, or security. If none apply, write an evidence-backed N/A rationale.
29
+
30
+ | Source Rule / Spec | Subject / Actor | Action / Capability | Resource / Data | Scope | UI / API / State Behavior | Enforcement Point | AC / Scenario | Test / Evidence |
31
+ | --- | --- | --- | --- | --- | --- | --- | --- | --- |
32
+ | N/A or source id | | | | | | | | |
33
+
18
34
  ## Design Views
19
35
 
20
36
  Use Mermaid or linked configured design-source evidence to make boundaries, flows, states, and dependencies reviewable. Keep a view N/A only with rationale.
@@ -70,9 +86,11 @@ N/A rationale or diagram:
70
86
 
71
87
  ## Decisions
72
88
 
73
- | Decision | Alternatives Rejected | Rationale / Evidence | Rollback / Migration Note |
74
- | --- | --- | --- | --- |
75
- | | | | |
89
+ | ADR | Context / Requirement | Options Considered | Decision | Consequences / Risks | Rollback / Migration | Verification |
90
+ | --- | --- | --- | --- | --- | --- | --- |
91
+ | ADR-001 | | | | | | |
92
+
93
+ Use `N/A` only when no architecture, interface, data-flow, storage, migration, dependency, rollback, integration, cross-team ownership, security, or permission-enforcement decision is made.
76
94
 
77
95
  ## States And Failure Modes
78
96
 
@@ -96,11 +114,15 @@ Guidelines:
96
114
  - Define auth/storage reuse before demo so Playwright can run repeatably.
97
115
  - Keep generated docs, issues, evidence, and Playwright assets inside the `.zsk` paths required by `PROJECT-CONFIG.md` and `SYSTEM-SPEC.md`.
98
116
  - Route unclear behavior back to spec instead of redesigning requirements here.
117
+ - Do not author or repair `interaction-handoff.md` in design; update the
118
+ preproposal raw artifact first when interaction source facts change.
99
119
 
100
120
  ## Best-Practice Checklist
101
121
 
102
122
  - [ ] Behavior maps to files/modules/interfaces/state/data flow without changing approved requirements.
103
123
  - [ ] Design includes useful diagrams/charts for context, flow, state, data, dependency, or UX where complexity requires them; otherwise N/A rationale is explicit.
124
+ - [ ] ADR/decision-record entries capture context, options, decision, consequences, rollback/migration, and verification for design-significant decisions.
125
+ - [ ] Auth/permission/privacy/security/data-access scope has a control traceability matrix, or N/A cites source evidence.
104
126
  - [ ] Security/auth/privacy, migration/rollback, performance, and rollout risks are recorded when touched.
105
127
  - [ ] UI work includes accessible locator/state strategy and Playwright evidence needs.
106
128
  - [ ] Project military rules from `PROJECT-CONFIG.md` and `SYSTEM-SPEC.md` are enforced or blocked.
@@ -24,6 +24,14 @@ Do not draft or pass this proposal until project-level path, source-priority, ev
24
24
  - Assumptions:
25
25
  - Open questions / blockers:
26
26
 
27
+ ## Upstream Raw Sources
28
+
29
+ | Source | Reviewed Revision / Evidence | Proposal Use |
30
+ | --- | --- | --- |
31
+ | `.zsk/raws/prepare/product/{topic}/product-brief.md` | | product direction / scope input |
32
+ | `.zsk/raws/prepare/product/{topic}/roadmap.md` | | MVP / phase / module boundary input |
33
+ | `.zsk/raws/prepare/ux/{topic}/interaction-handoff.md` | N/A or reviewed revision | interaction source reference only; do not copy full handoff here |
34
+
27
35
  ## Success Criteria
28
36
 
29
37
  | Criterion | Evidence Source | Owner / Next Stage |
@@ -14,6 +14,13 @@ Do not freeze this spec until source-priority, conflict-routing, evidence, and s
14
14
  | ID | Requirement | Type | Source / Decision | Priority | Observable Outcome |
15
15
  | --- | --- | --- | --- | --- | --- |
16
16
  | FR-001 | | FR | | P0 | |
17
+ | NFR-001 | | NFR | | P0/P1/P2 | |
18
+
19
+ ## Upstream Interaction Source
20
+
21
+ | Source | Reviewed Revision / Evidence | Spec Impact |
22
+ | --- | --- | --- |
23
+ | `.zsk/raws/prepare/ux/{topic}/interaction-handoff.md` | N/A or reviewed revision | Convert accepted interaction facts into FR/NFR/AC/scenarios; route missing behavior back to preproposal/spec clarification. |
17
24
 
18
25
  ## Acceptance Criteria
19
26
 
@@ -21,6 +28,14 @@ Do not freeze this spec until source-priority, conflict-routing, evidence, and s
21
28
  | --- | --- | --- | --- |
22
29
  | AC-001 | FR-001 | Given / When / Then | |
23
30
 
31
+ ## Control Matrix When Triggered
32
+
33
+ Use this table when the module touches auth, permissions, roles, tenancy, data access, compliance, audit, privacy, or security. If none apply, write an evidence-backed N/A rationale.
34
+
35
+ | Source Rule | Subject / Actor | Action / Capability | Resource / Data | Scope | Expected Outcome | FR/AC / Scenario |
36
+ | --- | --- | --- | --- | --- | --- | --- |
37
+ | N/A or source id | | | | | | |
38
+
24
39
  ## Scenario Contracts
25
40
 
26
41
  | Scenario | User Goal | Entry | Preconditions | Observable Result | PRD/SRS / FR/AC | Automate |
@@ -32,6 +47,7 @@ Rules:
32
47
  - Define behavior and observable outcomes here.
33
48
  - Link every P0/P1 scenario back to the original PRD/SRS or accepted FR/AC.
34
49
  - Link every project-wide rule that changes behavior back to `PROJECT-CONFIG.md` or `SYSTEM-SPEC.md`.
50
+ - Include a control matrix when auth/permission/privacy/security/data-access behavior is touched; N/A needs evidence.
35
51
  - Mark unclear or conflicting facts as blockers instead of choosing behavior silently.
36
52
  - Do not write brittle selectors in spec.
37
53
  - Mark which P0/P1 scenarios must become Playwright cases.
@@ -11,18 +11,18 @@ Do not start coding until path boundaries, evidence routing, issue routing, vali
11
11
 
12
12
  ## Task Todo List
13
13
 
14
- - [ ] T-001:
14
+ - [ ] 1. <task group: deliverable outcome>
15
15
  - Owner:
16
16
  - Depends on:
17
17
  - Scope / files:
18
18
  - Linked FR/AC:
19
19
  - Evidence hook:
20
20
  - Stop condition:
21
- - [ ] T-001.1:
21
+ - [ ] 1.1 <subtask: executable step>
22
22
  - Owner:
23
23
  - Output:
24
24
  - Evidence:
25
- - [ ] T-001.2:
25
+ - [ ] 1.2 <subtask: executable step>
26
26
  - Owner:
27
27
  - Output:
28
28
  - Evidence:
@@ -31,13 +31,27 @@ Do not start coding until path boundaries, evidence routing, issue routing, vali
31
31
 
32
32
  | Order | Task / Subtask | Depends On | Can Run In Parallel With | Blocker / Decision Needed |
33
33
  | --- | --- | --- | --- | --- |
34
- | 1 | T-001.1 | | | |
34
+ | 1 | 1.1 | | | |
35
35
 
36
- ## Coverage Matrix
36
+ ## Proposal / Spec / Design / ADR Alignment Matrix
37
+
38
+ | Goal / FR / AC / NFR | Design Decision / ADR | Task Group | Subtask | Evidence |
39
+ | --- | --- | --- | --- | --- |
40
+ | FR-001 / AC-001 | ADR-001 | 1 | 1.1 | |
41
+
42
+ ## FR / AC Coverage Matrix
37
43
 
38
44
  | FR/AC | Implementation Task/Subtask | Test / Scenario Task/Subtask | Docs / Issue / Evidence Task/Subtask |
39
45
  | --- | --- | --- | --- |
40
- | FR-001 / AC-001 | T-001.1 | T-001.2 | |
46
+ | FR-001 / AC-001 | 1.1 | 1.2 | |
47
+
48
+ ## Control Row Task Coverage When Triggered
49
+
50
+ Use this table when spec/design include auth, permission, privacy, security, tenancy, compliance, audit, or data-access control rows. If none apply, write an evidence-backed N/A rationale.
51
+
52
+ | Control Row | Implementation Task | Test / Scenario Task | Docs / Issue Task | Evidence |
53
+ | --- | --- | --- | --- | --- |
54
+ | N/A or CTRL-001 | | | | |
41
55
 
42
56
  ## Playwright Case Tasks
43
57
 
@@ -47,8 +61,10 @@ Do not start coding until path boundaries, evidence routing, issue routing, vali
47
61
 
48
62
  Rules:
49
63
 
50
- - Use a Kiro-style checkbox hierarchy: task IDs for deliverables, subtask IDs for executable steps.
64
+ - Use a Kiro-style checkbox hierarchy: `- [ ] 1. <task group>` with indented `- [ ] 1.1 <subtask>` children.
51
65
  - Every task and subtask must have owner, dependency, output, evidence hook, and stop condition.
66
+ - Every design decision/ADR must map to task groups, subtasks, and evidence or an explicit blocker.
67
+ - Every triggered control row must map to implementation, test/scenario, docs/issue, and evidence tasks.
52
68
  - Create Playwright skeletons under `__PLAYWRIGHT_SPECS__` before demo.
53
69
  - Create or update source-aligned tests/scenarios before implementation for testable behavior changes.
54
70
  - Tag cases as smoke/demo/verify/regression.
@@ -12,7 +12,40 @@ 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.
15
28
  sources: {}
16
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
49
+
17
50
  customize:
18
51
  roles: .zsk/roles.yaml
@@ -53,6 +53,49 @@ Every module stage document is a handoff contract:
53
53
 
54
54
  If a document cannot answer its stage questions, stop and record the missing source, decision, blocker, or issue instead of filling the template.
55
55
 
56
+ ## Preproposal Raw Artifacts
57
+
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.
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}/`.
66
+
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.
71
+
72
+ ## Prepare Capture Strategy
73
+
74
+ `prepare` records where facts come from and whether they can be acquired. It is
75
+ not a requirement author, interaction designer, code designer, or task planner.
76
+
77
+ Use this order for source capture:
78
+
79
+ 1. Register stable origins in `.zsk/config.yaml#sources`.
80
+ 2. Run `zsk prepare plan` to classify ready, stale, blocked, and ambiguous
81
+ 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
85
+ `--allow-network`, `--browser`, and `--auth-state` only when that acquisition
86
+ is intentional.
87
+ 5. Review `.zsk/evidence/prepare/{run}/adapter-results/` and
88
+ `downstream-impact.md` before downstream stages consume the snapshot.
89
+
90
+ For Figma or similar design tools, prefer provider API/export payloads, raw node
91
+ exports, screenshots/assets, and local design-source maps over a bare page URL.
92
+ Browser-rendered capture is useful evidence, but it is not complete interaction
93
+ truth. Pair design snapshots with a reviewed
94
+ `.zsk/raws/prepare/ux/{topic}/interaction-handoff.md` when page/module behavior,
95
+ states, empty/error/loading flows, or accessibility rules are needed. For
96
+ module-targeted preproposal work, `{topic}` defaults to the module id unless a
97
+ narrower page/frame split is justified in the raw artifact.
98
+
56
99
  ## Maintenance Checklist
57
100
 
58
101
  - Update `.zsk/config.yaml` when paths, tools, or source origins change.
@@ -20,6 +20,7 @@ Agents must use the smallest sufficient lane: read local sources first, run dete
20
20
  - `paths.docs` stores project-level docs only.
21
21
  - `paths.modules` stores module source-of-truth docs.
22
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
24
  - Module `_issues` stores module-specific actionable issue records; `paths.issues` is created on demand only for shared/global indexes or cross-module issues.
24
25
  - Module `_evidence` stores module-specific runtime evidence and verification artifacts; `paths.evidence` is created on demand only for shared/global evidence.
25
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.
@@ -46,6 +47,7 @@ ZSK stage documents are decision artifacts. They are complete only when the next
46
47
  | Stage | Document Mode | Must Prove |
47
48
  | --- | --- | --- |
48
49
  | `prepare` | Evidence report | Source origins, freshness, conflicts, and raw snapshot paths are known before planning. |
50
+ | `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. |
49
51
  | `proposal` | Decision brief | Problem, user/business outcome, scope, non-goals, risks, and success criteria are explicit. |
50
52
  | `spec` | Behavior contract | FR/NFR, scenarios, edge cases, and acceptance criteria are observable and source-linked. |
51
53
  | `design` | Implementation contract | Behavior maps to files/modules/interfaces/state/data flow, with risks and verification strategy. |
@@ -56,4 +58,24 @@ ZSK stage documents are decision artifacts. They are complete only when the next
56
58
  | `ready` | Verification handoff | Fixed issues, AC, evidence, replay steps, version, and residual risks are mapped. |
57
59
  | `verify` | Independent evidence | The ready claim is replayed with fresh evidence and pass/fail issue status updates. |
58
60
 
59
- Each stage document must separate facts, decisions, assumptions, open questions, evidence, and next action. Do not leave template filler, untraceable "best practice" claims, vague tasks, or unresolved contradictions in a stage artifact.
61
+ Each stage document must separate facts, decisions, assumptions, open questions,
62
+ evidence, and next action. Do not leave template filler, untraceable "best
63
+ practice" claims, vague tasks, or unresolved contradictions in a stage artifact.
64
+ Each stage challenge must also align terminology against project context,
65
+ configured raw sources, existing artifact IDs, and implementation names when
66
+ implementation-facing work is touched. Conflicting, overloaded, stale, or
67
+ translated terms must be recorded as a blocker or repaired by the owning stage.
68
+
69
+ ## Lifecycle Ownership
70
+
71
+ | Artifact / Decision | Owning Stage | Notes |
72
+ | --- | --- | --- |
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. |
74
+ | 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
+ | Scope, non-goals, success criteria, high-level risks | `proposal` | Freezes the smallest useful problem/scope boundary before behavior is specified. |
76
+ | FR, NFR, acceptance criteria, scenarios, edge cases | `spec` | Creates observable behavior contracts from proposal/source evidence. Missing quality targets remain `未指定` instead of invented. |
77
+ | 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. |
78
+ | Proposal/spec/design/ADR alignment and executable work | `task` | Preserves FR/AC/NFR/ADR traceability into task groups, subtasks, evidence, and stop conditions. |
79
+
80
+ Downstream stages consume reviewed upstream revisions. They may report gaps, but
81
+ must not silently rewrite another stage's source of truth.
@@ -5,11 +5,30 @@ Immutable fact sources for this project. Generated and refreshed by `zsk prep`.
5
5
  Active source snapshots should be organized by prepare responsibility lane:
6
6
 
7
7
  - `prepare/product/` for SRS, PRD, business process, acceptance semantics, and work items.
8
+ - `prepare/product/{topic}/product-brief.md` and `roadmap.md` for preproposal-generated product direction and MVP/phase decomposition after checkpoint review.
8
9
  - `prepare/backend/` for backend repositories, API contracts, data model, and service-boundary evidence.
9
10
  - `prepare/design/` for design/prototype sources, screen maps, and visual assets.
11
+ - `prepare/design/{topic}/design-source-needs.md` for preproposal design-source readiness gaps after checkpoint review.
12
+ - `prepare/design/{topic}/design-source-map.md` for provider-backed design source coverage and missing Figma/prototype metadata.
10
13
  - `prepare/ux/` for user flows, interaction notes, IA, and usability evidence.
14
+ - `prepare/ux/{topic}/ux-readiness.md` for preproposal journey/flow/IA/readiness seeds after checkpoint review.
15
+ - `prepare/ux/{topic}/interaction-handoff.md` for sourced interaction matrices, state coverage, accessibility contract, and unresolved interaction gaps. For module-targeted preproposal work, `{topic}` defaults to the module id.
11
16
  - `prepare/qa/` for test cases, acceptance scenarios, regression matrices, and QA evidence.
12
17
 
18
+ Interaction handoff files are living raw artifacts owned by `preproposal`, not
19
+ inline sections of module `proposal.md` or `design.md`. Downstream module stages
20
+ should reference a reviewed revision, for example:
21
+
22
+ ```md
23
+ Interaction source:
24
+ - `.zsk/raws/prepare/ux/{topic}/interaction-handoff.md`
25
+ - Accepted revision: <review evidence or commit/date>
26
+ ```
27
+
28
+ If later UX changes alter scope or behavior, revise the raw artifact first,
29
+ record source/status/impact, then route affected module stages back through
30
+ `proposal`, `spec`, `design`, or `task` as needed.
31
+
13
32
  | Provider | Type | Status | Snapshot / Origin |
14
33
  | --- | --- | --- | --- |
15
34
  | | | | |
@@ -1,3 +1,21 @@
1
1
  # Design Sources
2
2
 
3
3
  Design handoff files, wireframes, prototype exports, visual assets, design tokens, and platform snapshots.
4
+
5
+ Use `prepare/design/{topic}/design-source-map.md` for provider-backed design
6
+ sources such as Figma, MasterGo, exports, screenshots, and assets.
7
+
8
+ Rules:
9
+
10
+ - Preserve provider URL, file/page/frame/node ids, capture method, raw payload,
11
+ screenshots/assets, capture time, and tool/auth limits.
12
+ - Record prototype links, annotations, variables/tokens, components, variants,
13
+ and missing source data when available.
14
+ - Treat design files as source evidence, not complete interaction truth.
15
+ - Pair source maps with `prepare/ux/{topic}/interaction-handoff.md` when visual
16
+ sources need page/module interaction detail.
17
+ - For module-targeted preproposal work, `{topic}` defaults to the module id so
18
+ the design-source map and interaction handoff can be consumed by the same
19
+ module proposal/spec/design chain.
20
+ - Code design remains owned by module `design.md`; this lane provides source
21
+ evidence and gaps only.
@@ -2,3 +2,36 @@
2
2
 
3
3
  Reusable source snapshots for prepare. Iterations and releases should reference these snapshots instead of copying source content.
4
4
 
5
+ ## Responsibility
6
+
7
+ `prepare` is the source acquisition and evidence stage. It owns:
8
+
9
+ - source origin registration from `.zsk/config.yaml#sources`;
10
+ - repository inventory and draft source discovery;
11
+ - acquisition planning, blocked-source questions, and correspondence prompts;
12
+ - auth preflight and reusable Playwright storageState helpers;
13
+ - raw snapshot materialization through local, provider, URL, browser, or
14
+ metadata-only strategies;
15
+ - `.zsk/raws/manifest.json`, raw indexes, adapter results, and downstream impact
16
+ evidence.
17
+
18
+ `prepare` does not own product decisions, formal FR/NFR, interaction decisions,
19
+ code design, or task planning. If a source is missing or private, preserve the
20
+ previous snapshot when present, write a blocked/gap artifact, and route the
21
+ missing decision to the owning stage.
22
+
23
+ ## Capture Strategy
24
+
25
+ Use the least lossy acquisition method that is explicit and repeatable:
26
+
27
+ | Source Kind | Preferred Strategy | Notes |
28
+ | --- | --- | --- |
29
+ | Local docs/contracts/exports | `origin.kind: local` + `zsk prepare sync` | Best default for PRD, API, QA, Figma JSON exports, screenshots, and manually reviewed handoffs. |
30
+ | Provider APIs | `origin.provider` + API/export URL + `--allow-network` | Use Confluence/Jira/GitLab/design-source adapters when provider payloads are available. |
31
+ | Private web pages | `zsk prepare auth-check`, then `zsk prepare sync --browser --auth-state ... --allow-network` | Browser capture is fallback evidence, not a replacement for provider exports. |
32
+ | Repository roots | metadata-only snapshot | Do not crawl broad repositories; configure concrete contracts/files instead. |
33
+ | Figma/design URLs | provider export or local raw payload first; browser URL only as fallback | Pair with `prepare/ux/{topic}/interaction-handoff.md` for interaction details. |
34
+
35
+ Record incomplete provider coverage as a source gap. A successful prepare run is
36
+ allowed to say "blocked" or "needs confirmation"; that is expected behavior, not
37
+ a silent failure.
@@ -1,3 +1,22 @@
1
1
  # UX Sources
2
2
 
3
3
  User flows, interaction maps, screen behavior notes, usability findings, and experience research artifacts.
4
+
5
+ Use `prepare/ux/{topic}/interaction-handoff.md` when UI, UX, or design-source
6
+ interaction needs clarification before formal proposal/spec/design work. When
7
+ the brief targets a module, `{topic}` defaults to the module id.
8
+
9
+ Rules:
10
+
11
+ - `preproposal` owns this file as a living source artifact.
12
+ - Generate an AI brief from available Figma/design/source/code evidence before
13
+ asking humans to fill gaps.
14
+ - Separate sourced facts, accepted decisions, inferred assumptions, missing
15
+ details, recommended answers, and human confirmation status.
16
+ - Record revisions and impact. Downstream module docs consume only reviewed or
17
+ accepted revisions.
18
+ - For module-targeted work, name the target module, module path, reviewed module
19
+ artifacts, scope boundary, terminology alignment, and any page/frame split
20
+ rationale in the interaction handoff.
21
+ - Do not use this lane for final code design, formal FR/NFR, or task execution
22
+ planning.
@@ -13,21 +13,21 @@ roles:
13
13
 
14
14
  product-owner:
15
15
  subagentType: analyst
16
- stages: [prepare, proposal, spec, review, verify, acceptance]
16
+ stages: [prepare, preproposal, proposal, spec, review, verify, acceptance]
17
17
  lanes: [product, pm, requirement, requirements, srs, prd]
18
18
  activation: when product or requirement evidence is configured or in scope
19
19
  reason: Interpret product scope, requirement semantics, priorities, and acceptance gaps.
20
20
 
21
21
  business-analyst:
22
22
  subagentType: analyst
23
- stages: [proposal, spec]
23
+ stages: [preproposal, proposal, spec]
24
24
  lanes: [business, domain, process, rules]
25
25
  activation: when domain process or business-rule evidence is configured or in scope
26
26
  reason: Map domain process, terminology, business rules, and edge cases.
27
27
 
28
28
  architect:
29
29
  subagentType: architect
30
- stages: [proposal, spec, design, review]
30
+ stages: [preproposal, proposal, spec, design, review]
31
31
  activation: when architecture, API, system-boundary, or dependency decisions are in scope
32
32
  reason: Review system boundaries, module relationships, contracts, and technical risks.
33
33
 
@@ -40,28 +40,28 @@ roles:
40
40
 
41
41
  frontend-engineer:
42
42
  subagentType: executor
43
- stages: [design]
43
+ stages: [preproposal, design]
44
44
  lanes: [frontend, web, client, mobile]
45
45
  activation: when frontend implementation, routing, state, or UI integration is in scope
46
- reason: Map UI implementation, routing, state, and component integration risk.
46
+ reason: Map existing UI implementation surfaces, routing, state, candidate page/module-to-code mapping, and component integration risk.
47
47
 
48
48
  design-specialist:
49
49
  subagentType: designer
50
- stages: [prepare, design]
50
+ stages: [prepare, preproposal]
51
51
  lanes: [design, ui, visual]
52
52
  activation: when design, UI, visual, prototype, or asset sources are configured
53
53
  reason: Inspect design assets, screens, visual states, and design-source gaps.
54
54
 
55
55
  ux-specialist:
56
56
  subagentType: designer
57
- stages: [prepare]
57
+ stages: [prepare, preproposal]
58
58
  lanes: [ux, ue, user-experience, research]
59
59
  activation: when UX, UE, user-flow, or research sources are configured
60
60
  reason: Inspect user flows, interaction constraints, and usability ambiguity.
61
61
 
62
62
  qa-engineer:
63
63
  subagentType: test-engineer
64
- stages: [prepare, spec, task, coding, review, verify]
64
+ stages: [prepare, preproposal, spec, task, coding, fix, review, verify]
65
65
  lanes: [qa, test, testing, quality]
66
66
  activation: when QA, test, acceptance, or quality evidence is configured or in scope
67
67
  reason: Connect requirements to acceptance scenarios, test coverage, and verification evidence.
@@ -88,19 +88,19 @@ roles:
88
88
 
89
89
  researcher:
90
90
  subagentType: researcher
91
- stages: [prepare]
91
+ stages: [prepare, preproposal]
92
92
  activation: optional when current official or external evidence is required
93
93
  reason: Collect official/current external references only when configured local sources are insufficient.
94
94
 
95
95
  planner:
96
96
  subagentType: planner
97
- stages: [task]
97
+ stages: [preproposal, task]
98
98
  activation: when task sequencing, dependencies, and risk flags are in scope
99
99
  reason: Sequence implementation tasks, dependencies, ownership, and evidence hooks.
100
100
 
101
101
  executor:
102
102
  subagentType: executor
103
- stages: [task, coding]
103
+ stages: [task, coding, fix]
104
104
  activation: when implementation ownership, write scope, or scoped code changes are in scope
105
105
  reason: Implement or estimate scoped code ownership and write boundaries.
106
106