@captain_z/zsk 1.3.0 → 1.4.1

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 (61) hide show
  1. package/README.md +25 -19
  2. package/dist/bin.js +52 -4
  3. package/dist/bin.js.map +1 -1
  4. package/dist/commands/add.js +2 -2
  5. package/dist/commands/add.js.map +1 -1
  6. package/dist/commands/check.js +7 -4
  7. package/dist/commands/check.js.map +1 -1
  8. package/dist/commands/config.d.ts +1 -0
  9. package/dist/commands/config.js +23 -0
  10. package/dist/commands/config.js.map +1 -1
  11. package/dist/commands/issue.d.ts +12 -0
  12. package/dist/commands/issue.js +92 -0
  13. package/dist/commands/issue.js.map +1 -0
  14. package/dist/commands/module.d.ts +8 -0
  15. package/dist/commands/module.js +40 -0
  16. package/dist/commands/module.js.map +1 -0
  17. package/dist/commands/prep.js +13 -2
  18. package/dist/commands/prep.js.map +1 -1
  19. package/dist/commands/project-init.js +5 -5
  20. package/dist/commands/project-init.js.map +1 -1
  21. package/dist/core/config.d.ts +19 -3
  22. package/dist/core/config.js +63 -16
  23. package/dist/core/config.js.map +1 -1
  24. package/dist/core/raw-manifest.d.ts +11 -3
  25. package/dist/core/raw-manifest.js +16 -8
  26. package/dist/core/raw-manifest.js.map +1 -1
  27. package/dist/core/scaffolder.d.ts +1 -0
  28. package/dist/core/scaffolder.js +12 -5
  29. package/dist/core/scaffolder.js.map +1 -1
  30. package/package.json +3 -2
  31. package/{templates/project-init/.zsk/schemas → schemas}/module.schema.json +36 -25
  32. package/{templates/project-init/.zsk/schemas → schemas}/zsk-config.schema.json +185 -37
  33. package/templates/issue/default/assets/index.md +5 -0
  34. package/templates/issue/default/debug-logs/index.md +5 -0
  35. package/templates/issue/default/issue.md +45 -0
  36. package/templates/module/frontend-module/design.md +6 -0
  37. package/templates/module/frontend-module/module.yaml +26 -0
  38. package/templates/module/frontend-module/spec.md +6 -0
  39. package/templates/module/frontend-module/tasks.md +6 -0
  40. package/templates/module/frontend-module/verification.md +6 -0
  41. package/templates/project-init/.issues/README.md +31 -16
  42. package/templates/project-init/.raws/README.md +18 -32
  43. package/templates/project-init/.raws/api-contracts/index.md +22 -0
  44. package/templates/project-init/.raws/design-assets/index.md +25 -0
  45. package/templates/project-init/.raws/design-sources/index.md +24 -0
  46. package/templates/project-init/.raws/index.md +53 -0
  47. package/templates/project-init/.raws/requirements/index.md +23 -0
  48. package/templates/project-init/.raws/testing/index.md +22 -0
  49. package/templates/project-init/.zsk/config.yaml +39 -0
  50. package/templates/project-init/{SYSTEM-SPEC.md → docs/SYSTEM-SPEC.md} +16 -18
  51. package/templates/project-init/.issues/_templates/issue.md +0 -44
  52. package/templates/project-init/.raws/FIGMA-INDEX.md +0 -38
  53. package/templates/project-init/.raws/SRS.md +0 -73
  54. package/templates/project-init/.raws/api-contracts/README.md +0 -13
  55. package/templates/project-init/.raws/design-assets/README.md +0 -16
  56. package/templates/project-init/.raws/testing/README.md +0 -10
  57. package/templates/project-init/CLAUDE.md +0 -45
  58. package/templates/project-init/docs/_module-template/module.yaml +0 -32
  59. package/templates/project-init/docs/system/README.md +0 -12
  60. package/templates/project-init/project-config.md +0 -296
  61. package/templates/project-init/zsk.config.yaml +0 -50
@@ -0,0 +1,23 @@
1
+ # Requirements Index
2
+
3
+ Use this directory for local snapshots of SRS, PRD, acceptance notes, product decisions, and other requirement documents.
4
+
5
+ ## Organization
6
+
7
+ ```text
8
+ .raws/requirements/
9
+ ├── index.md
10
+ ├── srs.md
11
+ ├── prd.md
12
+ └── {source-or-date}/
13
+ ├── page.md
14
+ ├── comments.json
15
+ └── attachments/
16
+ ```
17
+
18
+ ## Usage Rules
19
+
20
+ - Configure real origins in `.zsk/config.yaml` `sources`.
21
+ - Use this directory for immutable or append-only snapshots.
22
+ - Reference requirement snapshots from `docs/{module}/proposal.md` and `docs/{module}/spec.md`.
23
+ - Do not rewrite upstream text to resolve conflicts; document conflict analysis in module docs or `.issues/`.
@@ -0,0 +1,22 @@
1
+ # Testing Assets Index
2
+
3
+ Use this directory for upstream or imported test assets: QA sheets, acceptance cases, release cases, manual verification scripts, and exported test documents.
4
+
5
+ ## Organization
6
+
7
+ ```text
8
+ .raws/testing/
9
+ ├── index.md
10
+ ├── qa-cases.md
11
+ ├── acceptance-cases.md
12
+ └── {source-or-release}/
13
+ ├── cases.md
14
+ └── cases.xlsx
15
+ ```
16
+
17
+ ## Usage Rules
18
+
19
+ - Configure real test case origins in `.zsk/config.yaml` `sources`.
20
+ - Map module-level raw cases in `docs/{module}/module.yaml` `tests.raw_cases` or `sources.testing`.
21
+ - Derived cases and automated tests belong in module docs or code test files.
22
+ - `zsk check` treats non-index files here as raw test assets that should be mapped to a module.
@@ -0,0 +1,39 @@
1
+ # yaml-language-server: $schema=https://unpkg.com/@captain_z/zsk@1.3.0/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
+ # Resource origins. AI or zsk config setup should fill these with online URLs,
12
+ # git repositories, Figma/Modao links, OpenAPI locations, or local files.
13
+ # Optional snapshots should land under paths.raws, for example:
14
+ #
15
+ # sources:
16
+ # srs:
17
+ # type: srs
18
+ # origin:
19
+ # kind: url
20
+ # url: https://example.com/srs
21
+ # snapshot: .raws/requirements/srs.md
22
+ # figma_main:
23
+ # type: design
24
+ # origin:
25
+ # kind: figma
26
+ # url: https://www.figma.com/file/...
27
+ # snapshot: .raws/design-sources/figma-main.json
28
+ sources: {}
29
+
30
+ tools:
31
+ runtime_ui:
32
+ - computer_use
33
+ - browser_use
34
+ design:
35
+ - figma_mcp
36
+
37
+ modules:
38
+ index: docs/_module-index.md
39
+ root: docs
@@ -1,36 +1,34 @@
1
1
  # System Spec
2
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`.
3
+ This file defines project-level behavior rules for humans and AI agents. Keep stable constraints here, and keep machine-readable paths and source origins in `.zsk/config.yaml`.
4
4
 
5
5
  ## Source Priority
6
6
 
7
7
  When sources conflict, use this priority order until the project overrides it:
8
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`
9
+ 1. `docs/SYSTEM-SPEC.md`
10
+ 2. `.zsk/config.yaml`
11
+ 3. Project sources listed in `.zsk/config.yaml`
12
+ 4. Module sources listed in `docs/{module}/module.yaml`
13
+ 5. `docs/{module}/spec.md`
14
+ 6. `docs/{module}/design.md`
17
15
 
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.
16
+ If two upstream sources conflict, do not silently choose one. Record the conflict under the configured issue root, then ask for confirmation before changing accepted specs or designs.
19
17
 
20
- ## Directory Policy
18
+ ## Store Policy
21
19
 
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/`.
20
+ - `paths.raws` stores local snapshots of upstream facts only.
21
+ - `paths.docs` stores digested module knowledge, decisions, tasks, and verification.
22
+ - `paths.issues` stores defects, local verification evidence, screenshots, logs, and retest records.
23
+ - Runtime screenshots, debug logs, HAR files, and failed verification artifacts must not be stored under the docs root.
26
24
 
27
25
  ## Testing Policy
28
26
 
29
27
  Test cases are first-class project assets.
30
28
 
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.
29
+ - Original QA, acceptance, release, and manually supplied test cases belong in configured project sources and may be snapshotted under `paths.raws`.
30
+ - Module-derived test cases belong under each module's configured docs output.
31
+ - AI coding must be TDD-driven from raw and module-derived test cases.
34
32
  - A task is not done until the relevant test case is covered by automated tests or recorded as runtime/manual verification evidence.
35
33
 
36
34
  ## Documentation Feedback Policy
@@ -1,44 +0,0 @@
1
- # BUG-0000-short-description
2
-
3
- ## Priority
4
-
5
- P1
6
-
7
- ## Module
8
-
9
- `<module-id>`
10
-
11
- ## Environment
12
-
13
- - Date: YYYY-MM-DD
14
- - Branch:
15
- - URL:
16
- - Command:
17
- - Browser:
18
- - Data source:
19
-
20
- ## Reproduction Steps
21
-
22
- 1.
23
-
24
- ## Actual Result
25
-
26
-
27
- ## Expected Result
28
-
29
-
30
- ## Logs And Evidence
31
-
32
- - `assets/<file>`:
33
- - `debug-logs/<file>`:
34
-
35
- ## Impact
36
-
37
-
38
- ## Root Cause / Hypothesis
39
-
40
-
41
- ## Status
42
-
43
- - Status: Open
44
- - Retest:
@@ -1,38 +0,0 @@
1
- ---
2
- title: Figma Index
3
- project: <fill-me>
4
- last_updated: <YYYY-MM-DD>
5
- ---
6
-
7
- # Figma Index — <项目名>
8
-
9
- > **角色**:模块 → Figma URL / node-id 的权威索引。zsk skill 通过 `{{config.paths.figma_index}}` 引用。
10
- > **配合 skill**:`zsk:ue-mcp`(结构化快照)、`zsk:figma-to-code`(7 步工作流)。
11
- > **更新时机**:模块首次接入 Figma 设计时登记;设计大改时追加新 snapshot 行。
12
-
13
- ## 1. 模块索引
14
-
15
- | 模块 ID | Figma URL | Node ID | 页面 / Frame | 最后确认 | 快照路径 |
16
- | --- | --- | --- | --- | --- | --- |
17
- | <module-a> | https://www.figma.com/file/... | <int:int> | <Page / Frame> | <YYYY-MM-DD> | `.raws/design-assets/module-a/<snapshot>/` |
18
-
19
- ## 2. 工作流
20
-
21
- 1. 模块接入 Figma 时:登记本表一行
22
- 2. 走 `zsk:ue-mcp` skill:
23
- - 创建 `.raws/design-assets/{module}/{YYYY-MM-DD}-{描述}/` 目录
24
- - 落盘 `description.md`(结构化 YAML frontmatter + 人读章节)
25
- - 落盘 `screenshot-*.png`(每状态一张)
26
- - 可选:`raw/mcp-response.json`(`.gitignore`)
27
- 3. 走 `zsk:figma-to-code`:按 7 步从快照产出生产级代码
28
-
29
- ## 3. 变更纪律
30
-
31
- - **新 snapshot**:设计大改 → 新目录,**不覆盖历史**(历史用于回溯)
32
- - **本表改写**:指向新 snapshot 目录,旧行转入"归档"小节(保留追溯)
33
- - **node-id 废弃**:Figma 重绘导致 node-id 失效 → 旧行标 `[deprecated]`,新 node-id 新行
34
-
35
- ## 归档(历史 snapshot)
36
-
37
- | 模块 ID | 旧 snapshot | 归档原因 | 归档日期 |
38
- | --- | --- | --- | --- |
@@ -1,73 +0,0 @@
1
- ---
2
- title: Software Requirements Specification
3
- project: <fill-me>
4
- status: draft
5
- version: 0.1.0
6
- last_updated: <YYYY-MM-DD>
7
- ---
8
-
9
- # SRS — <项目名>
10
-
11
- > **角色**:原始需求事实源。zsk skill 通过 `{{config.paths.srs}}` 引用本文件。
12
- > **变更流程**:走人工评审(见 `zsk:proposal` → `zsk:spec`),不由 LLM 自由改写。
13
- > **编号纪律**:FR / NFR / AC 只增不改,废弃用 `[deprecated]` 标记。
14
-
15
- ## 1. 范围与目标
16
-
17
- ### 1.1 背景
18
- <为什么要做此产品/模块>
19
-
20
- ### 1.2 SMART 目标
21
- <用 zsk:proposal skill 的 G-{n} 格式>
22
-
23
- ### 1.3 超出范围(Out of Scope)
24
- <显式列出不做什么,避免范围蔓延>
25
-
26
- ## 2. 用户角色与核心场景
27
-
28
- | 角色 | 核心场景 | 优先级 |
29
- | --- | --- | --- |
30
- | <角色 A> | <场景描述> | P0 |
31
-
32
- ## 3. 功能需求(FR)
33
-
34
- > 编号规则见 `zsk:spec`。每条 FR 必须可被下游 Design / Task / Verify 用编号引用。
35
-
36
- - **FR-001**: <描述:做什么,不写怎么做>
37
- - **FR-002**: <...>
38
-
39
- ## 4. 非功能需求(NFR)
40
-
41
- > 7 大类:performance / a11y / security / i18n / compat / observability / reliability
42
- > 项目级基线见 `project-config.md` 的 `quality.*`;模块级偏离单独声明。
43
-
44
- - **NFR-001**: <描述 + 阈值 + 验证手法>
45
-
46
- ## 5. 验收条件(AC)
47
-
48
- > Gherkin(Given/When/Then)或 BDD 可执行化。每条 AC 覆盖至少 1 个 FR。
49
-
50
- - **AC-001**: Given <前置>, When <操作>, Then <期望结果> · 覆盖 `FR-001`
51
-
52
- ## 6. 用户故事(US)
53
-
54
- > INVEST 原则。每个 US 关联若干 FR/AC。
55
-
56
- - **US-001**: 作为 <角色>,我想 <目标>,以便 <价值> · 覆盖 `FR-001` / `AC-001`
57
-
58
- ## 7. 约束(Constraints)
59
-
60
- <业务/合规/技术约束。技术约束尽量走 `project-config.md` 与 ADR,不在此重抄>
61
-
62
- ## 8. 术语表(Glossary)
63
-
64
- > 可独立维护于 `docs/system/glossary.md`(zsk:glossary skill)。
65
-
66
- | 术语 | 定义 |
67
- | --- | --- |
68
- | <Term A> | <定义> |
69
-
70
- ## 9. 开放问题
71
-
72
- - [ ] <待澄清问题 1>
73
- - [ ] <待澄清问题 2>
@@ -1,13 +0,0 @@
1
- # API Contracts
2
-
3
- Store upstream API contracts here, grouped by service or provider.
4
-
5
- Recommended layout:
6
-
7
- ```text
8
- .raws/api-contracts/
9
- └── {service}/
10
- └── contracts/
11
- ```
12
-
13
- Do not edit generated or upstream-owned contracts to match frontend assumptions. If a contract conflicts with SRS, test cases, or design assets, record an issue and resolve the decision in `docs/{module}/`.
@@ -1,16 +0,0 @@
1
- # Design Assets
2
-
3
- Store Figma, MCP, and design-source snapshots here.
4
-
5
- Recommended layout:
6
-
7
- ```text
8
- .raws/design-assets/
9
- └── {module}/
10
- └── {snapshot}/
11
- ├── description.md
12
- ├── screenshot-*.png
13
- └── raw/
14
- ```
15
-
16
- Treat each sync as a snapshot. Prefer adding a new snapshot over overwriting historical evidence.
@@ -1,10 +0,0 @@
1
- # Testing Sources
2
-
3
- Store original test assets here:
4
-
5
- - QA test cases
6
- - acceptance spreadsheets or exports
7
- - release test packs
8
- - manually supplied validation scenarios
9
-
10
- These are raw source facts. Derived scenario matrices and automated test mappings belong under `docs/{module}/`.
@@ -1,45 +0,0 @@
1
- # CLAUDE.md — <项目名>
2
-
3
- > Claude Code 进入本项目时自动读取的会话指令。其他 harness(Codex `AGENTS.md` / Gemini `GEMINI.md`)镜像核心语义。
4
-
5
- ## 项目身份
6
-
7
- - **名称**:<项目名>
8
- - **类型**:<microfrontend / monolith / library / cli>
9
- - **技术栈**:见 [`project-config.md`](./project-config.md)(frontmatter `stack.*`)
10
-
11
- ## 本项目使用 zsk skill set
12
-
13
- 通过 `@captain_z/zsk add` 安装(`~/.claude/skills/` 或 `./.claude/skills/`)。运行时自动发现;手动触发写 "用 `zsk:<name>`"。
14
-
15
- **常用 skill 组合**(见 `npx @captain_z/zsk list`):
16
-
17
- - 启动任一变更:`zsk:feature` / `zsk:bugfix` / `zsk:refactor`
18
- - 7 阶段:`zsk:proposal` → `zsk:spec` → `zsk:design` → `zsk:coding` → `zsk:reviewing` → `zsk:verify` → `zsk:archive`
19
- - 任务:`zsk:task` / `zsk:task-structure` / `zsk:task-tracking`(含 §6 每任务交互契约)/ `zsk:task-evidence` / `zsk:dor-dod`
20
- - 前端扩展:`zsk:spec-frontend` / `zsk:design-frontend` / `zsk:review-frontend` / `zsk:feature-tasks-frontend`
21
-
22
- ## 项目事实源
23
-
24
- | 文件 / 目录 | 作用 |
25
- | --- | --- |
26
- | [`project-config.md`](./project-config.md) | 机械配置(`{{config.*}}` 占位符的解析源) |
27
- | [`.raws/`](./.raws/) | 原始事实源(SRS / FIGMA-INDEX / api-contracts / design-assets) |
28
- | `docs/system/` | 系统级决策(ADR / architecture / glossary / nfr-baseline) |
29
- | `SYSTEM-SPEC.md`(可选) | 团队共享的项目硬约束,覆写 zsk skill 默认 |
30
-
31
- ## 规约优先级(冲突时上位胜出)
32
-
33
- 1. 用户会话显式指令
34
- 2. 本 `CLAUDE.md` 的项目指令
35
- 3. `SYSTEM-SPEC.md`(若存在)
36
- 4. `project-config.md`
37
- 5. `docs/system/*`(ADR / architecture / NFR baseline)
38
- 6. zsk skills(已安装)
39
- 7. 平台级 skill(`~/.claude/skills/*` 非 zsk 的)
40
- 8. 工具默认行为
41
-
42
- ## 交互契约(LLM 执行任务时)
43
-
44
- 见 `zsk:task-tracking` §6:**每单任务执行完 → 更新状态 + 填证据 → 短汇报 → 等人类确认 → 再推下一个**,不自动连跑。
45
- 例外:纯读取任务 / 用户显式授权"连跑 N 个" / CI 自动化任务。
@@ -1,32 +0,0 @@
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
@@ -1,12 +0,0 @@
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}/`.