@captain_z/zsk 1.8.5 → 1.8.7

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 (78) hide show
  1. package/dist/bin.js +128 -0
  2. package/dist/bin.js.map +1 -1
  3. package/dist/commands/add-flow.js +7 -1
  4. package/dist/commands/add-flow.js.map +1 -1
  5. package/dist/commands/add.js +22 -5
  6. package/dist/commands/add.js.map +1 -1
  7. package/dist/commands/config.js +3 -2
  8. package/dist/commands/config.js.map +1 -1
  9. package/dist/commands/dispatch.d.ts +4 -0
  10. package/dist/commands/dispatch.js +483 -7
  11. package/dist/commands/dispatch.js.map +1 -1
  12. package/dist/commands/doctor.js +21 -5
  13. package/dist/commands/doctor.js.map +1 -1
  14. package/dist/commands/issue.d.ts +1 -0
  15. package/dist/commands/issue.js +2 -2
  16. package/dist/commands/issue.js.map +1 -1
  17. package/dist/commands/prepare.js +7 -0
  18. package/dist/commands/prepare.js.map +1 -1
  19. package/dist/commands/project-init.js +15 -8
  20. package/dist/commands/project-init.js.map +1 -1
  21. package/dist/commands/work.d.ts +34 -0
  22. package/dist/commands/work.js +1769 -0
  23. package/dist/commands/work.js.map +1 -0
  24. package/dist/commands/workflow.d.ts +32 -0
  25. package/dist/commands/workflow.js +270 -0
  26. package/dist/commands/workflow.js.map +1 -0
  27. package/dist/core/config.d.ts +29 -0
  28. package/dist/core/config.js +173 -4
  29. package/dist/core/config.js.map +1 -1
  30. package/dist/core/prepare-lifecycle.d.ts +2 -0
  31. package/dist/core/prepare-lifecycle.js +49 -0
  32. package/dist/core/prepare-lifecycle.js.map +1 -1
  33. package/dist/core/skill-classification.d.ts +13 -0
  34. package/dist/core/skill-classification.js +50 -0
  35. package/dist/core/skill-classification.js.map +1 -0
  36. package/dist/core/stage-clarity-verification.js +58 -7
  37. package/dist/core/stage-clarity-verification.js.map +1 -1
  38. package/dist/core/template-registry.js +26 -7
  39. package/dist/core/template-registry.js.map +1 -1
  40. package/dist/core/work-ledger.d.ts +44 -0
  41. package/dist/core/work-ledger.js +88 -0
  42. package/dist/core/work-ledger.js.map +1 -0
  43. package/dist/core/work-provider-adapters.d.ts +110 -0
  44. package/dist/core/work-provider-adapters.js +484 -0
  45. package/dist/core/work-provider-adapters.js.map +1 -0
  46. package/dist/core/workflow-graph.d.ts +100 -0
  47. package/dist/core/workflow-graph.js +655 -0
  48. package/dist/core/workflow-graph.js.map +1 -0
  49. package/dist/core/workspace-conformance.js +55 -0
  50. package/dist/core/workspace-conformance.js.map +1 -1
  51. package/dist/core/workspace-layout.d.ts +3 -1
  52. package/dist/core/workspace-layout.js +4 -0
  53. package/dist/core/workspace-layout.js.map +1 -1
  54. package/package.json +2 -2
  55. package/schemas/zsk-config.schema.json +112 -1
  56. package/templates/module/frontend-module/CONTEXT.md +22 -0
  57. package/templates/module/frontend-module/design.md +1 -1
  58. package/templates/module/frontend-module/proposal.md +1 -1
  59. package/templates/module/frontend-module/spec.md +1 -1
  60. package/templates/module/frontend-module/tasks.md +14 -1
  61. package/templates/project-init/.zsk/CONTEXT.md +35 -0
  62. package/templates/project-init/.zsk/README.md +108 -15
  63. package/templates/project-init/.zsk/config.yaml +12 -6
  64. package/templates/project-init/.zsk/docs/CONFIG-SCHEMA.md +21 -5
  65. package/templates/project-init/.zsk/docs/PROJECT-CONFIG.md +48 -14
  66. package/templates/project-init/.zsk/docs/SYSTEM-SPEC.md +10 -4
  67. package/templates/project-init/.zsk/raws/README.md +7 -2
  68. package/templates/project-init/.zsk/team.yaml +218 -0
  69. package/templates/project-init/.zsk/templates/config.examples.yaml +29 -8
  70. package/templates/project-init/.zsk/work.yaml +75 -0
  71. package/templates/project-init/.zsk/evidence/README.md +0 -15
  72. package/templates/project-init/.zsk/issues/README.md +0 -10
  73. package/templates/project-init/.zsk/templates/module/README.md +0 -13
  74. package/templates/project-init/.zsk/templates/module/design.md +0 -22
  75. package/templates/project-init/.zsk/templates/module/module.yaml +0 -15
  76. package/templates/project-init/.zsk/templates/module/proposal.md +0 -20
  77. package/templates/project-init/.zsk/templates/module/spec.md +0 -22
  78. package/templates/project-init/.zsk/templates/module/tasks.md +0 -16
@@ -1,11 +1,11 @@
1
1
  # ZSK Workspace
2
2
 
3
- This workspace is config-driven.
3
+ This workspace is entry-driven and evidence-first.
4
4
 
5
- Do not create empty resource directories. `zsk init` creates the governance
6
- entrypoints only. Resource snapshot directories under `.zsk/raws/**` are created
7
- by `zsk prepare sync` only after `.zsk/config.yaml` declares a resource and the
8
- sync run produces a snapshot.
5
+ Do not create empty resource directories. `zsk init` creates the governance and
6
+ collaboration entrypoints only. Resource snapshot directories under
7
+ `.zsk/raws/**` are created by `zsk prepare sync` only after `.zsk/config.yaml`
8
+ declares a durable entry source and the sync run produces a snapshot.
9
9
 
10
10
  ## Working Model
11
11
 
@@ -13,9 +13,16 @@ sync run produces a snapshot.
13
13
  | --- | --- | --- | --- |
14
14
  | `.zsk/config.yaml` | config | init/user | commit |
15
15
  | `.zsk/roles.yaml` | staffing policy | init/user | commit |
16
+ | `.zsk/team.yaml` | talent pool | init/user | commit |
17
+ | `.zsk/work.yaml` | work provider mapping | init/user | commit |
18
+ | `.zsk/work.jsonl` | work event ledger | task/issue/dispatch/work sync/status import | commit when created |
19
+ | `.zsk/CONTEXT.md` | project context | init/user/stages | commit |
16
20
  | `.zsk/docs/**` | governance docs | init/user | commit |
17
- | `.zsk/templates/**` | reusable templates | init | commit |
21
+ | `.zsk/templates/config.examples.yaml` | config examples | init | commit |
22
+ | `.zsk/templates/issue-card.md` | issue template | init | commit |
18
23
  | `.zsk/raws/README.md` | resource snapshot contract | init | commit |
24
+ | `.zsk/evidence/prepare/<run>/config-draft.yaml` | discovered source draft | prepare draft/plan/run | commit for review |
25
+ | `.zsk/evidence/prepare/<run>/source-promotion-suggestions.md` | human review queue | prepare draft/plan/run | commit for review |
19
26
  | `.zsk/raws/**/snapshot.md` | generated summary | prepare sync | commit |
20
27
  | `.zsk/raws/**/metadata.yaml` | generated provenance | prepare sync | commit |
21
28
  | `.zsk/raws/**/source.json` | raw provider payload | prepare sync | ignore by default |
@@ -23,26 +30,112 @@ sync run produces a snapshot.
23
30
  | `.zsk/modules/index.md` | module registry view | init/module add | commit |
24
31
  | `.zsk/modules/<module>/**` | module work surface | module add/user | commit |
25
32
  | `.zsk/modules/<module>/_issues/**` | module task cards | prepare sync/user | commit |
26
- | `.zsk/issues/**` | global/cross-module issues | init/prepare/user | commit |
33
+ | `.zsk/issues/**` | global/cross-module issues | issue/prepare/user | commit |
27
34
  | `.zsk/evidence/prepare/sync-report.md` | prepare report | prepare sync | commit |
35
+ | `.zsk/plans/<run>/workflow-graph.{json,yaml,md}` | workflow graph | workflow plan/zskplan | commit |
36
+ | `.zsk/plans/current-workflow-graph.json` | workflow resume pointer | workflow plan/advance/mark | commit |
28
37
  | `.zsk/runs/**` | runtime state | commands | ignore |
29
38
  | `.zsk/state/**` | runtime state | commands | ignore |
30
39
  | `.zsk/tmp/**` | temporary files | commands | ignore |
31
40
 
41
+ ## Lazy Roots
42
+
43
+ `zsk init` does not create these roots. They appear only when an owning command
44
+ has real content to write:
45
+
46
+ | Path | Created When |
47
+ | --- | --- |
48
+ | `.zsk/issues/**` | A shared/global issue is created. |
49
+ | `.zsk/evidence/**` | Prepare, demo, verify, or review writes shared evidence. |
50
+ | `.zsk/resources/**` | A future registry/stage-pack layer earns a separate root. Current resource snapshots use `.zsk/raws/**`. |
51
+ | `.zsk/plans/**` | `zsk workflow plan` or `zskplan` writes a workflow graph or plan artifact. |
52
+ | `.zsk/playwright/**` | Shared Playwright config/auth/helper assets are required. Prefer module `_playwright` first. |
53
+
32
54
  ## Rules
33
55
 
34
56
  - Raw snapshots live under `.zsk/raws/**`.
57
+ - Project-wide terminology, naming decisions, and cross-module decomposition
58
+ rationale live in `.zsk/CONTEXT.md`.
35
59
  - Module work lives under `.zsk/modules/**`.
60
+ - Module-local terminology and decomposition rationale live in
61
+ `.zsk/modules/<module>/CONTEXT.md`.
36
62
  - Module-local issues live under `.zsk/modules/<module>/_issues/**`.
37
- - Global or cross-module blockers live under `.zsk/issues/**`.
38
- - Provider connections, resource intents, and routes are declared in
39
- `.zsk/config.yaml`.
40
- - Staffing policy lives in `.zsk/roles.yaml`; a specific run's chosen agents
41
- belong in evidence, not in the template.
63
+ - Global or cross-module blockers live under `.zsk/issues/**` only after a
64
+ scope decision proves they are not module-local.
65
+ - Module templates are owned by `zsk module init`; do not maintain duplicate
66
+ copies under `.zsk/templates/module/**`.
67
+ - Provider connections are declared once in `.zsk/config.yaml`.
68
+ - `.zsk/config.yaml` should keep durable entry sources, not every child page,
69
+ node, issue, or file found during prepare.
70
+ - Discovered child sources go through `config-draft.yaml` and
71
+ `source-promotion-suggestions.md`; only human-approved entries are promoted
72
+ back into `.zsk/config.yaml`.
73
+ - Talent pool policy lives in `.zsk/team.yaml`; roles, agents, and squads stay
74
+ provider-agnostic while provider-specific ids live under adapter references.
75
+ Dispatch maps staffing-plan roles to team roles through
76
+ `assignmentPolicy.dispatch.roleMappings`, then uses
77
+ `assignmentPolicy.dispatch.stageRoutes`, role `subagentTypes`, agent
78
+ `stages/modules/subagentTypes/capacity/priority`, and optional
79
+ `providerCatalogs` to select the most suitable expert. Project-specific
80
+ experts belong in `.zsk/team.yaml` or a configured provider catalog rather
81
+ than CLI code.
82
+ - Work provider mapping lives in `.zsk/work.yaml`; Multica is a default adapter
83
+ reference, but `.zsk/work.jsonl` events stay generic for other providers.
84
+ - `.zsk/work.jsonl` is lazy. Do not create an empty ledger; create it only when
85
+ a skill emits a real work event.
86
+ - `zsk work emit-tasks` reads module `tasks.md` Kiro-style task groups and
87
+ subtasks, then appends generic `work.item.upserted` and parent-child
88
+ `work.item.linked` events to `.zsk/work.jsonl`. Use `--dry-run` first; it
89
+ never calls provider APIs or CLIs.
90
+ - `zsk work sync --dry-run` writes a provider command plan from generic work
91
+ events. Assignment commands preserve role/stage/subagent/selection evidence
92
+ under command `metadata` for adapter-specific execution later. The plan is
93
+ reviewable evidence only; it does not call provider APIs or CLIs.
94
+ - `zsk work import-experts --dry-run` previews normalization of a provider
95
+ expert export into the generic catalog shape. Without `--dry-run`, it writes
96
+ a local catalog only. Dispatch auto-discovers
97
+ `.zsk/providers/<provider>/experts.yaml` when present, so a Multica-style
98
+ talent export can enrich assignment without changing the work ledger schema.
99
+ - `zsk workflow mark --status blocked` and blocked `zsk workflow advance`
100
+ decisions append generic `work.item.blocked` events. Provider updates still
101
+ require `zsk work sync --dry-run` review.
102
+ - `zsk dispatch plan --item <id> --emit-work-assignments` appends generic
103
+ `work.assignment.requested` events for the bound work item from the staffing
104
+ plan, `.zsk/team.yaml` dispatch role mappings, stage routes, role
105
+ `subagentTypes`, local agent pool, and optional provider expert catalog; it
106
+ records the selection source, score, and reasons, and does not call provider
107
+ APIs or CLIs.
108
+ - `zsk work assign --dry-run` previews a `work.assignment.requested` event and
109
+ provider assignment command plan from `.zsk/team.yaml` roles, agents, squads,
110
+ and `.zsk/work.yaml` project mapping.
111
+ - `zsk work assign` without `--dry-run` appends only a generic local
112
+ `work.assignment.requested` event to `.zsk/work.jsonl`; provider assignment
113
+ remains behind `zsk work sync --dry-run`.
114
+ - `zsk work import-status` may append `work.provider_status.imported` events
115
+ from provider exports. When a record explicitly links a local `issue.md`,
116
+ it also updates that issue status block and refreshes issue indexes. When a
117
+ record explicitly links a module `tasks.md`, it updates only a matching
118
+ `zsk-task-status` marker block. It never calls provider APIs or CLIs.
119
+ - Dynamic workflow state lives in `.zsk/plans/**`. Use
120
+ `zsk workflow plan|next|advance|mark` to create, resume, or conservatively
121
+ advance it from existing local evidence; do not create a
122
+ separate top-level runs directory for stage routing.
123
+ - Project-facing documents must use portable paths such as `.zsk/...`,
124
+ `src/...`, `$HOME/...`, or `<workspace>/...`; do not copy personal absolute
125
+ paths like `/Users/<name>/...`, `/home/<name>/...`, `C:\Users\<name>\...`, or
126
+ `/private/var/...` into proposal, spec, design, tasks, Context Records,
127
+ handoffs, archives, issues, or evidence summaries.
42
128
 
43
129
  ## Next Steps
44
130
 
45
131
  1. Edit `.zsk/config.yaml`.
46
- 2. Add modules with `zsk module init -m <module-id> --name "<Module Name>"`.
47
- 3. Run `zsk config check`.
48
- 4. Run `zsk prepare sync` when resource acquisition is intentionally allowed.
132
+ 2. Review `.zsk/team.yaml` and `.zsk/work.yaml` before syncing or assigning
133
+ work to any external provider.
134
+ 3. Add modules with `zsk module init -m <module-id> --name "<Module Name>"`.
135
+ 4. Run `zsk config check`.
136
+ 5. Run `zsk workflow plan --goal "<goal>"` when a durable stage graph is useful.
137
+ 6. Run `zsk workflow advance` after a stage writes decisive local gate or
138
+ prepare evidence.
139
+ 7. Run `zsk prepare draft` or `zsk prepare plan` to review discovered source
140
+ candidates before changing `.zsk/config.yaml`.
141
+ 8. Run `zsk prepare sync` when resource acquisition is intentionally allowed.
@@ -12,12 +12,15 @@ 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.
15
+ # Provider connection profiles. Configure each platform once. Keep credentials
16
+ # out of this file; reference environment variables or global profiles instead.
17
17
  providers: {}
18
18
 
19
- # Resource intents to prepare. Directories under .zsk/raws/** are created only
20
- # for configured resources that actually produce snapshots.
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.
21
24
  resources: []
22
25
 
23
26
  # Routes map prepared resources into controlled consumption surfaces such as
@@ -47,9 +50,12 @@ modules:
47
50
  # password: input[type="password"]
48
51
  # submit: button[type="submit"]
49
52
 
50
- # Current prepare implementation compatibility tree. New resource preparation
51
- # should prefer providers/resources/routes above as the stable config surface.
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.
52
56
  sources: {}
53
57
 
54
58
  customize:
55
59
  roles: .zsk/roles.yaml
60
+ team: .zsk/team.yaml
61
+ work: .zsk/work.yaml
@@ -10,27 +10,43 @@ not runtime results.
10
10
  | `project` | Stable project identity. |
11
11
  | `template` | ZSK template id and version. |
12
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. |
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
14
  | `routes` | Delivery rules from prepared resources to module or shared consumption surfaces. |
15
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`. |
16
+ | `customize` / `staffing` | Pointers to role, workflow, team, work-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
18
 
19
19
  ## Materialization
20
20
 
21
21
  The workspace does not pre-create resource directories.
22
22
 
23
- - `resources` entries produce `.zsk/raws/**` snapshots after sync.
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`.
24
27
  - `routes` entries may update `.zsk/modules/<module>/_issues/**`,
25
28
  `.zsk/modules/<module>/sources.yaml`, or other controlled artifacts.
26
29
  - `zsk prepare sync` writes `.zsk/evidence/prepare/sync-report.md`.
30
+ - `.zsk/work.jsonl` is created lazily only after a skill or future work sync
31
+ command emits a real provider-agnostic work event.
27
32
  - Missing provider credentials or route conflicts must be visible in the report
28
33
  with a clear state, reason, output path, and next action.
29
34
 
35
+ ## Work Management
36
+
37
+ `customize.team` points to `.zsk/team.yaml`, the talent-pool file for roles,
38
+ agents, squads, capacity hints, and assignment policy.
39
+
40
+ `customize.work` points to `.zsk/work.yaml`, the provider mapping file for work
41
+ items, project/module linkage, status mapping, sync policy, and adapter defaults.
42
+ Multica is the default provider, but events remain provider-agnostic so another
43
+ adapter can consume the same ledger later.
44
+
30
45
  ## Resource Output
31
46
 
32
47
  Default raw output is derived from `type + id`, but a resource may override it
33
- with `output.rawPath`.
48
+ with `output.rawPath`. Keep these entries at the authority-entry level; do not
49
+ hand-maintain every child page, issue, Figma node, or file found under the entry.
34
50
 
35
51
  ```yaml
36
52
  resources:
@@ -20,9 +20,14 @@ Use this layer to answer three questions before execution:
20
20
  | --- | --- |
21
21
  | `.zsk/config.yaml` | Machine-readable project config and path authority |
22
22
  | `.zsk/roles.yaml` | Project staffing policy and role pool overrides |
23
+ | `.zsk/team.yaml` | Talent pool: roles, agents, squads, and assignment policy |
24
+ | `.zsk/work.yaml` | Work provider mapping, status mapping, sync policy, and adapter defaults |
25
+ | `.zsk/work.jsonl` | Lazy append-only Work Event Ledger, created only after a real work event |
23
26
  | `.zsk/docs/` | Project-level docs such as this file, `SYSTEM-SPEC.md`, `CONFIG-SCHEMA.md`, and `SECURITY.md` |
24
- | `.zsk/modules/{module}/` | Module `module.yaml`, `proposal.md`, `spec.md`, `design.md`, `tasks.md` |
25
- | `.zsk/raws/` | Config-driven Resource Snapshot Library |
27
+ | `.zsk/modules/{module}/` | Module `CONTEXT.md`, `module.yaml`, `proposal.md`, `spec.md`, `design.md`, `tasks.md` |
28
+ | `.zsk/raws/` | Entry-driven Resource Snapshot Library |
29
+ | `.zsk/evidence/prepare/{run}/config-draft.yaml` | Auto-discovered source candidate tree for review |
30
+ | `.zsk/evidence/prepare/{run}/source-promotion-suggestions.md` | Human review queue for promoting candidates into config |
26
31
  | `.zsk/modules/{module}/_issues/` | Module-private issue records, created on demand |
27
32
  | `.zsk/modules/{module}/_evidence/` | Module-private evidence, screenshots, traces, logs, and verification artifacts, created on demand |
28
33
  | `.zsk/modules/{module}/_playwright/` | Module-specific Playwright specs, plans, auth state, results, reports, and execution records, created on demand |
@@ -30,16 +35,29 @@ Use this layer to answer three questions before execution:
30
35
 
31
36
  Root `docs/`, `.raws/`, `.issues/`, and `.playwright/` are not default write targets. Use explicit export or migration tooling when you need project-root copies.
32
37
 
38
+ ## Path Privacy
39
+
40
+ Stage documents, Context Records, handoffs, archives, issues, and evidence
41
+ summaries should use `.zsk/...`, repo-relative, `$HOME/...`, or `<workspace>/...`
42
+ references. Do not preserve personal home-directory absolute paths such as
43
+ `/Users/<name>/...`, `/home/<name>/...`, `C:\Users\<name>\...`, or
44
+ `/private/var/...` in reusable project docs. If raw acquisition metadata needs
45
+ the original absolute path, keep it in raw/evidence metadata and provide a
46
+ portable alias for downstream design/spec/task docs.
47
+
33
48
  ## Source Priorities
34
49
 
35
50
  1. `.zsk/config.yaml`
36
51
  2. `.zsk/docs/SYSTEM-SPEC.md`
37
- 3. Project provider/resource/route intent in `.zsk/config.yaml`
38
- 4. Materialized resource snapshots under `.zsk/raws/**`
39
- 5. `.zsk/modules/{module}/module.yaml`
40
- 6. `.zsk/modules/{module}/spec.md`
41
- 7. `.zsk/modules/{module}/design.md`
42
- 8. Runtime evidence under module `_evidence` / `_playwright` or shared `.zsk/evidence` / `.zsk/playwright`
52
+ 3. Project provider/entry-source/route intent in `.zsk/config.yaml`
53
+ 4. Talent and work-provider policy in `.zsk/team.yaml` and `.zsk/work.yaml`
54
+ 5. Prepare drafts and promotion suggestions under `.zsk/evidence/prepare/{run}/`
55
+ 6. Materialized resource snapshots under `.zsk/raws/**`
56
+ 7. `.zsk/modules/{module}/CONTEXT.md`
57
+ 8. `.zsk/modules/{module}/module.yaml`
58
+ 8. `.zsk/modules/{module}/spec.md`
59
+ 9. `.zsk/modules/{module}/design.md`
60
+ 10. Runtime evidence under module `_evidence` / `_playwright` or shared `.zsk/evidence` / `.zsk/playwright`
43
61
 
44
62
  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.
45
63
 
@@ -59,6 +77,14 @@ If a document cannot answer its stage questions, stop and record the missing sou
59
77
  `prepare sync` materializes configured resources under `.zsk/raws/**`; init does
60
78
  not create resource subdirectories or empty indexes.
61
79
 
80
+ Configure durable entry sources in `.zsk/config.yaml`, not every child artifact
81
+ found below an entry. For example, one Confluence space/page entry can be the
82
+ authority for a product area; child pages discovered from that entry first land
83
+ in `.zsk/evidence/prepare/{run}/config-draft.yaml` and
84
+ `source-promotion-suggestions.md`. Promote a child into `.zsk/config.yaml` only
85
+ after a human confirms it is stable, reusable, and worth tracking as an
86
+ authority source.
87
+
62
88
  Default resource output is derived from `type + id`, for example:
63
89
 
64
90
  | Resource | Default Snapshot Path |
@@ -79,17 +105,20 @@ not a requirement author, interaction designer, code designer, or task planner.
79
105
 
80
106
  Use this order for source capture:
81
107
 
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
108
+ 1. Register provider profiles, entry sources, and routes in `.zsk/config.yaml`.
109
+ 2. Run `zsk prepare draft` to write a candidate `config-draft.yaml` and
110
+ `source-promotion-suggestions.md`; review these before applying changes to
111
+ `.zsk/config.yaml`.
112
+ 3. Run `zsk prepare plan` to classify ready, stale, blocked, and ambiguous
84
113
  sources before writing snapshots.
85
- 3. Run `zsk prepare auth-check` for private URLs so credentials are verified
114
+ 4. Run `zsk prepare auth-check` for private URLs so credentials are verified
86
115
  without writing source content. The command reads exported env vars such as
87
116
  `ACCESS_TOKEN`, `CONFLUENCE_USER`, and `CONFLUENCE_PASSWORD`; it never reads
88
117
  `~/.zshrc` directly or prints secret values.
89
- 4. Run `zsk prepare sync` for local/provider/export sources, adding
118
+ 5. Run `zsk prepare sync` for local/provider/export sources, adding
90
119
  `--allow-network`, `--browser`, and `--auth-state` only when that acquisition
91
120
  is intentional.
92
- 5. Review `.zsk/evidence/prepare/sync-report.md` before downstream stages
121
+ 6. Review `.zsk/evidence/prepare/sync-report.md` before downstream stages
93
122
  consume the snapshot.
94
123
 
95
124
  For Figma or similar design tools, prefer provider API/export payloads, raw node
@@ -103,7 +132,12 @@ narrower page/frame split is justified in the raw artifact.
103
132
 
104
133
  ## Maintenance Checklist
105
134
 
106
- - Update `.zsk/config.yaml` when providers, resources, routes, modules, paths, or tools change.
135
+ - Update `.zsk/config.yaml` when providers, durable entry sources, routes, modules, paths, or tools change.
136
+ - Update `.zsk/team.yaml` when role, agent, squad, capacity, or assignment policy changes.
137
+ - Update `.zsk/work.yaml` when provider, project/module mapping, status mapping, or sync policy changes.
138
+ - Do not create `.zsk/work.jsonl` manually; skills or future work sync commands create it when they emit real work events.
139
+ - Review `config-draft.yaml` and `source-promotion-suggestions.md` before
140
+ promoting discovered child resources into `.zsk/config.yaml`.
107
141
  - Keep project-wide reusable rules in `.zsk/docs/SYSTEM-SPEC.md`.
108
142
  - Keep module-specific decisions in `.zsk/modules/{module}/`.
109
143
  - Keep shared raw source facts under `.zsk/raws/`.
@@ -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
- - config-declared resource snapshots 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,8 +20,12 @@ 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 shared Resource Snapshots produced from configured resources.
23
+ - `paths.raws` stores shared Resource Snapshots produced from configured entry sources.
23
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.
@@ -82,12 +87,13 @@ artifact and any reusable `CONTEXT.md` term, then stop after minimal validation.
82
87
 
83
88
  | Artifact / Decision | Owning Stage | Notes |
84
89
  | --- | --- | --- |
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. |
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. |
86
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. |
87
92
  | Scope, non-goals, success criteria, high-level risks | `proposal` | Freezes the smallest useful problem/scope boundary before behavior is specified. |
88
93
  | FR, NFR, acceptance criteria, scenarios, edge cases | `spec` | Creates observable behavior contracts from proposal/source evidence. Missing quality targets remain `未指定` instead of invented. |
89
94
  | 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
95
  | Proposal/spec/design/ADR alignment and executable work | `task` | Preserves FR/AC/NFR/ADR traceability into task groups, subtasks, evidence, and stop conditions. |
96
+ | Provider-agnostic work items, assignment requests, provider comments, and status sync | `task`, `issue`, `dispatch`, `coding`, `verify` | `task` may create or update work items but must not auto-start provider agents. Dispatch owns assignment requests. Verify owns final verified/done claims. |
91
97
 
92
98
  Downstream stages consume reviewed upstream revisions. They may report gaps, but
93
99
  must not silently rewrite another stage's source of truth.
@@ -2,12 +2,17 @@
2
2
 
3
3
  `.zsk/raws` is the Resource Snapshot Library.
4
4
 
5
- This directory is config-driven. Do not create empty resource type directories
5
+ This directory is entry-driven. Do not create empty resource type directories
6
6
  because an adapter exists. A child directory is created only when:
7
7
 
8
- 1. `.zsk/config.yaml` declares a resource, and
8
+ 1. `.zsk/config.yaml` declares a durable entry source, and
9
9
  2. `zsk prepare sync` produces a snapshot for that resource.
10
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
+
11
16
  ## Snapshot Contract
12
17
 
13
18
  ```text
@@ -0,0 +1,218 @@
1
+ # ZSK talent pool.
2
+ #
3
+ # Roles describe responsibility. Agents describe concrete execution capacity.
4
+ # Squads group agents behind a leader for cross-functional or ambiguous work.
5
+ # Provider-specific ids are adapter references, not ZSK role names.
6
+
7
+ version: 1
8
+
9
+ roles:
10
+ product-owner:
11
+ responsibilities:
12
+ - Own product outcome, scope, priority, and acceptance intent.
13
+ - Keep proposal/spec/task claims tied to sourced product evidence.
14
+ stages: [prepare, preproposal, proposal, spec, task, acceptance]
15
+ subagentTypes: [analyst]
16
+
17
+ business-analyst:
18
+ responsibilities:
19
+ - Convert product, policy, and workflow material into requirements and edge cases.
20
+ - Preserve open questions and conflicts as issues instead of assumptions.
21
+ stages: [prepare, preproposal, proposal, spec]
22
+ subagentTypes: [analyst]
23
+
24
+ researcher:
25
+ responsibilities:
26
+ - Gather and validate external or provider-backed evidence when local sources are insufficient.
27
+ - Record source freshness, uncertainty, and gaps.
28
+ stages: [prepare, preproposal, proposal]
29
+ subagentTypes: [researcher]
30
+
31
+ architect:
32
+ responsibilities:
33
+ - Own module boundaries, interfaces, data flow, integration risks, and ADR-worthy decisions.
34
+ - Keep implementation tasks aligned with design decisions.
35
+ stages: [design, task, review]
36
+ subagentTypes: [architect]
37
+
38
+ frontend-engineer:
39
+ responsibilities:
40
+ - Own browser-facing implementation, UI state, accessibility, and visual/runtime evidence.
41
+ - Preserve TDD and demo evidence for assigned work items.
42
+ stages: [task, coding, demo, smoke]
43
+ subagentTypes: [executor]
44
+
45
+ backend-engineer:
46
+ responsibilities:
47
+ - Own API, data, integration, permission, and service behavior.
48
+ - Preserve contract, migration, and rollback evidence for assigned work items.
49
+ stages: [task, coding, smoke]
50
+ subagentTypes: [executor]
51
+
52
+ test-engineer:
53
+ responsibilities:
54
+ - Define RED/GREEN/REFACTOR expectations, regression coverage, and verification strategy.
55
+ - Reject untestable acceptance criteria or missing evidence hooks.
56
+ stages: [spec, design, task, coding, smoke, verify]
57
+ subagentTypes: [test-engineer, verifier]
58
+
59
+ reviewer:
60
+ responsibilities:
61
+ - Review behavioral risk, maintainability, regressions, and missing evidence.
62
+ - Report findings without taking implementation ownership.
63
+ stages: [review]
64
+ subagentTypes: [code-reviewer, reviewer]
65
+
66
+ verifier:
67
+ responsibilities:
68
+ - Prove or block completion claims against acceptance criteria and fresh evidence.
69
+ - Keep provider done status separate from ZSK verified status.
70
+ stages: [verify, acceptance]
71
+ subagentTypes: [verifier]
72
+
73
+ agents:
74
+ solo-lead:
75
+ roles: [product-owner, architect, reviewer, verifier]
76
+ route: leader-sequential
77
+ capacity: primary
78
+
79
+ product-agent:
80
+ roles: [product-owner, business-analyst, researcher]
81
+ stages: [prepare, preproposal, proposal, spec]
82
+ subagentTypes: [analyst, researcher]
83
+ route: native-or-provider
84
+ capacity: high
85
+ priority: 4
86
+ providerRefs:
87
+ multica:
88
+ agent: product-agent
89
+
90
+ architecture-agent:
91
+ roles: [architect, reviewer]
92
+ stages: [design, task, review]
93
+ subagentTypes: [architect, code-reviewer]
94
+ route: native-or-provider
95
+ capacity: high
96
+ priority: 4
97
+ providerRefs:
98
+ multica:
99
+ agent: architecture-agent
100
+
101
+ frontend-agent:
102
+ roles: [frontend-engineer, test-engineer]
103
+ stages: [task, coding, demo, smoke]
104
+ subagentTypes: [executor, test-engineer]
105
+ route: native-or-provider
106
+ capacity: high
107
+ priority: 4
108
+ providerRefs:
109
+ multica:
110
+ agent: frontend-agent
111
+
112
+ backend-agent:
113
+ roles: [backend-engineer, test-engineer]
114
+ stages: [task, coding, smoke]
115
+ subagentTypes: [executor, test-engineer]
116
+ route: native-or-provider
117
+ capacity: high
118
+ priority: 4
119
+ providerRefs:
120
+ multica:
121
+ agent: backend-agent
122
+
123
+ verification-agent:
124
+ roles: [test-engineer, reviewer, verifier]
125
+ stages: [smoke, review, verify, acceptance]
126
+ subagentTypes: [test-engineer, code-reviewer, verifier]
127
+ route: native-or-provider
128
+ capacity: high
129
+ priority: 4
130
+ providerRefs:
131
+ multica:
132
+ agent: verification-agent
133
+
134
+ squads:
135
+ product:
136
+ leader: product-agent
137
+ members: [product-agent, architecture-agent, verification-agent]
138
+ useWhen:
139
+ - Product direction, resource readiness, or acceptance intent is unclear.
140
+ - External research or source conflict resolution is required.
141
+
142
+ design:
143
+ leader: architecture-agent
144
+ members: [architecture-agent, frontend-agent, backend-agent, verification-agent]
145
+ useWhen:
146
+ - Interfaces, data flow, UX, integration, security, or rollback decisions are coupled.
147
+ - A design decision affects more than one module or implementation lane.
148
+
149
+ delivery:
150
+ leader: solo-lead
151
+ members: [frontend-agent, backend-agent, verification-agent]
152
+ useWhen:
153
+ - Approved task work needs implementation, tests, and verification evidence.
154
+ - Multiple implementation lanes can proceed without write-scope conflict.
155
+
156
+ # Optional provider expert catalogs can enrich the local talent pool without
157
+ # making the work ledger provider-specific. A Multica export can be normalized
158
+ # into a generic experts.yaml with id/providerAgent/roles/stages/modules.
159
+ # `zsk work import-experts` writes `.zsk/providers/<provider>/experts.yaml`,
160
+ # and dispatch auto-discovers that default path when the file exists.
161
+ providerCatalogs:
162
+ # multica:
163
+ # path: .zsk/providers/multica/experts.yaml
164
+
165
+ assignmentPolicy:
166
+ defaultMode: squad-for-ambiguous-direct-for-clear
167
+ directWhen:
168
+ - Work item has a single module, clear role, clear write scope, and test contract.
169
+ squadWhen:
170
+ - Work item crosses product, design, implementation, or verification concerns.
171
+ - Required source, acceptance, or evidence ownership is uncertain.
172
+ neverAutoStartFromStages:
173
+ - task
174
+ requiresDispatchBeforeProviderAssignment: true
175
+ dispatch:
176
+ assignmentMode: agent
177
+ ownerRoleHints:
178
+ enabledForStaffingRoles: [executor, planner]
179
+ stageRoutes:
180
+ prepare:
181
+ roles: [product-owner, business-analyst, researcher, test-engineer]
182
+ subagentTypes: [analyst, researcher, test-engineer]
183
+ proposal:
184
+ roles: [product-owner, business-analyst, architect, researcher]
185
+ subagentTypes: [analyst, architect, researcher]
186
+ spec:
187
+ roles: [product-owner, business-analyst, architect, test-engineer]
188
+ subagentTypes: [analyst, architect, test-engineer]
189
+ design:
190
+ roles: [architect, frontend-engineer, backend-engineer, test-engineer]
191
+ subagentTypes: [architect, executor, test-engineer]
192
+ task:
193
+ roles: [architect, frontend-engineer, backend-engineer, test-engineer]
194
+ subagentTypes: [planner, architect, executor, test-engineer]
195
+ coding:
196
+ roles: [frontend-engineer, backend-engineer, test-engineer]
197
+ subagentTypes: [executor, test-engineer]
198
+ demo:
199
+ roles: [frontend-engineer, test-engineer]
200
+ subagentTypes: [executor, test-engineer]
201
+ review:
202
+ roles: [reviewer, architect, test-engineer]
203
+ subagentTypes: [code-reviewer, architect, test-engineer]
204
+ verify:
205
+ roles: [verifier, test-engineer]
206
+ subagentTypes: [verifier, test-engineer]
207
+ roleMappings:
208
+ auth-fetch-agent: [researcher]
209
+ design-specialist: [frontend-engineer]
210
+ executor: [frontend-engineer, backend-engineer]
211
+ lead-integrator: [verifier, architect, product-owner]
212
+ market-researcher: [researcher]
213
+ planner: [architect, product-owner]
214
+ qa-engineer: [test-engineer]
215
+ senior-engineering-reviewer: [reviewer]
216
+ technical-writer: [product-owner]
217
+ ue-a11y-reviewer: [reviewer, frontend-engineer]
218
+ ux-specialist: [frontend-engineer]