create-yss-spec 3.1.3 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/package.json +1 -1
- package/template/.agents/skills/.strategic-design-skills-manifest.json +1 -1
- package/template/.agents/skills/yss-domain/SKILL.md +3 -3
- package/template/.agents/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
- package/template/.agents/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
- package/template/.agents/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +10 -2
- package/template/.agents/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
- package/template/.agents/skills/yss-mvc-design/SKILL.md +16 -0
- package/template/.agents/skills/yss-mvc-design/agents/openai.yaml +4 -0
- package/template/.agents/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
- package/template/.agents/skills/yss-product-lifecycle/SKILL.md +2 -2
- package/template/.agents/skills/yss-product-lifecycle/references/artifact-dependencies.md +2 -2
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration-contract.yaml +14 -9
- package/template/.agents/skills/yss-product-lifecycle/references/orchestration.md +1 -1
- package/template/.agents/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.agents/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.agents/skills/yss-tactical-design/references/output-template.md +2 -0
- package/template/.agents/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
- package/template/.agents/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
- package/template/.agents/skills/yss-technical-design/SKILL.md +31 -0
- package/template/.agents/skills/yss-technical-design/agents/openai.yaml +4 -0
- package/template/.agents/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
- package/template/.agents/skills/yss-technical-design/references/technical-design-contract.md +31 -0
- package/template/.agents/skills/yss-technical-design/references/technical-design.schema.json +759 -0
- package/template/.agents/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
- package/template/.agents/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
- package/template/.agents/skills/yss-technical-design/tests/fixtures.mjs +32 -0
- package/template/.agents/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
- package/template/.claude/skills/yss-domain/SKILL.md +3 -3
- package/template/.claude/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
- package/template/.claude/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
- package/template/.claude/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +10 -2
- package/template/.claude/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
- package/template/.claude/skills/yss-mvc-design/SKILL.md +16 -0
- package/template/.claude/skills/yss-mvc-design/agents/openai.yaml +4 -0
- package/template/.claude/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
- package/template/.claude/skills/yss-product-lifecycle/SKILL.md +2 -2
- package/template/.claude/skills/yss-product-lifecycle/references/artifact-dependencies.md +2 -2
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration-contract.yaml +14 -9
- package/template/.claude/skills/yss-product-lifecycle/references/orchestration.md +1 -1
- package/template/.claude/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.claude/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.claude/skills/yss-tactical-design/references/output-template.md +2 -0
- package/template/.claude/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
- package/template/.claude/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
- package/template/.claude/skills/yss-technical-design/SKILL.md +31 -0
- package/template/.claude/skills/yss-technical-design/agents/openai.yaml +4 -0
- package/template/.claude/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
- package/template/.claude/skills/yss-technical-design/references/technical-design-contract.md +31 -0
- package/template/.claude/skills/yss-technical-design/references/technical-design.schema.json +759 -0
- package/template/.claude/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
- package/template/.claude/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
- package/template/.claude/skills/yss-technical-design/tests/fixtures.mjs +32 -0
- package/template/.claude/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
- package/template/.codex/skills/yss-domain/SKILL.md +3 -3
- package/template/.codex/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
- package/template/.codex/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
- package/template/.codex/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +10 -2
- package/template/.codex/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
- package/template/.codex/skills/yss-mvc-design/SKILL.md +16 -0
- package/template/.codex/skills/yss-mvc-design/agents/openai.yaml +4 -0
- package/template/.codex/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
- package/template/.codex/skills/yss-product-lifecycle/SKILL.md +2 -2
- package/template/.codex/skills/yss-product-lifecycle/references/artifact-dependencies.md +2 -2
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration-contract.yaml +14 -9
- package/template/.codex/skills/yss-product-lifecycle/references/orchestration.md +1 -1
- package/template/.codex/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.codex/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.codex/skills/yss-tactical-design/references/output-template.md +2 -0
- package/template/.codex/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
- package/template/.codex/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
- package/template/.codex/skills/yss-technical-design/SKILL.md +31 -0
- package/template/.codex/skills/yss-technical-design/agents/openai.yaml +4 -0
- package/template/.codex/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
- package/template/.codex/skills/yss-technical-design/references/technical-design-contract.md +31 -0
- package/template/.codex/skills/yss-technical-design/references/technical-design.schema.json +759 -0
- package/template/.codex/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
- package/template/.codex/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
- package/template/.codex/skills/yss-technical-design/tests/fixtures.mjs +32 -0
- package/template/.codex/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
- package/template/.cursor/skills/yss-domain/SKILL.md +3 -3
- package/template/.cursor/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +10 -2
- package/template/.cursor/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
- package/template/.cursor/skills/yss-mvc-design/SKILL.md +16 -0
- package/template/.cursor/skills/yss-mvc-design/agents/openai.yaml +4 -0
- package/template/.cursor/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
- package/template/.cursor/skills/yss-product-lifecycle/SKILL.md +2 -2
- package/template/.cursor/skills/yss-product-lifecycle/references/artifact-dependencies.md +2 -2
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration-contract.yaml +14 -9
- package/template/.cursor/skills/yss-product-lifecycle/references/orchestration.md +1 -1
- package/template/.cursor/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.cursor/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.cursor/skills/yss-tactical-design/references/output-template.md +2 -0
- package/template/.cursor/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
- package/template/.cursor/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
- package/template/.cursor/skills/yss-technical-design/SKILL.md +31 -0
- package/template/.cursor/skills/yss-technical-design/agents/openai.yaml +4 -0
- package/template/.cursor/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
- package/template/.cursor/skills/yss-technical-design/references/technical-design-contract.md +31 -0
- package/template/.cursor/skills/yss-technical-design/references/technical-design.schema.json +759 -0
- package/template/.cursor/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
- package/template/.cursor/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
- package/template/.cursor/skills/yss-technical-design/tests/fixtures.mjs +32 -0
- package/template/.cursor/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
- package/template/.pi/skills/yss-domain/SKILL.md +3 -3
- package/template/.pi/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
- package/template/.pi/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
- package/template/.pi/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +10 -2
- package/template/.pi/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
- package/template/.pi/skills/yss-mvc-design/SKILL.md +16 -0
- package/template/.pi/skills/yss-mvc-design/agents/openai.yaml +4 -0
- package/template/.pi/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
- package/template/.pi/skills/yss-product-lifecycle/SKILL.md +2 -2
- package/template/.pi/skills/yss-product-lifecycle/references/artifact-dependencies.md +2 -2
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration-contract.yaml +14 -9
- package/template/.pi/skills/yss-product-lifecycle/references/orchestration.md +1 -1
- package/template/.pi/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.pi/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.pi/skills/yss-tactical-design/references/output-template.md +2 -0
- package/template/.pi/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
- package/template/.pi/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
- package/template/.pi/skills/yss-technical-design/SKILL.md +31 -0
- package/template/.pi/skills/yss-technical-design/agents/openai.yaml +4 -0
- package/template/.pi/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
- package/template/.pi/skills/yss-technical-design/references/technical-design-contract.md +31 -0
- package/template/.pi/skills/yss-technical-design/references/technical-design.schema.json +759 -0
- package/template/.pi/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
- package/template/.pi/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
- package/template/.pi/skills/yss-technical-design/tests/fixtures.mjs +32 -0
- package/template/.pi/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
- package/template/.qoder/skills/yss-domain/SKILL.md +3 -3
- package/template/.qoder/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
- package/template/.qoder/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
- package/template/.qoder/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +10 -2
- package/template/.qoder/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
- package/template/.qoder/skills/yss-mvc-design/SKILL.md +16 -0
- package/template/.qoder/skills/yss-mvc-design/agents/openai.yaml +4 -0
- package/template/.qoder/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
- package/template/.qoder/skills/yss-product-lifecycle/SKILL.md +2 -2
- package/template/.qoder/skills/yss-product-lifecycle/references/artifact-dependencies.md +2 -2
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration-contract.yaml +14 -9
- package/template/.qoder/skills/yss-product-lifecycle/references/orchestration.md +1 -1
- package/template/.qoder/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.qoder/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.qoder/skills/yss-tactical-design/references/output-template.md +2 -0
- package/template/.qoder/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
- package/template/.qoder/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
- package/template/.qoder/skills/yss-technical-design/SKILL.md +31 -0
- package/template/.qoder/skills/yss-technical-design/agents/openai.yaml +4 -0
- package/template/.qoder/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
- package/template/.qoder/skills/yss-technical-design/references/technical-design-contract.md +31 -0
- package/template/.qoder/skills/yss-technical-design/references/technical-design.schema.json +759 -0
- package/template/.qoder/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
- package/template/.qoder/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
- package/template/.qoder/skills/yss-technical-design/tests/fixtures.mjs +32 -0
- package/template/.qoder/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
- package/template/.trae/skills/yss-domain/SKILL.md +3 -3
- package/template/.trae/skills/yss-implementation-contract-compiler/SKILL.md +2 -2
- package/template/.trae/skills/yss-implementation-contract-compiler/references/boundaries.md +5 -0
- package/template/.trae/skills/yss-implementation-contract-compiler/references/compiler-contract.yaml +10 -2
- package/template/.trae/skills/yss-implementation-contract-compiler/references/slice-implementation-contract.md +8 -1
- package/template/.trae/skills/yss-mvc-design/SKILL.md +16 -0
- package/template/.trae/skills/yss-mvc-design/agents/openai.yaml +4 -0
- package/template/.trae/skills/yss-mvc-design/references/mvc-design.schema.json +315 -0
- package/template/.trae/skills/yss-product-lifecycle/SKILL.md +2 -2
- package/template/.trae/skills/yss-product-lifecycle/references/artifact-dependencies.md +2 -2
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration-contract.yaml +14 -9
- package/template/.trae/skills/yss-product-lifecycle/references/orchestration.md +1 -1
- package/template/.trae/skills/yss-product-lifecycle/references/state-model.md +1 -1
- package/template/.trae/skills/yss-tactical-design/SKILL.md +2 -2
- package/template/.trae/skills/yss-tactical-design/references/output-template.md +2 -0
- package/template/.trae/skills/yss-tactical-design/references/tactical-design-contract.md +3 -1
- package/template/.trae/skills/yss-tactical-design/scripts/validate-tactical-design.mjs +3 -2
- package/template/.trae/skills/yss-technical-design/SKILL.md +31 -0
- package/template/.trae/skills/yss-technical-design/agents/openai.yaml +4 -0
- package/template/.trae/skills/yss-technical-design/references/technical-design-common.schema.json +290 -0
- package/template/.trae/skills/yss-technical-design/references/technical-design-contract.md +31 -0
- package/template/.trae/skills/yss-technical-design/references/technical-design.schema.json +759 -0
- package/template/.trae/skills/yss-technical-design/scripts/generate-schema.mjs +20 -0
- package/template/.trae/skills/yss-technical-design/scripts/validate-technical-design.mjs +134 -0
- package/template/.trae/skills/yss-technical-design/tests/fixtures.mjs +32 -0
- package/template/.trae/skills/yss-technical-design/tests/run-scenarios.mjs +82 -0
- package/template/CONTEXT.md +2 -1
- package/template/docs/agents/digital-human-roles.yaml +2 -2
- package/template/docs/agents/yss-skill-registry.yaml +20 -1
- package/template/docs/architecture/templates/architecture-review-checklist.md +1 -1
- package/template/docs/architecture/templates/system-overview-design-template.md +15 -4
- package/template/docs/process/lifecycle-artifact-map.md +2 -0
- package/template/docs/process/lifecycle-registry-baseline.json +3 -1
- package/template/docs/process/lifecycle-registry.yaml +9 -2
- package/template/docs/process/schemas/strategic-design-handoff.schema.json +77 -4
- package/template/docs/process/strategic-handoff-package.md +4 -2
- package/template/docs/process/template-verification-profiles.yaml +14 -0
- 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 +7 -6
- package/template/scripts/fixtures/strategic-handoff/fixture.mjs +3 -2
- package/template/scripts/lib/implementation-contract-compiler.mjs +8 -1
- package/template/scripts/lib/strategic-handoff-consumption.mjs +4 -4
- package/template/scripts/lib/strategic-handoff-design-targets.mjs +15 -0
- package/template/scripts/lib/technical-design-boundary.mjs +23 -0
- package/template/scripts/sync-strategic-handoff-tools +3 -2
- package/template/scripts/verify-strategic-handoff-package-scenarios +7 -1
- package/template/skills-lock.json +41 -11
- package/template.snapshot.json +4 -4
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
|
|
7
7
|
## 输出
|
|
8
8
|
|
|
9
|
+
以下 v1 结构作为新 Technical Design Contract v2 的 DDD `design` 内容使用。旧独立 v1 文件保持显式只读兼容;新合同共同头与战略交接绑定由 `yss-technical-design` 持有,分支不重复保存。
|
|
10
|
+
|
|
9
11
|
```yaml
|
|
10
12
|
schema_version: 1
|
|
11
13
|
tactical_design_id: tactical-design.<feature>
|
|
@@ -40,4 +42,4 @@ evidence_refs: []
|
|
|
40
42
|
6. 复杂跨聚合一致性、并发、幂等、事件补偿或持久化错位必须写明策略,必要时升级独立文档。
|
|
41
43
|
7. 实现发现新影响时必须阻断并回到生命周期重新路由。
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
跨仓快照消费在 v2 共同头(旧独立 v1 则为根对象)绑定 `strategic_handoff`;字段与实际命令以 `docs/process/strategic-handoff-package.md` 为准。
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
3
|
import process from "node:process";
|
|
4
|
+
import { pathToFileURL } from "node:url";
|
|
4
5
|
import { parseDocument } from "../../../../scripts/vendor/yaml.mjs";
|
|
5
6
|
|
|
6
7
|
import { parseArgs } from "node:util";
|
|
@@ -68,7 +69,7 @@ function refsExist(values, known, path, errors) {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
|
|
71
|
-
function validate(data) {
|
|
72
|
+
export function validate(data) {
|
|
72
73
|
const errors = [];
|
|
73
74
|
if (!isObject(data)) return ["合同必须是对象"];
|
|
74
75
|
for (const field of required) requireField(data, field, "root", errors);
|
|
@@ -218,4 +219,4 @@ async function main() {
|
|
|
218
219
|
process.stdout.write(`${JSON.stringify({ result: "ready-for-lifecycle-review", tactical_design_id: document.get("tactical_design_id"), status: document.get("status") }, null, 2)}\n`);
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
main().catch((error) => { process.stderr.write(`${error.message}\n`); process.exitCode = 1; });
|
|
222
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main().catch((error) => { process.stderr.write(`${error.message}\n`); process.exitCode = 1; });
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yss-technical-design
|
|
3
|
+
description: 在 YSS 技术分析中统一承接需求与战略输入,按已确认的 DDD 或传统 MVC 架构组织设计合同。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# YSS 技术设计
|
|
7
|
+
|
|
8
|
+
由 `yss-product-lifecycle` 调度,负责 `work-unit.technical-analysis` 的技术设计,不另起生命周期、不生成生产代码。生命周期维护批准和状态;`yss-implementation-contract-compiler` 消费批准且当前的设计,起草实现合同。
|
|
9
|
+
|
|
10
|
+
## 输入与架构选择
|
|
11
|
+
|
|
12
|
+
先读根 `CONTEXT.md`、已批准且当前的 Spec、业务规则、关键场景、适用的 API 契约、ADR 和工程约束。没有 API 或其他专项影响时记录有依据的不适用,不生成占位设计。
|
|
13
|
+
|
|
14
|
+
按项目绑定架构选择的来源及摘要。新工程复用 `scaffold-architecture-decisions.yaml` 的用户确认决定,先确认再进入分支,后续脚手架消费同一决定;既有工程沿用已登记架构,架构转换另行立项。只有 `domain-driven` 和 `layered-mvc` 两种架构族,不能从目录推断或默认 DDD。具体 Profile 及模块边界消费技能注册表与 `docs/agents/backend-architecture-profiles.md`。
|
|
15
|
+
|
|
16
|
+
- `domain-driven`:调用 `yss-tactical-design`,补齐适用的战略领域输入。
|
|
17
|
+
- `layered-mvc`:调用 `yss-mvc-design`,不要求战略 DDD、聚合、值对象、Domain Event 或 DDD Gateway。
|
|
18
|
+
|
|
19
|
+
已有 Strategic Design Handoff 时,两种分支都必须先完成导入和目标词汇对账,再逐条承接规则与关键场景。没有战略交接包的项目直接消费批准需求,不能为 MVC 补造战略 DDD。
|
|
20
|
+
|
|
21
|
+
## 合同与验证
|
|
22
|
+
|
|
23
|
+
新产物使用 schema v2 Technical Design Contract:共同头记录架构来源、输入版本与摘要、规则/场景承接、评审证据和状态,`design` 保存架构专属内容。合同格式与兼容规则见 `references/technical-design-contract.md`,Schema 见 `references/technical-design.schema.json`。
|
|
24
|
+
|
|
25
|
+
运行 `node .agents/skills/yss-technical-design/scripts/validate-technical-design.mjs <合同> --root <项目根>`。整体存在延期或冲突即阻断整体;相关切片可带 `--slice <切片ID>` 按依赖核验,仍须合同已批准。校验成功只返回审查输入,不批准、不设置 `ready-for-agent`。
|
|
26
|
+
|
|
27
|
+
schema v1 战术合同只按 DDD 显式兼容读取;使用 `--legacy-ddd`,不能解释为 MVC。迁移不自动批准,输入或架构变化必须重新校验并按现有门禁审查。新合同使用 `artifact.technical-design` / `evidence.technical-design-review`;旧 DDD 稳定 ID 保留原含义。
|
|
28
|
+
|
|
29
|
+
## 交接
|
|
30
|
+
|
|
31
|
+
按现有架构审查门禁进行独立评审。批准且版本当前后交回生命周期,再交编译器;DDD 实现使用 `yss-domain`,MVC 实现按已登记 Profile 的能力与 Recipe 路由。发现 `stale`、`drift`、`new_impacts` 或路径越界时回交重路由。需要图示时按用户或合同要求调用 `archify`,图只作派生证据。
|
package/template/.agents/skills/yss-technical-design/references/technical-design-common.schema.json
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "object",
|
|
3
|
+
"properties": {
|
|
4
|
+
"schema_version": {
|
|
5
|
+
"const": 2
|
|
6
|
+
},
|
|
7
|
+
"technical_design_id": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"pattern": "^technical-design\\.[a-z0-9][a-z0-9-]*$"
|
|
10
|
+
},
|
|
11
|
+
"version": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"pattern": "^v[1-9][0-9]*$"
|
|
14
|
+
},
|
|
15
|
+
"status": {
|
|
16
|
+
"enum": [
|
|
17
|
+
"draft",
|
|
18
|
+
"ready-for-human",
|
|
19
|
+
"approved",
|
|
20
|
+
"blocked",
|
|
21
|
+
"stale",
|
|
22
|
+
"drift",
|
|
23
|
+
"new_impacts"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
"context_ref": {
|
|
27
|
+
"const": "CONTEXT.md"
|
|
28
|
+
},
|
|
29
|
+
"architecture": {
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"family": {
|
|
33
|
+
"enum": [
|
|
34
|
+
"domain-driven",
|
|
35
|
+
"layered-mvc"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"project_id": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"minLength": 1
|
|
41
|
+
},
|
|
42
|
+
"source_kind": {
|
|
43
|
+
"enum": [
|
|
44
|
+
"scaffold-decision",
|
|
45
|
+
"existing-registration"
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
"decision_ref": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"minLength": 1
|
|
51
|
+
},
|
|
52
|
+
"decision_digest": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"family",
|
|
59
|
+
"project_id",
|
|
60
|
+
"source_kind",
|
|
61
|
+
"decision_ref",
|
|
62
|
+
"decision_digest"
|
|
63
|
+
],
|
|
64
|
+
"additionalProperties": false
|
|
65
|
+
},
|
|
66
|
+
"inputs": {
|
|
67
|
+
"type": "array",
|
|
68
|
+
"minItems": 2,
|
|
69
|
+
"items": {
|
|
70
|
+
"type": "object",
|
|
71
|
+
"properties": {
|
|
72
|
+
"ref": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"minLength": 1
|
|
75
|
+
},
|
|
76
|
+
"version": {
|
|
77
|
+
"type": "string",
|
|
78
|
+
"minLength": 1
|
|
79
|
+
},
|
|
80
|
+
"digest": {
|
|
81
|
+
"type": "string",
|
|
82
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
83
|
+
},
|
|
84
|
+
"kind": {
|
|
85
|
+
"enum": [
|
|
86
|
+
"context",
|
|
87
|
+
"spec",
|
|
88
|
+
"rules",
|
|
89
|
+
"scenarios",
|
|
90
|
+
"api",
|
|
91
|
+
"adr",
|
|
92
|
+
"engineering",
|
|
93
|
+
"strategic"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"required": [
|
|
98
|
+
"ref",
|
|
99
|
+
"version",
|
|
100
|
+
"digest",
|
|
101
|
+
"kind"
|
|
102
|
+
],
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"source_items": {
|
|
107
|
+
"type": "array",
|
|
108
|
+
"minItems": 0,
|
|
109
|
+
"items": {
|
|
110
|
+
"type": "object",
|
|
111
|
+
"properties": {
|
|
112
|
+
"source_id": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"minLength": 1
|
|
115
|
+
},
|
|
116
|
+
"kind": {
|
|
117
|
+
"enum": [
|
|
118
|
+
"rule",
|
|
119
|
+
"scenario"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"critical": {
|
|
123
|
+
"type": "boolean"
|
|
124
|
+
},
|
|
125
|
+
"source_ref": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"minLength": 1
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": [
|
|
131
|
+
"source_id",
|
|
132
|
+
"kind",
|
|
133
|
+
"critical",
|
|
134
|
+
"source_ref"
|
|
135
|
+
],
|
|
136
|
+
"additionalProperties": false
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"traceability": {
|
|
140
|
+
"type": "array",
|
|
141
|
+
"items": {
|
|
142
|
+
"type": "object",
|
|
143
|
+
"properties": {
|
|
144
|
+
"source_id": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"minLength": 1
|
|
147
|
+
},
|
|
148
|
+
"disposition": {
|
|
149
|
+
"enum": [
|
|
150
|
+
"implemented",
|
|
151
|
+
"deferred",
|
|
152
|
+
"not-applicable",
|
|
153
|
+
"pending",
|
|
154
|
+
"conflict"
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"tactical_refs": {
|
|
158
|
+
"type": "array",
|
|
159
|
+
"items": {
|
|
160
|
+
"type": "string",
|
|
161
|
+
"minLength": 1
|
|
162
|
+
},
|
|
163
|
+
"uniqueItems": true
|
|
164
|
+
},
|
|
165
|
+
"test_seam_refs": {
|
|
166
|
+
"type": "array",
|
|
167
|
+
"items": {
|
|
168
|
+
"type": "string",
|
|
169
|
+
"minLength": 1
|
|
170
|
+
},
|
|
171
|
+
"uniqueItems": true
|
|
172
|
+
},
|
|
173
|
+
"evidence_refs": {
|
|
174
|
+
"type": "array",
|
|
175
|
+
"items": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"minLength": 1
|
|
178
|
+
},
|
|
179
|
+
"uniqueItems": true
|
|
180
|
+
},
|
|
181
|
+
"dependency_status": {
|
|
182
|
+
"enum": [
|
|
183
|
+
"known",
|
|
184
|
+
"unknown"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"dependent_slice_refs": {
|
|
188
|
+
"type": "array",
|
|
189
|
+
"items": {
|
|
190
|
+
"type": "string",
|
|
191
|
+
"minLength": 1
|
|
192
|
+
},
|
|
193
|
+
"uniqueItems": true
|
|
194
|
+
},
|
|
195
|
+
"scenario_tests": {
|
|
196
|
+
"type": "array",
|
|
197
|
+
"items": {
|
|
198
|
+
"type": "object",
|
|
199
|
+
"properties": {
|
|
200
|
+
"outcome": {
|
|
201
|
+
"enum": [
|
|
202
|
+
"success",
|
|
203
|
+
"failure"
|
|
204
|
+
]
|
|
205
|
+
},
|
|
206
|
+
"seam_ref": {
|
|
207
|
+
"type": "string",
|
|
208
|
+
"minLength": 1
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"required": [
|
|
212
|
+
"outcome",
|
|
213
|
+
"seam_ref"
|
|
214
|
+
],
|
|
215
|
+
"additionalProperties": false
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
"reason": {
|
|
219
|
+
"type": "string",
|
|
220
|
+
"minLength": 1
|
|
221
|
+
},
|
|
222
|
+
"risk": {
|
|
223
|
+
"type": "string",
|
|
224
|
+
"minLength": 1
|
|
225
|
+
},
|
|
226
|
+
"owner": {
|
|
227
|
+
"type": "string",
|
|
228
|
+
"minLength": 1
|
|
229
|
+
},
|
|
230
|
+
"followup_ticket_ref": {
|
|
231
|
+
"type": "string",
|
|
232
|
+
"minLength": 1
|
|
233
|
+
},
|
|
234
|
+
"verification_plan": {
|
|
235
|
+
"type": "string",
|
|
236
|
+
"minLength": 1
|
|
237
|
+
},
|
|
238
|
+
"target_version": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"minLength": 1
|
|
241
|
+
}
|
|
242
|
+
},
|
|
243
|
+
"required": [
|
|
244
|
+
"source_id",
|
|
245
|
+
"disposition",
|
|
246
|
+
"dependency_status",
|
|
247
|
+
"dependent_slice_refs"
|
|
248
|
+
],
|
|
249
|
+
"additionalProperties": true
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"strategic_handoff": {
|
|
253
|
+
"type": "object"
|
|
254
|
+
},
|
|
255
|
+
"design": {
|
|
256
|
+
"type": "object"
|
|
257
|
+
},
|
|
258
|
+
"evidence_refs": {
|
|
259
|
+
"type": "array",
|
|
260
|
+
"items": {
|
|
261
|
+
"type": "string",
|
|
262
|
+
"minLength": 1
|
|
263
|
+
},
|
|
264
|
+
"uniqueItems": true
|
|
265
|
+
},
|
|
266
|
+
"digest": {
|
|
267
|
+
"type": "string",
|
|
268
|
+
"pattern": "^sha256:[a-f0-9]{64}$"
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"required": [
|
|
272
|
+
"schema_version",
|
|
273
|
+
"technical_design_id",
|
|
274
|
+
"version",
|
|
275
|
+
"status",
|
|
276
|
+
"context_ref",
|
|
277
|
+
"architecture",
|
|
278
|
+
"inputs",
|
|
279
|
+
"source_items",
|
|
280
|
+
"traceability",
|
|
281
|
+
"design",
|
|
282
|
+
"evidence_refs",
|
|
283
|
+
"digest"
|
|
284
|
+
],
|
|
285
|
+
"additionalProperties": false,
|
|
286
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
287
|
+
"$id": "https://yss.dev/schemas/technical-design-v2.json",
|
|
288
|
+
"title": "YSS Technical Design Contract v2",
|
|
289
|
+
"$comment": "共同合同权威;完整分支 Schema 由 scripts/generate-schema.mjs 派生。"
|
|
290
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Technical Design Contract v2
|
|
2
|
+
|
|
3
|
+
共同合同字段由 `technical-design-common.schema.json` 定义,完整 `technical-design.schema.json` 通过 `scripts/generate-schema.mjs` 合并专项 Schema 派生,使用 `--check` 检查同步,`design` 按 `architecture.family` 校验:`domain-driven` 沿用 DDD v1 内容结构,`layered-mvc` 使用 `yss-mvc-design/references/mvc-design.schema.json`。DDD 内层的 schema/version/status 是分支内容版本,status 必须与共同头一致;战略交接绑定只写共同头,避免双重维护。
|
|
4
|
+
|
|
5
|
+
## 共同头
|
|
6
|
+
|
|
7
|
+
- `schema_version: 2`、`technical_design_id: technical-design.<name>`、`version: vN`、`status`、`context_ref: CONTEXT.md`。
|
|
8
|
+
- `architecture`:`family`、`project_id`、`source_kind: scaffold-decision | existing-registration`、`decision_ref`、`decision_digest`。新项目引用正式且 current 的脚手架决定,所选项目必须已由用户确认;既有登记引用当前 `project_id` 和 `architecture_identity.architecture_family`,也可从登记的 `repositories` 数组按项目解析。架构来源变化须重新绑定和审查,不能改合同字段冒充用户改选。
|
|
9
|
+
- `inputs`:每行 `{kind, ref, version, digest}`,kind 为 context/spec/rules/scenarios/api/adr/engineering/strategic;至少包含根 CONTEXT.md 与 Spec。适用的工程/API 约束同样绑定。无 API 影响理由记录在需求或工程输入中。DDD 另须 strategic 输入,MVC 不要求。
|
|
10
|
+
- `source_items`:无战略包时从批准需求提取稳定规则和场景 `{source_id, kind: rule | scenario, critical, source_ref}`。source_ref 必须对应 inputs,不复制源正文成为第二事实源。
|
|
11
|
+
- `traceability`:逐项对应 source_items。沿用 `tactical_refs` 字段名以兼容承接协议,其值在新合同中可指向 MVC 用例、规则或 DDD 对象;其他字段与战略承接 rows 相同。implemented 仅表示设计承接已落实,不表示代码已实现。
|
|
12
|
+
- 有战略包时追加 `strategic_handoff`,按 `docs/process/strategic-handoff-package.md` 绑定导入收据、摘要、正式对账及 rows;本地补充规则仍可写 source_items / traceability,但不能重复维护包内来源。
|
|
13
|
+
- `evidence_refs`:现有审查证据的可读取路径。approved 状态必须有评审证据,真正批准仍由生命周期核验适用批准记录;本校验器不产生批准。
|
|
14
|
+
- `digest`:删除根 digest 后按键排序、数组保持顺序的 canonical JSON SHA-256,前缀 `sha256:`。来源文件的 digest 使用原始字节 SHA-256;这两种摘要不可混用。
|
|
15
|
+
|
|
16
|
+
所有仓内引用相对 `--root` 解析;不接受越界或符号链接。输入摘要不匹配、未知架构、悬空落点、缺少关键场景成功/失败测试均阻断。延期与冲突按已声明的切片依赖阻断,依赖未知时整体阻断。
|
|
17
|
+
|
|
18
|
+
## 设计与实现交接
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
node .agents/skills/yss-technical-design/scripts/validate-technical-design.mjs docs/design/technical-design.yaml --root <项目根>
|
|
22
|
+
node .agents/skills/yss-technical-design/scripts/validate-technical-design.mjs docs/design/technical-design.yaml --root <项目根> --slice <切片ID>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
编译器输入与 resolution 使用 `technical_design: {ref, version, digest}`,digest 是已持久化整个合同的原始字节摘要,并绑定 `slice_id`。命中 `backend-technical-design-impact` 或已有领域/状态/一致性影响条件时必须提供;编译与 freshness 检查重新执行验证,并核对架构族。没有相关设计影响的编译继续消费原有最小合同。
|
|
26
|
+
|
|
27
|
+
schema v1 仅配合 `--legacy-ddd`(编译器绑定 `legacy_ddd: true`)读取为 DDD。旧 DDD 校验入口保留,不改变旧批准或历史文件。新写合同一律 v2;格式迁移不代表批准,架构、输入或设计变化走现有门禁重审。
|
|
28
|
+
|
|
29
|
+
## MVC 示例
|
|
30
|
+
|
|
31
|
+
可执行示例见 `../tests/fixtures.mjs` 的 `mvcFixture`:在临时项目绑定需求与现有登记,定义 server → service → repository、提交用例、规则、事务、存储映射和成功/失败 seam。它只用于模板验证,不生成产品实例 Spec。
|