@captain_z/zsk 1.0.2 → 1.1.0

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 (35) hide show
  1. package/README.md +38 -3
  2. package/dist/bin.js +40 -1
  3. package/dist/bin.js.map +1 -1
  4. package/dist/commands/check.d.ts +4 -0
  5. package/dist/commands/check.js +157 -0
  6. package/dist/commands/check.js.map +1 -0
  7. package/dist/commands/config.d.ts +4 -0
  8. package/dist/commands/config.js +18 -0
  9. package/dist/commands/config.js.map +1 -0
  10. package/dist/commands/prep.d.ts +4 -0
  11. package/dist/commands/prep.js +27 -0
  12. package/dist/commands/prep.js.map +1 -0
  13. package/dist/commands/project-init.js +12 -11
  14. package/dist/commands/project-init.js.map +1 -1
  15. package/dist/core/config.d.ts +35 -0
  16. package/dist/core/config.js +191 -0
  17. package/dist/core/config.js.map +1 -0
  18. package/dist/core/raw-manifest.d.ts +21 -0
  19. package/dist/core/raw-manifest.js +53 -0
  20. package/dist/core/raw-manifest.js.map +1 -0
  21. package/package.json +3 -2
  22. package/templates/project-init/.issues/README.md +26 -0
  23. package/templates/project-init/.issues/_templates/issue.md +44 -0
  24. package/templates/project-init/.raws/README.md +15 -12
  25. package/templates/project-init/.raws/api-contracts/README.md +13 -0
  26. package/templates/project-init/.raws/design-assets/README.md +16 -0
  27. package/templates/project-init/.raws/manifest.json +4 -0
  28. package/templates/project-init/.raws/testing/README.md +10 -0
  29. package/templates/project-init/.zsk/schemas/module.schema.json +203 -0
  30. package/templates/project-init/.zsk/schemas/zsk-config.schema.json +246 -0
  31. package/templates/project-init/SYSTEM-SPEC.md +55 -0
  32. package/templates/project-init/docs/_module-index.md +7 -0
  33. package/templates/project-init/docs/_module-template/module.yaml +32 -0
  34. package/templates/project-init/docs/system/README.md +12 -0
  35. package/templates/project-init/zsk.config.yaml +50 -0
@@ -0,0 +1,203 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://zsk.dev/schemas/module.schema.json",
4
+ "title": "ZSK Module Config",
5
+ "description": "Module-level resource, runtime, test, and output mapping for ZSK workflows.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["module", "sources", "tests", "outputs"],
9
+ "properties": {
10
+ "module": {
11
+ "description": "Module identity.",
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["id", "name"],
15
+ "properties": {
16
+ "id": {
17
+ "description": "Stable module slug.",
18
+ "type": "string",
19
+ "minLength": 1,
20
+ "pattern": "^[a-z0-9][a-z0-9-]*$"
21
+ },
22
+ "name": {
23
+ "description": "Human-readable module name.",
24
+ "type": "string",
25
+ "minLength": 1
26
+ },
27
+ "metadata": {
28
+ "$ref": "#/$defs/metadata"
29
+ }
30
+ }
31
+ },
32
+ "sources": {
33
+ "description": "Raw and derived resource inputs consumed by this module.",
34
+ "type": "object",
35
+ "additionalProperties": false,
36
+ "required": ["testing"],
37
+ "properties": {
38
+ "srs": {
39
+ "$ref": "#/$defs/srsSource"
40
+ },
41
+ "api_contracts": {
42
+ "$ref": "#/$defs/pathList"
43
+ },
44
+ "testing": {
45
+ "$ref": "#/$defs/pathList"
46
+ },
47
+ "design_assets": {
48
+ "$ref": "#/$defs/pathList"
49
+ },
50
+ "figma": {
51
+ "$ref": "#/$defs/pathList"
52
+ },
53
+ "metadata": {
54
+ "$ref": "#/$defs/metadata"
55
+ }
56
+ }
57
+ },
58
+ "runtime": {
59
+ "description": "Optional runtime verification target.",
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["url"],
63
+ "properties": {
64
+ "url": {
65
+ "description": "Local or deployed URL used for runtime verification.",
66
+ "type": "string",
67
+ "minLength": 1
68
+ },
69
+ "tools": {
70
+ "description": "Preferred runtime verification tools.",
71
+ "type": "array",
72
+ "items": {
73
+ "$ref": "#/$defs/toolName"
74
+ },
75
+ "uniqueItems": true
76
+ },
77
+ "metadata": {
78
+ "$ref": "#/$defs/metadata"
79
+ }
80
+ }
81
+ },
82
+ "tests": {
83
+ "description": "Test asset mapping and TDD policy for this module.",
84
+ "type": "object",
85
+ "additionalProperties": false,
86
+ "required": ["raw_cases", "derived_cases", "automated", "tdd_required"],
87
+ "properties": {
88
+ "raw_cases": {
89
+ "$ref": "#/$defs/pathList"
90
+ },
91
+ "derived_cases": {
92
+ "$ref": "#/$defs/pathList"
93
+ },
94
+ "automated": {
95
+ "description": "Executable test locations grouped by test level.",
96
+ "type": "object",
97
+ "additionalProperties": false,
98
+ "required": ["unit", "integration", "e2e"],
99
+ "properties": {
100
+ "unit": {
101
+ "$ref": "#/$defs/pathList"
102
+ },
103
+ "integration": {
104
+ "$ref": "#/$defs/pathList"
105
+ },
106
+ "e2e": {
107
+ "$ref": "#/$defs/pathList"
108
+ },
109
+ "metadata": {
110
+ "$ref": "#/$defs/metadata"
111
+ }
112
+ }
113
+ },
114
+ "tdd_required": {
115
+ "description": "Whether AI coding must create/update failing tests before implementation.",
116
+ "type": "boolean"
117
+ },
118
+ "metadata": {
119
+ "$ref": "#/$defs/metadata"
120
+ }
121
+ }
122
+ },
123
+ "outputs": {
124
+ "description": "Module output locations for docs and issues.",
125
+ "type": "object",
126
+ "additionalProperties": false,
127
+ "required": ["docs", "issues"],
128
+ "properties": {
129
+ "docs": {
130
+ "$ref": "#/$defs/pathRef"
131
+ },
132
+ "issues": {
133
+ "$ref": "#/$defs/pathRef"
134
+ },
135
+ "metadata": {
136
+ "$ref": "#/$defs/metadata"
137
+ }
138
+ }
139
+ },
140
+ "metadata": {
141
+ "$ref": "#/$defs/metadata"
142
+ }
143
+ },
144
+ "$defs": {
145
+ "pathRef": {
146
+ "description": "Project-relative path unless the value is intentionally absolute.",
147
+ "type": "string",
148
+ "minLength": 1
149
+ },
150
+ "pathList": {
151
+ "description": "List of project-relative paths or glob-like path patterns.",
152
+ "type": "array",
153
+ "items": {
154
+ "$ref": "#/$defs/pathRef"
155
+ },
156
+ "uniqueItems": true
157
+ },
158
+ "srsSource": {
159
+ "description": "SRS source path with optional section anchors.",
160
+ "type": "object",
161
+ "additionalProperties": false,
162
+ "required": ["path"],
163
+ "properties": {
164
+ "path": {
165
+ "$ref": "#/$defs/pathRef"
166
+ },
167
+ "sections": {
168
+ "description": "Relevant SRS sections for this module.",
169
+ "type": "array",
170
+ "items": {
171
+ "type": "string",
172
+ "minLength": 1
173
+ },
174
+ "uniqueItems": true
175
+ },
176
+ "anchors": {
177
+ "description": "Stable raw-source anchors such as FR/AC IDs.",
178
+ "type": "array",
179
+ "items": {
180
+ "type": "string",
181
+ "minLength": 1
182
+ },
183
+ "uniqueItems": true
184
+ },
185
+ "metadata": {
186
+ "$ref": "#/$defs/metadata"
187
+ }
188
+ }
189
+ },
190
+ "toolName": {
191
+ "description": "Known runtime/design verification tool.",
192
+ "type": "string",
193
+ "enum": ["computer_use", "browser_use", "figma_mcp", "script", "manual", "skill"]
194
+ },
195
+ "metadata": {
196
+ "description": "Explicit extension point for project-specific metadata.",
197
+ "type": "object",
198
+ "additionalProperties": {
199
+ "type": ["string", "number", "integer", "boolean", "null"]
200
+ }
201
+ }
202
+ }
203
+ }
@@ -0,0 +1,246 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://zsk.dev/schemas/zsk-config.schema.json",
4
+ "title": "ZSK Project Config",
5
+ "description": "Project-level configuration for ZSK resource discovery, workspace paths, tools, and module index locations.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["project", "paths", "sources", "tools", "modules"],
9
+ "properties": {
10
+ "project": {
11
+ "description": "Project identity used in generated docs and resource manifests.",
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "required": ["name"],
15
+ "properties": {
16
+ "name": {
17
+ "description": "Stable project identifier.",
18
+ "type": "string",
19
+ "minLength": 1
20
+ },
21
+ "display_name": {
22
+ "description": "Human-readable project name.",
23
+ "type": "string",
24
+ "minLength": 1
25
+ },
26
+ "metadata": {
27
+ "$ref": "#/$defs/metadata"
28
+ }
29
+ }
30
+ },
31
+ "paths": {
32
+ "description": "Top-level project knowledge workspace paths.",
33
+ "type": "object",
34
+ "additionalProperties": false,
35
+ "required": ["raws", "docs", "issues"],
36
+ "properties": {
37
+ "raws": {
38
+ "$ref": "#/$defs/pathRef"
39
+ },
40
+ "docs": {
41
+ "$ref": "#/$defs/pathRef"
42
+ },
43
+ "issues": {
44
+ "$ref": "#/$defs/pathRef"
45
+ },
46
+ "metadata": {
47
+ "$ref": "#/$defs/metadata"
48
+ }
49
+ }
50
+ },
51
+ "sources": {
52
+ "description": "Project-level raw resource entry points.",
53
+ "type": "object",
54
+ "additionalProperties": false,
55
+ "required": ["srs", "figma_index", "api_contracts", "testing", "design_assets"],
56
+ "properties": {
57
+ "srs": {
58
+ "$ref": "#/$defs/sourceRef"
59
+ },
60
+ "figma_index": {
61
+ "$ref": "#/$defs/sourceRef"
62
+ },
63
+ "api_contracts": {
64
+ "$ref": "#/$defs/sourceRef"
65
+ },
66
+ "testing": {
67
+ "$ref": "#/$defs/sourceRef"
68
+ },
69
+ "design_assets": {
70
+ "$ref": "#/$defs/sourceRef"
71
+ },
72
+ "vendor_docs": {
73
+ "$ref": "#/$defs/sourceRef"
74
+ },
75
+ "metadata": {
76
+ "$ref": "#/$defs/metadata"
77
+ }
78
+ }
79
+ },
80
+ "tools": {
81
+ "description": "Preferred AI/tool capabilities for project-level workflows.",
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": ["runtime_ui", "design"],
85
+ "properties": {
86
+ "runtime_ui": {
87
+ "description": "Preferred tools for runtime UI verification.",
88
+ "type": "array",
89
+ "items": {
90
+ "$ref": "#/$defs/toolName"
91
+ },
92
+ "uniqueItems": true
93
+ },
94
+ "design": {
95
+ "description": "Preferred tools for design and Figma resource capture.",
96
+ "type": "array",
97
+ "items": {
98
+ "$ref": "#/$defs/toolName"
99
+ },
100
+ "uniqueItems": true
101
+ },
102
+ "metadata": {
103
+ "$ref": "#/$defs/metadata"
104
+ }
105
+ }
106
+ },
107
+ "modules": {
108
+ "description": "Module discovery and module config locations.",
109
+ "type": "object",
110
+ "additionalProperties": false,
111
+ "required": ["index", "root"],
112
+ "properties": {
113
+ "index": {
114
+ "$ref": "#/$defs/pathRef"
115
+ },
116
+ "root": {
117
+ "$ref": "#/$defs/pathRef"
118
+ },
119
+ "metadata": {
120
+ "$ref": "#/$defs/metadata"
121
+ }
122
+ }
123
+ },
124
+ "sync": {
125
+ "description": "Optional deterministic or AI-assisted raw resource sync configuration.",
126
+ "type": "object",
127
+ "additionalProperties": {
128
+ "$ref": "#/$defs/syncRef"
129
+ }
130
+ },
131
+ "metadata": {
132
+ "$ref": "#/$defs/metadata"
133
+ }
134
+ },
135
+ "$defs": {
136
+ "pathRef": {
137
+ "description": "Project-relative path unless the value is intentionally absolute.",
138
+ "type": "string",
139
+ "minLength": 1
140
+ },
141
+ "toolName": {
142
+ "description": "Known tool or capability name.",
143
+ "type": "string",
144
+ "enum": ["computer_use", "browser_use", "figma_mcp", "script", "manual", "skill"]
145
+ },
146
+ "sourceRef": {
147
+ "description": "Resource source reference.",
148
+ "oneOf": [
149
+ {
150
+ "$ref": "#/$defs/localSource"
151
+ },
152
+ {
153
+ "$ref": "#/$defs/scriptSource"
154
+ },
155
+ {
156
+ "$ref": "#/$defs/skillSource"
157
+ }
158
+ ]
159
+ },
160
+ "localSource": {
161
+ "description": "Resource that already exists in the project workspace.",
162
+ "type": "object",
163
+ "additionalProperties": false,
164
+ "required": ["kind", "path"],
165
+ "properties": {
166
+ "kind": {
167
+ "description": "Local source kind.",
168
+ "type": "string",
169
+ "const": "local"
170
+ },
171
+ "path": {
172
+ "$ref": "#/$defs/pathRef"
173
+ },
174
+ "metadata": {
175
+ "$ref": "#/$defs/metadata"
176
+ }
177
+ }
178
+ },
179
+ "scriptSource": {
180
+ "description": "Resource produced by a deterministic script command.",
181
+ "type": "object",
182
+ "additionalProperties": false,
183
+ "required": ["kind", "command", "output"],
184
+ "properties": {
185
+ "kind": {
186
+ "description": "Script source kind.",
187
+ "type": "string",
188
+ "const": "script"
189
+ },
190
+ "command": {
191
+ "description": "Command that syncs this resource.",
192
+ "type": "string",
193
+ "minLength": 1
194
+ },
195
+ "output": {
196
+ "$ref": "#/$defs/pathRef"
197
+ },
198
+ "metadata": {
199
+ "$ref": "#/$defs/metadata"
200
+ }
201
+ }
202
+ },
203
+ "skillSource": {
204
+ "description": "Resource produced by an AI skill or tool-assisted workflow.",
205
+ "type": "object",
206
+ "additionalProperties": false,
207
+ "required": ["kind", "skill", "output"],
208
+ "properties": {
209
+ "kind": {
210
+ "description": "Skill source kind.",
211
+ "type": "string",
212
+ "const": "skill"
213
+ },
214
+ "skill": {
215
+ "description": "Skill used to obtain the resource.",
216
+ "type": "string",
217
+ "minLength": 1
218
+ },
219
+ "output": {
220
+ "$ref": "#/$defs/pathRef"
221
+ },
222
+ "metadata": {
223
+ "$ref": "#/$defs/metadata"
224
+ }
225
+ }
226
+ },
227
+ "syncRef": {
228
+ "description": "Optional sync entry for a resource provider.",
229
+ "oneOf": [
230
+ {
231
+ "$ref": "#/$defs/scriptSource"
232
+ },
233
+ {
234
+ "$ref": "#/$defs/skillSource"
235
+ }
236
+ ]
237
+ },
238
+ "metadata": {
239
+ "description": "Explicit extension point for project-specific metadata.",
240
+ "type": "object",
241
+ "additionalProperties": {
242
+ "type": ["string", "number", "integer", "boolean", "null"]
243
+ }
244
+ }
245
+ }
246
+ }
@@ -0,0 +1,55 @@
1
+ # System Spec
2
+
3
+ This file defines project-level behavior rules for humans and AI agents. Keep stable constraints here, and keep machine-readable paths in `zsk.config.yaml`.
4
+
5
+ ## Source Priority
6
+
7
+ When sources conflict, use this priority order until the project overrides it:
8
+
9
+ 1. `SYSTEM-SPEC.md`
10
+ 2. `zsk.config.yaml`
11
+ 3. `.raws/SRS.md`
12
+ 4. `.raws/api-contracts/`
13
+ 5. `.raws/testing/`
14
+ 6. `.raws/design-assets/`
15
+ 7. `docs/{module}/spec.md`
16
+ 8. `docs/{module}/design.md`
17
+
18
+ If two upstream raw sources conflict, do not silently choose one. Record the conflict in `.issues/{module}/BUG-xxxx-short-slug/issue.md`, then ask for confirmation before changing accepted specs or designs.
19
+
20
+ ## Directory Policy
21
+
22
+ - `.raws/` stores upstream facts and source snapshots only.
23
+ - `docs/` stores digested module knowledge, decisions, tasks, and verification.
24
+ - `.issues/` stores defects, local verification evidence, screenshots, logs, and retest records.
25
+ - Runtime screenshots, debug logs, HAR files, and failed verification artifacts must not be stored under `docs/`.
26
+
27
+ ## Testing Policy
28
+
29
+ Test cases are first-class project assets.
30
+
31
+ - Original QA, acceptance, release, and manually supplied test cases belong under `.raws/testing/`.
32
+ - Module-derived test cases belong under `docs/{module}/`.
33
+ - AI coding must be TDD-driven from `.raws/testing` and module-derived test cases.
34
+ - A task is not done until the relevant test case is covered by automated tests or recorded as runtime/manual verification evidence.
35
+
36
+ ## Documentation Feedback Policy
37
+
38
+ Every project stage must feed confirmed conversation outcomes back into durable files.
39
+
40
+ Required stage record:
41
+
42
+ ```md
43
+ ## Documentation Feedback
44
+
45
+ - Conversation decisions captured:
46
+ - {decision or "None"}
47
+ - Durable files updated:
48
+ - `{path}`: {what changed and why}
49
+ - Source links:
50
+ - `{path or issue}`: {source role}
51
+ - No-update rationale:
52
+ - {required when no file changed}
53
+ ```
54
+
55
+ A stage is not complete until its documentation feedback check is complete.
@@ -0,0 +1,7 @@
1
+ # Module Index
2
+
3
+ This file is maintained by `zsk prep` and AI-assisted module discovery.
4
+
5
+ | Module | Name | Config | Status |
6
+ | --- | --- | --- | --- |
7
+ | `<module-id>` | `<module-name>` | `docs/<module-id>/module.yaml` | pending |
@@ -0,0 +1,32 @@
1
+ # yaml-language-server: $schema=../../.zsk/schemas/module.schema.json
2
+
3
+ module:
4
+ id: example-module
5
+ name: Example Module
6
+
7
+ sources:
8
+ srs:
9
+ path: .raws/SRS.md
10
+ sections: []
11
+ api_contracts: []
12
+ testing: []
13
+ design_assets: []
14
+
15
+ runtime:
16
+ url: http://localhost:3000
17
+ tools:
18
+ - computer_use
19
+ - browser_use
20
+
21
+ tests:
22
+ raw_cases: []
23
+ derived_cases: []
24
+ automated:
25
+ unit: []
26
+ integration: []
27
+ e2e: []
28
+ tdd_required: true
29
+
30
+ outputs:
31
+ docs: docs/example-module
32
+ issues: .issues/example-module
@@ -0,0 +1,12 @@
1
+ # System Docs
2
+
3
+ Use this directory for project-wide architecture, ADRs, glossary, and non-functional requirements.
4
+
5
+ Recommended files:
6
+
7
+ - `architecture.md`
8
+ - `glossary.md`
9
+ - `nfr-baseline.md`
10
+ - `adrs/ADR-0001-title.md`
11
+
12
+ Keep project-wide rules in `SYSTEM-SPEC.md`; keep module-specific behavior under `docs/{module}/`.
@@ -0,0 +1,50 @@
1
+ # yaml-language-server: $schema=.zsk/schemas/zsk-config.schema.json
2
+
3
+ project:
4
+ name: "<project-name>"
5
+
6
+ paths:
7
+ raws: .raws
8
+ docs: docs
9
+ issues: .issues
10
+
11
+ sources:
12
+ srs:
13
+ kind: local
14
+ path: .raws/SRS.md
15
+ figma_index:
16
+ kind: local
17
+ path: .raws/FIGMA-INDEX.md
18
+ api_contracts:
19
+ kind: local
20
+ path: .raws/api-contracts
21
+ testing:
22
+ kind: local
23
+ path: .raws/testing
24
+ design_assets:
25
+ kind: local
26
+ path: .raws/design-assets
27
+
28
+ # Optional resource sync definitions.
29
+ # Use kind: script for deterministic fetch/generate commands, or kind: skill
30
+ # when an AI skill/tool must collect the resource (for example Figma MCP).
31
+ # sync:
32
+ # figma_snapshot:
33
+ # kind: skill
34
+ # skill: zsk:ue-mcp
35
+ # output: .raws/design-assets/<module>/<snapshot>
36
+ # api_contracts:
37
+ # kind: script
38
+ # command: pnpm sync:api-contracts
39
+ # output: .raws/api-contracts
40
+
41
+ tools:
42
+ runtime_ui:
43
+ - computer_use
44
+ - browser_use
45
+ design:
46
+ - figma_mcp
47
+
48
+ modules:
49
+ index: docs/_module-index.md
50
+ root: docs