create-yss-spec 2.2.7 → 2.2.9

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 (191) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/template/.agents/skills/maintaining-skills/SKILL.md +1 -1
  4. package/template/.agents/skills/yss-antd-design/references/evidence.md +4 -0
  5. package/template/.agents/skills/yss-design-system/SKILL.md +3 -1
  6. package/template/.agents/skills/yss-page-module-development/SKILL.md +1 -1
  7. package/template/.agents/skills/yss-product-lifecycle/SKILL.md +3 -1
  8. package/template/.agents/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  9. package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  10. package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  11. package/template/.agents/skills/yss-prototype-stage/SKILL.md +11 -6
  12. package/template/.agents/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  13. package/template/.agents/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  14. package/template/.agents/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  15. package/template/.agents/skills/yss-router/references/boundaries.md +1 -1
  16. package/template/.agents/skills/yss-router/references/router-contract.yaml +30 -3
  17. package/template/.agents/skills/yss-router/references/slice-implementation-contract.md +14 -0
  18. package/template/.agents/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  19. package/template/.agents/skills/yss-ui/references/antdv-compatibility.md +1 -1
  20. package/template/.claude/skills/maintaining-skills/SKILL.md +1 -1
  21. package/template/.claude/skills/yss-antd-design/references/evidence.md +4 -0
  22. package/template/.claude/skills/yss-design-system/SKILL.md +3 -1
  23. package/template/.claude/skills/yss-page-module-development/SKILL.md +1 -1
  24. package/template/.claude/skills/yss-product-lifecycle/SKILL.md +3 -1
  25. package/template/.claude/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  26. package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  27. package/template/.claude/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  28. package/template/.claude/skills/yss-prototype-stage/SKILL.md +11 -6
  29. package/template/.claude/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  30. package/template/.claude/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  31. package/template/.claude/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  32. package/template/.claude/skills/yss-router/references/boundaries.md +1 -1
  33. package/template/.claude/skills/yss-router/references/router-contract.yaml +30 -3
  34. package/template/.claude/skills/yss-router/references/slice-implementation-contract.md +14 -0
  35. package/template/.claude/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  36. package/template/.claude/skills/yss-ui/references/antdv-compatibility.md +1 -1
  37. package/template/.codex/skills/maintaining-skills/SKILL.md +1 -1
  38. package/template/.codex/skills/yss-antd-design/references/evidence.md +4 -0
  39. package/template/.codex/skills/yss-design-system/SKILL.md +3 -1
  40. package/template/.codex/skills/yss-page-module-development/SKILL.md +1 -1
  41. package/template/.codex/skills/yss-product-lifecycle/SKILL.md +3 -1
  42. package/template/.codex/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  43. package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  44. package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  45. package/template/.codex/skills/yss-prototype-stage/SKILL.md +11 -6
  46. package/template/.codex/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  47. package/template/.codex/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  48. package/template/.codex/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  49. package/template/.codex/skills/yss-router/references/boundaries.md +1 -1
  50. package/template/.codex/skills/yss-router/references/router-contract.yaml +30 -3
  51. package/template/.codex/skills/yss-router/references/slice-implementation-contract.md +14 -0
  52. package/template/.codex/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  53. package/template/.codex/skills/yss-ui/references/antdv-compatibility.md +1 -1
  54. package/template/.cursor/skills/maintaining-skills/SKILL.md +1 -1
  55. package/template/.cursor/skills/yss-antd-design/references/evidence.md +4 -0
  56. package/template/.cursor/skills/yss-design-system/SKILL.md +3 -1
  57. package/template/.cursor/skills/yss-page-module-development/SKILL.md +1 -1
  58. package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +3 -1
  59. package/template/.cursor/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  60. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  61. package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  62. package/template/.cursor/skills/yss-prototype-stage/SKILL.md +11 -6
  63. package/template/.cursor/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  64. package/template/.cursor/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  65. package/template/.cursor/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  66. package/template/.cursor/skills/yss-router/references/boundaries.md +1 -1
  67. package/template/.cursor/skills/yss-router/references/router-contract.yaml +30 -3
  68. package/template/.cursor/skills/yss-router/references/slice-implementation-contract.md +14 -0
  69. package/template/.cursor/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  70. package/template/.cursor/skills/yss-ui/references/antdv-compatibility.md +1 -1
  71. package/template/.hermes/skills/maintaining-skills/SKILL.md +1 -1
  72. package/template/.hermes/skills/yss-antd-design/references/evidence.md +4 -0
  73. package/template/.hermes/skills/yss-design-system/SKILL.md +3 -1
  74. package/template/.hermes/skills/yss-page-module-development/SKILL.md +1 -1
  75. package/template/.hermes/skills/yss-product-lifecycle/SKILL.md +3 -1
  76. package/template/.hermes/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  77. package/template/.hermes/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  78. package/template/.hermes/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  79. package/template/.hermes/skills/yss-prototype-stage/SKILL.md +11 -6
  80. package/template/.hermes/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  81. package/template/.hermes/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  82. package/template/.hermes/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  83. package/template/.hermes/skills/yss-router/references/boundaries.md +1 -1
  84. package/template/.hermes/skills/yss-router/references/router-contract.yaml +30 -3
  85. package/template/.hermes/skills/yss-router/references/slice-implementation-contract.md +14 -0
  86. package/template/.hermes/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  87. package/template/.hermes/skills/yss-ui/references/antdv-compatibility.md +1 -1
  88. package/template/.pi/skills/maintaining-skills/SKILL.md +1 -1
  89. package/template/.pi/skills/yss-antd-design/references/evidence.md +4 -0
  90. package/template/.pi/skills/yss-design-system/SKILL.md +3 -1
  91. package/template/.pi/skills/yss-page-module-development/SKILL.md +1 -1
  92. package/template/.pi/skills/yss-product-lifecycle/SKILL.md +3 -1
  93. package/template/.pi/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  94. package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  95. package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  96. package/template/.pi/skills/yss-prototype-stage/SKILL.md +11 -6
  97. package/template/.pi/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  98. package/template/.pi/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  99. package/template/.pi/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  100. package/template/.pi/skills/yss-router/references/boundaries.md +1 -1
  101. package/template/.pi/skills/yss-router/references/router-contract.yaml +30 -3
  102. package/template/.pi/skills/yss-router/references/slice-implementation-contract.md +14 -0
  103. package/template/.pi/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  104. package/template/.pi/skills/yss-ui/references/antdv-compatibility.md +1 -1
  105. package/template/.qoder/skills/maintaining-skills/SKILL.md +1 -1
  106. package/template/.qoder/skills/yss-antd-design/references/evidence.md +4 -0
  107. package/template/.qoder/skills/yss-design-system/SKILL.md +3 -1
  108. package/template/.qoder/skills/yss-page-module-development/SKILL.md +1 -1
  109. package/template/.qoder/skills/yss-product-lifecycle/SKILL.md +3 -1
  110. package/template/.qoder/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  111. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  112. package/template/.qoder/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  113. package/template/.qoder/skills/yss-prototype-stage/SKILL.md +11 -6
  114. package/template/.qoder/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  115. package/template/.qoder/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  116. package/template/.qoder/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  117. package/template/.qoder/skills/yss-router/references/boundaries.md +1 -1
  118. package/template/.qoder/skills/yss-router/references/router-contract.yaml +30 -3
  119. package/template/.qoder/skills/yss-router/references/slice-implementation-contract.md +14 -0
  120. package/template/.qoder/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  121. package/template/.qoder/skills/yss-ui/references/antdv-compatibility.md +1 -1
  122. package/template/.trae/skills/maintaining-skills/SKILL.md +1 -1
  123. package/template/.trae/skills/yss-antd-design/references/evidence.md +4 -0
  124. package/template/.trae/skills/yss-design-system/SKILL.md +3 -1
  125. package/template/.trae/skills/yss-page-module-development/SKILL.md +1 -1
  126. package/template/.trae/skills/yss-product-lifecycle/SKILL.md +3 -1
  127. package/template/.trae/skills/yss-product-lifecycle/references/matt-yss-adapter.md +2 -2
  128. package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +46 -1
  129. package/template/.trae/skills/yss-product-lifecycle/references/orchestration.md +6 -0
  130. package/template/.trae/skills/yss-prototype-stage/SKILL.md +11 -6
  131. package/template/.trae/skills/yss-prototype-stage/references/product-design-adapter.md +54 -0
  132. package/template/.trae/skills/yss-prototype-stage/scripts/prototype-contract.mjs +207 -0
  133. package/template/.trae/skills/yss-prototype-stage/tests/run-scenarios.mjs +154 -0
  134. package/template/.trae/skills/yss-router/references/boundaries.md +1 -1
  135. package/template/.trae/skills/yss-router/references/router-contract.yaml +30 -3
  136. package/template/.trae/skills/yss-router/references/slice-implementation-contract.md +14 -0
  137. package/template/.trae/skills/yss-router/references/yss-skill-execution-result.md +5 -0
  138. package/template/.trae/skills/yss-ui/references/antdv-compatibility.md +1 -1
  139. package/template/AGENTS.md +5 -4
  140. package/template/CONTEXT.md +2 -2
  141. package/template/DESIGN.md +203 -0
  142. package/template/README.md +10 -11
  143. package/template/__yss_dotfile__.gitignore +1 -0
  144. package/template/docs/agents/digital-human-roles.md +1 -1
  145. package/template/docs/agents/digital-human-roles.yaml +17 -21
  146. package/template/docs/agents/skills-maintenance.md +2 -2
  147. package/template/docs/agents/yss-plugin-dependency-contract.md +45 -0
  148. package/template/docs/agents/yss-skill-registry.yaml +30 -1
  149. package/template/docs/api/templates/openapi-draft-review-checklist.md +2 -2
  150. package/template/docs/architecture/templates/engineering-baseline-review-template.md +19 -0
  151. package/template/docs/design/README.md +14 -3
  152. package/template/docs/design/design-system-sync.yaml +12 -0
  153. package/template/docs/design/design.md +69 -10
  154. package/template/docs/design/preview-dark.html +15 -0
  155. package/template/docs/design/preview.html +20 -0
  156. package/template/docs/design/templates/interaction-spec-template.md +2 -2
  157. package/template/docs/design/templates/prototype-confirmation-template.md +1 -1
  158. package/template/docs/design/templates/prototype-evidence-template.yaml +52 -10
  159. package/template/docs/design/tokens/.design-md-projection.json +13 -0
  160. package/template/docs/discovery/reports/agent-governance-options.md +71 -0
  161. package/template/docs/process/harness-process-tailoring.md +12 -5
  162. package/template/docs/process/lifecycle-registry-baseline.json +1 -1
  163. package/template/docs/process/lifecycle-registry.yaml +1 -1
  164. package/template/docs/process/template-engineering-overview.md +2 -2
  165. package/template/docs/process/template-verification-profiles.yaml +15 -1
  166. package/template/docs/process/templates/maintenance-checkpoint-template.yaml +3 -12
  167. package/template/docs/templates/build-architecture-checklist-template.md +2 -0
  168. package/template/docs/templates/implementation-routing-template.md +23 -0
  169. package/template/docs/templates/requirement-freeze-template.md +1 -1
  170. package/template/docs/user-guide//346/210/230/346/234/257/350/256/276/350/256/241/345/255/220/351/241/271/347/233/256/347/224/250/346/210/267/346/211/213/345/206/214.md +218 -0
  171. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214.md +1014 -0
  172. package/template/docs/user-guide//347/224/250/346/210/267/346/211/213/345/206/214/347/264/242/345/274/225.md +15 -25
  173. package/template/scripts/lib/digital-human-roles.mjs +0 -1
  174. package/template/scripts/lib/maintenance-intensity.mjs +24 -10
  175. package/template/scripts/lib/skill-governance.mjs +19 -0
  176. package/template/scripts/lib/skill-registry.mjs +70 -0
  177. package/template/scripts/node-verify-lifecycle-registry.mjs +1 -1
  178. package/template/scripts/verify-digital-human-roles-scenarios +1 -1
  179. package/template/scripts/verify-template-verification-scenarios +5 -0
  180. package/template/scripts/verify-yss-prototype-contract-scenarios +2 -0
  181. package/template/skills-lock.json +8 -8
  182. package/template.manifest.json +1 -0
  183. package/template.snapshot.json +5 -5
  184. package/template/docs/user-guide/templates//347/224/250/346/210/267/346/211/213/345/206/214/346/250/241/346/235/277.md +0 -53
  185. package/template/docs/user-guide//344/272/247/345/223/201/347/224/237/345/221/275/345/221/250/346/234/237/345/267/245/344/275/234/346/265/201.md +0 -223
  186. package/template/docs/user-guide//344/272/247/345/223/201/347/240/224/345/217/221/345/205/250/347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +0 -1115
  187. package/template/docs/user-guide//345/244/226/351/203/250/345/221/275/344/273/244/350/241/214/345/267/245/345/205/267/345/256/236/350/267/265/346/214/207/345/215/227.md +0 -117
  188. package/template/docs/user-guide//347/224/237/345/221/275/345/221/250/346/234/237/346/234/200/344/275/263/345/256/236/350/267/265.md +0 -584
  189. package/template/docs/user-guide//350/247/204/346/240/274/344/270/216/344/273/273/345/212/241/350/277/201/347/247/273/346/214/207/345/215/227.md +0 -44
  190. package/template/docs/user-guide//351/234/200/346/261/202/346/276/204/346/270/205/346/214/207/345/215/227.md +0 -230
  191. package/template/docs/user-guide//351/234/200/346/261/202/346/276/204/346/270/205/346/234/200/344/275/263/345/256/236/350/267/265.md +0 -275
@@ -0,0 +1,207 @@
1
+ #!/usr/bin/env node
2
+ import { existsSync } from "node:fs";
3
+ import { mkdir, readFile, writeFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import process from "node:process";
6
+ import { fileURLToPath, pathToFileURL } from "node:url";
7
+ import { parseDocument } from "../../../../scripts/vendor/yaml.mjs";
8
+
9
+ const nonEmpty = (value) => typeof value === "string" && value.trim().length > 0;
10
+ const object = (value) => value && typeof value === "object" && !Array.isArray(value);
11
+ const semver = /^6\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?$/;
12
+ const pnpmSemver = /^[0-9]+\.[0-9]+\.[0-9]+(?:-[0-9A-Za-z.-]+)?$/;
13
+
14
+ function required(data, field, parent, errors) {
15
+ if (!object(data) || data[field] === undefined || data[field] === null) errors.push(`${parent}.${field} 缺失`);
16
+ }
17
+
18
+ function requiredString(data, field, parent, errors) {
19
+ required(data, field, parent, errors);
20
+ if (object(data) && data[field] !== undefined && !nonEmpty(data[field])) errors.push(`${parent}.${field} 必须是非空字符串`);
21
+ }
22
+
23
+ function requiredPassed(data, field, parent, errors) {
24
+ requiredString(data, field, parent, errors);
25
+ if (object(data) && nonEmpty(data[field]) && !["passed", "approved"].includes(data[field])) errors.push(`${parent}.${field} 必须为 passed/approved`);
26
+ }
27
+
28
+ export function validatePrototypeEvidence(data, { allowTemplate = false, allowLegacy = false } = {}) {
29
+ const errors = [];
30
+ const warnings = [];
31
+ if (!object(data)) return { errors: ["原型证据必须是对象"], warnings };
32
+ if (data.schema_version === 1) {
33
+ if (!allowLegacy) errors.push("schema_version 1 是旧证据;完成 gate.prototype-verified 前必须迁移到 2,或只读时显式 --allow-legacy");
34
+ else warnings.push("legacy prototype evidence schema v1");
35
+ return { errors, warnings };
36
+ }
37
+ if (data.schema_version !== 2) errors.push("schema_version 必须为 2");
38
+ for (const field of ["feature", "prototype_ref", "prototype_stack", "design_baseline", "visual_semantic_mapping", "antd", "browser_verification", "design_qa", "accessibility_verification", "review", "user_confirmation", "blockers"]) required(data, field, "root", errors);
39
+
40
+ const templateValue = (value) => allowTemplate && nonEmpty(value) && /<[^>]+>/.test(value);
41
+ const stack = data.prototype_stack;
42
+ if (object(stack)) {
43
+ for (const field of ["framework", "package_manager", "package_manifest_ref", "lockfile_ref", "source_entry_ref", "build_entry_ref", "build_command", "build_result", "actual_antd_version"]) requiredString(stack, field, "prototype_stack", errors);
44
+ if (stack.framework !== "react") errors.push("prototype_stack.framework 必须为 react");
45
+ if (stack.package_manager !== "pnpm") errors.push("prototype_stack.package_manager 必须为 pnpm");
46
+ if (nonEmpty(stack.lockfile_ref) && !stack.lockfile_ref.endsWith("pnpm-lock.yaml")) errors.push("prototype_stack.lockfile_ref 必须指向 pnpm-lock.yaml");
47
+ if (!templateValue(stack.actual_antd_version) && nonEmpty(stack.actual_antd_version) && !semver.test(stack.actual_antd_version)) errors.push("prototype_stack.actual_antd_version 必须是明确的 antd 6.x semver");
48
+ if (!allowTemplate) requiredPassed(stack, "build_result", "prototype_stack", errors);
49
+ }
50
+
51
+ const baseline = data.design_baseline;
52
+ if (object(baseline)) {
53
+ for (const field of ["design_standard", "project_design_ref", "project_token_refs", "theme_adapter_ref", "project_override_reviewed"]) required(baseline, field, "design_baseline", errors);
54
+ if (baseline.design_standard !== "ant-design-v6") errors.push("design_baseline.design_standard 必须为 ant-design-v6");
55
+ if (!Array.isArray(baseline.project_token_refs) || baseline.project_token_refs.length === 0) errors.push("design_baseline.project_token_refs 必须是非空数组");
56
+ if (!allowTemplate && baseline.project_override_reviewed !== true) errors.push("design_baseline.project_override_reviewed 必须为 true");
57
+ }
58
+
59
+ const mapping = data.visual_semantic_mapping;
60
+ if (object(mapping)) {
61
+ if (mapping.runtime_component_library !== "ant-design-vue-4.x") errors.push("visual_semantic_mapping.runtime_component_library 必须为 ant-design-vue-4.x");
62
+ if (mapping.runtime_version_source !== "implementation-lockfile") errors.push("visual_semantic_mapping.runtime_version_source 必须为 implementation-lockfile");
63
+ if (!Array.isArray(mapping.components) || mapping.components.length === 0) errors.push("visual_semantic_mapping.components 必须是非空数组");
64
+ for (const [index, component] of (mapping.components ?? []).entries()) {
65
+ const parent = `visual_semantic_mapping.components[${index}]`;
66
+ for (const field of ["semantic_role", "antd_v6_component", "project_token_refs", "yss_or_antdv_target", "state_mapping", "react_only_api_not_copied", "verification_ref"]) required(component, field, parent, errors);
67
+ if (!Array.isArray(component?.project_token_refs) || component.project_token_refs.length === 0) errors.push(`${parent}.project_token_refs 必须是非空数组`);
68
+ if (!Array.isArray(component?.state_mapping) || component.state_mapping.length === 0) errors.push(`${parent}.state_mapping 必须是非空数组`);
69
+ if (!allowTemplate && component?.react_only_api_not_copied !== true) errors.push(`${parent}.React-only API 未确认隔离`);
70
+ }
71
+ }
72
+
73
+ if (object(data.antd)) {
74
+ requiredString(data.antd, "target_antd_version", "antd", errors);
75
+ if (object(stack) && nonEmpty(data.antd.target_antd_version) && nonEmpty(stack.actual_antd_version) && !templateValue(data.antd.target_antd_version) && data.antd.target_antd_version !== stack.actual_antd_version) errors.push("antd.target_antd_version 必须与 prototype_stack.actual_antd_version 一致");
76
+ }
77
+ if (object(data.design_qa)) {
78
+ requiredString(data.design_qa, "report_ref", "design_qa", errors);
79
+ requiredString(data.design_qa, "result", "design_qa", errors);
80
+ if (nonEmpty(data.design_qa.report_ref) && !/^docs\/\.scratch\/[^/]+\/verification\/design-qa\.md$/.test(data.design_qa.report_ref) && !templateValue(data.design_qa.report_ref)) errors.push("design_qa.report_ref 必须是 feature 级 verification/design-qa.md");
81
+ if (!allowTemplate) requiredPassed(data.design_qa, "result", "design_qa", errors);
82
+ }
83
+ const accessibility = data.accessibility_verification;
84
+ if (object(accessibility)) {
85
+ for (const field of ["contrast_results_ref", "keyboard_navigation_result", "focus_visible_and_order_result", "semantic_label_dialog_result", "zoom_200_result", "reduced_motion_result", "target_size_result", "automated_scan"]) required(accessibility, field, "accessibility_verification", errors);
86
+ requiredString(accessibility, "contrast_results_ref", "accessibility_verification", errors);
87
+ if (!allowTemplate) for (const field of ["keyboard_navigation_result", "focus_visible_and_order_result", "semantic_label_dialog_result", "zoom_200_result", "reduced_motion_result", "target_size_result"]) requiredPassed(accessibility, field, "accessibility_verification", errors);
88
+ if (object(accessibility.automated_scan)) for (const field of ["tool", "version", "result", "ref"]) requiredString(accessibility.automated_scan, field, "accessibility_verification.automated_scan", errors);
89
+ }
90
+ if (!Array.isArray(data.blockers)) errors.push("root.blockers 必须是数组");
91
+ if (!allowTemplate && Array.isArray(data.blockers) && data.blockers.length > 0) errors.push("存在 blockers,不能通过原型验证");
92
+ return { errors, warnings };
93
+ }
94
+
95
+ function safePrototypeRoot(projectRoot, root, feature) {
96
+ const resolvedProject = path.resolve(projectRoot);
97
+ const resolvedRoot = path.resolve(root);
98
+ const expected = path.resolve(resolvedProject, "docs/.scratch", feature, "design/prototypes");
99
+ if (resolvedRoot !== expected) throw new TypeError(`原型目录必须精确匹配 ${expected}`);
100
+ if (!resolvedRoot.startsWith(`${resolvedProject}${path.sep}`)) throw new TypeError("原型目录越出项目根");
101
+ return { resolvedProject, resolvedRoot };
102
+ }
103
+
104
+ export async function preparePrototype({ projectRoot, root, feature, targetAntdVersion, pnpmVersion }) {
105
+ if (!/^[a-z0-9][a-z0-9-]*$/.test(feature ?? "")) throw new TypeError("feature 必须是小写 kebab-case");
106
+ if (!semver.test(targetAntdVersion ?? "")) throw new TypeError("targetAntdVersion 必须是明确的 antd 6.x semver");
107
+ if (!pnpmSemver.test(pnpmVersion ?? "")) throw new TypeError("pnpmVersion 必须是明确 semver");
108
+ const { resolvedProject, resolvedRoot } = safePrototypeRoot(projectRoot, root, feature);
109
+ const packagePath = path.join(resolvedRoot, "package.json");
110
+ if (!existsSync(packagePath)) throw new TypeError(`缺少 Product Design starter package.json: ${packagePath}`);
111
+ const pkg = JSON.parse(await readFile(packagePath, "utf8"));
112
+ pkg.packageManager = `pnpm@${pnpmVersion}`;
113
+ pkg.dependencies = { ...(pkg.dependencies ?? {}), "@ant-design/icons": "^6.0.0", antd: targetAntdVersion };
114
+ await writeFile(packagePath, `${JSON.stringify(pkg, null, 2)}\n`);
115
+
116
+ const themeSourcePath = path.join(resolvedProject, "docs/design/tokens/theme.json");
117
+ if (!existsSync(themeSourcePath)) throw new TypeError(`缺少项目主题: ${themeSourcePath}`);
118
+ const themeSource = JSON.parse(await readFile(themeSourcePath, "utf8"));
119
+ const generated = [
120
+ 'import { theme } from "antd";',
121
+ "",
122
+ `const source = ${JSON.stringify(themeSource, null, 2)};`,
123
+ 'const layoutKeys = new Set(["layoutHeaderHeight", "layoutSiderBackground", "layoutBodyBackground"]);',
124
+ "export const yssLayoutTokens = Object.fromEntries(Object.entries(source.token ?? {}).filter(([key]) => layoutKeys.has(key)));",
125
+ "export const yssTheme = {",
126
+ " algorithm: [theme.defaultAlgorithm, theme.compactAlgorithm],",
127
+ " token: Object.fromEntries(Object.entries(source.token ?? {}).filter(([key]) => !layoutKeys.has(key)))",
128
+ "};",
129
+ ""
130
+ ].join("\n");
131
+ await mkdir(path.join(resolvedRoot, "src"), { recursive: true });
132
+ await writeFile(path.join(resolvedRoot, "src/yss-theme.js"), generated);
133
+ const manifest = {
134
+ schema_version: 1,
135
+ feature,
136
+ design_standard: "ant-design-v6",
137
+ target_antd_version: targetAntdVersion,
138
+ prototype_framework: "react",
139
+ package_manager: `pnpm@${pnpmVersion}`,
140
+ theme_source: "docs/design/tokens/theme.json",
141
+ theme_adapter: `docs/.scratch/${feature}/design/prototypes/src/yss-theme.js`,
142
+ production_runtime: { framework: "vue-3", component_library: "ant-design-vue-4.x", version_source: "implementation-lockfile" },
143
+ next_commands: ["pnpm install", "pnpm build"]
144
+ };
145
+ await writeFile(path.join(resolvedRoot, "yss-prototype-adapter.json"), `${JSON.stringify(manifest, null, 2)}\n`);
146
+ return manifest;
147
+ }
148
+
149
+ export async function validatePrototypeProject({ root, targetAntdVersion }) {
150
+ const errors = [];
151
+ const packagePath = path.join(root, "package.json");
152
+ if (!existsSync(packagePath)) return { errors: ["缺少 package.json"] };
153
+ const pkg = JSON.parse(await readFile(packagePath, "utf8"));
154
+ if (pkg.dependencies?.antd !== targetAntdVersion) errors.push(`package.json 必须精确锁定 antd ${targetAntdVersion}`);
155
+ if (!String(pkg.packageManager ?? "").startsWith("pnpm@")) errors.push("package.json 必须记录实际 pnpm packageManager");
156
+ if (!existsSync(path.join(root, "pnpm-lock.yaml"))) errors.push("缺少 pnpm-lock.yaml");
157
+ if (!existsSync(path.join(root, "src/yss-theme.js"))) errors.push("缺少 src/yss-theme.js");
158
+ const sourceFiles = ["src/App.jsx", "src/App.tsx", "src/main.jsx", "src/main.tsx"].filter((file) => existsSync(path.join(root, file)));
159
+ const source = (await Promise.all(sourceFiles.map((file) => readFile(path.join(root, file), "utf8")))).join("\n");
160
+ if (!/ConfigProvider/.test(source) || !/yssTheme/.test(source)) errors.push("原型入口必须通过 ConfigProvider 消费 yssTheme");
161
+ if (!existsSync(path.join(root, "yss-prototype-adapter.json"))) errors.push("缺少 yss-prototype-adapter.json");
162
+ return { errors };
163
+ }
164
+
165
+ function args(argv) {
166
+ const result = { _: [] };
167
+ for (let index = 0; index < argv.length; index += 1) {
168
+ const item = argv[index];
169
+ if (!item.startsWith("--")) { result._.push(item); continue; }
170
+ const key = item.slice(2);
171
+ const value = argv[index + 1];
172
+ if (!value || value.startsWith("--")) result[key] = true;
173
+ else { result[key] = value; index += 1; }
174
+ }
175
+ return result;
176
+ }
177
+
178
+ async function loadYaml(file) {
179
+ const document = parseDocument(await readFile(file, "utf8"), { uniqueKeys: true });
180
+ if (document.errors.length > 0) throw new TypeError(document.errors[0].message);
181
+ return document.toJS({ maxAliasCount: 0 });
182
+ }
183
+
184
+ async function main(argv) {
185
+ const parsed = args(argv);
186
+ const command = parsed._[0];
187
+ if (command === "prepare") {
188
+ const result = await preparePrototype({ projectRoot: parsed["project-root"], root: parsed.root, feature: parsed.feature, targetAntdVersion: parsed["target-antd-version"], pnpmVersion: parsed["pnpm-version"] });
189
+ process.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
190
+ return;
191
+ }
192
+ if (command === "validate-project") {
193
+ const result = await validatePrototypeProject({ root: parsed.root, targetAntdVersion: parsed["target-antd-version"] });
194
+ if (result.errors.length > 0) throw new TypeError(result.errors.join("\n"));
195
+ process.stdout.write("prototype project contract passed\n");
196
+ return;
197
+ }
198
+ if (command === "validate-evidence") {
199
+ const result = validatePrototypeEvidence(await loadYaml(parsed._[1]), { allowTemplate: Boolean(parsed["allow-template"]), allowLegacy: Boolean(parsed["allow-legacy"]) });
200
+ if (result.errors.length > 0) throw new TypeError(result.errors.join("\n"));
201
+ process.stdout.write(`prototype evidence passed${result.warnings.length ? ` with warnings: ${result.warnings.join(", ")}` : ""}\n`);
202
+ return;
203
+ }
204
+ throw new TypeError("usage: prototype-contract.mjs prepare|validate-project|validate-evidence ...");
205
+ }
206
+
207
+ if (import.meta.url === pathToFileURL(process.argv[1]).href) main(process.argv.slice(2)).catch((error) => { process.stderr.write(`${error.message}\n`); process.exitCode = 1; });
@@ -0,0 +1,154 @@
1
+ #!/usr/bin/env node
2
+ import assert from "node:assert/strict";
3
+ import { mkdtemp, mkdir, readFile, writeFile } from "node:fs/promises";
4
+ import os from "node:os";
5
+ import path from "node:path";
6
+ import {
7
+ preparePrototype,
8
+ validatePrototypeEvidence,
9
+ validatePrototypeProject
10
+ } from "../scripts/prototype-contract.mjs";
11
+
12
+ const tempRoot = await mkdtemp(path.join(os.tmpdir(), "yss-prototype-contract-"));
13
+ const projectRoot = path.join(tempRoot, "project");
14
+ const feature = "order-review";
15
+ const prototypeRoot = path.join(projectRoot, "docs/.scratch", feature, "design/prototypes");
16
+ await mkdir(path.join(prototypeRoot, "src"), { recursive: true });
17
+ await mkdir(path.join(projectRoot, "docs/design/tokens"), { recursive: true });
18
+ await writeFile(path.join(prototypeRoot, "package.json"), JSON.stringify({
19
+ name: "order-review-prototype",
20
+ private: true,
21
+ type: "module",
22
+ scripts: { build: "vite build" },
23
+ dependencies: { react: "19.2.0", "react-dom": "19.2.0", vite: "6.4.2" }
24
+ }, null, 2));
25
+ await writeFile(path.join(projectRoot, "docs/design/tokens/theme.json"), JSON.stringify({
26
+ algorithm: "default",
27
+ token: {
28
+ colorPrimary: "#3371ff",
29
+ borderRadius: 6,
30
+ controlHeight: 32,
31
+ layoutHeaderHeight: 64
32
+ }
33
+ }, null, 2));
34
+
35
+ const before = await validatePrototypeProject({ root: prototypeRoot, targetAntdVersion: "6.6.2" });
36
+ assert(before.errors.some((message) => message.includes("antd")), "RED: starter without antd must fail");
37
+ assert(before.errors.some((message) => message.includes("pnpm-lock.yaml")), "RED: missing pnpm lockfile must fail");
38
+
39
+ await preparePrototype({ projectRoot, root: prototypeRoot, feature, targetAntdVersion: "6.6.2", pnpmVersion: "10.15.0" });
40
+ const pkg = JSON.parse(await readFile(path.join(prototypeRoot, "package.json"), "utf8"));
41
+ assert.equal(pkg.dependencies.antd, "6.6.2");
42
+ assert.equal(pkg.packageManager, "pnpm@10.15.0");
43
+ assert.match(await readFile(path.join(prototypeRoot, "src/yss-theme.js"), "utf8"), /compactAlgorithm/);
44
+
45
+ await writeFile(path.join(prototypeRoot, "pnpm-lock.yaml"), "lockfileVersion: '9.0'\n");
46
+ await writeFile(path.join(prototypeRoot, "src/App.jsx"), [
47
+ 'import { ConfigProvider, Button } from "antd";',
48
+ 'import { yssTheme } from "./yss-theme.js";',
49
+ 'export function App() { return <ConfigProvider theme={yssTheme}><Button type="primary">提交</Button></ConfigProvider>; }'
50
+ ].join("\n"));
51
+ const after = await validatePrototypeProject({ root: prototypeRoot, targetAntdVersion: "6.6.2" });
52
+ assert.deepEqual(after.errors, []);
53
+
54
+ const wrongTarget = await validatePrototypeProject({ root: prototypeRoot, targetAntdVersion: "6.6.1" });
55
+ assert(wrongTarget.errors.some((message) => message.includes("精确锁定 antd 6.6.1")), "target 与实际 antd 版本不一致必须失败");
56
+
57
+ const npmPackage = structuredClone(pkg);
58
+ npmPackage.packageManager = "npm@11.0.0";
59
+ await writeFile(path.join(prototypeRoot, "package.json"), JSON.stringify(npmPackage, null, 2));
60
+ const npmProject = await validatePrototypeProject({ root: prototypeRoot, targetAntdVersion: "6.6.2" });
61
+ assert(npmProject.errors.some((message) => message.includes("packageManager")), "原型包管理器漂移到 npm 必须失败");
62
+ await writeFile(path.join(prototypeRoot, "package.json"), JSON.stringify(pkg, null, 2));
63
+
64
+ await assert.rejects(
65
+ preparePrototype({
66
+ projectRoot,
67
+ root: path.join(projectRoot, "prototypes", feature),
68
+ feature,
69
+ targetAntdVersion: "6.6.2",
70
+ pnpmVersion: "10.15.0"
71
+ }),
72
+ /docs\/.scratch/,
73
+ "非标准原型目录必须被拒绝"
74
+ );
75
+
76
+ const validEvidence = {
77
+ schema_version: 2,
78
+ feature,
79
+ prototype_ref: `docs/.scratch/${feature}/design/prototypes/index.html`,
80
+ prototype_stack: {
81
+ framework: "react",
82
+ package_manager: "pnpm",
83
+ package_manifest_ref: `docs/.scratch/${feature}/design/prototypes/package.json`,
84
+ lockfile_ref: `docs/.scratch/${feature}/design/prototypes/pnpm-lock.yaml`,
85
+ source_entry_ref: `docs/.scratch/${feature}/design/prototypes/src/App.jsx`,
86
+ build_entry_ref: `docs/.scratch/${feature}/design/prototypes/dist/index.html`,
87
+ build_command: "pnpm build",
88
+ build_result: "passed",
89
+ actual_antd_version: "6.6.2"
90
+ },
91
+ design_baseline: {
92
+ design_standard: "ant-design-v6",
93
+ project_design_ref: "docs/design/design.md",
94
+ project_token_refs: ["docs/design/tokens/theme.json"],
95
+ theme_adapter_ref: `docs/.scratch/${feature}/design/prototypes/src/yss-theme.js`,
96
+ project_override_reviewed: true
97
+ },
98
+ visual_semantic_mapping: {
99
+ runtime_component_library: "ant-design-vue-4.x",
100
+ runtime_version_source: "implementation-lockfile",
101
+ components: [{
102
+ semantic_role: "primary-action",
103
+ antd_v6_component: "Button",
104
+ project_token_refs: ["colorPrimary"],
105
+ yss_or_antdv_target: "YButton",
106
+ state_mapping: ["default", "hover", "active", "disabled", "loading"],
107
+ react_only_api_not_copied: true,
108
+ verification_ref: "verification/button-states.png"
109
+ }]
110
+ },
111
+ antd: { target_antd_version: "6.6.2", queries: { design_md: "verification/antd-design.json", components: [] } },
112
+ browser_verification: { rendered_nonblank: true, viewports: [], main_flow_result: "passed", failure_permission_or_conflict_result: "passed", console_error_ref: "verification/console.txt" },
113
+ design_qa: { report_ref: `docs/.scratch/${feature}/verification/design-qa.md`, result: "passed" },
114
+ accessibility_verification: {
115
+ contrast_results_ref: "verification/contrast.json",
116
+ keyboard_navigation_result: "passed",
117
+ focus_visible_and_order_result: "passed",
118
+ semantic_label_dialog_result: "passed",
119
+ zoom_200_result: "passed",
120
+ reduced_motion_result: "passed",
121
+ target_size_result: "passed",
122
+ automated_scan: { tool: "axe", version: "4", result: "passed", ref: "verification/axe.json" }
123
+ },
124
+ review: { prototype_review_ref: "design/review.md", result: "approved" },
125
+ user_confirmation: { confirmation_ref: "design/confirmation.md", result: "approved" },
126
+ blockers: []
127
+ };
128
+ assert.deepEqual(validatePrototypeEvidence(validEvidence).errors, []);
129
+
130
+ const missingMapping = structuredClone(validEvidence);
131
+ delete missingMapping.visual_semantic_mapping;
132
+ assert(validatePrototypeEvidence(missingMapping).errors.some((message) => message.includes("visual_semantic_mapping")));
133
+
134
+ const copiedReactApi = structuredClone(validEvidence);
135
+ copiedReactApi.visual_semantic_mapping.components[0].react_only_api_not_copied = false;
136
+ assert(validatePrototypeEvidence(copiedReactApi).errors.some((message) => message.includes("React-only")));
137
+
138
+ const inaccessible = structuredClone(validEvidence);
139
+ inaccessible.accessibility_verification.contrast_results_ref = "";
140
+ assert(validatePrototypeEvidence(inaccessible).errors.some((message) => message.includes("contrast_results_ref")));
141
+
142
+ const wrongQaRoot = structuredClone(validEvidence);
143
+ wrongQaRoot.design_qa.report_ref = "docs/design/design-qa.md";
144
+ assert(validatePrototypeEvidence(wrongQaRoot).errors.some((message) => message.includes("design_qa.report_ref")));
145
+
146
+ const versionMismatch = structuredClone(validEvidence);
147
+ versionMismatch.antd.target_antd_version = "6.6.1";
148
+ assert(validatePrototypeEvidence(versionMismatch).errors.some((message) => message.includes("target_antd_version")));
149
+
150
+ const unresolvedBlocker = structuredClone(validEvidence);
151
+ unresolvedBlocker.blockers = ["缺少权限失败态"];
152
+ assert(validatePrototypeEvidence(unresolvedBlocker).errors.some((message) => message.includes("blockers")));
153
+
154
+ process.stdout.write("YSS prototype contract scenarios passed\n");
@@ -15,7 +15,7 @@ Use this reference when multiple YSS skills seem applicable.
15
15
  - `yss-use-table-height`: Only table available-height calculation and required container/pagination/toolbar wiring.
16
16
  - `yss-use-tree-height`: Only tree available-height calculation, search offset, and virtual scrolling wiring.
17
17
 
18
- Default for a new page: first verify the approved product design, state matrix, Ant Design v6 high-fidelity HTML prototype, AntD CLI evidence, and user confirmation; then start with `yss-page-module-development` and add the narrow skills that match the page controls.
18
+ Default for a new page: first verify the approved product design, state matrix, Ant Design v6 theme/visual-standard high-fidelity HTML prototype, schema v2 semantic mapping/browser/accessibility evidence, and user confirmation; then use the implementation lockfile to map into YSS UI + Ant Design Vue 4.x, start with `yss-page-module-development`, and add the narrow skills that match the page controls.
19
19
 
20
20
  中文说明:新建页面默认从页面模块技能开始,只有遇到具体组件、Hook、API、Formily 细节时再加载专项技能。
21
21
 
@@ -68,7 +68,7 @@ slice_contract_required:
68
68
  root: [schema_version, contract_id, contract_version, slice_id, status, lifecycle_refs, readiness, common, frontend, backend, contract, cross_repo, work_units]
69
69
  lifecycle_refs: [spec, ticket, requirement_freeze, low_fidelity_review, prototype_review, high_fidelity_html, prototype_verification, antd_cli_evidence, browser_verification_evidence, prototype_confirmation, openapi_freeze_or_no_impact, architecture_review, data_architecture, tactical_design, engineering_baseline, build_architecture_checklist, implementation_repository, frontend_repository, backend_repository, maven_wrapper]
70
70
  readiness: [blockers, stale_inputs, not_applicable]
71
- common: [impacted_areas, implementation_path_policy, project_roots, required_skills, optional_skills, unavailable_skills, allowed_write_paths, forbidden_patterns, expected_evidence_files, verification_commands, human_review_points, full_reroute_triggers]
71
+ common: [impacted_areas, implementation_path_policy, project_roots, required_skills, optional_skills, unavailable_skills, allowed_write_paths, forbidden_patterns, expected_evidence_files, verification_commands, human_review_points, full_reroute_triggers, quality_baseline_ref, context_plan, doubt_driven_review]
72
72
  frontend: [status, required_skills, approved_prototype_ref, state_matrix_ref, allowed_write_paths, component_test_seams, e2e_paths]
73
73
  backend: [status, affected_layers, component_impacts, required_skills, application_boundary, transaction_boundary, persistence_strategy, allowed_write_paths, forbidden_patterns, expected_evidence_files, seam_deferred, verification_commands, tactical_ddd]
74
74
  contract: [api_impact, freeze_ref, no_api_impact_ref, generated_clients, contract_tests, regeneration_commands]
@@ -100,7 +100,12 @@ work_unit_required: [id, behavior, primary_skill, supporting_skills, tdd_mode, a
100
100
  work_unit_nonempty_arrays: [allowed_write_paths, expected_evidence, verification_commands]
101
101
  slice_contract_nonempty: [contract_id, contract_version, slice_id, status]
102
102
  slice_contract_array_fields:
103
- common: [impacted_areas, implementation_path_policy, project_roots, required_skills, allowed_write_paths, forbidden_patterns, expected_evidence_files, verification_commands, full_reroute_triggers]
103
+ common: [impacted_areas, implementation_path_policy, project_roots, required_skills, allowed_write_paths, forbidden_patterns, expected_evidence_files, verification_commands, full_reroute_triggers, quality_baseline_ref, context_plan, doubt_driven_review]
104
+
105
+ context_plan:
106
+ required: [required_context_refs, on_demand_context_refs, context_stop_rule, missing_context_action]
107
+ context_stop_rule: minimal-sufficient-evidence
108
+ missing_context_action: [blocked, reroute]
104
109
 
105
110
  scaffold_contract_schema:
106
111
  schema_version: 1
@@ -241,6 +246,7 @@ full_reroute_triggers:
241
246
  - test-seam-changed
242
247
  - verification-command-changed
243
248
  - delivery-order-changed
249
+ - doubt-review-triggered
244
250
 
245
251
  reroute_destinations:
246
252
  scaffold-baseline-drift: stage7-scaffold-revalidation
@@ -258,9 +264,30 @@ reroute_destinations:
258
264
  test-seam-changed: spec-ticket-test-seam-review
259
265
  verification-command-changed: stage7-contract-recompile
260
266
  delivery-order-changed: cross-repo-release-review
267
+ doubt-review-triggered: high-risk-decision-review
268
+
269
+ doubt_driven_review:
270
+ applies_when:
271
+ - api-schema-impact
272
+ - database-schema-impact
273
+ - cross-repo-contract
274
+ - release-or-rollback
275
+ - authentication-authorization-tenant-or-sensitive-data-behavior
276
+ - lifecycle-or-generation-semantics
277
+ required: [claim, counterclaim, evidence_refs, residual_risks, reviewer_ref]
278
+ status_values: [not-applicable, required, completed, blocked]
279
+ blocking_when: [missing-counterclaim, insufficient-evidence, unresolved-residual-risk]
280
+ evidence_owner: decision-or-review-record
281
+ no_new_lifecycle_stage: true
282
+
283
+ quality_baseline:
284
+ source: lifecycle_refs.engineering_baseline
285
+ required_for: [project-instance]
286
+ reused_by: [slice-contract, yss-skill-execution-result, code-review, release]
287
+ redefinition: forbidden
261
288
 
262
289
  execution_result_allowed_statuses: [implemented, seam-deferred, drift, violation, not-applicable]
263
- execution_blockers: [path-outside-contract, missing-evidence, verification-not-executed, verification-command-mismatch, seam-deferred-without-owner, constraint-failed, unapproved-deviation, drift, violation, new-impacts]
290
+ execution_blockers: [path-outside-contract, missing-evidence, verification-not-executed, verification-command-mismatch, seam-deferred-without-owner, constraint-failed, doubt-review-missing, unapproved-deviation, drift, violation, new-impacts]
264
291
 
265
292
  contract_versioning:
266
293
  full_reroute_current_status: stale
@@ -54,6 +54,20 @@ slice_contract:
54
54
  verification_commands: []
55
55
  human_review_points: []
56
56
  full_reroute_triggers: []
57
+ quality_baseline_ref:
58
+ context_plan:
59
+ required_context_refs: []
60
+ on_demand_context_refs: []
61
+ context_stop_rule: minimal-sufficient-evidence
62
+ missing_context_action: blocked # or reroute
63
+ doubt_driven_review:
64
+ status: not-applicable # or required / completed / blocked
65
+ trigger_impacts: []
66
+ claim:
67
+ counterclaim:
68
+ evidence_refs: []
69
+ residual_risks: []
70
+ reviewer_ref:
57
71
  frontend:
58
72
  status: not-applicable
59
73
  required_skills: []
@@ -13,6 +13,8 @@ execution_result:
13
13
  contract_ref:
14
14
  contract_id:
15
15
  contract_version:
16
+ quality_baseline_ref:
17
+ context_plan_ref:
16
18
  changed_files:
17
19
  - path:
18
20
  contract_area: common | frontend | backend | contract | cross_repo
@@ -28,6 +30,9 @@ execution_result:
28
30
  - constraint:
29
31
  status: passed | failed | not-applicable
30
32
  evidence_ref:
33
+ doubt_driven_review:
34
+ status: not-applicable | completed | blocked
35
+ record_ref:
31
36
  seam_deferred:
32
37
  - risk:
33
38
  owner:
@@ -32,7 +32,7 @@ pnpm why vue @yss-ui/components @yss-ui/hooks ant-design-vue vxe-table
32
32
 
33
33
  ## Ant Design v6 边界
34
34
 
35
- Ant Design v6 可以作为产品原型的视觉和 token 语义参考;Vue 生产实现使用 Ant Design Vue 4.x。禁止复制 React hooks、JSX、组件 props、theme algorithm API 或事件模型到 Vue 代码。
35
+ Ant Design v6 是产品原型默认的主题样式、视觉和 token 语义标准;Vue 生产实现使用 Ant Design Vue 4.x。版本号不同本身不是冲突。生产映射必须消费原型证据中的 `visual_semantic_mapping`,并用实现仓 lockfile/类型验证 YSS 或 AntDV 目标;禁止复制 React hooks、JSX、组件 props、theme algorithm API 或事件模型到 Vue 代码。
36
36
 
37
37
  ## 兼容性证据
38
38
 
@@ -24,6 +24,7 @@
24
24
  | 技能清单、来源、版本、哈希和投影目标 | `skills-lock.json` |
25
25
  | 技能分层、别名、默认可发现性和运行时入口 | `docs/agents/yss-skill-registry.yaml`(当前 `status: active`;Router / 生命周期必须消费) |
26
26
  | 数字人角色、阶段协作组、运行时绑定与生命周期会签 | `docs/agents/digital-human-roles.yaml`;`docs/agents/digital-human-roles.md` 为操作说明 |
27
+ | 视觉令牌与组件视觉变体规范 | 根目录 `DESIGN.md`;`docs/design/design.md` 为中文治理与生命周期适配,`docs/design/tokens/*` 为派生快照 |
27
28
 
28
29
  README、用户指南、根目录 `CLAUDE.md` 和其他说明文档只引用或解释上述事实,不重复定义同一规则。`CLAUDE.md` 是 Claude Code 入口指针,不是第二套 Agent 规则。
29
30
 
@@ -39,7 +40,7 @@ README、用户指南、根目录 `CLAUDE.md` 和其他说明文档只引用或
39
40
 
40
41
  按“影响面 → 单一事实来源 → 投影 / 派生资产 → 分级证据”维护。强度分级、最低证据和 checkpoint 合同见 `docs/process/harness-process-tailoring.md`。
41
42
 
42
- - 创建、修改或退役 skill 时使用 `maintaining-skills`,并先按 `docs/process/harness-process-tailoring.md` 判定 L1 / L2 / L3;只有 L3 必须保留完整基线失败、压力场景、修订后验证和正式独立审查证据。
43
+ - 创建、修改或退役 skill 时使用 `maintaining-skills`,并先按 `docs/process/harness-process-tailoring.md` 判定 L1 / L2 / L3;L3 日常记录维护者自检与 fresh verification,正式发布前执行完整模板门禁。
43
44
  - `.agents/skills` 是跨 Agent 共享技能的权威内容;`.claude/skills`、`.codex/skills`、`.cursor/skills`、`.hermes/skills`、`.pi/skills`、`.qoder/skills`、`.trae/skills` 中的共享技能是生成投影,禁止分别手工修改。Cursor 的契约运行时入口是 `.cursor/skills`;不得把 canonical `.agents/skills` 与某个平台投影当作同权双入口。
44
45
  - 模板维护默认以 `scripts/verify-template-fast` 完成 `implementation-ready`;显式晋级审查时用 `scripts/verify-template-candidate`,首次冻结前和最终发布前仍必须执行完整 `scripts/verify-template`。后者是不可裁剪的模板发布阻断门禁。模板与外部 `create-yss-spec` 的跨仓库契约未完成集成验证时,不得声称可发布。
45
46
 
@@ -54,7 +55,7 @@ README、用户指南、根目录 `CLAUDE.md` 和其他说明文档只引用或
54
55
  | 入口分诊 `stage.entry-triage` | `work-unit.entry-triage` | `yss-product-lifecycle` | 仓库身份、影响面、最近可信阶段;`gate.repository-identity-valid` |
55
56
  | Discovery `stage.discovery` | `work-unit.discovery-opportunity`、`work-unit.discovery-requirements`、`work-unit.domain-strategy-design`、`work-unit.stage-decision` | `yss-product-lifecycle`;按事实 / 领域影响使用 `competitive-intelligence`、`research`、`grilling`、`domain-modeling`、`yss-stage-decision` | Discovery、用户/MVP/非目标/成功标准、测试 seam;必要时 DDD 战略设计与阶段决策包;`gate.domain-strategy-approved`、`gate.stage-decision-package-approved` |
56
57
  | Spec / 功能架构 `stage.spec-architecture` | `work-unit.spec-synthesis` | `yss-product-lifecycle`;`to-spec` 仅为显式兼容入口 | Spec、产品总体设计、功能架构;必要时 Spec Delta;`gate.spec-baseline-approved` |
57
- | 产品设计 `stage.product-design` | `work-unit.prototype-design` | `yss-design-system` → `prototype-review` → `yss-prototype-stage` → `yss-antd-design` → Codex `product-design:index`;前端落地改用 `yss-ui` | 交互说明、低 / 高保真原型、状态矩阵;`gate.prototype-reviewed`、`gate.prototype-verified`、`gate.user-confirmation` |
58
+ | 产品设计 `stage.product-design` | `work-unit.prototype-design` | `yss-prototype-stage` 为主合同,内部依次消费 `yss-design-system`、低保真、独立 `prototype-review`、`yss-antd-design` pre-build facts、Codex `product-design:index` focused workflow、post-build/浏览器/无障碍验证;前端落地改用 `yss-ui` | 交互说明、低 / 高保真原型、状态矩阵;`gate.prototype-reviewed`、`gate.prototype-verified`、`gate.user-confirmation` |
58
59
  | 系统 / 数据架构与工程契约 `stage.system-data-engineering` | `work-unit.technical-analysis` | `yss-router`;按影响使用 `yss-openapi-governance`、`yss-openapi-draft-review`、`codebase-design`、`implementation-repo-onboarding`、`yss-tactical-design` | OpenAPI Draft / Freeze、数据架构、工程基线、架构审查;无 API 影响记录;必要时 Tactical DDD Check;`gate.openapi-draft-reviewed`、`gate.design-reviewed`、`gate.openapi-frozen`、`gate.engineering-baseline-accepted`、`gate.architecture-reviewed` |
59
60
  | Ticket 正式化 `stage.ticket-formalization` | `work-unit.ticket-decomposition` | `yss-product-lifecycle` + `yss-router`;`to-tickets` 仅为显式兼容入口 | 功能父 Ticket、垂直切片、Slice Implementation Contract;切片初始 `ready-for-human`;`gate.slice-contract-approved`、`gate.slice-ready-for-agent` |
60
61
  | 垂直切片实现 `stage.vertical-slice-implementation` | `work-unit.slice-implementation` | `yss-router` + `tdd`;UI 影响追加 `yss-ui`、`yss-page-module-development` 及条件专项 skill;`implement` 仅为显式兼容入口 | 前后端代码、TDD、YSS Skill Execution Result;仅允许 `ready-for-agent` 且合同当前 |
@@ -96,7 +97,7 @@ README、用户指南、根目录 `CLAUDE.md` 和其他说明文档只引用或
96
97
  |---|---|
97
98
  | 技术事实、标准、第三方 API 或框架行为影响决策 | `research` 或等价的一手资料记录 |
98
99
  | 竞品、市场或用户口碑事实 | `competitive-intelligence` |
99
- | UI 设计、原型、组件或主题 | `yss-design-system` → `prototype-review` → `yss-prototype-stage`;原型事实用 `yss-antd-design`,Codex 再路由 `product-design:index`,其他 Agent 交付等价合同资产。前端代码落地改用 `yss-ui`,不要继续调用 `yss-antd-design` |
100
+ | UI 设计、原型、组件或主题 | `yss-prototype-stage` 持有阶段合同:`yss-design-system` → 低保真 → 独立 `prototype-review` → `yss-antd-design` pre-build facts → Codex `product-design:index` focused workflow → post-build/浏览器/无障碍验证;其他 Agent 交付等价合同资产。前端代码落地改用 `yss-ui`,不要继续调用 `yss-antd-design` |
100
101
  | Bug、测试失败或性能回退 | `diagnosing-bugs` 建立可复现反馈,再用 `tdd` |
101
102
  | merge / rebase 冲突 | `resolving-merge-conflicts` |
102
103
  | 架构治理、难测模块或深模块设计 | `codebase-design`;`improve-codebase-architecture` 仅作为用户显式兼容入口 |
@@ -114,7 +115,7 @@ README、用户指南、根目录 `CLAUDE.md` 和其他说明文档只引用或
114
115
 
115
116
  ## 10. 独立审查、验证和追踪
116
117
 
117
- - 实现者不能承担命中的独立审查(含数字人)。模板维护按 L1 / L2 / L3 分别使用 self-check / 人工 checkpoint、聚焦独立审查、正式独立审查;模板发布、代码切片和高风险变更仍必须由其他 Agent 或独立审查者完成。产品切片与模板维护共用同一 finding 闭环:`violation` 由实现者在原合同路径修复后重新捕获并全轴复审;`drift` / `new_impacts` 使合同 `stale` 并回 Router。审查者不得写实现。命中后的 mandatory 不得豁免;未命中才 `not-applicable`。
118
+ - 实现者不能承担命中的独立审查(含数字人)。模板维护的 L3 日常路径使用维护者自检;L2 仍按需使用聚焦独立审查,正式发布仍执行完整模板门禁。模板发布、代码切片和高风险变更仍必须满足各自独立审查要求。产品切片与模板维护共用同一 finding 闭环:`violation` 由实现者在原合同路径修复后重新捕获并全轴复审;`drift` / `new_impacts` 使合同 `stale` 并回 Router。审查者不得写实现。命中后的 mandatory 不得豁免;未命中才 `not-applicable`。
118
119
  - 任何“完成 / 可合并 / 可发布”结论必须基于 fresh verification,不接受“之前跑过”或实现者自述。
119
120
  - 会签门禁按 `docs/agents/digital-human-roles.yaml` 的 `gate_policy` 关闭,会签文件经 `scripts/verify-approval-record` 核验;`gate.release-ready`、对外商务承诺和运行时外部副作用仍须生物人。
120
121
  - 在会签暂停、handoff、进入实现、合并或发布边界集中同步范围、验证证据、风险、会签点、Ticket 状态和下一步;阻塞、责任人变化或资产单独批准时立即同步。
@@ -23,8 +23,8 @@
23
23
  | Ticket 状态 | Tracker 五态:`needs-triage`、`needs-info`、`ready-for-agent`、`ready-for-human`、`wontfix`。 | — | 不要称为数字人角色或「标准角色」。 |
24
24
  | 阶段协作组 | 某阶段需要共同可见会签的逻辑成员集合。 | — | 不是某个产品的群聊;平台人数上限只写在对应 `runtimes`。 |
25
25
  | 需求经理 | 主责 Discovery 语言、用户/MVP/非目标、Spec 正文与测试 seam 的数字人角色。 | — | 不拥有原型视觉定稿,不 Freeze API,不写实现。 |
26
- | 产品经理 | 主责优先级、产品设计影响、原型确认建议和范围裁剪的数字人角色。 | — | 不写生产代码,不单独 Freeze API。 |
27
- | 商务 | 主责机会调研商业约束、交付承诺和发布窗口商务非目标的数字人角色。 | — | 不参与 Spec 定稿、契约、代码或 Ticket 状态推进。 |
26
+ | 产品经理 | 主责优先级、产品设计影响、原型确认建议、范围裁剪以及商业约束、交付承诺、发布窗口和商业非目标的数字人角色。 | — | 不写生产代码,不单独 Freeze API;对外商务合同和正式承诺须由生物人批准。 |
27
+ | 商业约束 | Discovery 与发布阶段需要确认的商业边界、交付承诺、发布窗口和商业非目标。 | — | 由产品经理负责数字人侧的整理与协调;不等同于独立的“商务”数字人角色。 |
28
28
  | Agent 入口规则 | Agent 启动任务时必须先遵守的全局路由、硬门禁和禁止事项。 | — | 不作为 YSS 后端、前端或其他专项编码规范的完整手册。 |
29
29
  | 标准文档语言 | 面向业务、产品、架构、实施、审查、发布和复盘的持久化文档所使用的默认语言。 | — | 统一使用简体中文;英文专有名词、代码标识、API 路径、schema、文件名和协议 metadata 保持原样。 |
30
30
  | Matt Engineering Skills | 来自 `mattpocock/skills` 的轻量工程流程技能集合。 | — | 用于澄清、Spec、Ticket、实现、TDD、诊断、审查和架构治理,不替代 YSS 专项规范。 |