specops 0.2.5 → 0.3.2
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/.opencode/agent/specops-codebase-mapper.md +764 -0
- package/.opencode/agent/specops-debugger.md +1246 -0
- package/.opencode/agent/specops-executor.md +475 -0
- package/.opencode/agent/specops-integration-checker.md +443 -0
- package/.opencode/agent/specops-phase-researcher.md +547 -0
- package/.opencode/agent/specops-plan-checker.md +690 -0
- package/.opencode/agent/specops-planner.md +581 -0
- package/.opencode/agent/specops-project-researcher.md +354 -0
- package/.opencode/agent/specops-research-synthesizer.md +242 -0
- package/.opencode/agent/specops-roadmapper.md +642 -0
- package/.opencode/agent/specops-work-verifier.md +573 -0
- package/.opencode/references/checkpoints.md +776 -0
- package/.opencode/references/continuation-format.md +249 -0
- package/.opencode/references/decimal-phase-calculation.md +65 -0
- package/.opencode/references/git-integration.md +248 -0
- package/.opencode/references/git-planning-commit.md +38 -0
- package/.opencode/references/model-profile-resolution.md +34 -0
- package/.opencode/references/model-profiles.md +92 -0
- package/.opencode/references/phase-argument-parsing.md +61 -0
- package/.opencode/references/planning-config.md +196 -0
- package/.opencode/references/questioning.md +145 -0
- package/.opencode/references/tdd.md +263 -0
- package/.opencode/references/ui-brand.md +160 -0
- package/.opencode/references/verification-patterns.md +612 -0
- package/.opencode/templates/DEBUG.md +164 -0
- package/.opencode/templates/UAT.md +180 -0
- package/.opencode/templates/VALIDATION.md +76 -0
- package/.opencode/templates/codebase/architecture.md +255 -0
- package/.opencode/templates/codebase/concerns.md +310 -0
- package/.opencode/templates/codebase/conventions.md +307 -0
- package/.opencode/templates/codebase/integrations.md +280 -0
- package/.opencode/templates/codebase/stack.md +186 -0
- package/.opencode/templates/codebase/structure.md +285 -0
- package/.opencode/templates/codebase/testing.md +480 -0
- package/.opencode/templates/context.md +221 -0
- package/.opencode/templates/continue-here.md +78 -0
- package/.opencode/templates/debug-subagent-prompt.md +91 -0
- package/.opencode/templates/discovery.md +147 -0
- package/.opencode/templates/milestone-archive.md +123 -0
- package/.opencode/templates/milestone.md +115 -0
- package/.opencode/templates/phase-prompt.md +333 -0
- package/.opencode/templates/planner-subagent-prompt.md +117 -0
- package/.opencode/templates/project.md +184 -0
- package/.opencode/templates/requirements.md +130 -0
- package/.opencode/templates/research-project/ARCHITECTURE.md +204 -0
- package/.opencode/templates/research-project/FEATURES.md +147 -0
- package/.opencode/templates/research-project/PITFALLS.md +200 -0
- package/.opencode/templates/research-project/STACK.md +120 -0
- package/.opencode/templates/research-project/SUMMARY.md +170 -0
- package/.opencode/templates/research.md +278 -0
- package/.opencode/templates/retrospective.md +54 -0
- package/.opencode/templates/roadmap.md +202 -0
- package/.opencode/templates/state.md +176 -0
- package/.opencode/templates/summary-complex.md +59 -0
- package/.opencode/templates/summary-minimal.md +41 -0
- package/.opencode/templates/summary-standard.md +48 -0
- package/.opencode/templates/summary.md +248 -0
- package/.opencode/templates/user-setup.md +311 -0
- package/.opencode/templates/verification-report.md +322 -0
- package/.opencode/workflows/add-phase.md +111 -0
- package/.opencode/workflows/add-tests.md +350 -0
- package/.opencode/workflows/add-todo.md +157 -0
- package/.opencode/workflows/audit-milestone.md +297 -0
- package/.opencode/workflows/check-todos.md +176 -0
- package/.opencode/workflows/cleanup.md +152 -0
- package/.opencode/workflows/complete-milestone.md +763 -0
- package/.opencode/workflows/diagnose-issues.md +219 -0
- package/.opencode/workflows/discovery-phase.md +288 -0
- package/.opencode/workflows/discuss-phase.md +542 -0
- package/.opencode/workflows/execute-phase.md +449 -0
- package/.opencode/workflows/execute-plan.md +447 -0
- package/.opencode/workflows/health.md +156 -0
- package/.opencode/workflows/help.md +489 -0
- package/.opencode/workflows/insert-phase.md +129 -0
- package/.opencode/workflows/list-phase-assumptions.md +178 -0
- package/.opencode/workflows/map-codebase.md +315 -0
- package/.opencode/workflows/new-milestone.md +382 -0
- package/.opencode/workflows/new-project.md +1116 -0
- package/.opencode/workflows/pause-work.md +122 -0
- package/.opencode/workflows/plan-milestone-gaps.md +274 -0
- package/.opencode/workflows/plan-phase.md +569 -0
- package/.opencode/workflows/progress.md +381 -0
- package/.opencode/workflows/quick.md +453 -0
- package/.opencode/workflows/remove-phase.md +154 -0
- package/.opencode/workflows/research-phase.md +73 -0
- package/.opencode/workflows/resume-project.md +304 -0
- package/.opencode/workflows/set-profile.md +80 -0
- package/.opencode/workflows/settings.md +213 -0
- package/.opencode/workflows/transition.md +544 -0
- package/.opencode/workflows/update.md +219 -0
- package/.opencode/workflows/verify-phase.md +242 -0
- package/.opencode/workflows/verify-work.md +569 -0
- package/commands/specops/add-phase.md +43 -0
- package/commands/specops/add-tests.md +41 -0
- package/commands/specops/add-todo.md +47 -0
- package/commands/specops/audit-milestone.md +36 -0
- package/commands/specops/check-todos.md +45 -0
- package/commands/specops/cleanup.md +18 -0
- package/commands/specops/complete-milestone.md +136 -0
- package/commands/specops/debug.md +167 -0
- package/commands/specops/discuss-phase.md +83 -0
- package/commands/specops/execute-phase.md +41 -0
- package/commands/specops/health.md +22 -0
- package/commands/specops/help.md +22 -0
- package/commands/specops/insert-phase.md +32 -0
- package/commands/specops/join-discord.md +18 -0
- package/commands/specops/list-phase-assumptions.md +46 -0
- package/commands/specops/map-codebase.md +71 -0
- package/commands/specops/new-milestone.md +44 -0
- package/commands/specops/new-project.md +42 -0
- package/commands/specops/pause-work.md +38 -0
- package/commands/specops/plan-milestone-gaps.md +34 -0
- package/commands/specops/plan-phase.md +45 -0
- package/commands/specops/progress.md +24 -0
- package/commands/specops/quick.md +41 -0
- package/commands/specops/reapply-patches.md +111 -0
- package/commands/specops/remove-phase.md +31 -0
- package/commands/specops/research-phase.md +189 -0
- package/commands/specops/resume-work.md +40 -0
- package/commands/specops/set-profile.md +34 -0
- package/commands/specops/settings.md +36 -0
- package/commands/specops/update.md +37 -0
- package/commands/specops/verify-work.md +38 -0
- package/dist/__integration__/fixtures/generator.d.ts +4 -0
- package/dist/__integration__/fixtures/generator.js +1 -0
- package/dist/__integration__/mocks/server.d.ts +7 -0
- package/dist/__integration__/mocks/server.js +1 -0
- package/dist/__integration__/setup.d.ts +6 -0
- package/dist/__integration__/setup.js +1 -0
- package/dist/acceptance/lazyDetector.js +1 -1
- package/dist/acceptance/reporter.js +1 -1
- package/dist/acceptance/runner.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/context/index.js +1 -1
- package/dist/context/promptTemplate.js +1 -1
- package/dist/context/techContextLoader.js +1 -1
- package/dist/engine.d.ts +1 -0
- package/dist/engine.js +1 -1
- package/dist/evolution/distiller.js +1 -1
- package/dist/evolution/index.js +1 -1
- package/dist/evolution/memoryGraph.js +1 -1
- package/dist/evolution/selector.js +1 -1
- package/dist/evolution/signals.js +1 -1
- package/dist/evolution/solidify.js +1 -1
- package/dist/evolution/store.js +1 -1
- package/dist/evolution/types.js +1 -1
- package/dist/init.d.ts +4 -3
- package/dist/init.js +1 -1
- package/dist/machines/agentMachine.js +1 -1
- package/dist/machines/supervisorMachine.js +1 -1
- package/dist/persistence/schema.js +1 -1
- package/dist/persistence/stateFile.js +1 -1
- package/dist/plugin-engine.js +1 -1
- package/dist/plugin.js +1 -1
- package/dist/requirement-analysis/analyzers/repository-parser.d.ts +121 -0
- package/dist/requirement-analysis/analyzers/repository-parser.js +1 -0
- package/dist/requirement-analysis/generators/prd-generator.d.ts +90 -0
- package/dist/requirement-analysis/generators/prd-generator.js +1 -0
- package/dist/requirement-analysis/integrations/v1-integration.d.ts +73 -0
- package/dist/requirement-analysis/integrations/v1-integration.js +1 -0
- package/dist/requirement-analysis/tools/analyze-requirements.js +1 -0
- package/dist/requirement-analysis/types/analysis-result.d.ts +326 -0
- package/dist/requirement-analysis/types/analysis-result.js +1 -0
- package/dist/requirement-analysis/types/feature-mapping.d.ts +294 -0
- package/dist/requirement-analysis/types/feature-mapping.js +1 -0
- package/dist/requirement-analysis/types/index.d.ts +171 -0
- package/dist/requirement-analysis/types/index.js +1 -0
- package/dist/requirement-analysis/types/tech-stack.d.ts +213 -0
- package/dist/requirement-analysis/types/tech-stack.js +1 -0
- package/dist/requirement-analysis/utils/error-handler.d.ts +112 -0
- package/dist/requirement-analysis/utils/error-handler.js +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.js +1 -1
- package/dist/utils/id.js +1 -1
- package/package.json +4 -2
- package/skills/competitor-search/SKILL.md +169 -0
- package/skills/demand-analysis/SKILL.md +307 -0
- package/skills/feature-search/SKILL.md +182 -0
- package/skills/requirement-analysis/README.md +464 -0
- package/skills/requirement-analysis/SKILL.md +224 -0
- package/skills/requirement-analysis/templates/feature-mapping-template.json +210 -0
- package/skills/requirement-analysis/templates/prd-template.md +104 -0
- package/skills/tech-selection/SKILL.md +198 -0
- package/dist/__e2e__/01-state-engine.e2e.test.d.ts +0 -10
- package/dist/__e2e__/01-state-engine.e2e.test.js +0 -1
- package/dist/acceptance/lazyDetector.test.d.ts +0 -1
- package/dist/acceptance/lazyDetector.test.js +0 -1
- package/dist/acceptance/reporter.test.d.ts +0 -1
- package/dist/acceptance/reporter.test.js +0 -1
- package/dist/acceptance/runner.test.d.ts +0 -1
- package/dist/acceptance/runner.test.js +0 -1
- package/dist/context/promptTemplate.test.d.ts +0 -1
- package/dist/context/promptTemplate.test.js +0 -1
- package/dist/context/techContextLoader.test.d.ts +0 -1
- package/dist/context/techContextLoader.test.js +0 -1
- package/dist/machines/agentMachine.test.d.ts +0 -1
- package/dist/machines/agentMachine.test.js +0 -1
- package/dist/machines/supervisorMachine.test.d.ts +0 -1
- package/dist/machines/supervisorMachine.test.js +0 -1
- package/dist/persistence/stateFile.test.d.ts +0 -1
- package/dist/persistence/stateFile.test.js +0 -1
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# 验证报告模板
|
|
2
|
+
|
|
3
|
+
`.planning/phases/XX-name/{phase_num}-VERIFICATION.md` 的模板,用于记录阶段目标验证结果。
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 文件模板
|
|
8
|
+
|
|
9
|
+
```markdown
|
|
10
|
+
---
|
|
11
|
+
phase: XX-name
|
|
12
|
+
verified: YYYY-MM-DDTHH:MM:SSZ
|
|
13
|
+
status: passed | gaps_found | human_needed
|
|
14
|
+
score: N/M 必要项已验证
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
# 阶段 {X}: {Name} 验证报告
|
|
18
|
+
|
|
19
|
+
**阶段目标:** {ROADMAP.md 中的目标}
|
|
20
|
+
**验证时间:** {timestamp}
|
|
21
|
+
**状态:** {passed | gaps_found | human_needed}
|
|
22
|
+
|
|
23
|
+
## 目标达成情况
|
|
24
|
+
|
|
25
|
+
### 可观测事实
|
|
26
|
+
|
|
27
|
+
| # | 事实 | 状态 | 证据 |
|
|
28
|
+
|---|------|------|------|
|
|
29
|
+
| 1 | {must_haves 中的事实} | ✓ 已验证 | {确认依据} |
|
|
30
|
+
| 2 | {must_haves 中的事实} | ✗ 失败 | {问题描述} |
|
|
31
|
+
| 3 | {must_haves 中的事实} | ? 不确定 | {无法验证的原因} |
|
|
32
|
+
|
|
33
|
+
**得分:** {N}/{M} 项事实已验证
|
|
34
|
+
|
|
35
|
+
### 必需产物
|
|
36
|
+
|
|
37
|
+
| 产物 | 预期 | 状态 | 详情 |
|
|
38
|
+
|------|------|------|------|
|
|
39
|
+
| `src/components/Chat.tsx` | 消息列表组件 | ✓ 存在且有实质内容 | 导出 ChatList,渲染 Message[],无桩代码 |
|
|
40
|
+
| `src/app/api/chat/route.ts` | 消息 CRUD | ✗ 桩代码 | 文件存在但 POST 返回占位内容 |
|
|
41
|
+
| `prisma/schema.prisma` | Message 模型 | ✓ 存在且有实质内容 | 模型已定义所有字段 |
|
|
42
|
+
|
|
43
|
+
**产物:** {N}/{M} 已验证
|
|
44
|
+
|
|
45
|
+
### 关键连接验证
|
|
46
|
+
|
|
47
|
+
| 来源 | 目标 | 通过 | 状态 | 详情 |
|
|
48
|
+
|------|------|------|------|------|
|
|
49
|
+
| Chat.tsx | /api/chat | useEffect 中的 fetch | ✓ 已连接 | 第 23 行: `fetch('/api/chat')` 含响应处理 |
|
|
50
|
+
| ChatInput | /api/chat POST | onSubmit 处理器 | ✗ 未连接 | onSubmit 只调用了 console.log |
|
|
51
|
+
| /api/chat POST | 数据库 | prisma.message.create | ✗ 未连接 | 返回硬编码响应,无数据库调用 |
|
|
52
|
+
|
|
53
|
+
**连接:** {N}/{M} 已验证
|
|
54
|
+
|
|
55
|
+
## 需求覆盖
|
|
56
|
+
|
|
57
|
+
| 需求 | 状态 | 阻塞问题 |
|
|
58
|
+
|------|------|----------|
|
|
59
|
+
| {REQ-01}: {描述} | ✓ 已满足 | - |
|
|
60
|
+
| {REQ-02}: {描述} | ✗ 被阻塞 | API 路由是桩代码 |
|
|
61
|
+
| {REQ-03}: {描述} | ? 需人工 | 无法通过程序验证 WebSocket |
|
|
62
|
+
|
|
63
|
+
**覆盖率:** {N}/{M} 需求已满足
|
|
64
|
+
|
|
65
|
+
## 发现的反模式
|
|
66
|
+
|
|
67
|
+
| 文件 | 行号 | 模式 | 严重程度 | 影响 |
|
|
68
|
+
|------|------|------|----------|------|
|
|
69
|
+
| src/app/api/chat/route.ts | 12 | `// TODO: implement` | ⚠️ 警告 | 表明未完成 |
|
|
70
|
+
| src/components/Chat.tsx | 45 | `return <div>Placeholder</div>` | 🛑 阻塞 | 无实际内容渲染 |
|
|
71
|
+
| src/hooks/useChat.ts | - | 文件缺失 | 🛑 阻塞 | 预期的 hook 不存在 |
|
|
72
|
+
|
|
73
|
+
**反模式:** {N} 个 ({blockers} 个阻塞, {warnings} 个警告)
|
|
74
|
+
|
|
75
|
+
## 需要人工验证
|
|
76
|
+
|
|
77
|
+
{如果不需要人工验证:}
|
|
78
|
+
无需人工验证,所有可验证项已通过程序检查。
|
|
79
|
+
|
|
80
|
+
{如果需要人工验证:}
|
|
81
|
+
|
|
82
|
+
### 1. {测试名称}
|
|
83
|
+
**测试:** {操作步骤}
|
|
84
|
+
**预期:** {应该发生什么}
|
|
85
|
+
**为何需人工:** {为什么无法通过程序验证}
|
|
86
|
+
|
|
87
|
+
### 2. {测试名称}
|
|
88
|
+
**测试:** {操作步骤}
|
|
89
|
+
**预期:** {应该发生什么}
|
|
90
|
+
**为何需人工:** {为什么无法通过程序验证}
|
|
91
|
+
|
|
92
|
+
## 缺口总结
|
|
93
|
+
|
|
94
|
+
{如果没有缺口:}
|
|
95
|
+
**未发现缺口。** 阶段目标已达成,可以继续推进。
|
|
96
|
+
|
|
97
|
+
{如果发现缺口:}
|
|
98
|
+
|
|
99
|
+
### 关键缺口(阻塞进度)
|
|
100
|
+
|
|
101
|
+
1. **{缺口名称}**
|
|
102
|
+
- 缺失: {缺少什么}
|
|
103
|
+
- 影响: {为什么阻塞目标}
|
|
104
|
+
- 修复: {需要做什么}
|
|
105
|
+
|
|
106
|
+
2. **{缺口名称}**
|
|
107
|
+
- 缺失: {缺少什么}
|
|
108
|
+
- 影响: {为什么阻塞目标}
|
|
109
|
+
- 修复: {需要做什么}
|
|
110
|
+
|
|
111
|
+
### 非关键缺口(可延后)
|
|
112
|
+
|
|
113
|
+
1. **{缺口名称}**
|
|
114
|
+
- 问题: {什么问题}
|
|
115
|
+
- 影响: {影响有限,因为...}
|
|
116
|
+
- 建议: {现在修复还是延后}
|
|
117
|
+
|
|
118
|
+
## 建议修复计划
|
|
119
|
+
|
|
120
|
+
{如果发现缺口,生成修复计划建议:}
|
|
121
|
+
|
|
122
|
+
### {phase}-{next}-PLAN.md: {修复名称}
|
|
123
|
+
|
|
124
|
+
**目标:** {修复什么}
|
|
125
|
+
|
|
126
|
+
**任务:**
|
|
127
|
+
1. {修复缺口 1 的任务}
|
|
128
|
+
2. {修复缺口 2 的任务}
|
|
129
|
+
3. {验证任务}
|
|
130
|
+
|
|
131
|
+
**预估范围:** {小 / 中}
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
### {phase}-{next+1}-PLAN.md: {修复名称}
|
|
136
|
+
|
|
137
|
+
**目标:** {修复什么}
|
|
138
|
+
|
|
139
|
+
**任务:**
|
|
140
|
+
1. {任务}
|
|
141
|
+
2. {任务}
|
|
142
|
+
|
|
143
|
+
**预估范围:** {小 / 中}
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
## 验证元数据
|
|
148
|
+
|
|
149
|
+
**验证方法:** 目标反推(从阶段目标推导)
|
|
150
|
+
**必要项来源:** {PLAN.md frontmatter | 从 ROADMAP.md 目标推导}
|
|
151
|
+
**自动检查:** {N} 通过, {M} 失败
|
|
152
|
+
**需人工检查:** {N}
|
|
153
|
+
**总验证时间:** {duration}
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
*验证时间: {timestamp}*
|
|
157
|
+
*验证者: Claude (子代理)*
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## 指南
|
|
163
|
+
|
|
164
|
+
**状态值:**
|
|
165
|
+
- `passed` — 所有必要项已验证,无阻塞
|
|
166
|
+
- `gaps_found` — 发现一个或多个关键缺口
|
|
167
|
+
- `human_needed` — 自动检查通过但需要人工验证
|
|
168
|
+
|
|
169
|
+
**证据类型:**
|
|
170
|
+
- 存在性: "文件在路径,导出 X"
|
|
171
|
+
- 实质性: "N 行代码,包含模式 X, Y, Z"
|
|
172
|
+
- 连接性: "第 N 行: 连接 A 到 B 的代码"
|
|
173
|
+
- 失败: "缺失因为 X" 或 "桩代码因为 Y"
|
|
174
|
+
|
|
175
|
+
**严重程度:**
|
|
176
|
+
- 🛑 阻塞: 阻止目标达成,必须修复
|
|
177
|
+
- ⚠️ 警告: 表明未完成但不阻塞
|
|
178
|
+
- ℹ️ 信息: 值得注意但无问题
|
|
179
|
+
|
|
180
|
+
**修复计划生成:**
|
|
181
|
+
- 仅在 gaps_found 时生成
|
|
182
|
+
- 将相关修复归入单个计划
|
|
183
|
+
- 每个计划保持 2-3 个任务
|
|
184
|
+
- 每个计划包含验证任务
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## 示例
|
|
189
|
+
|
|
190
|
+
```markdown
|
|
191
|
+
---
|
|
192
|
+
phase: 03-chat
|
|
193
|
+
verified: 2025-01-15T14:30:00Z
|
|
194
|
+
status: gaps_found
|
|
195
|
+
score: 2/5 必要项已验证
|
|
196
|
+
---
|
|
197
|
+
|
|
198
|
+
# 阶段 3: 聊天界面 验证报告
|
|
199
|
+
|
|
200
|
+
**阶段目标:** 可用的聊天界面,用户可以发送和接收消息
|
|
201
|
+
**验证时间:** 2025-01-15T14:30:00Z
|
|
202
|
+
**状态:** gaps_found
|
|
203
|
+
|
|
204
|
+
## 目标达成情况
|
|
205
|
+
|
|
206
|
+
### 可观测事实
|
|
207
|
+
|
|
208
|
+
| # | 事实 | 状态 | 证据 |
|
|
209
|
+
|---|------|------|------|
|
|
210
|
+
| 1 | 用户可以看到已有消息 | ✗ 失败 | 组件渲染占位内容,非消息数据 |
|
|
211
|
+
| 2 | 用户可以输入消息 | ✓ 已验证 | 输入框存在且有 onChange 处理器 |
|
|
212
|
+
| 3 | 用户可以发送消息 | ✗ 失败 | onSubmit 处理器只有 console.log |
|
|
213
|
+
| 4 | 发送的消息出现在列表中 | ✗ 失败 | 发送后无状态更新 |
|
|
214
|
+
| 5 | 消息在刷新后持久化 | ? 不确定 | 无法验证,发送功能不工作 |
|
|
215
|
+
|
|
216
|
+
**得分:** 1/5 项事实已验证
|
|
217
|
+
|
|
218
|
+
### 必需产物
|
|
219
|
+
|
|
220
|
+
| 产物 | 预期 | 状态 | 详情 |
|
|
221
|
+
|------|------|------|------|
|
|
222
|
+
| `src/components/Chat.tsx` | 消息列表组件 | ✗ 桩代码 | 返回 `<div>Chat will be here</div>` |
|
|
223
|
+
| `src/components/ChatInput.tsx` | 消息输入 | ✓ 存在且有实质内容 | 表单含输入框、提交按钮、处理器 |
|
|
224
|
+
| `src/app/api/chat/route.ts` | 消息 CRUD | ✗ 桩代码 | GET 返回 [], POST 返回 { ok: true } |
|
|
225
|
+
| `prisma/schema.prisma` | Message 模型 | ✓ 存在且有实质内容 | Message 模型含 id, content, userId, createdAt |
|
|
226
|
+
|
|
227
|
+
**产物:** 2/4 已验证
|
|
228
|
+
|
|
229
|
+
### 关键连接验证
|
|
230
|
+
|
|
231
|
+
| 来源 | 目标 | 通过 | 状态 | 详情 |
|
|
232
|
+
|------|------|------|------|------|
|
|
233
|
+
| Chat.tsx | /api/chat GET | fetch | ✗ 未连接 | 组件中无 fetch 调用 |
|
|
234
|
+
| ChatInput | /api/chat POST | onSubmit | ✗ 未连接 | 处理器只记录日志,不发请求 |
|
|
235
|
+
| /api/chat GET | 数据库 | prisma.message.findMany | ✗ 未连接 | 返回硬编码 [] |
|
|
236
|
+
| /api/chat POST | 数据库 | prisma.message.create | ✗ 未连接 | 返回 { ok: true },无数据库调用 |
|
|
237
|
+
|
|
238
|
+
**连接:** 0/4 已验证
|
|
239
|
+
|
|
240
|
+
## 需求覆盖
|
|
241
|
+
|
|
242
|
+
| 需求 | 状态 | 阻塞问题 |
|
|
243
|
+
|------|------|----------|
|
|
244
|
+
| CHAT-01: 用户可以发送消息 | ✗ 被阻塞 | API POST 是桩代码 |
|
|
245
|
+
| CHAT-02: 用户可以查看消息 | ✗ 被阻塞 | 组件是占位内容 |
|
|
246
|
+
| CHAT-03: 消息持久化 | ✗ 被阻塞 | 无数据库集成 |
|
|
247
|
+
|
|
248
|
+
**覆盖率:** 0/3 需求已满足
|
|
249
|
+
|
|
250
|
+
## 发现的反模式
|
|
251
|
+
|
|
252
|
+
| 文件 | 行号 | 模式 | 严重程度 | 影响 |
|
|
253
|
+
|------|------|------|----------|------|
|
|
254
|
+
| src/components/Chat.tsx | 8 | `<div>Chat will be here</div>` | 🛑 阻塞 | 无实际内容 |
|
|
255
|
+
| src/app/api/chat/route.ts | 5 | `return Response.json([])` | 🛑 阻塞 | 硬编码空数组 |
|
|
256
|
+
| src/app/api/chat/route.ts | 12 | `// TODO: save to database` | ⚠️ 警告 | 未完成 |
|
|
257
|
+
|
|
258
|
+
**反模式:** 3 个 (2 个阻塞, 1 个警告)
|
|
259
|
+
|
|
260
|
+
## 需要人工验证
|
|
261
|
+
|
|
262
|
+
自动缺口修复前无需人工验证。
|
|
263
|
+
|
|
264
|
+
## 缺口总结
|
|
265
|
+
|
|
266
|
+
### 关键缺口(阻塞进度)
|
|
267
|
+
|
|
268
|
+
1. **聊天组件是占位内容**
|
|
269
|
+
- 缺失: 实际的消息列表渲染
|
|
270
|
+
- 影响: 用户看到 "Chat will be here" 而非消息
|
|
271
|
+
- 修复: 实现 Chat.tsx 以获取和渲染消息
|
|
272
|
+
|
|
273
|
+
2. **API 路由是桩代码**
|
|
274
|
+
- 缺失: GET 和 POST 的数据库集成
|
|
275
|
+
- 影响: 无数据持久化,无实际功能
|
|
276
|
+
- 修复: 在路由处理器中接入 prisma 调用
|
|
277
|
+
|
|
278
|
+
3. **前后端未连接**
|
|
279
|
+
- 缺失: 组件中的 fetch 调用
|
|
280
|
+
- 影响: 即使 API 正常,UI 也不会调用它
|
|
281
|
+
- 修复: 在 Chat 中添加 useEffect fetch,在 ChatInput 中添加 onSubmit fetch
|
|
282
|
+
|
|
283
|
+
## 建议修复计划
|
|
284
|
+
|
|
285
|
+
### 03-04-PLAN.md: 实现聊天 API
|
|
286
|
+
|
|
287
|
+
**目标:** 将 API 路由连接到数据库
|
|
288
|
+
|
|
289
|
+
**任务:**
|
|
290
|
+
1. 用 prisma.message.findMany 实现 GET /api/chat
|
|
291
|
+
2. 用 prisma.message.create 实现 POST /api/chat
|
|
292
|
+
3. 验证: API 返回真实数据,POST 创建记录
|
|
293
|
+
|
|
294
|
+
**预估范围:** 小
|
|
295
|
+
|
|
296
|
+
---
|
|
297
|
+
|
|
298
|
+
### 03-05-PLAN.md: 实现聊天 UI
|
|
299
|
+
|
|
300
|
+
**目标:** 将 Chat 组件连接到 API
|
|
301
|
+
|
|
302
|
+
**任务:**
|
|
303
|
+
1. 用 useEffect fetch 和消息渲染实现 Chat.tsx
|
|
304
|
+
2. 将 ChatInput 的 onSubmit 连接到 POST /api/chat
|
|
305
|
+
3. 验证: 消息正常显示,发送后新消息出现
|
|
306
|
+
|
|
307
|
+
**预估范围:** 小
|
|
308
|
+
|
|
309
|
+
---
|
|
310
|
+
|
|
311
|
+
## 验证元数据
|
|
312
|
+
|
|
313
|
+
**验证方法:** 目标反推(从阶段目标推导)
|
|
314
|
+
**必要项来源:** 03-01-PLAN.md frontmatter
|
|
315
|
+
**自动检查:** 2 通过, 8 失败
|
|
316
|
+
**需人工检查:** 0 (被自动检查失败阻塞)
|
|
317
|
+
**总验证时间:** 2 分钟
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
*验证时间: 2025-01-15T14:30:00Z*
|
|
321
|
+
*验证者: Claude (子代理)*
|
|
322
|
+
```
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<purpose>
|
|
2
|
+
在当前里程碑的路线图末尾添加一个新的整数阶段。自动计算下一个阶段编号,创建阶段目录,并更新路线图结构。
|
|
3
|
+
</purpose>
|
|
4
|
+
|
|
5
|
+
<required_reading>
|
|
6
|
+
在开始之前,阅读调用提示的 execution_context 中引用的所有文件。
|
|
7
|
+
</required_reading>
|
|
8
|
+
|
|
9
|
+
<process>
|
|
10
|
+
|
|
11
|
+
<step name="parse_arguments">
|
|
12
|
+
解析命令参数:
|
|
13
|
+
- 所有参数组成阶段描述
|
|
14
|
+
- 示例:`/specops:add-phase Add authentication` → description = "Add authentication"
|
|
15
|
+
- 示例:`/specops:add-phase Fix critical performance issues` → description = "Fix critical performance issues"
|
|
16
|
+
|
|
17
|
+
如果未提供参数:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
ERROR: Phase description required
|
|
21
|
+
Usage: /specops:add-phase <description>
|
|
22
|
+
Example: /specops:add-phase Add authentication system
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
退出。
|
|
26
|
+
</step>
|
|
27
|
+
|
|
28
|
+
<step name="init_context">
|
|
29
|
+
加载阶段操作上下文:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
INIT=$(node .opencode/bin/specops-tools.cjs init phase-op "0")
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
检查 init JSON 中的 `roadmap_exists`。如果为 false:
|
|
36
|
+
```
|
|
37
|
+
ERROR: No roadmap found (.planning/ROADMAP.md)
|
|
38
|
+
Run /specops:new-project to initialize.
|
|
39
|
+
```
|
|
40
|
+
退出。
|
|
41
|
+
</step>
|
|
42
|
+
|
|
43
|
+
<step name="add_phase">
|
|
44
|
+
**将阶段添加操作委托给 specops-tools:**
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
RESULT=$(node .opencode/bin/specops-tools.cjs phase add "${description}")
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
CLI 处理以下操作:
|
|
51
|
+
- 查找最大的现有整数阶段编号
|
|
52
|
+
- 计算下一个阶段编号(最大值 + 1)
|
|
53
|
+
- 从描述生成 slug
|
|
54
|
+
- 创建阶段目录(`.planning/phases/{NN}-{slug}/`)
|
|
55
|
+
- 在 ROADMAP.md 中插入阶段条目,包含 Goal、Depends on 和 Plans 部分
|
|
56
|
+
|
|
57
|
+
从结果中提取:`phase_number`、`padded`、`name`、`slug`、`directory`。
|
|
58
|
+
</step>
|
|
59
|
+
|
|
60
|
+
<step name="update_project_state">
|
|
61
|
+
更新 STATE.md 以反映新阶段:
|
|
62
|
+
|
|
63
|
+
1. 读取 `.planning/STATE.md`
|
|
64
|
+
2. 在 "## Accumulated Context" → "### Roadmap Evolution" 下添加条目:
|
|
65
|
+
```
|
|
66
|
+
- Phase {N} added: {description}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
如果 "Roadmap Evolution" 部分不存在,则创建它。
|
|
70
|
+
</step>
|
|
71
|
+
|
|
72
|
+
<step name="completion">
|
|
73
|
+
展示完成摘要:
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
Phase {N} added to current milestone:
|
|
77
|
+
- Description: {description}
|
|
78
|
+
- Directory: .planning/phases/{phase-num}-{slug}/
|
|
79
|
+
- Status: Not planned yet
|
|
80
|
+
|
|
81
|
+
Roadmap updated: .planning/ROADMAP.md
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## ▶ Next Up
|
|
86
|
+
|
|
87
|
+
**Phase {N}: {description}**
|
|
88
|
+
|
|
89
|
+
`/specops:plan-phase {N}`
|
|
90
|
+
|
|
91
|
+
<sub>`/clear` first → fresh context window</sub>
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
**Also available:**
|
|
96
|
+
- `/specops:add-phase <description>` — add another phase
|
|
97
|
+
- Review roadmap
|
|
98
|
+
|
|
99
|
+
---
|
|
100
|
+
```
|
|
101
|
+
</step>
|
|
102
|
+
|
|
103
|
+
</process>
|
|
104
|
+
|
|
105
|
+
<success_criteria>
|
|
106
|
+
- [ ] `specops-tools phase add` 执行成功
|
|
107
|
+
- [ ] 阶段目录已创建
|
|
108
|
+
- [ ] 路线图已更新,包含新阶段条目
|
|
109
|
+
- [ ] STATE.md 已更新路线图演进记录
|
|
110
|
+
- [ ] 用户已被告知后续步骤
|
|
111
|
+
</success_criteria>
|