@namewta/speculo 0.8.4 → 0.8.6
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 +4 -3
- package/dist/src/structured.js +162 -4
- package/dist/src/structured.js.map +1 -1
- package/package.json +2 -2
- package/template/.speculo/README.md +7 -6
- package/template/canonical/canonical-specdev-goal-plan.md +0 -1
- package/template/canonical/canonical-specdev-grill-with-docs.md +0 -1
- package/template/canonical/canonical-specdev-spec.md +0 -1
- package/template/canonical/canonical-specdev-tickets.md +0 -1
- package/template/commands/status.md +3 -3
- package/template/skills/archive-and-consolidate/SKILL.md +19 -14
- package/template/workflows/learning/A-archive-and-consolidate/A-archive-and-consolidate.md +38 -0
- package/template/workflows/learning/A-archive-and-consolidate/promotion-plan-template.md +23 -0
- package/template/workflows/learning/A-assess-and-plan/A-assess-and-plan.md +39 -0
- package/template/workflows/learning/A-assess-and-plan/change-status-template.json +28 -0
- package/template/workflows/learning/A-assess-and-plan/learning-plan-template.md +28 -0
- package/template/workflows/learning/E-eli5/E-eli5.md +37 -0
- package/template/workflows/learning/E-eli5/lesson-template.md +31 -0
- package/template/workflows/learning/I-init-setup/I-init-setup.md +36 -0
- package/template/workflows/learning/I-init-setup/context-index-template.md +6 -0
- package/template/workflows/learning/I-init-setup/learner-profile-template.md +17 -0
- package/template/workflows/learning/I-init-setup/review-index-template.md +4 -0
- package/template/workflows/learning/INDEX.md +26 -0
- package/template/workflows/learning/P-practice/P-practice.md +34 -0
- package/template/workflows/learning/P-practice/practice-template.md +16 -0
- package/template/workflows/learning/Q-quiz/Q-quiz.md +34 -0
- package/template/workflows/learning/Q-quiz/quiz-artifact-template.md +16 -0
- package/template/workflows/learning/R-review/R-review.md +35 -0
- package/template/workflows/learning/R-review/review-template.md +12 -0
- package/template/workflows/learning/README.md +121 -0
- package/template/workflows/learning/_state/archive/.gitkeep +1 -0
- package/template/workflows/learning/_state/changes/.gitkeep +1 -0
- package/template/workflows/learning/_state/status.json +6 -0
- package/template/workflows/learning/common/rules/artifact-contract.md +27 -0
- package/template/workflows/learning/common/rules/assessment-policy.md +7 -0
- package/template/workflows/learning/common/rules/knowledge-organization.md +9 -0
- package/template/workflows/learning/common/rules/mastery-policy.md +21 -0
- package/template/workflows/learning/common/rules/path-reference-contract.md +7 -0
- package/template/workflows/learning/common/rules/teaching-policy.md +15 -0
- package/template/workflows/learning/common/schemas/change-status.schema.json +41 -0
- package/template/workflows/learning/common/schemas/status.schema.json +32 -0
- package/template/workflows/learning/common/skills/knowledge-promotion/SKILL.md +46 -0
- package/template/workflows/learning/common/skills/knowledge-promotion/domain-index-template.md +6 -0
- package/template/workflows/learning/common/skills/knowledge-promotion/domain-overview-template.md +19 -0
- package/template/workflows/learning/common/skills/knowledge-promotion/knowledge-template.md +25 -0
- package/template/workflows/learning/common/tools/validate-learning.mjs +356 -0
- package/template/workflows/learning/runtime-contract.json +11 -0
- package/template/workflows/specdev/A-archive-and-consolidate/A-archive-and-consolidate.md +2 -0
- package/template/workflows/specdev/C-code-review/C-code-review.md +2 -0
- package/template/workflows/specdev/D-diagnose-bugs/D-diagnose-bugs.md +2 -0
- package/template/workflows/specdev/G-grill-with-docs/G-grill-with-docs.md +2 -0
- package/template/workflows/specdev/I-implement/I-implement.md +2 -0
- package/template/workflows/specdev/I-init-setup/I-init-setup.md +3 -1
- package/template/workflows/specdev/INDEX.md +9 -241
- package/template/workflows/specdev/P-goal-plan/P-goal-plan.md +2 -0
- package/template/workflows/specdev/P-prototype/P-prototype.md +2 -0
- package/template/workflows/specdev/R-review-architecture/R-review-architecture.md +2 -0
- package/template/workflows/specdev/README.md +244 -0
- package/template/workflows/specdev/S-spec/S-spec.md +2 -0
- package/template/workflows/specdev/T-tickets/T-tickets.md +2 -0
- package/template/workflows/specdev/T-triage/T-triage.md +3 -1
- package/template/workflows/specdev/W-wayfinder/W-wayfinder.md +2 -0
- package/template/workflows/specdev/common/rules/artifact-contract.md +0 -1
- package/template/workflows/specdev/common/tools/validate-specdev.mjs +0 -68
- package/template/canonical/canonical-specdev-engineering-cognitive-mentor.md +0 -1968
- package/template/workflows/specdev/E-eli5/E-eli5.md +0 -95
- package/template/workflows/specdev/E-engineering-cognitive-mentor/E-engineering-cognitive-mentor.md +0 -252
- package/template/workflows/specdev/E-engineering-cognitive-mentor/architecture-guidance.md +0 -90
- package/template/workflows/specdev/E-engineering-cognitive-mentor/bug-guidance.md +0 -80
- package/template/workflows/specdev/E-engineering-cognitive-mentor/codebase-guidance.md +0 -107
- package/template/workflows/specdev/E-engineering-cognitive-mentor/comprehension-and-closure.md +0 -95
- package/template/workflows/specdev/E-engineering-cognitive-mentor/domain-learning-guidance.md +0 -62
- package/template/workflows/specdev/E-engineering-cognitive-mentor/evidence-and-options.md +0 -132
- package/template/workflows/specdev/E-engineering-cognitive-mentor/interaction-protocol.md +0 -116
- package/template/workflows/specdev/E-engineering-cognitive-mentor/mentor-report-template.md +0 -135
- package/template/workflows/specdev/E-engineering-cognitive-mentor/mode-routing.md +0 -47
- package/template/workflows/specdev/E-engineering-cognitive-mentor/persistence-and-resume.md +0 -132
- package/template/workflows/specdev/E-engineering-cognitive-mentor/requirements-guidance.md +0 -92
|
@@ -3,254 +3,22 @@ id: specdev
|
|
|
3
3
|
type: workflow
|
|
4
4
|
workflow: specdev
|
|
5
5
|
name: SpecDev Workflow
|
|
6
|
-
description:
|
|
7
|
-
keywords: [specdev, local-first, 规格驱动开发, decision-complete,
|
|
6
|
+
description: 以本地工件为唯一开发权威,从来源冻结、诊断、设计、原型、规格、Ticket、编排和审查推进到证据驱动实现、远程 reconcile 与知识归档。
|
|
7
|
+
keywords: [specdev, local-first, 规格驱动开发, decision-complete, prototype, code-review, TDD, 证据]
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
# SpecDev
|
|
10
|
+
# SpecDev Index
|
|
11
11
|
|
|
12
|
-
SpecDev
|
|
12
|
+
本索引用于发现 SpecDev,并让未激活 SpecDev 的会话按需取得项目已经沉淀的长期知识。
|
|
13
13
|
|
|
14
|
-
##
|
|
14
|
+
## 永久知识
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
- 状态根:`<Path>{roots.state}/specdev/</Path>`
|
|
16
|
+
读取本索引时,只把与当前请求相关且已经存在的内容作为只读背景;不存在的路径静默跳过:
|
|
18
17
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## 工件链
|
|
22
|
-
|
|
23
|
-
```text
|
|
24
|
-
远程 Issue、指定内容或对话
|
|
25
|
-
↓
|
|
26
|
-
Triage 冻结为本地 Source
|
|
27
|
-
↓
|
|
28
|
-
Diagnose / Grill / ELI5 / Wayfinder / Prototype / Code Review / Architecture Review
|
|
29
|
-
↓
|
|
30
|
-
Spec 外部行为、范围、验收合同与关键约束
|
|
31
|
-
↓
|
|
32
|
-
Ticket 单一垂直切片的决策完备微计划
|
|
33
|
-
↓
|
|
34
|
-
Tickets Map DAG、合同覆盖、Ready 与并行投影
|
|
35
|
-
↓
|
|
36
|
-
Goal Plan 仅在需要时编排跨 Ticket Gate、Wave、owner 与恢复
|
|
37
|
-
↓
|
|
38
|
-
Implement 在既定契约内设计、TDD、审查、验证和交接
|
|
39
|
-
↓
|
|
40
|
-
Evidence 实际修改、命令、结果、偏差和残余风险
|
|
41
|
-
↓
|
|
42
|
-
Triage 本地完成后按确认回写/关闭支持的远程 Issue
|
|
43
|
-
↓
|
|
44
|
-
Archive 归档历史并将经验证知识提升为当前长期知识
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
核心状态工件:
|
|
48
|
-
|
|
49
|
-
- `<Path>{roots.state}/specdev/changes/{change}/source.md</Path>`
|
|
50
|
-
- `<Path>{roots.state}/specdev/changes/{change}/triage.md</Path>`
|
|
51
|
-
- `<Path>{roots.state}/specdev/changes/{change}/spec.md</Path>`
|
|
52
|
-
- `<Path>{roots.state}/specdev/changes/{change}/ticket/</Path>`
|
|
53
|
-
- `<Path>{roots.state}/specdev/changes/{change}/tickets-map.md</Path>`
|
|
54
|
-
- `<Path>{roots.state}/specdev/changes/{change}/goal-plan.md</Path>`
|
|
55
|
-
- `<Path>{roots.state}/specdev/changes/{change}/design-tree.json</Path>`
|
|
56
|
-
- `<Path>{roots.state}/specdev/changes/{change}/wayfinder-map.md</Path>`
|
|
57
|
-
- `<Path>{roots.state}/specdev/changes/{change}/investigation/</Path>`
|
|
58
|
-
- `<Path>{roots.state}/specdev/changes/{change}/evidence/</Path>`
|
|
59
|
-
- `<Path>{roots.state}/specdev/changes/{change}/reviews/</Path>`
|
|
60
|
-
- `<Path>{roots.state}/specdev/changes/{change}/prototypes/</Path>`
|
|
61
|
-
- `<Path>{roots.state}/specdev/changes/{change}/questionnaires/</Path>`
|
|
62
|
-
- `<Path>{roots.state}/specdev/changes/{change}/eli_index.md</Path>` 与 `<Path>{roots.state}/specdev/changes/{change}/<number>_<topic>.md</Path>`
|
|
63
|
-
|
|
64
|
-
工件职责和冲突裁决位于 `<Path>{roots.workflows}/specdev/common/rules/artifact-contract.md</Path>`。
|
|
65
|
-
|
|
66
|
-
## 持久化约定
|
|
67
|
-
|
|
68
|
-
`speculo init` 创建固定状态骨架:
|
|
69
|
-
|
|
70
|
-
- 全局状态:`<Path>{roots.state}/specdev/status.json</Path>`
|
|
71
|
-
- 活跃 change:`<Path>{roots.state}/specdev/changes/</Path>`
|
|
72
|
-
- 历史归档:`<Path>{roots.state}/specdev/archive/</Path>`
|
|
73
|
-
|
|
74
|
-
刷新时 CLI 依据 `<Path>{roots.workflows}/specdev/runtime-contract.json</Path>` 处理持久化数据:配置使用 baseline 三方合并,登记的状态 schema 使用显式 migrator,其他 runtime 文件按字节保留。只有字段删除或结构迁移时才在 `<Path>{roots.state}/back/</Path>` 写入 targeted backup;冲突在替换 active 安装前阻塞。`<Path>{roots.state}/back/</Path>`、`<Path>{roots.state}/install.json</Path>`、`<Path>{roots.state}/managed.json</Path>` 与 `<Path>{roots.state}/baselines/</Path>` 均不属于 SpecDev 写入 namespace。
|
|
75
|
-
|
|
76
|
-
初始化设置 work 首次运行时生成配置并创建空的永久 namespace:
|
|
77
|
-
|
|
78
|
-
- 全局配置:`<Path>{roots.state}/specdev/config.json</Path>`
|
|
79
|
-
- 追踪规则:`<Path>{roots.state}/specdev/.config/tracking.md</Path>`
|
|
80
|
-
- 领域布局:`<Path>{roots.state}/specdev/.config/domain-layout.md</Path>`
|
|
81
|
-
- 永久 ADR:`<Path>{roots.state}/specdev/adr/</Path>`
|
|
18
|
+
- 永久架构决策:`<Path>{roots.state}/specdev/adr/</Path>`
|
|
82
19
|
- 永久领域上下文:`<Path>{roots.state}/specdev/context/</Path>`
|
|
83
20
|
- 永久研究:`<Path>{roots.state}/specdev/research/</Path>`
|
|
84
21
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
单个 change 可以包含:
|
|
88
|
-
|
|
89
|
-
- `<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>`
|
|
90
|
-
- `<Path>{roots.state}/specdev/changes/{change}/source.md</Path>`
|
|
91
|
-
- `<Path>{roots.state}/specdev/changes/{change}/triage.md</Path>`
|
|
92
|
-
- `<Path>{roots.state}/specdev/changes/{change}/diagnosis.md</Path>`
|
|
93
|
-
- `<Path>{roots.state}/specdev/changes/{change}/diagnostics/</Path>`
|
|
94
|
-
- `<Path>{roots.state}/specdev/changes/{change}/CONTEXT.md</Path>`
|
|
95
|
-
- `<Path>{roots.state}/specdev/changes/{change}/ADR.md</Path>`
|
|
96
|
-
- `<Path>{roots.state}/specdev/changes/{change}/LOG.md</Path>`
|
|
97
|
-
- `<Path>{roots.state}/specdev/changes/{change}/design-tree.json</Path>`
|
|
98
|
-
- `<Path>{roots.state}/specdev/changes/{change}/spec.md</Path>`
|
|
99
|
-
- `<Path>{roots.state}/specdev/changes/{change}/ticket/</Path>`
|
|
100
|
-
- `<Path>{roots.state}/specdev/changes/{change}/tickets-map.md</Path>`
|
|
101
|
-
- `<Path>{roots.state}/specdev/changes/{change}/goal-plan.md</Path>`
|
|
102
|
-
- `<Path>{roots.state}/specdev/changes/{change}/wayfinder-map.md</Path>`
|
|
103
|
-
- `<Path>{roots.state}/specdev/changes/{change}/investigation/</Path>`
|
|
104
|
-
- `<Path>{roots.state}/specdev/changes/{change}/investigation/comments/</Path>`
|
|
105
|
-
- `<Path>{roots.state}/specdev/changes/{change}/architecture-review.md</Path>`
|
|
106
|
-
- `<Path>{roots.state}/specdev/changes/{change}/architecture-review.html</Path>`
|
|
107
|
-
- `<Path>{roots.state}/specdev/changes/{change}/evidence/</Path>`
|
|
108
|
-
- `<Path>{roots.state}/specdev/changes/{change}/reviews/</Path>`
|
|
109
|
-
- `<Path>{roots.state}/specdev/changes/{change}/prototypes/</Path>`
|
|
110
|
-
- `<Path>{roots.state}/specdev/changes/{change}/questionnaires/</Path>`
|
|
111
|
-
- `<Path>{roots.state}/specdev/changes/{change}/eli_index.md</Path>` 与 `<Path>{roots.state}/specdev/changes/{change}/<number>_<topic>.md</Path>`
|
|
112
|
-
|
|
113
|
-
## 全局治理原则
|
|
114
|
-
|
|
115
|
-
1. **先发现、后询问**:仓库、配置、schema、测试和文档能回答的事实先探索;只询问真正影响行为、架构、风险、范围、迁移或验收的偏好。
|
|
116
|
-
2. **规划深度随风险增长**:Lite、Standard、Deep 由复杂度和事故半径决定,不由文档长度决定。
|
|
117
|
-
3. **Ticket 是微型计划**:每个 Ready Ticket 决策完备,但不展开逐行代码。
|
|
118
|
-
4. **Goal Plan 按需出现**:只在跨 Ticket 编排复杂度需要时生成,不以固定章节数量作为质量标准。
|
|
119
|
-
5. **证据优先**:每个验收合同、Ticket 和 Gate 都必须有可重复验证与 Evidence。
|
|
120
|
-
6. **路径所有权**:并发实现者只能修改授权项目路径;shared path 有唯一 owner。
|
|
121
|
-
7. **偏差显式化**:计划与事实冲突时停止、记录、修订,不静默扩大范围或改写契约。
|
|
122
|
-
8. **状态单一来源**:Ticket frontmatter 是单 Ticket 状态权威;Map 和 Goal Plan 是投影与编排。
|
|
123
|
-
9. **知识以当前真相为目标**:归档保留历史,永久知识只保留仍真实且经实现验证的结论。
|
|
124
|
-
10. **恢复依赖权威工件**:跨 Work 或 Agent 边界时同步 active change 的 `current_work`,成功完成后去重更新 `works_run`,返回下一 Work 和权威工件的完整路径。
|
|
125
|
-
11. **本地执行权威**:远程 Issue/PR/URL 只作为来源或完成投影;Spec、Ticket、Map、Goal Plan、Evidence 和状态始终以本地工件为准。
|
|
126
|
-
12. **完成与归档分离**:本地完成按 change completion 合同决定;远程 close 失败不回滚完成,但必须 reconcile 或 waive 后才归档。
|
|
127
|
-
13. **Lead 与隔离正交**:Lead 固定拥有 SpecDev 状态、Evidence 与父分支;是否派遣 subagent 由 Lead 动态决定。Goal Plan 创建时询问 Ticket 是否开启 worktree,默认不开启;选择只作用于当前 Goal Plan。
|
|
128
|
-
14. **策略化验收**:current 模式使用当前 workspace 严格串行、direct-parent 验证;required 模式使用 source worktree 与 parent-candidate。只有 required 模式创建独立 Ticket worktree。
|
|
129
|
-
|
|
130
|
-
共享规则:
|
|
131
|
-
|
|
132
|
-
- `<Path>{roots.workflows}/specdev/common/rules/planning-principles.md</Path>`
|
|
133
|
-
- `<Path>{roots.workflows}/specdev/common/rules/artifact-contract.md</Path>`
|
|
134
|
-
- `<Path>{roots.workflows}/specdev/common/rules/readiness-and-depth.md</Path>`
|
|
135
|
-
- `<Path>{roots.workflows}/specdev/common/rules/path-ownership.md</Path>`
|
|
136
|
-
- `<Path>{roots.workflows}/specdev/common/rules/evidence-and-verification.md</Path>`
|
|
137
|
-
- `<Path>{roots.workflows}/specdev/common/rules/deviation-control.md</Path>`
|
|
138
|
-
- `<Path>{roots.workflows}/specdev/common/rules/path-reference-contract.md</Path>`
|
|
139
|
-
- `<Path>{roots.workflows}/specdev/common/rules/codebase-design.md</Path>`
|
|
140
|
-
- `<Path>{roots.workflows}/specdev/common/rules/change-completion.md</Path>`
|
|
141
|
-
|
|
142
|
-
## 启动协议
|
|
143
|
-
|
|
144
|
-
1. 解析 workflow 和 state roots。
|
|
145
|
-
2. 读取 `<Path>{roots.state}/specdev/config.json</Path>`;不存在时运行 `<Path>{roots.workflows}/specdev/I-init-setup/I-init-setup.md</Path>`。
|
|
146
|
-
3. 读取 `<Path>{roots.state}/specdev/status.json</Path>`:用户指定 change 优先;唯一活跃 change 直接使用;无活跃时创建;多个候选时请求消歧。
|
|
147
|
-
4. 若当前 change 已有非空 `current_work`,先恢复或显式结束该 Work;否则将 `current_work` 设置为本次 work id。
|
|
148
|
-
5. 只加载当前步骤需要的 work 子文件和共享规则。
|
|
149
|
-
6. 完成后写入产物、运行适用校验、更新状态和 `works_run`。
|
|
150
|
-
|
|
151
|
-
Change 从 active/blocked 转为 completed 时加载 `<Path>{roots.workflows}/specdev/common/rules/change-completion.md</Path>`:有 Goal Plan 时由其中唯一 Lead 拥有转换;无 Goal Plan 的 Ticket/Direct Spec 由当前 I owner 拥有;非实现型终点由最终验收工件 owner 拥有。Archive 不补造 completed。
|
|
152
|
-
|
|
153
|
-
## 状态字段
|
|
154
|
-
|
|
155
|
-
`<Path>{roots.state}/specdev/status.json</Path>` 使用全局 schema v5;Spec/Ticket/Tickets Map 继续使用各自 schema v3,config 使用 schema v5,Goal Plan 使用 schema v6,`<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>` 使用 schema v6:
|
|
156
|
-
|
|
157
|
-
- `schema_version`(数字):全局状态 schema 版本,固定为 `4`。
|
|
158
|
-
- `workflow`(字符串):workflow 标识,固定为 `"specdev"`。
|
|
159
|
-
- `active`(对象数组):当前活跃 change;每项包含:
|
|
160
|
-
- `change`(字符串):change 目录名,格式 `"YYYY-MM-DD-<kebab-topic>"`。
|
|
161
|
-
- `current_work`(字符串或 null):当前 work id,如 `"specdev/implement"`;无运行中 work 时为 null。
|
|
162
|
-
- `works_run`(去重字符串数组):已成功完成的 work id;重复运行同一 work 不追加副本。
|
|
163
|
-
- `claimed_investigations`(对象数组,可选):并行调查领取记录;每项包含 `id`、`owner`、可选 `session` 和 `claimed_at`。
|
|
164
|
-
- `archived`(去重字符串数组):已归档 change 名称。详细归档时间、路径和 promotion 摘要只存在于 `<Path>{roots.state}/specdev/archive/YYYY-MM/{change}/.status.json</Path>`。
|
|
165
|
-
|
|
166
|
-
`active[].change` 必须唯一,且不得同时出现在 `archived`。开始 Work 时设置 `current_work`;暂停或可恢复阻塞时保留;成功完成时加入 `works_run` 并清空;取消时清空但不加入。逐次时间、结果和审计证据由 change 自有状态、Work 主产物、Evidence 或 LOG 承载,不写入全局索引。
|
|
167
|
-
|
|
168
|
-
`<Path>{roots.state}/specdev/config.json</Path>` 的 `execution.max_implementation_agents`、`max_integration_attempts` 和 planning 原型变体字段均为可配置正整数,初始化时写入默认值;仅 implementation subagent 受前者约束且不含 Lead,current workspace 仍保持单 writer 串行安全不变量;只读 review/research/test-observation agent 不设 SpecDev 数字上限。
|
|
169
|
-
|
|
170
|
-
`<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>` 的 `worktrees` 保存 Ticket 级 `base_sha`、父分支、workspace/implementation/integration owner、workspace locator、implementation/source checkpoint、适用 candidate/result SHA、验证、E2E disposition 与生命周期状态。current 记录使用 `workspace_ref=current` 和 direct-parent;required 记录使用 source/parent-candidate。每个实现 Ticket 都有一条记录;父分支只有在对应策略的验证通过后推进。`removed` 是 required 集成后来源 branch/worktree 完成清理的终态,必须保留全部集成与 E2E 证据。
|
|
171
|
-
|
|
172
|
-
领域状态枚举:
|
|
173
|
-
|
|
174
|
-
- change:`active | blocked | completed | archived`
|
|
175
|
-
- Ticket:`draft | ready | in_progress | blocked | review | done | deviated | cancelled`
|
|
176
|
-
- Investigation status:`open | closed`
|
|
177
|
-
- Investigation resolution:`answered | out-of-scope | superseded | cancelled | null`
|
|
178
|
-
- Planning Depth:`lite | standard | deep`
|
|
179
|
-
- Worktree:`planned | active | review | integrating | integrated | removed | blocked`
|
|
180
|
-
|
|
181
|
-
## 路径分配
|
|
182
|
-
|
|
183
|
-
1. workflow 运行状态写入 `<Path>{roots.state}/specdev/</Path>`。
|
|
184
|
-
2. change 产物写入 `<Path>{roots.state}/specdev/changes/{change}/</Path>`。
|
|
185
|
-
3. 项目代码、测试和用户要求的项目文档写入项目路径;Evidence 仅保存项目相对指针。
|
|
186
|
-
4. 长期知识候选先在 change 内形成;只有 A 在完成证据、毕业评估和用户确认全部通过后,才提升到对应永久 namespace。
|
|
187
|
-
|
|
188
|
-
## 副作用边界
|
|
189
|
-
|
|
190
|
-
未经用户明确授权不得提交、推送、合并、删除来源 branch/worktree、部署、发布、移动归档、写入/关闭远程 Issue 或执行不可逆迁移。Ready Goal Plan/Ticket 执行必须明确取得 implementation commit 与所选 direct-parent/candidate integration/父分支更新授权;required 模式该授权包含 transient candidate checkout/branch 生命周期,不扩展到来源 cleanup、远端或生产动作。只读探索、change 工件生成和已授权验证可以进行。远程开发投影仅由 Triage reconcile 执行;Retro command 的 Speculo 反馈 Issue 是独立 command 边界。敏感值不得写入 `<Path>{roots.state}/specdev/</Path>`。
|
|
191
|
-
|
|
192
|
-
## 场景路由
|
|
193
|
-
|
|
194
|
-
| 场景 | 入口 | 正常出口 |
|
|
195
|
-
|---|---|---|
|
|
196
|
-
| 远程 Issue、URL、文件或对话摄入 | T-triage intake | D / G / W / P / S / C / T |
|
|
197
|
-
| 本地 change 完成且来源可关闭 | T-triage reconcile | A |
|
|
198
|
-
| 疑难 bug 或性能回归 | D-diagnose-bugs | S / T / I / R / W |
|
|
199
|
-
| 模糊但可通过决策访谈收敛 | G-grill-with-docs | P / S / T / W |
|
|
200
|
-
| 需要向刚上大一、没有专业背景的读者做 Markdown 与 ASCII 图解 | E-eli5 | 返回用户 / 继续当前 change |
|
|
201
|
-
| 路径超出单次上下文 | W-wayfinder | G / P / D / S / T |
|
|
202
|
-
| 需要用代码回答逻辑/UI 问题 | P-prototype | G / S / T / I |
|
|
203
|
-
| 固定点 diff、branch 或 PR review | C-code-review | completed / T / S / G |
|
|
204
|
-
| 外部行为已清楚 | S-spec | T-tickets |
|
|
205
|
-
| Ready Spec 需要垂直切片 | T-tickets | P-goal-plan / I |
|
|
206
|
-
| 多 Ticket 协调 | P-goal-plan | I / Triage / A |
|
|
207
|
-
| Ready 执行 | I-implement | Triage / A / blocked / deviation |
|
|
208
|
-
| 架构健康扫描 | R-review-architecture | G / T |
|
|
209
|
-
|
|
210
|
-
同 change 下一阶段需要当前一手推理且上下文健康时继续;切换 repo/person/harness 或旁路时使用 `<Path>{roots.commands}/handoff.md</Path>`;严格限定且可独立派单时使用 Dispatch Packet;其他长上下文以权威工件路径恢复。平台不支持 clear/compact 时不虚构操作。
|
|
211
|
-
|
|
212
|
-
## Work 条目
|
|
213
|
-
|
|
214
|
-
<!-- AUTO-INDEX-START -->
|
|
215
|
-
|
|
216
|
-
- **A-archive-and-consolidate** — 归档与沉淀:校验本地完成与远程 reconcile 门,复用全局归档能力移动 completed change 并提升当前知识,或从代码访谈形成可归档知识 change。
|
|
217
|
-
- **C-code-review** — 代码审查:将 commit、branch、tag、merge-base 或 PR 解析为本地不可变固定点,执行隔离的标准轴与规范轴审查并持久化可恢复报告。
|
|
218
|
-
- **D-diagnose-bugs** — 诊断 Bug:先建立会在精确症状上变红的紧凑反馈回路,再通过最小化、排名假设和单变量探针确认根因,输出修复契约而不实施生产修复。
|
|
219
|
-
- **E-eli5** — 零基础新生解释:面向刚上大一、没有专业背景的读者解释一个主题;用 Markdown 和 ASCII 图解说明概念、数据与调用如何流动。
|
|
220
|
-
- **E-engineering-cognitive-mentor** — 工程认知导师:面向 Bug、项目源码、需求技术方案、架构设计与陌生技术领域的非执行型认知指导 Work;以证据、因果 Why、候选方案对比和逐轮澄清帮助用户形成可复述理解,并将完整问答轨迹持续持久化到当前 change。
|
|
221
|
-
- **G-grill-with-docs** — 设计访谈(带文档):以完整 frontier 逐轮推进设计树,直到每个决策分支都已关闭并获得用户共识,同时持续维护当前 change 的设计树、日志、领域上下文和架构决策。
|
|
222
|
-
- **I-implement** — 实现:基于 Ready Ticket 或获批小型 Spec 执行设计检查、TDD、动态派单、双轴审查、按 Goal Plan 选择的 current workspace 或 Ticket worktree 提交、直接父分支或候选合并验证和 Lead Evidence 回写。
|
|
223
|
-
- **I-init-setup** — 初始化设置:初始化 SpecDev 的语言、配置、全局状态、本地 change 追踪、领域知识布局、验证命令和并发治理。
|
|
224
|
-
- **P-goal-plan** — 目标规划:在跨 Ticket 协调复杂度需要时,以固定 Lead、动态派单、DAG/Gate 和候选合并门禁生成决策完备且可恢复的执行计划。
|
|
225
|
-
- **P-prototype** — 原型:在获授权的临时 branch/worktree 中构建一次性 Logic 或 UI 原型,回答一个明确设计问题并持久化答案、资产定位和清理状态。
|
|
226
|
-
- **R-review-architecture** — 架构审查:从用户指定范围或 Git 热点扫描代码库的深化机会,以持久化可视化 HTML 呈现候选,并对用户选择的一个方案运行设计树访谈。
|
|
227
|
-
- **S-spec** — 编写 Spec:综合已知事实、设计决定、诊断与代码现状,产出以外部行为和验收合同为权威的 Ready Spec。
|
|
228
|
-
- **T-tickets** — 拆分 Tickets:将 Spec、计划或已确认对话拆成曳光弹式垂直切片;每个 Ticket 决策完备、可独立验证、适配单一上下文,并建立阻塞 DAG、路径所有权和执行就绪门禁。
|
|
229
|
-
- **T-triage** — 请求分诊:把远程 Issue、URL、文件或对话冻结为本地来源工件,完成风险分诊与路由,并在本地 change 完成后受控回写和关闭支持的远程 Issue。
|
|
230
|
-
- **W-wayfinder** — 寻路:为超出单次会话且路径尚不可见的工作建立本地共享地图,逐个解决 research、prototype、grilling 或 task Ticket,直到目的地路线决策完备。
|
|
231
|
-
|
|
232
|
-
<!-- AUTO-INDEX-END -->
|
|
233
|
-
|
|
234
|
-
## Common 目录
|
|
235
|
-
|
|
236
|
-
- 总览:`<Path>{roots.workflows}/specdev/common/README.md</Path>`
|
|
237
|
-
- Rules:`<Path>{roots.workflows}/specdev/common/rules/</Path>`
|
|
238
|
-
- Schemas:`<Path>{roots.workflows}/specdev/common/schemas/</Path>`
|
|
239
|
-
- Tools:`<Path>{roots.workflows}/specdev/common/tools/</Path>`
|
|
240
|
-
- Skills:`<Path>{roots.workflows}/specdev/common/skills/</Path>`
|
|
241
|
-
|
|
242
|
-
## 自动校验
|
|
243
|
-
|
|
244
|
-
校验一个 change:
|
|
245
|
-
|
|
246
|
-
```bash
|
|
247
|
-
node <Path>{roots.workflows}/specdev/common/tools/validate-specdev.mjs</Path> \
|
|
248
|
-
--stage <triage|diagnosis|grill|eli5|spec|tickets|goal-plan|implement|review|prototype|wayfinder|complete> \
|
|
249
|
-
<Path>{roots.state}/specdev/changes/{change}</Path>
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
校验工作流包:
|
|
22
|
+
## Work 激活
|
|
253
23
|
|
|
254
|
-
|
|
255
|
-
node <Path>{roots.workflows}/specdev/common/tools/validate-specdev.mjs</Path> --self-check
|
|
256
|
-
```
|
|
24
|
+
用户明确激活 SpecDev 或其中某个 Work 后,读取 `<Path>{roots.workflows}/specdev/README.md</Path>` 取得 Work 条目、启动、恢复、状态、所有权和副作用合同,再进入目标 Work。仅发现本索引或读取永久知识不加载该合同。
|
|
@@ -9,6 +9,8 @@ keywords: [目标规划, Lead, Subagent, DAG, Gate, Wave, worktree, candidate-me
|
|
|
9
9
|
|
|
10
10
|
# 目标规划
|
|
11
11
|
|
|
12
|
+
> 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
|
|
13
|
+
|
|
12
14
|
Goal Plan 只拥有单个 Ticket 无法独立决定的事情:整体 Outcome、跨 Ticket 顺序与并发、共享所有权、里程碑 Gate、动态派单边界、父分支集成、迁移/发布顺序、偏差升级和恢复。Ticket 继续拥有局部实现合同。
|
|
13
15
|
|
|
14
16
|
每次 Goal Plan 都采用 `lead-directed`:当前主会话是唯一 Lead,负责计划、SpecDev 状态、Evidence、派单、验收、父分支推进和最终回复。形成 Goal Plan 时必须询问是否开启 worktree 开发,默认不开启;选择写入当前 Goal Plan,不修改全局配置。不开启时 Ticket 严格串行,允许动态派遣 implementation subagent,但同一时间只有一个 implementation owner 可写当前 workspace;开启时沿用每 Ticket 独立 worktree 与 candidate-merge。
|
|
@@ -9,6 +9,8 @@ keywords: [architecture, review, module, interface, depth, seam, adapter, levera
|
|
|
9
9
|
|
|
10
10
|
# 改善代码库架构
|
|
11
11
|
|
|
12
|
+
> 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
|
|
13
|
+
|
|
12
14
|
揭示架构摩擦,提出**深化机会**——将 shallow module 转变为 deep module 的重构。目标是可测试性和 AI 可导航性。
|
|
13
15
|
|
|
14
16
|
本 work 基于项目领域模型,并建立在共享设计词汇之上:
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
# SpecDev Activation Contract
|
|
2
|
+
|
|
3
|
+
本合同只在用户明确激活 SpecDev Work 后读取。它定义所有 Works 共享的启动、恢复、状态、所有权、路由和验证规则;具体 Work 仍只加载当前步骤需要的分支文件与共享规则。
|
|
4
|
+
|
|
5
|
+
SpecDev 将“理解、决定、规划、执行、验证、沉淀”拆成职责清晰的工件链。目标不是让文档尽可能长,而是让每一层拥有明确权威,并让后续模型无需重新决定前一层已经锁定的事项。
|
|
6
|
+
|
|
7
|
+
## 运行时根
|
|
8
|
+
|
|
9
|
+
- 工作流根:`<Path>{roots.workflows}/specdev/</Path>`
|
|
10
|
+
- 状态根:`<Path>{roots.state}/specdev/</Path>`
|
|
11
|
+
|
|
12
|
+
任何具体文件或目录引用必须遵守 `<Path>{roots.workflows}/specdev/common/rules/path-reference-contract.md</Path>`。禁止内部相对链接、裸文件名和机器绝对路径。
|
|
13
|
+
|
|
14
|
+
## 工件链
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
远程 Issue、指定内容或对话
|
|
18
|
+
↓
|
|
19
|
+
Triage 冻结为本地 Source
|
|
20
|
+
↓
|
|
21
|
+
Diagnose / Grill / Wayfinder / Prototype / Code Review / Architecture Review
|
|
22
|
+
↓
|
|
23
|
+
Spec 外部行为、范围、验收合同与关键约束
|
|
24
|
+
↓
|
|
25
|
+
Ticket 单一垂直切片的决策完备微计划
|
|
26
|
+
↓
|
|
27
|
+
Tickets Map DAG、合同覆盖、Ready 与并行投影
|
|
28
|
+
↓
|
|
29
|
+
Goal Plan 仅在需要时编排跨 Ticket Gate、Wave、owner 与恢复
|
|
30
|
+
↓
|
|
31
|
+
Implement 在既定契约内设计、TDD、审查、验证和交接
|
|
32
|
+
↓
|
|
33
|
+
Evidence 实际修改、命令、结果、偏差和残余风险
|
|
34
|
+
↓
|
|
35
|
+
Triage 本地完成后按确认回写/关闭支持的远程 Issue
|
|
36
|
+
↓
|
|
37
|
+
Archive 归档历史并将经验证知识提升为当前长期知识
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
核心状态工件:
|
|
41
|
+
|
|
42
|
+
- `<Path>{roots.state}/specdev/changes/{change}/source.md</Path>`
|
|
43
|
+
- `<Path>{roots.state}/specdev/changes/{change}/triage.md</Path>`
|
|
44
|
+
- `<Path>{roots.state}/specdev/changes/{change}/spec.md</Path>`
|
|
45
|
+
- `<Path>{roots.state}/specdev/changes/{change}/ticket/</Path>`
|
|
46
|
+
- `<Path>{roots.state}/specdev/changes/{change}/tickets-map.md</Path>`
|
|
47
|
+
- `<Path>{roots.state}/specdev/changes/{change}/goal-plan.md</Path>`
|
|
48
|
+
- `<Path>{roots.state}/specdev/changes/{change}/design-tree.json</Path>`
|
|
49
|
+
- `<Path>{roots.state}/specdev/changes/{change}/wayfinder-map.md</Path>`
|
|
50
|
+
- `<Path>{roots.state}/specdev/changes/{change}/investigation/</Path>`
|
|
51
|
+
- `<Path>{roots.state}/specdev/changes/{change}/evidence/</Path>`
|
|
52
|
+
- `<Path>{roots.state}/specdev/changes/{change}/reviews/</Path>`
|
|
53
|
+
- `<Path>{roots.state}/specdev/changes/{change}/prototypes/</Path>`
|
|
54
|
+
- `<Path>{roots.state}/specdev/changes/{change}/questionnaires/</Path>`
|
|
55
|
+
|
|
56
|
+
工件职责和冲突裁决位于 `<Path>{roots.workflows}/specdev/common/rules/artifact-contract.md</Path>`。
|
|
57
|
+
|
|
58
|
+
## 持久化约定
|
|
59
|
+
|
|
60
|
+
`speculo init` 创建固定状态骨架:
|
|
61
|
+
|
|
62
|
+
- 全局状态:`<Path>{roots.state}/specdev/status.json</Path>`
|
|
63
|
+
- 活跃 change:`<Path>{roots.state}/specdev/changes/</Path>`
|
|
64
|
+
- 历史归档:`<Path>{roots.state}/specdev/archive/</Path>`
|
|
65
|
+
|
|
66
|
+
刷新时 CLI 依据 `<Path>{roots.workflows}/specdev/runtime-contract.json</Path>` 处理持久化数据:配置使用 baseline 三方合并,登记的状态 schema 使用显式 migrator,其他 runtime 文件按字节保留。只有字段删除或结构迁移时才在 `<Path>{roots.state}/back/</Path>` 写入 targeted backup;冲突在替换 active 安装前阻塞。`<Path>{roots.state}/back/</Path>`、`<Path>{roots.state}/install.json</Path>`、`<Path>{roots.state}/managed.json</Path>` 与 `<Path>{roots.state}/baselines/</Path>` 均不属于 SpecDev 写入 namespace。
|
|
67
|
+
|
|
68
|
+
初始化设置 work 首次运行时生成配置并创建空的永久 namespace:
|
|
69
|
+
|
|
70
|
+
- 全局配置:`<Path>{roots.state}/specdev/config.json</Path>`
|
|
71
|
+
- 追踪规则:`<Path>{roots.state}/specdev/.config/tracking.md</Path>`
|
|
72
|
+
- 领域布局:`<Path>{roots.state}/specdev/.config/domain-layout.md</Path>`
|
|
73
|
+
- 永久 ADR:`<Path>{roots.state}/specdev/adr/</Path>`
|
|
74
|
+
- 永久领域上下文:`<Path>{roots.state}/specdev/context/</Path>`
|
|
75
|
+
- 永久研究:`<Path>{roots.state}/specdev/research/</Path>`
|
|
76
|
+
|
|
77
|
+
初始化只保证永久目录存在,不写知识内容。只有 A-archive-and-consolidate 在 change 完成、实现证据验证、毕业评估和用户确认后,才能创建、合并或改写这些永久 namespace 中的内容;其他 Works 只读。
|
|
78
|
+
|
|
79
|
+
单个 change 可以包含:
|
|
80
|
+
|
|
81
|
+
- `<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>`
|
|
82
|
+
- `<Path>{roots.state}/specdev/changes/{change}/source.md</Path>`
|
|
83
|
+
- `<Path>{roots.state}/specdev/changes/{change}/triage.md</Path>`
|
|
84
|
+
- `<Path>{roots.state}/specdev/changes/{change}/diagnosis.md</Path>`
|
|
85
|
+
- `<Path>{roots.state}/specdev/changes/{change}/diagnostics/</Path>`
|
|
86
|
+
- `<Path>{roots.state}/specdev/changes/{change}/CONTEXT.md</Path>`
|
|
87
|
+
- `<Path>{roots.state}/specdev/changes/{change}/ADR.md</Path>`
|
|
88
|
+
- `<Path>{roots.state}/specdev/changes/{change}/LOG.md</Path>`
|
|
89
|
+
- `<Path>{roots.state}/specdev/changes/{change}/design-tree.json</Path>`
|
|
90
|
+
- `<Path>{roots.state}/specdev/changes/{change}/spec.md</Path>`
|
|
91
|
+
- `<Path>{roots.state}/specdev/changes/{change}/ticket/</Path>`
|
|
92
|
+
- `<Path>{roots.state}/specdev/changes/{change}/tickets-map.md</Path>`
|
|
93
|
+
- `<Path>{roots.state}/specdev/changes/{change}/goal-plan.md</Path>`
|
|
94
|
+
- `<Path>{roots.state}/specdev/changes/{change}/wayfinder-map.md</Path>`
|
|
95
|
+
- `<Path>{roots.state}/specdev/changes/{change}/investigation/</Path>`
|
|
96
|
+
- `<Path>{roots.state}/specdev/changes/{change}/investigation/comments/</Path>`
|
|
97
|
+
- `<Path>{roots.state}/specdev/changes/{change}/architecture-review.md</Path>`
|
|
98
|
+
- `<Path>{roots.state}/specdev/changes/{change}/architecture-review.html</Path>`
|
|
99
|
+
- `<Path>{roots.state}/specdev/changes/{change}/evidence/</Path>`
|
|
100
|
+
- `<Path>{roots.state}/specdev/changes/{change}/reviews/</Path>`
|
|
101
|
+
- `<Path>{roots.state}/specdev/changes/{change}/prototypes/</Path>`
|
|
102
|
+
- `<Path>{roots.state}/specdev/changes/{change}/questionnaires/</Path>`
|
|
103
|
+
|
|
104
|
+
## 全局治理原则
|
|
105
|
+
|
|
106
|
+
1. **先发现、后询问**:仓库、配置、schema、测试和文档能回答的事实先探索;只询问真正影响行为、架构、风险、范围、迁移或验收的偏好。
|
|
107
|
+
2. **规划深度随风险增长**:Lite、Standard、Deep 由复杂度和事故半径决定,不由文档长度决定。
|
|
108
|
+
3. **Ticket 是微型计划**:每个 Ready Ticket 决策完备,但不展开逐行代码。
|
|
109
|
+
4. **Goal Plan 按需出现**:只在跨 Ticket 编排复杂度需要时生成,不以固定章节数量作为质量标准。
|
|
110
|
+
5. **证据优先**:每个验收合同、Ticket 和 Gate 都必须有可重复验证与 Evidence。
|
|
111
|
+
6. **路径所有权**:并发实现者只能修改授权项目路径;shared path 有唯一 owner。
|
|
112
|
+
7. **偏差显式化**:计划与事实冲突时停止、记录、修订,不静默扩大范围或改写契约。
|
|
113
|
+
8. **状态单一来源**:Ticket frontmatter 是单 Ticket 状态权威;Map 和 Goal Plan 是投影与编排。
|
|
114
|
+
9. **知识以当前真相为目标**:归档保留历史,永久知识只保留仍真实且经实现验证的结论。
|
|
115
|
+
10. **恢复依赖权威工件**:跨 Work 或 Agent 边界时同步 active change 的 `current_work`,成功完成后去重更新 `works_run`,返回下一 Work 和权威工件的完整路径。
|
|
116
|
+
11. **本地执行权威**:远程 Issue/PR/URL 只作为来源或完成投影;Spec、Ticket、Map、Goal Plan、Evidence 和状态始终以本地工件为准。
|
|
117
|
+
12. **完成与归档分离**:本地完成按 change completion 合同决定;远程 close 失败不回滚完成,但必须 reconcile 或 waive 后才归档。
|
|
118
|
+
13. **Lead 与隔离正交**:Lead 固定拥有 SpecDev 状态、Evidence 与父分支;是否派遣 subagent 由 Lead 动态决定。Goal Plan 创建时询问 Ticket 是否开启 worktree,默认不开启;选择只作用于当前 Goal Plan。
|
|
119
|
+
14. **策略化验收**:current 模式使用当前 workspace 严格串行、direct-parent 验证;required 模式使用 source worktree 与 parent-candidate。只有 required 模式创建独立 Ticket worktree。
|
|
120
|
+
|
|
121
|
+
共享规则:
|
|
122
|
+
|
|
123
|
+
- `<Path>{roots.workflows}/specdev/common/rules/planning-principles.md</Path>`
|
|
124
|
+
- `<Path>{roots.workflows}/specdev/common/rules/artifact-contract.md</Path>`
|
|
125
|
+
- `<Path>{roots.workflows}/specdev/common/rules/readiness-and-depth.md</Path>`
|
|
126
|
+
- `<Path>{roots.workflows}/specdev/common/rules/path-ownership.md</Path>`
|
|
127
|
+
- `<Path>{roots.workflows}/specdev/common/rules/evidence-and-verification.md</Path>`
|
|
128
|
+
- `<Path>{roots.workflows}/specdev/common/rules/deviation-control.md</Path>`
|
|
129
|
+
- `<Path>{roots.workflows}/specdev/common/rules/path-reference-contract.md</Path>`
|
|
130
|
+
- `<Path>{roots.workflows}/specdev/common/rules/codebase-design.md</Path>`
|
|
131
|
+
- `<Path>{roots.workflows}/specdev/common/rules/change-completion.md</Path>`
|
|
132
|
+
|
|
133
|
+
## 启动协议
|
|
134
|
+
|
|
135
|
+
1. 解析 workflow 和 state roots。
|
|
136
|
+
2. 读取 `<Path>{roots.state}/specdev/config.json</Path>`;不存在时运行 `<Path>{roots.workflows}/specdev/I-init-setup/I-init-setup.md</Path>`。
|
|
137
|
+
3. 读取 `<Path>{roots.state}/specdev/status.json</Path>`:用户指定 change 优先;唯一活跃 change 直接使用;无活跃时创建;多个候选时请求消歧。
|
|
138
|
+
4. 若当前 change 已有非空 `current_work`,先恢复或显式结束该 Work;否则将 `current_work` 设置为本次 work id。
|
|
139
|
+
5. 只加载当前步骤需要的 work 子文件和共享规则。
|
|
140
|
+
6. 完成后写入产物、运行适用校验、更新状态和 `works_run`。
|
|
141
|
+
|
|
142
|
+
Change 从 active/blocked 转为 completed 时加载 `<Path>{roots.workflows}/specdev/common/rules/change-completion.md</Path>`:有 Goal Plan 时由其中唯一 Lead 拥有转换;无 Goal Plan 的 Ticket/Direct Spec 由当前 I owner 拥有;非实现型终点由最终验收工件 owner 拥有。Archive 不补造 completed。
|
|
143
|
+
|
|
144
|
+
## 状态字段
|
|
145
|
+
|
|
146
|
+
`<Path>{roots.state}/specdev/status.json</Path>` 使用全局 schema v5;Spec/Ticket/Tickets Map 继续使用各自 schema v3,config 使用 schema v5,Goal Plan 使用 schema v6,`<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>` 使用 schema v6:
|
|
147
|
+
|
|
148
|
+
- `schema_version`(数字):全局状态 schema 版本,固定为 `5`。
|
|
149
|
+
- `workflow`(字符串):workflow 标识,固定为 `"specdev"`。
|
|
150
|
+
- `active`(对象数组):当前活跃 change;每项包含:
|
|
151
|
+
- `change`(字符串):change 目录名,格式 `"YYYY-MM-DD-<kebab-topic>"`。
|
|
152
|
+
- `current_work`(字符串或 null):当前 work id,如 `"specdev/implement"`;无运行中 work 时为 null。
|
|
153
|
+
- `works_run`(去重字符串数组):已成功完成的 work id;重复运行同一 work 不追加副本。
|
|
154
|
+
- `claimed_investigations`(对象数组,可选):并行调查领取记录;每项包含 `id`、`owner`、可选 `session` 和 `claimed_at`。
|
|
155
|
+
- `archived`(去重字符串数组):已归档 change 名称。详细归档时间、路径和 promotion 摘要只存在于 `<Path>{roots.state}/specdev/archive/YYYY-MM/{change}/.status.json</Path>`。
|
|
156
|
+
|
|
157
|
+
`active[].change` 必须唯一,且不得同时出现在 `archived`。开始 Work 时设置 `current_work`;暂停或可恢复阻塞时保留;成功完成时加入 `works_run` 并清空;取消时清空但不加入。逐次时间、结果和审计证据由 change 自有状态、Work 主产物、Evidence 或 LOG 承载,不写入全局索引。
|
|
158
|
+
|
|
159
|
+
`<Path>{roots.state}/specdev/config.json</Path>` 的 `execution.max_implementation_agents`、`max_integration_attempts` 和 planning 原型变体字段均为可配置正整数,初始化时写入默认值;仅 implementation subagent 受前者约束且不含 Lead,current workspace 仍保持单 writer 串行安全不变量;只读 review/research/test-observation agent 不设 SpecDev 数字上限。
|
|
160
|
+
|
|
161
|
+
`<Path>{roots.state}/specdev/changes/{change}/.status.json</Path>` 的 `worktrees` 保存 Ticket 级 `base_sha`、父分支、workspace/implementation/integration owner、workspace locator、implementation/source checkpoint、适用 candidate/result SHA、验证、E2E disposition 与生命周期状态。current 记录使用 `workspace_ref=current` 和 direct-parent;required 记录使用 source/parent-candidate。每个实现 Ticket 都有一条记录;父分支只有在对应策略的验证通过后推进。`removed` 是 required 集成后来源 branch/worktree 完成清理的终态,必须保留全部集成与 E2E 证据。
|
|
162
|
+
|
|
163
|
+
领域状态枚举:
|
|
164
|
+
|
|
165
|
+
- change:`active | blocked | completed | archived`
|
|
166
|
+
- Ticket:`draft | ready | in_progress | blocked | review | done | deviated | cancelled`
|
|
167
|
+
- Investigation status:`open | closed`
|
|
168
|
+
- Investigation resolution:`answered | out-of-scope | superseded | cancelled | null`
|
|
169
|
+
- Planning Depth:`lite | standard | deep`
|
|
170
|
+
- Worktree:`planned | active | review | integrating | integrated | removed | blocked`
|
|
171
|
+
|
|
172
|
+
## 路径分配
|
|
173
|
+
|
|
174
|
+
1. workflow 运行状态写入 `<Path>{roots.state}/specdev/</Path>`。
|
|
175
|
+
2. change 产物写入 `<Path>{roots.state}/specdev/changes/{change}/</Path>`。
|
|
176
|
+
3. 项目代码、测试和用户要求的项目文档写入项目路径;Evidence 仅保存项目相对指针。
|
|
177
|
+
4. 长期知识候选先在 change 内形成;只有 A 在完成证据、毕业评估和用户确认全部通过后,才提升到对应永久 namespace。
|
|
178
|
+
|
|
179
|
+
## 副作用边界
|
|
180
|
+
|
|
181
|
+
未经用户明确授权不得提交、推送、合并、删除来源 branch/worktree、部署、发布、移动归档、写入/关闭远程 Issue 或执行不可逆迁移。Ready Goal Plan/Ticket 执行必须明确取得 implementation commit 与所选 direct-parent/candidate integration/父分支更新授权;required 模式该授权包含 transient candidate checkout/branch 生命周期,不扩展到来源 cleanup、远端或生产动作。只读探索、change 工件生成和已授权验证可以进行。远程开发投影仅由 Triage reconcile 执行;Retro command 的 Speculo 反馈 Issue 是独立 command 边界。敏感值不得写入 `<Path>{roots.state}/specdev/</Path>`。
|
|
182
|
+
|
|
183
|
+
## 场景路由
|
|
184
|
+
|
|
185
|
+
| 场景 | 入口 | 正常出口 |
|
|
186
|
+
|---|---|---|
|
|
187
|
+
| 远程 Issue、URL、文件或对话摄入 | T-triage intake | D / G / W / P / S / C / T |
|
|
188
|
+
| 本地 change 完成且来源可关闭 | T-triage reconcile | A |
|
|
189
|
+
| 疑难 bug 或性能回归 | D-diagnose-bugs | S / T / I / R / W |
|
|
190
|
+
| 模糊但可通过决策访谈收敛 | G-grill-with-docs | P / S / T / W |
|
|
191
|
+
| 路径超出单次上下文 | W-wayfinder | G / P / D / S / T |
|
|
192
|
+
| 需要用代码回答逻辑/UI 问题 | P-prototype | G / S / T / I |
|
|
193
|
+
| 固定点 diff、branch 或 PR review | C-code-review | completed / T / S / G |
|
|
194
|
+
| 外部行为已清楚 | S-spec | T-tickets |
|
|
195
|
+
| Ready Spec 需要垂直切片 | T-tickets | P-goal-plan / I |
|
|
196
|
+
| 多 Ticket 协调 | P-goal-plan | I / Triage / A |
|
|
197
|
+
| Ready 执行 | I-implement | Triage / A / blocked / deviation |
|
|
198
|
+
| 架构健康扫描 | R-review-architecture | G / T |
|
|
199
|
+
|
|
200
|
+
同 change 下一阶段需要当前一手推理且上下文健康时继续;切换 repo/person/harness 或旁路时使用 `<Path>{roots.commands}/handoff.md</Path>`;严格限定且可独立派单时使用 Dispatch Packet;其他长上下文以权威工件路径恢复。平台不支持 clear/compact 时不虚构操作。
|
|
201
|
+
|
|
202
|
+
## Work 条目
|
|
203
|
+
|
|
204
|
+
<!-- AUTO-INDEX-START -->
|
|
205
|
+
|
|
206
|
+
- **A-archive-and-consolidate** — 归档与沉淀:校验本地完成与远程 reconcile 门,复用全局归档能力移动 completed change 并提升当前知识,或从代码访谈形成可归档知识 change。
|
|
207
|
+
- **C-code-review** — 代码审查:将 commit、branch、tag、merge-base 或 PR 解析为本地不可变固定点,执行隔离的标准轴与规范轴审查并持久化可恢复报告。
|
|
208
|
+
- **D-diagnose-bugs** — 诊断 Bug:先建立会在精确症状上变红的紧凑反馈回路,再通过最小化、排名假设和单变量探针确认根因,输出修复契约而不实施生产修复。
|
|
209
|
+
- **G-grill-with-docs** — 设计访谈(带文档):以完整 frontier 逐轮推进设计树,直到每个决策分支都已关闭并获得用户共识,同时持续维护当前 change 的设计树、日志、领域上下文和架构决策。
|
|
210
|
+
- **I-implement** — 实现:基于 Ready Ticket 或获批小型 Spec 执行设计检查、TDD、动态派单、双轴审查、按 Goal Plan 选择的 current workspace 或 Ticket worktree 提交、直接父分支或候选合并验证和 Lead Evidence 回写。
|
|
211
|
+
- **I-init-setup** — 初始化设置:初始化 SpecDev 的语言、配置、全局状态、本地 change 追踪、领域知识布局、验证命令和并发治理。
|
|
212
|
+
- **P-goal-plan** — 目标规划:在跨 Ticket 协调复杂度需要时,以固定 Lead、动态派单、DAG/Gate 和候选合并门禁生成决策完备且可恢复的执行计划。
|
|
213
|
+
- **P-prototype** — 原型:在获授权的临时 branch/worktree 中构建一次性 Logic 或 UI 原型,回答一个明确设计问题并持久化答案、资产定位和清理状态。
|
|
214
|
+
- **R-review-architecture** — 架构审查:从用户指定范围或 Git 热点扫描代码库的深化机会,以持久化可视化 HTML 呈现候选,并对用户选择的一个方案运行设计树访谈。
|
|
215
|
+
- **S-spec** — 编写 Spec:综合已知事实、设计决定、诊断与代码现状,产出以外部行为和验收合同为权威的 Ready Spec。
|
|
216
|
+
- **T-tickets** — 拆分 Tickets:将 Spec、计划或已确认对话拆成曳光弹式垂直切片;每个 Ticket 决策完备、可独立验证、适配单一上下文,并建立阻塞 DAG、路径所有权和执行就绪门禁。
|
|
217
|
+
- **T-triage** — 请求分诊:把远程 Issue、URL、文件或对话冻结为本地来源工件,完成风险分诊与路由,并在本地 change 完成后受控回写和关闭支持的远程 Issue。
|
|
218
|
+
- **W-wayfinder** — 寻路:为超出单次会话且路径尚不可见的工作建立本地共享地图,逐个解决 research、prototype、grilling 或 task Ticket,直到目的地路线决策完备。
|
|
219
|
+
|
|
220
|
+
<!-- AUTO-INDEX-END -->
|
|
221
|
+
|
|
222
|
+
## Common 目录
|
|
223
|
+
|
|
224
|
+
- 总览:`<Path>{roots.workflows}/specdev/common/README.md</Path>`
|
|
225
|
+
- Rules:`<Path>{roots.workflows}/specdev/common/rules/</Path>`
|
|
226
|
+
- Schemas:`<Path>{roots.workflows}/specdev/common/schemas/</Path>`
|
|
227
|
+
- Tools:`<Path>{roots.workflows}/specdev/common/tools/</Path>`
|
|
228
|
+
- Skills:`<Path>{roots.workflows}/specdev/common/skills/</Path>`
|
|
229
|
+
|
|
230
|
+
## 自动校验
|
|
231
|
+
|
|
232
|
+
校验一个 change:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
node <Path>{roots.workflows}/specdev/common/tools/validate-specdev.mjs</Path> \
|
|
236
|
+
--stage <triage|diagnosis|grill|eli5|spec|tickets|goal-plan|implement|review|prototype|wayfinder|complete> \
|
|
237
|
+
<Path>{roots.state}/specdev/changes/{change}</Path>
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
校验工作流包:
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
node <Path>{roots.workflows}/specdev/common/tools/validate-specdev.mjs</Path> --self-check
|
|
244
|
+
```
|
|
@@ -9,6 +9,8 @@ keywords: [spec, PRD, 用户故事, 验收合同, 接缝, 范围, readiness]
|
|
|
9
9
|
|
|
10
10
|
# 编写 Spec
|
|
11
11
|
|
|
12
|
+
> 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
|
|
13
|
+
|
|
12
14
|
本 work 以“综合已有上下文”为主,不启动宽泛访谈。它保留原有的代码库探索、领域词汇、ADR 约束、测试接缝设计和用户确认能力,但将确认限制为真正影响外部行为或验证的高价值问题。
|
|
13
15
|
|
|
14
16
|
Spec 决定“为什么、为谁、系统应表现为何”。它可以锁定影响公共接口、数据、兼容、安全或验收的实现约束,但不写逐文件施工计划。
|
|
@@ -9,6 +9,8 @@ keywords: [tickets, 拆分, 垂直切片, 阻塞, 曳光弹, decision-complete,
|
|
|
9
9
|
|
|
10
10
|
# 拆分 Tickets
|
|
11
11
|
|
|
12
|
+
> 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
|
|
13
|
+
|
|
12
14
|
Ticket 是**决策完备的微型执行计划**:它消除执行者在目标、范围、公共契约、关键顺序和验收上的关键决策,但不展开逐行代码、局部变量或可从现有惯例自然推导的实现细节。
|
|
13
15
|
|
|
14
16
|
本 work 保留原有能力:代码库探索、prefactor 识别、曳光弹垂直切片、真实阻塞边、用户粒度核对、宽重构的 expand-contract 排序、Ticket 独立文件和总体 Tickets Map。
|
|
@@ -9,6 +9,8 @@ keywords: [triage, 摄入, import, issue, reconcile, close, 风险, 路由]
|
|
|
9
9
|
|
|
10
10
|
# 请求分诊
|
|
11
11
|
|
|
12
|
+
> 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
|
|
13
|
+
|
|
12
14
|
Triage 是 SpecDev 唯一的远程摄入与关闭边界。开发期间,`<Path>{roots.state}/specdev/changes/{change}/source.md</Path>`、`<Path>{roots.state}/specdev/changes/{change}/triage.md</Path>`、Spec、Ticket、Map、Goal Plan、Evidence 和状态文件是唯一权威;远程系统只保存原始请求以及经确认后的完成通知。
|
|
13
15
|
|
|
14
16
|
## 模式
|
|
@@ -18,7 +20,7 @@ Triage 是 SpecDev 唯一的远程摄入与关闭边界。开发期间,`<Path>
|
|
|
18
20
|
|
|
19
21
|
## 共同启动
|
|
20
22
|
|
|
21
|
-
1. 解析 roots
|
|
23
|
+
1. 解析 roots,按 `<Path>{roots.workflows}/specdev/README.md</Path>` 读取全局状态和 change 状态。
|
|
22
24
|
2. Intake 可以创建 change;reconcile 必须选择一个已存在的 completed change。
|
|
23
25
|
3. 若该 change 的 `current_work` 为 null,设置为 `specdev/triage`;指向其他 Work 时先恢复或完成显式 handoff。
|
|
24
26
|
4. 重读已有 `<Path>{roots.state}/specdev/changes/{change}/source.md</Path>` 与 `<Path>{roots.state}/specdev/changes/{change}/triage.md</Path>`,不覆盖已冻结的来源。
|
|
@@ -9,6 +9,8 @@ keywords: [wayfinder, 寻路, shared-map, research, prototype, grilling, task,
|
|
|
9
9
|
|
|
10
10
|
# 寻路
|
|
11
11
|
|
|
12
|
+
> 激活本 Work 后,先读取 `<Path>{roots.workflows}/specdev/README.md</Path>`,再执行本入口。
|
|
13
|
+
|
|
12
14
|
一个模糊的想法出现了——太大而无法放入单个 Agent 会话,且从当前状态到**目的地**的路径尚不可见。寻路就是找到那条路,而非冲向目标。此 work 在 change state 中绘制一张**共享地图**,然后逐个处理其 Tickets,直到路径变得清晰。
|
|
13
15
|
|
|
14
16
|
目的地可能是一份待移交和迭代的 Spec、一个在规划开始前需锁定的决策,或一项经说明允许在地图中完成的变更。命名目的地是第一步,它塑造每个 Ticket。
|
|
@@ -20,7 +20,6 @@ SpecDev 通过分层工件避免同一决策被多个模型反复重做。每个
|
|
|
20
20
|
| Evidence | `<Path>{roots.state}/specdev/changes/{change}/evidence/{ticket-id}.md</Path>` | 实际修改、命令、结果、验收映射、偏差、风险和提交引用 | 新的产品或架构决策 |
|
|
21
21
|
| 代码审查 | `<Path>{roots.state}/specdev/changes/{change}/reviews/CR-###.md</Path>` | 固定点、标准轴和规范轴 finding | 实施修复或合并两轴排名 |
|
|
22
22
|
| 原型记录 | `<Path>{roots.state}/specdev/changes/{change}/prototypes/{prototype-id}/record.md</Path>` | 一个问题、分支、资产、答案、promotion 和清理 | 生产实现或多个问题的计划 |
|
|
23
|
-
| 零基础新生图解 | `<Path>{roots.state}/specdev/changes/{change}/eli_index.md</Path>` 与 `<Path>{roots.state}/specdev/changes/{change}/<number>_<topic>.md</Path>` | 面向刚上大一、没有专业背景读者的 Markdown 与 ASCII 图解;索引按序号持续追加 | 产品决定、架构决定或实现授权 |
|
|
24
23
|
| Stakeholder 问卷 | `<Path>{roots.state}/specdev/changes/{change}/questionnaires/{slug}.md</Path>` | 第三方原始回答和恢复条件 | 未经转录确认的产品/架构决定 |
|
|
25
24
|
| Wayfinder 地图 | `<Path>{roots.state}/specdev/changes/{change}/wayfinder-map.md</Path>` | 目的地、说明、已关闭决策索引、战争迷雾和范围之外 | 开放 Ticket 正文或答案详情 |
|
|
26
25
|
| Wayfinder Ticket | `<Path>{roots.state}/specdev/changes/{change}/investigation/{investigation-id}.md</Path>` | 一个可精确陈述的问题、类型、阻塞和关闭状态 | 解决方案评论或交付目标 |
|