spec-wave 2.1.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 (175) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +327 -0
  3. package/README.zh-CN.md +327 -0
  4. package/RELEASING.md +52 -0
  5. package/assets/README.md +30 -0
  6. package/assets/ci/samples/README.md +76 -0
  7. package/assets/ci/samples/hgm-ingest.yml.example +42 -0
  8. package/assets/ci/samples/lint-wiki-delta.pin.yml.example +47 -0
  9. package/assets/ci/samples/lint-wiki-delta.yml.example +49 -0
  10. package/assets/ci/samples/pytest.yml.example +49 -0
  11. package/assets/ci/samples/quality.yml.example +56 -0
  12. package/assets/ci/samples/skills-validate.yml.example +38 -0
  13. package/assets/ci/samples/tech-graph.yml.example +55 -0
  14. package/assets/coding_wiki/templates/README.md +115 -0
  15. package/assets/coding_wiki/templates/_index.md +19 -0
  16. package/assets/coding_wiki/templates/context.md +18 -0
  17. package/assets/coding_wiki/templates/stable.md +26 -0
  18. package/assets/coding_wiki/templates/topics/wiki_layout.md +13 -0
  19. package/assets/coding_wiki/templates/topics/wikilinks_export.md +13 -0
  20. package/assets/coding_wiki/templates/volatile.md +25 -0
  21. package/assets/docs/POINTER_ONBOARDING.md +9 -0
  22. package/assets/docs/POINTER_RUNBOOK_wiki_delta.md +18 -0
  23. package/assets/docs/POINTER_SDD_HAT_FLOW.md +8 -0
  24. package/assets/docs/POINTER_USER_GUIDE.md +8 -0
  25. package/assets/graph/stubs/README.md +6 -0
  26. package/assets/graph/templates/00_main.graph.yaml +72 -0
  27. package/assets/graph/templates/00_main.md +85 -0
  28. package/assets/graph/templates/01_struct.md +38 -0
  29. package/assets/graph/templates/02_version.md +7 -0
  30. package/assets/graph/templates/10_flow_MAIN.graph.yaml +105 -0
  31. package/assets/graph/templates/10_flow_MAIN.md +103 -0
  32. package/assets/graph/templates/99_mermaid_protocol.md +156 -0
  33. package/assets/graph/templates/README.md +66 -0
  34. package/assets/harness/README.md +18 -0
  35. package/assets/harness/discipline-coverage.yaml +320 -0
  36. package/assets/harness/invokes/README.md +22 -0
  37. package/assets/harness/invokes/TEMPLATE_invoke.md +61 -0
  38. package/assets/harness/lifecycle.yaml +127 -0
  39. package/assets/harness/prompts/00-orchestrator.md +91 -0
  40. package/assets/harness/prompts/10-spec-requirements.md +63 -0
  41. package/assets/harness/prompts/10-task-requirements.md +70 -0
  42. package/assets/harness/prompts/20-spec-audit.md +50 -0
  43. package/assets/harness/prompts/20-task-audit.md +90 -0
  44. package/assets/harness/prompts/30-execute-code.md +64 -0
  45. package/assets/harness/prompts/40-self-check.md +65 -0
  46. package/assets/harness/prompts/FRAGMENT_00_delegate_only_v1_zh.md +19 -0
  47. package/assets/harness/prompts/FRAGMENT_30_gate_verify_v1_zh.md +34 -0
  48. package/assets/harness/prompts/FRAGMENT_30_invoke_block_v1_zh.md +28 -0
  49. package/assets/harness/prompts/FRAGMENT_hat_reanchor_v1_zh.md +19 -0
  50. package/assets/harness/prompts/README.md +67 -0
  51. package/assets/harness/prompts/TEMPLATE_30_gate_stop.md +36 -0
  52. package/assets/harness/templates/FRAGMENT_task_domain_infer_v1_zh.md +16 -0
  53. package/assets/harness/templates/ONTOLOGY_consumer_slice_v1.md +41 -0
  54. package/assets/harness/templates/QUICKREF_v1_zh.md +35 -0
  55. package/assets/harness/templates/README.md +50 -0
  56. package/assets/harness/templates/TASK_TEMPLATE.md +133 -0
  57. package/assets/harness/templates/TASK_done_README.md +76 -0
  58. package/assets/harness/templates/TASK_epic.md +103 -0
  59. package/assets/harness/templates/TASK_graph_bootstrap.md +115 -0
  60. package/assets/harness/templates/VIEW_done_by_domain.md +66 -0
  61. package/assets/harness/templates/VIEW_done_thin_pointer.md +16 -0
  62. package/assets/ide/adapters/AGENTS.md.fragment.example +33 -0
  63. package/assets/ide/adapters/CLAUDE.md.fragment.example +32 -0
  64. package/assets/ide/adapters/README.md +57 -0
  65. package/assets/ide/adapters/cursor-harness-starter.mdc.example +39 -0
  66. package/assets/ide/commands/claude/kit/apply-standards.md +10 -0
  67. package/assets/ide/commands/claude/kit/gate-status.md +10 -0
  68. package/assets/ide/commands/claude/kit/graph-check.md +8 -0
  69. package/assets/ide/commands/claude/kit/hat-00-delegate.md +9 -0
  70. package/assets/ide/commands/claude/kit/hat-10-spec.md +9 -0
  71. package/assets/ide/commands/claude/kit/hat-10-task.md +9 -0
  72. package/assets/ide/commands/claude/kit/hat-20-spec-audit.md +9 -0
  73. package/assets/ide/commands/claude/kit/hat-20-task-audit.md +9 -0
  74. package/assets/ide/commands/claude/kit/hat-reanchor.md +8 -0
  75. package/assets/ide/commands/claude/kit/init-guide.md +16 -0
  76. package/assets/ide/commands/claude/kit/sync-prompts-guide.md +9 -0
  77. package/assets/ide/commands/claude/kit/verify.md +16 -0
  78. package/assets/ide/commands/cursor/kit-apply-standards.md +12 -0
  79. package/assets/ide/commands/cursor/kit-gate-status.md +12 -0
  80. package/assets/ide/commands/cursor/kit-graph-check.md +10 -0
  81. package/assets/ide/commands/cursor/kit-hat-00-delegate.md +11 -0
  82. package/assets/ide/commands/cursor/kit-hat-10-spec.md +11 -0
  83. package/assets/ide/commands/cursor/kit-hat-10-task.md +11 -0
  84. package/assets/ide/commands/cursor/kit-hat-20-spec-audit.md +11 -0
  85. package/assets/ide/commands/cursor/kit-hat-20-task-audit.md +11 -0
  86. package/assets/ide/commands/cursor/kit-hat-reanchor.md +10 -0
  87. package/assets/ide/commands/cursor/kit-init-guide.md +18 -0
  88. package/assets/ide/commands/cursor/kit-sync-prompts-guide.md +11 -0
  89. package/assets/ide/commands/cursor/kit-verify.md +18 -0
  90. package/assets/ide/host-adapt/README.md +113 -0
  91. package/assets/ide/host-adapt/examples/mvp-hosts.yaml +78 -0
  92. package/assets/ide/host-adapt/host-adapt.schema.json +97 -0
  93. package/assets/ide/skills-orch/README.md +16 -0
  94. package/assets/ide/skills-orch/kit-apply-standards/SKILL.md +17 -0
  95. package/assets/ide/skills-orch/kit-gate-status/SKILL.md +17 -0
  96. package/assets/ide/skills-orch/kit-hat-reanchor/SKILL.md +15 -0
  97. package/assets/ide/skills-orch/kit-init-guide/SKILL.md +23 -0
  98. package/assets/ide/skills-orch/kit-verify/SKILL.md +23 -0
  99. package/assets/ontology.yaml +113 -0
  100. package/assets/skills/README.md +37 -0
  101. package/assets/skills/harness-00-delegate-only/SKILL.md +19 -0
  102. package/assets/skills/harness-10-spec/SKILL.md +63 -0
  103. package/assets/skills/harness-10-task/SKILL.md +70 -0
  104. package/assets/skills/harness-20-spec-audit/SKILL.md +50 -0
  105. package/assets/skills/harness-20-task-audit/SKILL.md +90 -0
  106. package/assets/skills/harness-20-task-audit/references/TEMPLATE_30_gate_stop.md +36 -0
  107. package/assets/skills/harness-hat-reanchor/SKILL.md +19 -0
  108. package/assets/standards/POINTER_workspace_truth_v1_zh.md +42 -0
  109. package/assets/standards/README.md +35 -0
  110. package/assets/standards/SOURCES_v1_zh.md +49 -0
  111. package/assets/standards/TEMPLATE_CODING_BASELINE_L1_v1_zh.md +88 -0
  112. package/assets/standards/TEMPLATE_CODING_BASELINE_L2_backend_v1_zh.md +75 -0
  113. package/assets/standards/TEMPLATE_CODING_BASELINE_L2_frontend_v1_zh.md +76 -0
  114. package/bin/dsh-coding-kit.js +7 -0
  115. package/bin/specgate.js +7 -0
  116. package/bin/validate_template_compliance.py +470 -0
  117. package/cordis.patch.yml +5 -0
  118. package/lib/cli-checks.d.ts +68 -0
  119. package/lib/cli-checks.js +812 -0
  120. package/lib/cli-checks.js.map +1 -0
  121. package/lib/cli-graph-hgm.d.ts +74 -0
  122. package/lib/cli-graph-hgm.js +416 -0
  123. package/lib/cli-graph-hgm.js.map +1 -0
  124. package/lib/cli-graph-yaml.d.ts +79 -0
  125. package/lib/cli-graph-yaml.js +602 -0
  126. package/lib/cli-graph-yaml.js.map +1 -0
  127. package/lib/cli-graph.d.ts +1 -0
  128. package/lib/cli-graph.js +199 -0
  129. package/lib/cli-graph.js.map +1 -0
  130. package/lib/cli-host.d.ts +24 -0
  131. package/lib/cli-host.js +1197 -0
  132. package/lib/cli-host.js.map +1 -0
  133. package/lib/cli-lifecycle.d.ts +2 -0
  134. package/lib/cli-lifecycle.js +401 -0
  135. package/lib/cli-lifecycle.js.map +1 -0
  136. package/lib/cli-refresh-ide-blocks.d.ts +66 -0
  137. package/lib/cli-refresh-ide-blocks.js +484 -0
  138. package/lib/cli-refresh-ide-blocks.js.map +1 -0
  139. package/lib/cli-shared.d.ts +74 -0
  140. package/lib/cli-shared.js +281 -0
  141. package/lib/cli-shared.js.map +1 -0
  142. package/lib/cli-skills.d.ts +52 -0
  143. package/lib/cli-skills.js +363 -0
  144. package/lib/cli-skills.js.map +1 -0
  145. package/lib/cli-status.d.ts +2 -0
  146. package/lib/cli-status.js +251 -0
  147. package/lib/cli-status.js.map +1 -0
  148. package/lib/cli-sync-prompts.d.ts +25 -0
  149. package/lib/cli-sync-prompts.js +158 -0
  150. package/lib/cli-sync-prompts.js.map +1 -0
  151. package/lib/cli-sync.d.ts +2 -0
  152. package/lib/cli-sync.js +124 -0
  153. package/lib/cli-sync.js.map +1 -0
  154. package/lib/cli-task-extra.d.ts +53 -0
  155. package/lib/cli-task-extra.js +408 -0
  156. package/lib/cli-task-extra.js.map +1 -0
  157. package/lib/cli-timeline.d.ts +28 -0
  158. package/lib/cli-timeline.js +68 -0
  159. package/lib/cli-timeline.js.map +1 -0
  160. package/lib/cli-wiki.d.ts +21 -0
  161. package/lib/cli-wiki.js +189 -0
  162. package/lib/cli-wiki.js.map +1 -0
  163. package/lib/cli.d.ts +22 -0
  164. package/lib/cli.js +1034 -0
  165. package/lib/cli.js.map +1 -0
  166. package/lib/host-contract.d.ts +23 -0
  167. package/lib/host-contract.js +143 -0
  168. package/lib/host-contract.js.map +1 -0
  169. package/lib/index.d.ts +18 -0
  170. package/lib/index.js +290 -0
  171. package/lib/index.js.map +1 -0
  172. package/lib/yaml.d.ts +4 -0
  173. package/lib/yaml.js +10 -0
  174. package/lib/yaml.js.map +1 -0
  175. package/package.json +87 -0
@@ -0,0 +1,327 @@
1
+ # SpecGate
2
+
3
+ 简体中文 | [English](README.md)
4
+
5
+ **SpecGate**(`spec-wave@2.1.1`)是 **多宿主编码 CLI**(Cursor · Claude Code · 可选 DSH),带 **P0 闸 / Harness 过程命令** 与 IDE 物化。曾用名 **dsh-coding-kit**。纪律资产仍是 ICVO(Inform · Constrain · Verify · Orchestrate)。
6
+
7
+ > **加载 ≠ 注入。** 安装或加载可选 DSH 插件 **不会** 自动改写 system prompt。`apply()` 只注册工具。必须由你或模型调用 `apply_coding_standards` 之后,后续回合的 runtime context 才会含 `# Coding Standards`。
8
+
9
+ ## 选哪条入口
10
+
11
+ | 你是谁 | 入口 | 不要用 |
12
+ |--------|------|--------|
13
+ | Cursor / Claude Code / CI · 存量仓 | `npx spec-wave`(可选 `host apply`) | 不要把插件 `init_coding_kit` 与 CLI `init` 当成同一入口 |
14
+ | DSH 会话 / 模型调工具(可选) | `dsh plugin add dsh-coding-kit`(过渡包名;同一包) | 不要只 `npm install`(缺 bundle 层则工具不出现) |
15
+
16
+ 主入口是 npm 包 **`spec-wave@2.1.1`** 的 **`npx spec-wave`**。过渡 bin `specgate` / `dsh-coding-kit` 仍可用。插件面与 CLI 面互不替代。
17
+
18
+ ### 一包多宿主(F6 · 2.0 + 技能/编排 · 2.1 · tools UX · 2.1.1)
19
+
20
+ 单一声明式适配表 → 多个宿主原生落点(always_on + skills + **commands**)。Verify 真值仍在 CLI(`failClosed` exit **2**);IDE slash/command 只编排。**装 npm 包不会自动物化 IDE 文件**(无 postinstall);须显式跑 `init --tools` / `host apply`。
21
+
22
+ | 宿主 | `host apply`(profile `core`)写入 |
23
+ |------|-------------------------------------|
24
+ | **Cursor** | `.cursor/rules/*.mdc` · `.cursor/commands/kit-*.md` · `.cursor/skills/` |
25
+ | **Claude Code** | `CLAUDE.md` 产品 marker 块 · `.claude/commands/kit/<verb>.md` → **`/kit:verb`** · `.claude/skills/` |
26
+ | **DSH** | `.dsh/skills/` — 帽子技能 **+** 编排 `kit-*`(`/` 可发现;**不**建 `.dsh/commands/`) |
27
+ | **agents**(可选) | `AGENTS.md` 片段 · `.agents/skills/` |
28
+
29
+ **2.1 增量**(同一包):Claude `/kit:` 命名空间 · DSH `.dsh/skills/kit-*` 编排 · 可选 `--profile expanded` 物化 `kit-hat-*` 薄壳(默认仍 `core`)。
30
+
31
+ **2.1.1 · 安装/升级 UX**(对齐 OpenSpec `init --tools`):
32
+
33
+ | 主题 | 行为 |
34
+ |------|------|
35
+ | 粘性 | `host apply` / `host update` / `init`(含物化)在 `--yes` 成功写盘后更新 `.coding-kit/host-tools.json`(`host_ids` + `profile`)。dry-run **不**写粘性。 |
36
+ | `--tools` | `LIST`(如 `cursor,claude,dsh`)· `all`(适配表全部 host_id)· `none`(**仅 init**:只过程根、不物化)。`host apply` **必须**带 `--tools`。 |
37
+ | `host update`(方案 **A**) | 解析序:CLI `--tools` → 粘性 → 否则 **exit 1**。有粘性时 `host update --yes` **只**刷已选宿主。相对 2.1.0「省略 `--tools` = 全表」为 **BREAKING(小)**。 |
38
+ | `init` | TTY 无 `--tools` → **询问**(多选 / all / none)。非 TTY / CI 无 `--tools` → **exit 1**。`tools≠none` 且未 `--no-host-adapt` → 同进程 `host apply` + 写粘性。`--no-host-adapt` → 不 apply **亦不**写粘性。 |
39
+
40
+ 最短路径(先 dry-run,再写盘):
41
+
42
+ ```bash
43
+ npx spec-wave@2.1.1 host validate
44
+ npx spec-wave@2.1.1 host apply --tools cursor,claude,dsh --profile core
45
+ npx spec-wave@2.1.1 host apply --tools cursor,claude,dsh --profile core --yes
46
+ # 可选:--profile expanded # kit-hat-* 薄壳
47
+ # 可选:--tools all
48
+
49
+ # 升包后:刷粘性已选宿主(不必再抄 --tools)
50
+ npx spec-wave@2.1.1 host update --yes
51
+
52
+ # 首次 / CI:init 选型(仅过程根:--tools none)
53
+ npx spec-wave@2.1.1 init --preset harness-only --tools cursor,claude,dsh --yes
54
+ ```
55
+
56
+ `--yes` 后:Cursor 命令面板应可见 `kit-verify` / `kit-gate-status` 等;Claude Code 应对应出现 `/kit:verify` 等;DSH 应列出 `.dsh/skills/kit-*`。完整矩阵见 [`assets/ide/host-adapt/README.md`](assets/ide/host-adapt/README.md);录屏清单见 [`docs/guides/DOGFOOD_host_adapt_cursor_claude_录屏清单_v1_zh.md`](docs/guides/DOGFOOD_host_adapt_cursor_claude_录屏清单_v1_zh.md);规划见 [`docs/roadmap/PLAN_2_1_1_host_tools_ux_v1_zh.md`](docs/roadmap/PLAN_2_1_1_host_tools_ux_v1_zh.md)。
57
+
58
+ `peerDependencies` 中的 `@deepseek-ai/cordis` 与 `@deepseek-ai/dsh-tools` 是 **DSH 宿主插件契约**(仅宿主加载本包为插件时需要;CLI-only 不需要),已在 `peerDependenciesMeta` 标为 **optional**。
59
+
60
+ ## 入口 A · DSH 插件
61
+
62
+ 优先 npm(预构建,无需 allowBuilds):
63
+
64
+ ```bash
65
+ dsh plugin --profile web add dsh-coding-kit
66
+ ```
67
+
68
+ 备选:从 GitHub 安装(需 Node 构建;pnpm 10+ 可能要 allowBuilds):
69
+
70
+ ```bash
71
+ dsh plugin --profile web add github:Cyning12/SpecGate#main
72
+ ```
73
+
74
+ ### 确认层
75
+
76
+ ```bash
77
+ dsh --profile web --dump-config
78
+ ```
79
+
80
+ 安装成功后,profile 的 `package.json` 会出现依赖 `dsh-coding-kit`,且 `dsh.profile.bundles` 含该包名。用户一般不必手写 bundles;`dsh plugin add` 会维护。
81
+
82
+ ### 激活与调用
83
+
84
+ 1. 用该 profile 启动 DSH(例如 `dsh --profile web` / `dsh --profile web web`)。
85
+ 2. 在对话中说:**请应用 coding standards**(或「按 coding-kit 规范写代码」)。
86
+ 3. 模型应调用工具 `apply_coding_standards`。
87
+ 4. 成功后后续回合的 runtime context 含 `# Coding Standards`。
88
+
89
+ 可选参数:`profile=l1|l1+l2|full`(默认 `l1+l2`);`persist=false` 表示只在当轮工具结果里给出正文。
90
+
91
+ profile 档语义:
92
+
93
+ | 档 | 内容 |
94
+ |----|------|
95
+ | `l1` | L1 规范 + coding_wiki |
96
+ | `l1+l2`(默认) | 全部 standards + coding_wiki |
97
+ | `full` | **当前版本等价于 `l1+l2`**;保留枚举值,为后续扩展 bundle(差异化注入内容)预留 |
98
+
99
+ **override 根查找规则(自 1.3.0)**:`apply_coding_standards` 从当前工作目录逐级向上探测 `.coding-kit` 与 `.dsh/coding-kit`,在最近的含 `.git` 的祖先目录(git root)处截止——monorepo 子目录启动 DSH 也能命中仓根 override;git root 之外的更上层目录不会被误吸。无 `.git` 时向上查找到文件系统根。工具输出的 `source=override|package` 与 `root=` 行可观测实际命中。
100
+
101
+ 注入内容超 24k 字符时按**文件边界**截断:截断点只落在文件之间,不会注入半份文件;被略文件可由 `root` 下全集减去工具输出的 `files` 列表推出,且 `truncated=true` 附截断标记。
102
+
103
+ ### 初始化项目模板(插件面)
104
+
105
+ 初始化走工具 **`init_coding_kit`**(不是 CLI `init`)。
106
+
107
+ 对话:**请把 coding-kit 模板初始化到本项目** → 模型调用 `init_coding_kit`。
108
+ 之后修改 `.coding-kit/`,再调用 `apply_coding_standards`(`source=override`)。`init_coding_kit` 不覆盖已有文件。
109
+
110
+ 注意(读写根口径不对称,自 1.3.0 明示):**读取面**(`apply_coding_standards`)向上查找到 git root;**写入面**(`init_coding_kit`)仍写入当前工作目录。请在**仓根**对话中调用 `init_coding_kit`,避免在 monorepo 子目录里初始化后读取面却命中仓根。
111
+
112
+ 部分 IDE / yaml-language-server 会把根目录 `cordis.patch.yml` 当成 RFC6902 JSON Patch,报缺 `op` / `path` / `value`。这是误报,可忽略;该文件必须保持 `- insert`,不要改成 JSON Patch。
113
+
114
+ ## 入口 B · CLI(Cursor / Claude Code / CI)
115
+
116
+ P0 闸与 G1–G7(**1.2.0 已交付**):
117
+
118
+ ```bash
119
+ npx spec-wave init [--preset NAME] [--tools all|none|LIST] [--profile core|expanded] [--host-adapt|--no-host-adapt] [--yes] # NAME 词表: harness-only(唯一合法值)
120
+ npx spec-wave upgrade --yes
121
+ npx spec-wave refresh-ide-blocks [--target PATH] [--dry-run] [--yes] [--json]
122
+ npx spec-wave check
123
+ npx spec-wave verify --task <task.md> [--with-wiki-lint]
124
+ npx spec-wave verify --spec <SPEC.md> # SPEC→00 前审查文存在性闸(与 --task 互斥 · --with-wiki-lint 同生效)
125
+ npx spec-wave gate-check --task <task.md>
126
+ npx spec-wave audit --task <task.md>
127
+ npx spec-wave task lint --file <task.md>
128
+ npx spec-wave task close --file <task.md>
129
+ npx spec-wave status [--target] [--task] [--json] [--check]
130
+ npx spec-wave timeline --task FILE
131
+ npx spec-wave lifecycle show [--json]
132
+ npx spec-wave lifecycle dry-run --transition ID --from STATE
133
+ npx spec-wave discipline show [--json]
134
+ npx spec-wave graph yaml compile|check|export
135
+ npx spec-wave graph ingest|snapshot|axioms
136
+ npx spec-wave sync index
137
+ npx spec-wave sync prompts [--target PATH] [--yes] [--force] [--json]
138
+ npx spec-wave skills install [--target DIR] [--out DIR] [--global] [--force] [--with-execute-hats]
139
+ npx spec-wave skills build [--with-execute-hats]
140
+ npx spec-wave skills check
141
+ npx spec-wave host validate [--file PATH] [--json]
142
+ npx spec-wave host apply --tools cursor,claude --profile core [--target PATH] [--file PATH] [--json] [--dry-run|--yes]
143
+ npx spec-wave host update [--tools LIST|all] [--profile core] [--target PATH] [--file PATH] [--json] [--dry-run|--yes] [--force]
144
+ npx spec-wave wiki export --json
145
+ npx spec-wave task lint-done
146
+ npx spec-wave task lint-wiki-delta
147
+ npx spec-wave task check --file PATH
148
+ ```
149
+
150
+ `host apply` / `host update` 嗅探适配表 version 与可选 `@deepseek-ai/dsh-tools` peer(**U-01**):不匹配 → exit 2、零写入(`--json` 含 `contract.status`)。`--tools dsh` 仍 commands=[](不建 `.dsh/commands/`),编排落在 `.dsh/skills/kit-*`。**`host update` 省略 `--tools`** 时读粘性 `.coding-kit/host-tools.json`(否则 exit 1)。落点见上方 **一包多宿主**。
151
+
152
+ kit **源码仓**以 `docs/_tech_graph/` 做 `graph yaml compile|check|export` 的 dogfood(**不随 npm 包发布**;https://github.com/Cyning12/SpecGate/tree/main/docs/_tech_graph)。
153
+
154
+ `init` / `upgrade` / `sync index` / `skills build` 不覆盖 S2 过程域(`docs/tasks/`、`docs/harness/reviews/`、`docs/harness/invokes/by-task/`,以及 legacy 裸 `reviews/` / `invokes/by-task/`)。**S2 前缀真值源唯一**(`cli-shared` 的 `S2_TRUTH_PREFIXES`;F1 / 1.x MVP)。`sync prompts` 仅写入 Starter 白名单(`docs/harness/prompts/` **11** 文件 + `docs/harness/templates/TASK_TEMPLATE.md`)——默认 dry-run;本地内容与包内不同则列为 conflict 且不覆盖(`--force` 显式覆盖)。
155
+
156
+ `verify --with-wiki-lint`(显式旗标 · 非破坏):在既有检查之上追加 `lint-wiki-delta`(默认档 · `scope=all`),`--task` 与 `--spec` 模式同生效。有缺口时 verify 判 BLOCKED,列出 issue(缺口可能来自兄弟 active/done task),并打印与 PR CI 逐字一致的复跑命令 `npx --yes spec-wave task lint-wiki-delta --target .`(见 `assets/ci/samples/lint-wiki-delta.yml.example`);`--json` 增 `wiki_lint` 块(`ok` / `issues` / `scanned`)。target 无 `docs/tasks/` 目录时 scanned:0,不会误 BLOCKED。无旗标时 `verify` 行为与之前逐字一致。
157
+
158
+ `graph yaml export` / `graph yaml check` 的 graph 面行为自 1.7.0 起修正:① export 的 `graph_id` 以 yaml 声明值(`data.graph_id`,如 `00_main`)为唯一真值源写入 graphs/nodes/edges,不再用路径命名空间 id(如 `l0/00_main`)——路径 id 仅作输入兼容定位(`--graph-id` / 文件发现);② `check --all` 的 graph.json 切片过滤口径与 export 输出对齐(同一声明值真值源),kit 自产根 json 与 check 互认;③ export 保留全部 mark 类型(`?>` / `~>` / `::…` / `[…]`)的边 label(拓扑协议标记作为边属性呈现,不再丢弃 label 文本);④ compile 生成的 Mermaid class 段按 `nodes[].kind`(`flow`/`struct`/`external` → `phase`/`doc`/`infra`)生成,无 `kind` 时保留 id 推断作兜底。exit 码不变。**消费者注意**:依赖旧 export 输出(命名空间 graph_id / 空 label)的消费方需重跑 `graph yaml export`。
159
+
160
+ `check` 对 `manifest.version` 与包版本做三向比较(已是最新 / 可升级 / 高于)。自 1.5.2 起,当 manifest 带非 null `from_version`(即从旧 `@cyning/harness` 产品线迁来)时,「高于」分支输出跨产品线迁移语义(`@cyning/harness X → dsh-coding-kit Y`——跨产品线版本号不可比)并建议 `npx spec-wave upgrade --yes`,不再误报「可能为降级安装」;自 1.7.0 起该判据收窄为 `from_version` 属旧包产品线词表(2.x 系列)才走迁移文案,kit 线(1.x)`from_version` 与 `from_version: null` 均保留原三向文案。exit 码不变(恒 0)。
161
+
162
+ ### refresh-ide-blocks(R-07 · 存量 IDE 块旧命令字面刷写)
163
+
164
+ 旧包 `@cyning/harness` 时代 wizard marker merge 嵌入的 IDE 块(`<!-- cyning-harness:begin -->` … `<!-- cyning-harness:end -->`)内可能滞留旧命令字面。`refresh-ide-blocks` 仅在这类 **product marker 块体内** 做白名单字面替换:
165
+
166
+ - **默认 dry-run**:无旗标(或显式 `--dry-run`)只扫描 + 报告,零写入,exit 0;`--yes` 才写盘。
167
+ - **发现面(冻结白名单)**:仓根 `AGENTS.md`、`CLAUDE.md`、`.cursor/rules/*.mdc`(单层)。发现面之外的文件即使含 marker 也不处理。
168
+ - **映射表(冻结 · 仅块体内生效)**:
169
+
170
+ | 组 | 规则 | 行为 |
171
+ |----|------|------|
172
+ | A1 | `npx @cyning/harness` → `npx spec-wave` | 自动替换,子命令与参数原样保留 |
173
+ | A2 | `npx @cyning/harness@<version>` → `npx spec-wave` | 自动替换,钉版整体丢弃(报告记 dropped_pin) |
174
+ | A3 | `npx --yes @cyning/harness[@<version>]` → `npx --yes spec-wave` | 自动替换,`--yes` 保留、钉版丢弃 |
175
+ | A4 | 裸 bin 形态 `harness skills build` / `harness skills check` → `npx spec-wave skills build` / `npx spec-wave skills check` | 自动替换(行前缀已含 `npx spec-wave` 时防二刷) |
176
+ | A5 | `npx dsh-coding-kit` → `npx spec-wave` | 自动替换(B-REFRESH · SpecGate 改名) |
177
+ | A6 | `npx dsh-coding-kit@<version>` → `npx spec-wave` | 自动替换,钉版丢弃(dropped_pin) |
178
+ | A7 | `npx --yes dsh-coding-kit[@<version>]` → `npx --yes spec-wave` | 自动替换,`--yes` 保留、钉版丢弃 |
179
+ | B1–B5 | `CYNING_HARNESS` / `--with-scripts` / `wizard/` 路径 / `harness:<name>` script 名 / 其他裸 `@cyning/harness` 引用 | **仅报告「需人工」,不替换** |
180
+
181
+ - **纪律**:marker 行与块外内容字节不动;`<!-- cyning-harness-local:begin -->` 块永不改写;`docs/tasks/`、`docs/harness/reviews/`、`docs/harness/invokes/by-task/`(S2)一律拒写。
182
+ - **preflight(--yes 专用 fail-fast,exit 2 零写入)**:git 脏树 / 单文件新旧字面混杂(MIXED)/ marker 配对畸形(MALFORMED)/ S2 断言闸任一命中即拒写。脏树判定采用 `git status --porcelain` 语义——**untracked 文件也计入脏树**,`--yes` 前请先 commit 或 `git stash -u`。
183
+ - **备份与回滚**:--yes 写盘前原字节备份到 `.coding-kit/backups/refresh-ide-blocks/<UTCts>/`(保留最近 5 代);回滚首选 `git checkout -- <path>`,非 git 仓用备份 cp 回。备份仅供本机回滚——建议消费者将 `.coding-kit/backups/` 加入 `.gitignore`(不入库)。存量树可能仍有 legacy `.cyning-harness/backups/`;新写不再以此为目标。
184
+ - **无 marker 文件(仅报告,绝不改写)**:发现面内 0 product 块文件用 A/B 组同一组正则做只读扫描,命中入人类报告「无 marker 检出(仅报告,不刷写)」段与 --json top-level `plain_mentions: [{path, rule, count}]` 字段(schema 保持 `@1`,向后兼容增量);不触发 preflight fail-fast,不改 exit 码。
185
+ - **幂等**:已刷写文件再次运行 A 组命中 0,`files_written=0`、字节不变、exit 0。
186
+ - `--json` 输出单行机器报告(schema `dsh-coding-kit/refresh-ide-blocks-report@1`;自 1.5.2 起向后兼容增量含 `plain_mentions` / `totals.plain_mentions`)。
187
+
188
+ ### D5 测试制品探测边界(audit / verify · test_strategy=required)
189
+
190
+ `audit` / `verify` 在 task 声明 `test_strategy=required` 时执行 D5 强检查:目标仓须存在**真实测试制品**,否则 exit 2。D5 是制品探测,不执行测试命令。探测口径(自 1.3.0 收紧):
191
+
192
+ **强信号探针(存在即 PASS)**
193
+
194
+ - 目录:`test/` `tests/` `spec/` `specs/` `__tests__/`
195
+ - 配置文件:`jest.config.{js,ts}` `vitest.config.{js,ts}` `playwright.config.{js,ts}` `cypress.config.js` `pytest.ini`
196
+ - 测试文件名(仓根起 3 层内):`*.(test|spec).(js|ts|mjs|cjs)`、`*_test.py`、`test_*.py`
197
+
198
+ **CI 探测**:`.github/workflows/` 下 `*.yml|*.yaml` 逐一读文本,命中以下任一 test 步骤模式才算有 CI 测试:`pytest` `vitest` `jest` `npm (run )?test` `pnpm (run )?test` `yarn test` `node --test` `go test` `cargo test` `tox` `unittest`,或 step `name:` 含 `test`。
199
+
200
+ **已知误判面与逃生口**
201
+
202
+ - `pyproject.toml` / `setup.py` 存在**不再**视为测试制品(任意现代 Python 仓都有,与有无测试无关)。
203
+ - 纯 lint / 纯部署 workflow(无 test 步骤)不再放行。
204
+ - 探测深度为仓根起 3 层;monorepo 更深层或自定义测试命令(如 `make test`)不命中白名单时,在仓内放任一强信号文件(如 `tests/` 目录、`*_test.py`)即可。
205
+ - **WARN 过渡已硬化(1.5.0)**:1.3.0–1.4.0 期间「新探测失败但旧启发式通过 → `D5: WARN 过渡` exit 0 不阻塞」的过渡分支已删除;自 1.5.0 起上述情形一律 **FAIL**(verify BLOCKED / audit FAIL,exit 2)。升级前请在仓内补真实测试制品(如 `tests/`、`*_test.py`、`*.test.ts` 或含 test 步骤的 CI)。
206
+
207
+
208
+ ### P0 门禁退出码(failClosed · F2 / 1.x MVP)
209
+
210
+ | 退出码 | 含义 | 典型命令 |
211
+ |--------|------|----------|
212
+ | **0** | 通过 / 仅信息 | `check` **恒为** 0(只给版本建议) |
213
+ | **1** | 用法错误或非阻断失败 | 缺必填旗标、未知参数 |
214
+ | **2** | **门禁阻断** — failClosed,不得放行 | `verify` / `gate-check` / `audit` 的 P0 失败;`test_strategy=required` 时 D5 无测试制品 |
215
+
216
+ **failClosed**:P0 门禁失败一律 **exit 2**。CI / Agent 须把 2 当硬停(与 Claude Code hook「退出码 2 阻断」同族)。禁止在本地把 2 改映射成 0 以求「继续跑」。
217
+
218
+ **分层强制(文档级 · 1.x 不引入云/远程策略引擎)**:
219
+
220
+ 1. 消费者仓库内的机械门禁结论(`verify` / `gate-check` / `audit` 的 exit 2)优先于「本地习惯跳过门禁」。
221
+ 2. task 表 `HG-AUDIT-R1=approved` 之后,hat 30 才可改码。
222
+ 3. kit P0 **不依赖**宿主 hooks——判定在进程内 CLI 完成。
223
+
224
+
225
+ ## 从 @cyning/harness 迁移
226
+
227
+ 完整清单、F4 方案 B 布局与 **已公布** EOS / deprecate 日历:见 [`MIGRATION.md`](./MIGRATION.md)。
228
+
229
+ 钉 **spec-wave@2.1.1** 后可去掉 `@cyning/harness`。最小路径三步(必须,按序):
230
+
231
+ 1. 把 `devDependency` `@cyning/harness` 换成 `spec-wave`(钉 `2.1.1`;曾用名 `dsh-coding-kit`)。
232
+ 2. 在仓根执行 `npx spec-wave upgrade --yes`(读优先 `.coding-kit/manifest.json`,否则 legacy `.cyning-harness/manifest.json`;**写入** `.coding-kit/manifest.json`,`version` 钉 2.1.1,`from_version` 记旧号;**不删除** `.cyning-harness/`)。
233
+ 3. CI / 脚本里把 `npx @cyning/harness` / `npx dsh-coding-kit` 换成 `npx spec-wave`。
234
+
235
+ **布局**:过程落盘现行根为 **`.coding-kit/`**;`.cyning-harness/` 为 **legacy 只读**。勿再把 `.cyning-harness` 当新标准目录。
236
+
237
+ Skill 安装为 **推荐、非必须**(最小路径不依赖 DSH 扫 skill)。命令一律 `npx spec-wave`。旧包 **`@cyning/harness` 已在 npm deprecate**(2026-09-10 · 仅维护者可操作);请钉 **`spec-wave@2.1.1`** 并按 `MIGRATION.md` 迁移。
238
+
239
+ ### FAQ · pnpm peer
240
+
241
+ 若 pnpm 安装仍因 peer 链失败(例如解析到未公开发布的宿主包):在仓根设 `auto-install-peers=false`(或单次 `pnpm add -D spec-wave --config.auto-install-peers=false`)。即使 **1.2.2** 已将 cordis / dsh-tools 标为 optional,也建议保留此兜底。
242
+
243
+ ### 可复制 Prompt(给存量仓 Agent)
244
+
245
+ 整段粘贴:
246
+
247
+ ````text
248
+ 你 = 本仓库维护 Agent。把本仓从 @cyning/harness 迁到 spec-wave@2.1.1。
249
+
250
+ 最小路径(必须,按序):
251
+ 1. package.json 的 devDependency:删除 @cyning/harness,改为 spec-wave(钉 2.1.1;曾用名 dsh-coding-kit)。
252
+ 2. 在仓根执行:npx spec-wave upgrade --yes
253
+ (读 .coding-kit/manifest.json 或 legacy .cyning-harness/manifest.json;写入 .coding-kit/manifest.json;version 钉 2.1.1,from_version 记旧号;不删除 .cyning-harness/;不覆盖 docs/tasks、reviews、invokes/by-task。)
254
+ 3. CI 与脚本里所有 npx @cyning/harness 与 npx dsh-coding-kit 换成 npx spec-wave。
255
+ 命令一律 npx spec-wave。禁止再写 npx @cyning/harness skills build。
256
+ 布局与 EOS 日历见 MIGRATION.md(人闸未批前不得宣称已 deprecate)。
257
+
258
+ 推荐(非必须 · Skill 安装):
259
+ - 仓内:npx spec-wave skills install
260
+ 复制 npm 包内已生成 skills(默认不含 30/40)到本仓 .dsh/skills。已有文件默认不覆盖;要覆盖才加 --force。
261
+ - 用户级:npx spec-wave skills install --global
262
+ 写到 $HOME/.dsh/skills(展开 HOME;不要把 ~ 当成相对路径)。
263
+
264
+ 路径对照(禁止混用):
265
+ - .dsh/skills 或 $HOME/.dsh/skills = Skill 安装落点(本命令)。
266
+ - .claude/skills 或 ~/.claude/skills = Claude Code 的 skill 目录(本命令默认不写;若你用 Claude 可另拷或 --out)。
267
+ - .dsh/coding-kit 或 .coding-kit = 规范覆盖(apply_coding_standards / init_coding_kit),不是 skill 目录。
268
+
269
+ 已验证(对照 DSH 上游源码):DSH runtime 自动扫描本仓 .dsh/skills 与 $HOME/.dsh/skills 并按需加载。skill 形态为 <name>/SKILL.md 目录包或 <name>.md 平铺文件,frontmatter 必填 name/description;证据锚点见 README「扫描验证」节。
270
+
271
+ 不要做:GitHub Archive;npm publish / deprecate;让 apply 在加载时自动注入;默认安装 30/40;把 skills 拷进 .dsh/coding-kit。
272
+ ````
273
+
274
+ ### 路径对照
275
+
276
+ | 路径 | 用途 | 谁写入 |
277
+ |------|------|--------|
278
+ | 产品包 `assets/skills` | 生成物真值;`skills check` 对照根 | 维护者 `skills build`(G5 freeze) |
279
+ | `<repo>/.dsh/skills` | 消费者 Skill **安装落点** | `skills install` |
280
+ | `$HOME/.dsh/skills` | 用户级安装落点 | `skills install --global` |
281
+ | `<repo>/.claude/skills` 或 `~/.claude/skills` | Claude Code skill 目录 | 用户另拷或 `--out`;**默认不写** |
282
+ | `<repo>/.dsh/coding-kit` 或 `.coding-kit` | 规范覆盖(standards / wiki) | `init_coding_kit`;**禁止**当作 skill dest |
283
+
284
+ ### 扫描验证(已对照 DSH 上游源码)
285
+
286
+ **已验证(2026-08-22 · 对照 DSH 上游源码 deepseek-harness@141eb6f,即 dsh 0.1.0-rc.8)**:DSH runtime **会自动扫描** `<repo>/.dsh/skills` 与 `$HOME/.dsh/skills` 并 **按需加载**,二者正是本包 `skills install` 的两个 **安装落点**。证据锚点:
287
+
288
+ - `packages/skill/skill-filesystem/src/index.ts:246` —— 扫描 `<projectRoot>/.dsh/skills`(source=`project-dsh`,rank 100);同文件 `:253` —— 扫描 `<dshHome>/skills`(`$DSH_HOME` 或 `~/.dsh`,source=`user-dsh`,rank 400)。
289
+ - `docs/subsystems/skills.md`「Local discovery priority」表同口径(rank 100/400 两行);加载机制:skill 摘要注入会话 catalog,模型经 `skill({ name })` 工具按需拉取正文(该文档「Session catalog and tool contract」节)。
290
+
291
+ 结构与 frontmatter 要求(同源码):目录包 `<name>/SKILL.md` 或平铺 `<name>.md`(index.ts:724-728);frontmatter 必填 `name`/`description`,`name` 须 kebab-case(index.ts:810-816);projectRoot = 最近含 `.git` 的祖先目录(index.ts:937-947)。
292
+
293
+ 注意:扫描/加载是 **DSH runtime 的行为契约**,随上游版本演进;以上锚点对应 0.1.0-rc.8。本包职责止于把 skill 写入正确落点并保持 frontmatter 合法(`skills check`)。
294
+
295
+ ## Host 使用 coding-kit(沟通 Agent / 产品 Chat)
296
+
297
+ Skills **不能**覆盖全部过程能力。Host 要嵌套 Harness 过程,须同时具备:Process Kernel 对象 + CLI Capability + PromptAssembly 槽,而不是只拷 Skills。
298
+
299
+ 推荐 Capability 白名单(**须走 Policy / H2**:默认关 · Host env 显式授权 · 禁止任意 shell):
300
+
301
+ - `npx --yes spec-wave@<pin> verify …`
302
+ - `npx --yes spec-wave@<pin> task …`
303
+
304
+ | 能力 | Skills 能否覆盖 |
305
+ |------|----------------|
306
+ | 10/20 审过程指引 | 能(默认分发) |
307
+ | 00 委派纪律 | 弱:全文不进默认;delegate-only 短 Skill 可默认装 |
308
+ | 30/40 执行 | 弱:不进默认(T1 前);且执行仍须 `verify` |
309
+ | 闸 / pre-30 / may_start_30 | **否**:须 CLI `verify`(或 Host 封装同一 CLI) |
310
+ | 帽身份常驻 system | **否**:Skills 为 on-demand,非 system |
311
+ | Host 业务答题 | **否**:属产品 Prompt Pack |
312
+
313
+ 三分:**System/Re-anchor** = 短身份;**prompts 全文** = 换帽加载;**verify** = 机械。不可互替。
314
+
315
+ ## 发版(维护者)
316
+
317
+ **现行包**:**`spec-wave@2.1.1`** — **npm `latest=2.1.1`**(2026-09-10 · 人 publish · tag `v2.1.1`)。前一发版:**2.1.0**(技能/编排)。
318
+
319
+ 发布流程见 [RELEASING.md](RELEASING.md) —— publish 前硬步骤 checklist(先 commit 后 publish · 四门全绿 · 版本钉同步 · **Agent 可 bump/tag** · **`npm publish` 仅人**;DEF-001 教训制度化)。
320
+
321
+ ## GitHub topic
322
+
323
+ 本仓库当前 GitHub topics:**`dsh-plugin`**(DSH 官方发现机制 tag,见上游 deepseek-harness `README.md` 与 `CONTRIBUTING.md`;无应用商店)、**`deepseek-harness`**、**`dsh-plugins`**、**`dsh`**。`package.json` 的 npm keywords 同样含 `dsh-plugin` 与 `deepseek-harness`。
324
+
325
+ ## License
326
+
327
+ MIT
package/RELEASING.md ADDED
@@ -0,0 +1,52 @@
1
+ # RELEASING · SpecGate(`spec-wave`)发版硬步骤 Checklist
2
+
3
+ > **制度化来源**:DEF-001 教训 —— 曾从未提交工作树 publish,导致发布物与仓库真值漂移、无法溯源。
4
+ > 本清单把「publish 前 commit + tag」固化为**硬步骤**:任何一步未完成即停止,不得跳步。
5
+ > **职责分工(2026-09-09 起)**:**维护 Agent 可执行 ①–⑦ 与 bump/tag**;**⑧ `npm publish` 仅人**;⑨ 可由 Agent 在人 publish 后核验(或人自核)。
6
+ > **仍仅人**:`npm publish` · `npm deprecate`(另须 `HG-EOS-DATE`)· 云/账号 2FA 操作。
7
+ > **包名**:现行 **`spec-wave`**(曾用名 `dsh-coding-kit`;曾拟裸 `specgate` 遭 E403 相似拒)。
8
+
9
+ ## 最近一次发版
10
+
11
+ | 项 | 值 |
12
+ |----|-----|
13
+ | **npm `latest`(旧包名)** | **`dsh-coding-kit@2.1.1`**(2026-09-10 · 人 publish · **仍 published** 直至 deprecate) |
14
+ | **preparing(新包名)** | **`spec-wave@2.1.1` first publish**(仓内 name 已切;**尚未** `npm publish` · `HG-PUBLISH` pending · 仅人) |
15
+ | **git** | tag **`v2.1.1`** · commit `cc61324`(能力线同版;改名不 bump) |
16
+ | **主题(已发)** | patch:host tools 粘性 · update 缺省 A · `init --tools`(对齐 OpenSpec) |
17
+ | **主题(准备中)** | SpecGate 改名:包身份 `spec-wave` · 三 bin · 文档/GitHub 已切 · W4 仅人 publish + deprecate 旧 `dsh-coding-kit` |
18
+ | **前一发版** | **`2.1.0`**(多平台 Skills + Commands · published as `dsh-coding-kit`) |
19
+ | **更早旧包** | `@cyning/harness` **已 deprecate**(2026-09-10 · registry 文案曾钉 `dsh-coding-kit@1.12.0`) |
20
+ | **1.x** | **CLOSED**(见 `docs/roadmap/AUDIT_1x_residual_after_1_12_1_zh.md`) |
21
+ | **下一主线** | SpecGate W4 发版后 · **2.1.x+ / 2.2**(workspaces / onboard 等观察项;另闸) |
22
+ | **验收(2.1.1 UX)** | [`docs/roadmap/ACCEPTANCE_2_1_1_host_tools_ux_2_1_1_zh.md`](docs/roadmap/ACCEPTANCE_2_1_1_host_tools_ux_2_1_1_zh.md) |
23
+ | **验收(改名 · 准备档)** | [`docs/roadmap/ACCEPTANCE_rename_specgate_2_1_1_zh.md`](docs/roadmap/ACCEPTANCE_rename_specgate_2_1_1_zh.md) |
24
+
25
+ ### 前一发版(2.0.x–2.1.0)
26
+
27
+ 1. `2.0.0` / `2.0.1` / `2.0.2` 已 npm 发版(人 · 2026-09-10)
28
+ 2. `2.1.0` 多平台技能+编排(registry 曾为 `latest=2.1.0`)
29
+ 3. `2.1.1` host tools UX(checklist ⑨ 已核 · registry `latest=2.1.1`)
30
+
31
+ > 下方 checklist 供下一次发版勾选;勿永久勾死。
32
+
33
+ ## 硬步骤(按序执行 · 全部满足后方可 publish)
34
+
35
+ - [ ] **① 工作树干净且所有改动已提交**:`git status --porcelain` 为空;拟发布内容全部进入 git 历史。**禁止从未提交工作树 publish**(DEF-001 教训:工作树残留 = 发布物不可溯源)。(Agent 可做)
36
+ - [ ] **② 质量闸门全绿**:`npm run typecheck && npm test && npm run build && npm run test:lib` 依次全绿(与 `prepublishOnly` 同一四门;任一红即停止,先修再发)。(Agent 可做)
37
+ - [ ] **③ CHANGELOG 版本节已归拢**:`CHANGELOG.md` 的 `## [Unreleased]` 内容已归入 `## [X.Y.Z] - YYYY-MM-DD` 版本节(日期 + 版本号齐全),无残留 Unreleased 条目遗漏。(Agent 可做)
38
+ - [ ] **④ 版本钉(pins)已同步(F5 方案 B)**:新版本号已同步全部**现行钉点** —— `assets/ontology.yaml#product_semver`、`assets/harness/discipline-coverage.yaml#as_of_package_version`、README 双文件中的 `spec-wave@x.y.z`、以及含版本断言的测试。闸测:`test/version-pins-f5.test.ts`(及既有 ontology / discipline 分面测)。**仓根 `SPEC.md` 为 archived epic,不要求与包版本对齐,禁止再把其标题当作现行契约。**(Agent 可做)
39
+ - [ ] **⑤ npm version + tag(Agent 默认可做)**:`npm version <patch|minor|major>`(或等价:改 `package.json` + 钉点同步后落 version commit + `vX.Y.Z` tag);确认 tag 与 CHANGELOG 版本节一致。**禁止**在钉点未同步时 bump。
40
+ - [ ] **⑥ PR 合并 + CI 绿**:发版 PR 已 merge 进 `main` 且 CI 全绿(**CI 未绿禁合**);`git push` 含 `--follow-tags`(或单独 push tag),远端 main 与 tag 指向发布真值。(Agent 可推送,须用户/环境授权)
41
+ - [ ] **⑦ npm pack --dry-run 检查**:`npm pack --dry-run` 逐行核对 tarball 清单 —— 无 `test/` 泄漏、无工作区/私仓文件;仅 `package.json#files` 白名单(`bin` / `lib` / `assets` / `cordis.patch.yml` / `README.md` / `LICENSE`)内的内容入包。(Agent 可做)
42
+ - [ ] **⑧ npm publish(仅人)**:`npm publish`(`prepublishOnly` 会自动重跑②四门;⑦已核对清单)。**Agent 不得执行本步。**
43
+ - [ ] **⑨ publish 后核验 + 过程档状态更新**:`npm view spec-wave version`(及 `dist-tags`)确认新版本已生效;抽样验证;更新过程档状态为已发布。(人 publish 后 · Agent 可代核)
44
+
45
+ ## 禁令速查
46
+
47
+ - **禁止从未提交工作树 publish**(① · DEF-001)。
48
+ - **CI 未绿禁合**(⑥ · 合并前 CI 必须全绿)。
49
+ - **Agent 禁止 `npm publish`**(⑧ 仅人)。**Agent 允许 `npm version` / tag / 钉点同步**(⑤ · 须先过 ①–④)。
50
+ - **Agent 禁止 `npm deprecate`**(另闸 `HG-EOS-DATE`)。
51
+ - `npm pack --dry-run` 清单异常(`test/` 泄漏、白名单外文件)→ 停止发版,先修 `files` 白名单或 .npmignore 口径(⑦)。
52
+ - **CI 不得自动 `npm publish`**(与 Agent 同禁;registry 凭证仅人侧)。
@@ -0,0 +1,30 @@
1
+ # assets · 资产地图
2
+
3
+ 本目录是从旧仓 `cyning-harness` 按白名单复制的 **P0 模板资产**。目录名 `assets/harness/` 仅保留历史路径,对外产品名是 **coding-kit / ICVO / SDD**,不是 “harness”。
4
+
5
+ `apply_coding_standards`(T2)默认只读 `standards/` 与 `coding_wiki/`。其余目录供 `init_coding_kit` 整树复制,给人与 IDE `@` 使用,不全部灌进 prompt。
6
+
7
+ ## 旧路径对照
8
+
9
+ | 旧路径(相对 `cyning-harness/`) | 本仓路径 | 用途 |
10
+ |----------------------------------|----------|------|
11
+ | `coding_wiki/` | `assets/coding_wiki/` | Inform:LLM 读序模板 |
12
+ | `standards/` | `assets/standards/` | Constrain:L1/L2 编码规范模板 |
13
+ | `graph/` | `assets/graph/` | Inform:图谱模板 |
14
+ | `harness/` | `assets/harness/` | Orchestrate:过程/帽模板(历史目录名) |
15
+ | `ci/` | `assets/ci/` | Verify:CI 样例 |
16
+ | `ide/` | `assets/ide/` | IDE 入口片段 |
17
+ | `skills/` | `assets/skills/` | Agent Skills 封装 |
18
+ | `ontology.yaml` | `assets/ontology.yaml` | ICVO 机器可读抽取 |
19
+ | `LICENSE` | 仓根 `LICENSE` | MIT · Copyright (c) 2026 Cyning |
20
+
21
+ ## 明确不在本目录
22
+
23
+ | 旧路径 | 原因 |
24
+ |--------|------|
25
+ | `bin/` `lib/` | CLI 运行时,不属 1.0.0 |
26
+ | `wizard/*.sh` | CLI 安装器 |
27
+ | `eval/` `examples/` `golden/` | 评测夹具,P1 |
28
+ | `node_modules/` | 依赖,禁止拷入 |
29
+
30
+ 过程轨(SPEC / task / invoke / reviews)在工作区 `docs/dsh_coding_kit_init/`,不进本仓。
@@ -0,0 +1,76 @@
1
+ # ci/samples · Verify 轨
2
+
3
+ 复制并改写为用户仓 **`.github/workflows/`** workflow。
4
+
5
+ ## v0.1 已交付(T4 · M2)
6
+
7
+ | 样例 | 状态 | 适用栈 | 三门禁 / 说明 |
8
+ |------|------|--------|----------------|
9
+ | [`quality.yml.example`](./quality.yml.example) | ✅ | Node/TS · Next 等 | install → lint → test → build |
10
+ | [`pytest.yml.example`](./pytest.yml.example) | ✅ | Python · FastAPI 等 | install → pytest |
11
+ | [`tech-graph.yml.example`](./tech-graph.yml.example) | ✅ · **可选** | 已接入 `docs/_tech_graph` + `scripts/graph-compile.sh` | graph compile(业务仓自备脚本)。kit **自身**用源码仓 `.github/workflows/tech-graph.yml` + 本仓 bin compile/check,不走本样例脚本 |
12
+ | [`hgm-ingest.yml.example`](./hgm-ingest.yml.example) | ✅ · **可选** | 任意已接入 Harness 的仓 | `graph ingest`(默认 continue-on-error) |
13
+ | [`lint-wiki-delta.yml.example`](./lint-wiki-delta.yml.example) | ✅ · **可选** | ≥2.18 须有 `wiki_delta` 的仓 | 默认硬失败;注释含 `--strict` / 读 pin |
14
+ | [`lint-wiki-delta.pin.yml.example`](./lint-wiki-delta.pin.yml.example) | ✅ · **可选** | 有 `harness.pin.json` 的仓 | 从 pin 解析版本再 `npx`(F-220-02) |
15
+
16
+ ## 嵌入步骤
17
+
18
+ mkdir -p .github/workflows
19
+ cp cyning-harness/ci/samples/quality.yml.example .github/workflows/quality.yml
20
+ # 或
21
+ cp cyning-harness/ci/samples/pytest.yml.example .github/workflows/pytest.yml
22
+ # 图谱编译(可选 · 须自备 graph-compile.sh)
23
+ cp cyning-harness/ci/samples/tech-graph.yml.example .github/workflows/tech-graph.yml
24
+ # 过程可观测(可选 · 非三门禁必绿)
25
+ cp cyning-harness/ci/samples/hgm-ingest.yml.example .github/workflows/hgm-ingest.yml
26
+ # wiki_delta(可选)
27
+ cp cyning-harness/ci/samples/lint-wiki-delta.yml.example .github/workflows/lint-wiki-delta.yml
28
+ # 有 pin:
29
+ # cp cyning-harness/ci/samples/lint-wiki-delta.pin.yml.example .github/workflows/lint-wiki-delta.yml
30
+
31
+ 无 monorepo checkout 时:见薄指针页 [`POINTER_RUNBOOK_wiki_delta.md`](../../docs/POINTER_RUNBOOK_wiki_delta.md)(原文不随包发布 · §5.1 `npm pack` / GitHub raw)。
32
+
33
+ 按 `package.json` / `requirements.txt` / Node 版本 / env 变量 **裁剪注释块**。
34
+
35
+ ## 摩擦 / 坑 · setup-node × packageManager(pnpm) × npx-only
36
+
37
+ `actions/setup-node@v5` 默认会按 `package.json` 的 `packageManager` 开 **package-manager-cache**。若字段为 `pnpm@…`,但本 job **只装 Node、用 npx / 不跑 pnpm install**(未先 `pnpm/action-setup`),则会红:
38
+
39
+ Unable to locate executable file: pnpm
40
+
41
+ | Job 类型 | 正确做法 |
42
+ |----------|----------|
43
+ | **npx-only**(`tech-graph` / `hgm-ingest` / `lint-wiki-delta` 等) | `setup-node` 显式 `package-manager-cache: false` |
44
+ | **Python / 无 package.json**(FastAPI 等) | **同样**必须 `package-manager-cache: false`(防日后加 `packageManager` 踩坑;ops dogfood) |
45
+ | **质量三门禁**(`quality.yml.example`) | 先 `pnpm/action-setup`,再 `setup-node` 且 `cache: pnpm` |
46
+
47
+ 不要把 npx-only 样例抄成「开了 cache 却没装 pnpm」。
48
+
49
+ ## 金样 POINTER(Ink · 只读对照)
50
+
51
+ | 栈 | 路径(工作区) |
52
+ |----|----------------|
53
+ | 前端 | `ai-ink-brain/.github/workflows/quality.yml` |
54
+ | 后端 | `ai-ink-brain-api-python/.github/workflows/pytest.yml` |
55
+ | 图谱 | `ai-ink-brain-api-python/.github/workflows/tech-graph.yml`(业务专有;Starter 为最小 compile 样例) |
56
+
57
+ Ink workflow 含图谱 export、跨仓 checkout 等 **业务专有** 步骤;Starter 样例为 **最小三门禁 / 最小 compile**,按需从金样增量合并。
58
+
59
+ ## 与 Harness 关系
60
+
61
+ - task `test_strategy: required` → 本地/CI 须与 workflow 命令一致
62
+ - L2 模板 CI 对齐节:[`standards/TEMPLATE_CODING_BASELINE_L2_*.md`](../../standards/)
63
+ - ONBOARDING §5:五轨检查清单含 CI 样例已适配
64
+ - **不**把 tech-graph / pre-commit hook 绑进 `init` 默认拷贝;按需从本目录 `cp`
65
+
66
+ ## 修订记录
67
+
68
+ | 日期 | 说明 |
69
+ |------|------|
70
+ | 2026-08-28 | `tech-graph.yml.example` 行旁注:kit 自身 workflow 为源码仓 `.github/workflows/tech-graph.yml`(本仓 bin);样例仍给自备 `graph-compile.sh` 的业务仓 |
71
+ | 2026-07-28 | `lint-wiki-delta.pin.yml.example` · 样例矩阵 / Python 交叉链(v2.21 · web+ops FEEDBACK) |
72
+ | 2026-07-28 | `lint-wiki-delta` 样例注明:迁完再硬失败;可选 `--strict`(v2.20) |
73
+ | 2026-07-28 | 增 `lint-wiki-delta.yml.example`(升级扫迁 · v2.19.1) |
74
+ | 2026-07-27 | 增 `tech-graph.yml.example`;`hgm-ingest` 补 `package-manager-cache: false`;专节摩擦说明 |
75
+ | 2026-07-27 | 增 `hgm-ingest.yml.example`(过程可观测 P2 · 可选) |
76
+ | 2026-06-09 | T4 M2 首版样例 |
@@ -0,0 +1,42 @@
1
+ # Optional · HGM graph ingest(过程可观测 · 非默认必绿)
2
+ #
3
+ # 用途:复制为 .github/workflows/hgm-ingest.yml(或并入既有 workflow 的一步)。
4
+ # 失败策略:continue-on-error: true(样例默认)· 需要硬闸时改为 false。
5
+ #
6
+ # 与 status --check / timeline 配合:保证 events JSONL 较新,便于过程投影。
7
+
8
+ name: hgm-ingest
9
+
10
+ on:
11
+ pull_request:
12
+ push:
13
+ branches:
14
+ - main
15
+ workflow_dispatch:
16
+
17
+ jobs:
18
+ ingest:
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 10
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v5
24
+
25
+ # npx-only:关闭 setup-node@v5 默认 packageManager 缓存
26
+ # (package.json 若声明 packageManager=pnpm 且未装 pnpm → Unable to locate executable file: pnpm)
27
+ - name: Setup Node
28
+ uses: actions/setup-node@v5
29
+ with:
30
+ node-version: "24"
31
+ package-manager-cache: false
32
+
33
+ - name: graph ingest(幂等)
34
+ continue-on-error: true
35
+ run: npx --yes spec-wave graph ingest --target .
36
+
37
+ # 可选:过程闸(须业务仓有 active task 路径)
38
+ # - name: status --check
39
+ # continue-on-error: true
40
+ # run: |
41
+ # npx --yes spec-wave status --target . \
42
+ # --task docs/harness/tasks/active/task_xxx.md --check
@@ -0,0 +1,47 @@
1
+ # Optional · wiki_delta 扫描 · 读 harness.pin.json(消费者自管 pin · v2.21+)
2
+ # 【旧机制示例】旧包 @cyning/harness 已弃用,现行为 dsh-coding-kit;本文件仅为旧包 pin 流程存档,
3
+ # 本包未接线 harness.pin.json 读取,现行样例见 lint-wiki-delta.yml.example。
4
+ #
5
+ # 适用:仓根有 harness.pin.json(或等价单源版本文件,须改 jq/node 取值)。
6
+ # 对比:lint-wiki-delta.yml.example 曾写死 @cyning/harness@2.21(旧包,已弃用,现行为 dsh-coding-kit)。
7
+ # 获取:同 RUNBOOK §5.1(clone / npm pack / raw)。
8
+ #
9
+ # Python / npx-only:package-manager-cache: false(见 ci/samples/README)
10
+
11
+ name: lint-wiki-delta
12
+
13
+ on:
14
+ pull_request:
15
+ push:
16
+ branches:
17
+ - main
18
+ workflow_dispatch:
19
+
20
+ jobs:
21
+ lint-wiki-delta:
22
+ runs-on: ubuntu-latest
23
+ timeout-minutes: 10
24
+ steps:
25
+ - name: Checkout
26
+ uses: actions/checkout@v5
27
+
28
+ - name: Setup Node
29
+ uses: actions/setup-node@v5
30
+ with:
31
+ node-version: "24"
32
+ package-manager-cache: false
33
+
34
+ - name: Resolve pin
35
+ id: pin
36
+ run: echo "version=$(node -p "require('./harness.pin.json').version")" >> "$GITHUB_OUTPUT"
37
+
38
+ # 可选:本仓若有 check-harness-pin 脚本,在此先跑
39
+ # - name: check-harness-pin
40
+ # run: node scripts/check-harness-pin.mjs
41
+
42
+ - name: task lint-wiki-delta
43
+ run: npx --yes "@cyning/harness@${{ steps.pin.outputs.version }}" task lint-wiki-delta --target .
44
+
45
+ # 可选 · 迁完后关账预检(半迁勿开)
46
+ # - name: task lint-wiki-delta --strict
47
+ # run: npx --yes "@cyning/harness@${{ steps.pin.outputs.version }}" task lint-wiki-delta --target . --strict
@@ -0,0 +1,49 @@
1
+ # Optional · wiki_delta 扫描(默认硬失败 · v2.19+)
2
+ #
3
+ # 获取本文件:见薄指针页 assets/docs/POINTER_RUNBOOK_wiki_delta.md(原文不随包发布)§5.1(clone / npm pack / GitHub raw)
4
+ # 失败策略:迁移中 continue-on-error: true;迁完硬失败;--strict 半迁勿开。
5
+ # Python / 无 package.json:必须 package-manager-cache: false(见 ci/samples/README)
6
+ # 有 harness.pin.json:改用 lint-wiki-delta.pin.yml.example,或按下方「读 pin」注释改写。
7
+
8
+ name: lint-wiki-delta
9
+
10
+ on:
11
+ pull_request:
12
+ push:
13
+ branches:
14
+ - main
15
+ workflow_dispatch:
16
+
17
+ jobs:
18
+ lint-wiki-delta:
19
+ runs-on: ubuntu-latest
20
+ timeout-minutes: 10
21
+ steps:
22
+ - name: Checkout
23
+ uses: actions/checkout@v5
24
+
25
+ - name: Setup Node
26
+ uses: actions/setup-node@v5
27
+ with:
28
+ node-version: "24"
29
+ package-manager-cache: false
30
+
31
+ - name: task lint-wiki-delta
32
+ # 迁移中可改为 continue-on-error: true
33
+ # 本地预检(30/40 自检与本 CI 对齐 · verify 已并入本检查,BLOCKED 时打印同一复跑命令):
34
+ # npx spec-wave verify --task <task.md> --with-wiki-lint
35
+ run: npx --yes spec-wave task lint-wiki-delta --target .
36
+
37
+ # 可选矩阵 B · 关账预检(迁完字段后再开;半迁勿开)
38
+ # - name: task lint-wiki-delta --strict
39
+ # run: npx --yes spec-wave task lint-wiki-delta --target . --strict
40
+
41
+ # 可选:仅扫 active
42
+ # - name: lint-wiki-delta · active only
43
+ # run: npx --yes spec-wave task lint-wiki-delta --target . --scope active
44
+
45
+ # 可选 · 读 pin【旧机制示例:旧包 @cyning/harness 已弃用,现行为 dsh-coding-kit;harness.pin.json 为旧包 pin 流程,本包未接线】:
46
+ # - name: lint from pin
47
+ # run: |
48
+ # PIN=$(node -p "require('./harness.pin.json').version")
49
+ # npx --yes "@cyning/harness@${PIN}" task lint-wiki-delta --target .