@specpow/framework 0.5.10 → 0.5.12
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/CHANGELOG.md +623 -623
- package/LICENSE +21 -21
- package/bin/specpow.js +9 -9
- package/builtin/schemas/bug-fix/schema.yaml +64 -0
- package/builtin/schemas/bug-fix/templates/analysis.md +43 -0
- package/builtin/schemas/bug-fix/templates/fix-plan.md +19 -0
- package/builtin/schemas/bug-fix/templates/proposal.md +30 -0
- package/builtin/schemas/crud-module/schema.yaml +65 -0
- package/builtin/schemas/crud-module/templates/design.md +36 -0
- package/builtin/schemas/crud-module/templates/proposal.md +30 -0
- package/builtin/schemas/crud-module/templates/spec.md +33 -0
- package/builtin/schemas/crud-module/templates/tasks.md +57 -0
- package/builtin/schemas/spec-driven/schema.yaml +87 -0
- package/builtin/schemas/spec-driven/templates/design.md +54 -0
- package/builtin/schemas/spec-driven/templates/proposal.md +31 -0
- package/builtin/schemas/spec-driven/templates/spec.md +42 -0
- package/builtin/schemas/spec-driven/templates/tasks.md +98 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +4 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/commands/apply.d.ts.map +1 -1
- package/dist/commands/apply.js +12 -11
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/archive.d.ts.map +1 -1
- package/dist/commands/archive.js +6 -3
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/config.d.ts.map +1 -1
- package/dist/commands/config.js +5 -1
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +29 -10
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/execute.d.ts.map +1 -1
- package/dist/commands/execute.js +5 -2
- package/dist/commands/execute.js.map +1 -1
- package/dist/commands/explore.d.ts.map +1 -1
- package/dist/commands/explore.js +8 -10
- package/dist/commands/explore.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +17 -16
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/propose.d.ts.map +1 -1
- package/dist/commands/propose.js +4 -3
- package/dist/commands/propose.js.map +1 -1
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +5 -2
- package/dist/commands/schema.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +5 -2
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/store.d.ts.map +1 -1
- package/dist/commands/store.js +8 -6
- package/dist/commands/store.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +3 -1
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate-specs.d.ts.map +1 -1
- package/dist/commands/validate-specs.js +8 -5
- package/dist/commands/validate-specs.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +5 -2
- package/dist/commands/verify.js.map +1 -1
- package/dist/commands/workflow/index.d.ts.map +1 -1
- package/dist/commands/workflow/index.js +13 -8
- package/dist/commands/workflow/index.js.map +1 -1
- package/dist/core/archive/engine.d.ts.map +1 -1
- package/dist/core/archive/engine.js +10 -6
- package/dist/core/archive/engine.js.map +1 -1
- package/dist/core/artifact-graph/resolver.d.ts.map +1 -1
- package/dist/core/artifact-graph/resolver.js +5 -2
- package/dist/core/artifact-graph/resolver.js.map +1 -1
- package/dist/core/config/config-schema.d.ts +104 -0
- package/dist/core/config/config-schema.d.ts.map +1 -1
- package/dist/core/config/config-schema.js +15 -1
- package/dist/core/config/config-schema.js.map +1 -1
- package/dist/core/hooks/session-start-hook.d.ts.map +1 -1
- package/dist/core/hooks/session-start-hook.js +50 -45
- package/dist/core/hooks/session-start-hook.js.map +1 -1
- package/dist/core/hooks/workflow-state-hook.d.ts.map +1 -1
- package/dist/core/hooks/workflow-state-hook.js +3 -1
- package/dist/core/hooks/workflow-state-hook.js.map +1 -1
- package/dist/core/init/engine.d.ts.map +1 -1
- package/dist/core/init/engine.js +15 -12
- package/dist/core/init/engine.js.map +1 -1
- package/dist/core/memory/adapters/sqlite-adapter.js +55 -55
- package/dist/core/migration/index.d.ts.map +1 -1
- package/dist/core/migration/index.js +128 -4
- package/dist/core/migration/index.js.map +1 -1
- package/dist/core/store/index.d.ts +4 -3
- package/dist/core/store/index.d.ts.map +1 -1
- package/dist/core/store/index.js +7 -7
- package/dist/core/store/index.js.map +1 -1
- package/dist/core/templates/index.d.ts +1 -1
- package/dist/core/templates/index.d.ts.map +1 -1
- package/dist/core/templates/index.js +11 -6
- package/dist/core/templates/index.js.map +1 -1
- package/dist/core/workflow-state.d.ts +1 -1
- package/dist/core/workflow-state.d.ts.map +1 -1
- package/dist/core/workflow-state.js +10 -5
- package/dist/core/workflow-state.js.map +1 -1
- package/dist/templates/claude-commands/specpow-apply.md +23 -23
- package/dist/templates/claude-commands/specpow-archive.md +22 -22
- package/dist/templates/claude-commands/specpow-propose.md +27 -27
- package/dist/templates/claude-commands/specpow-status.md +22 -22
- package/dist/templates/claude-commands/specpow-validate-specs.md +28 -28
- package/dist/templates/claude-commands/specpow-verify.md +21 -21
- package/dist/templates/claude-commands/specpow.md +34 -34
- package/package.json +120 -122
- /package/{.specpow → builtin}/skills/business-code-review/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-db-design/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-deploy-check/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-doc-sync/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-java-codegen/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-menu-register/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-prd-writer/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-test-gen/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/business-ui-codegen/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/cli-router/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-finish-branch/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-git-worktrees/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-parallel-agents/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-receiving-review/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-requesting-review/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-sdd-orchestrator/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-subagent-dispatch/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-subagent-driven-dev/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-systematic-debugging/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-tdd/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/execution-verification-before-completion/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/meta-create-skill/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/meta-using-skills/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/meta-writing-skills/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-apply-change/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-archive-change/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-explore/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-onboard/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-propose/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-update-change/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-verify-change/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-write-design/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-write-plans/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/planning-write-specs/SKILL.md +0 -0
- /package/{.specpow → builtin}/skills/using-specpow/SKILL.md +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 buchengjin
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 buchengjin
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/bin/specpow.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* SpecPow CLI 入口
|
|
5
|
-
* Spec-Powered AI Development Framework
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { runCli } from '../dist/cli/index.js';
|
|
9
|
-
|
|
10
|
-
runCli();
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* SpecPow CLI 入口
|
|
5
|
+
* Spec-Powered AI Development Framework
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { runCli } from '../dist/cli/index.js';
|
|
9
|
+
|
|
10
|
+
runCli();
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Bug 修复 Schema
|
|
2
|
+
# 用于快速定位和修复 Bug 的工件流
|
|
3
|
+
|
|
4
|
+
name: bug-fix
|
|
5
|
+
description: 系统化定位和修复 Bug
|
|
6
|
+
|
|
7
|
+
apply:
|
|
8
|
+
requires:
|
|
9
|
+
- tasks
|
|
10
|
+
|
|
11
|
+
artifacts:
|
|
12
|
+
- id: proposal
|
|
13
|
+
name: Bug 描述
|
|
14
|
+
description: 描述 Bug 现象和复现步骤
|
|
15
|
+
requires: []
|
|
16
|
+
template: proposal.md
|
|
17
|
+
instruction: |
|
|
18
|
+
记录 Bug 信息:
|
|
19
|
+
- Bug 标题
|
|
20
|
+
- 复现步骤(Step 1, 2, 3...)
|
|
21
|
+
- 预期行为
|
|
22
|
+
- 实际行为
|
|
23
|
+
- 环境信息
|
|
24
|
+
- 影响范围
|
|
25
|
+
output: proposal.md
|
|
26
|
+
|
|
27
|
+
- id: analysis
|
|
28
|
+
name: 根因分析
|
|
29
|
+
description: 分析 Bug 根因
|
|
30
|
+
requires: [proposal]
|
|
31
|
+
template: analysis.md
|
|
32
|
+
instruction: |
|
|
33
|
+
根因分析(4 阶段):
|
|
34
|
+
1. 调查 — 收集日志、堆栈、复现
|
|
35
|
+
2. 模式分析 — 识别错误模式
|
|
36
|
+
3. 假设 — 提出根因假设
|
|
37
|
+
4. 验证 — 验证假设正确性
|
|
38
|
+
output: analysis.md
|
|
39
|
+
|
|
40
|
+
- id: fix-plan
|
|
41
|
+
name: 修复计划
|
|
42
|
+
description: 制定修复方案
|
|
43
|
+
requires: [analysis]
|
|
44
|
+
template: fix-plan.md
|
|
45
|
+
instruction: |
|
|
46
|
+
修复方案:
|
|
47
|
+
- 修复策略(热修复/正常修复/重构修复)
|
|
48
|
+
- 修改文件列表
|
|
49
|
+
- 回归测试计划
|
|
50
|
+
output: fix-plan.md
|
|
51
|
+
|
|
52
|
+
- id: tasks
|
|
53
|
+
name: 修复任务
|
|
54
|
+
description: 修复步骤拆分
|
|
55
|
+
requires: [fix-plan]
|
|
56
|
+
template: tasks.md
|
|
57
|
+
instruction: |
|
|
58
|
+
修复任务拆分:
|
|
59
|
+
1. 编写失败测试(复现 Bug)
|
|
60
|
+
2. 修复代码
|
|
61
|
+
3. 验证测试通过
|
|
62
|
+
4. 回归测试
|
|
63
|
+
5. 更新文档
|
|
64
|
+
output: tasks.md
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# 根因分析
|
|
2
|
+
|
|
3
|
+
## 1. 调查
|
|
4
|
+
|
|
5
|
+
### 错误日志
|
|
6
|
+
```
|
|
7
|
+
(关键错误日志)
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
### 堆栈跟踪
|
|
11
|
+
```
|
|
12
|
+
(关键堆栈)
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
### 复现结果
|
|
16
|
+
- 是否可稳定复现: 是/否
|
|
17
|
+
- 复现频率:
|
|
18
|
+
|
|
19
|
+
## 2. 模式分析
|
|
20
|
+
|
|
21
|
+
### 错误模式
|
|
22
|
+
- 错误类型:
|
|
23
|
+
- 涉及模块:
|
|
24
|
+
- 最近变更:
|
|
25
|
+
|
|
26
|
+
## 3. 假设
|
|
27
|
+
|
|
28
|
+
### 假设 1: [描述]
|
|
29
|
+
- 证据:
|
|
30
|
+
- 验证方法:
|
|
31
|
+
|
|
32
|
+
### 假设 2: [描述]
|
|
33
|
+
- 证据:
|
|
34
|
+
- 验证方法:
|
|
35
|
+
|
|
36
|
+
## 4. 结论
|
|
37
|
+
|
|
38
|
+
### 根因
|
|
39
|
+
[确认的根因描述]
|
|
40
|
+
|
|
41
|
+
### 影响分析
|
|
42
|
+
- 直接影响:
|
|
43
|
+
- 间接影响:
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Bug 描述
|
|
2
|
+
|
|
3
|
+
## Bug 标题
|
|
4
|
+
{{bugTitle}}
|
|
5
|
+
|
|
6
|
+
## 复现步骤
|
|
7
|
+
1.
|
|
8
|
+
2.
|
|
9
|
+
3.
|
|
10
|
+
|
|
11
|
+
## 预期行为
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 实际行为
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 环境信息
|
|
18
|
+
- 环境:
|
|
19
|
+
- 版本:
|
|
20
|
+
- 浏览器/客户端:
|
|
21
|
+
|
|
22
|
+
## 影响范围
|
|
23
|
+
- 影响用户:
|
|
24
|
+
- 影响功能:
|
|
25
|
+
- 严重程度: Critical / Major / Minor
|
|
26
|
+
|
|
27
|
+
## 相关日志
|
|
28
|
+
```
|
|
29
|
+
(粘贴错误日志)
|
|
30
|
+
```
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# CRUD 模块 Schema
|
|
2
|
+
# 用于快速生成标准 CRUD 模块的工件流
|
|
3
|
+
|
|
4
|
+
name: crud-module
|
|
5
|
+
description: 快速生成标准 CRUD 模块(Entity/Mapper/Service/Controller/页面)
|
|
6
|
+
|
|
7
|
+
apply:
|
|
8
|
+
requires:
|
|
9
|
+
- tasks
|
|
10
|
+
|
|
11
|
+
artifacts:
|
|
12
|
+
- id: proposal
|
|
13
|
+
name: 模块提案
|
|
14
|
+
description: 描述要生成的 CRUD 模块
|
|
15
|
+
requires: []
|
|
16
|
+
template: proposal.md
|
|
17
|
+
instruction: |
|
|
18
|
+
根据用户描述,生成 CRUD 模块提案。
|
|
19
|
+
包含:模块名称、核心实体、CRUD 操作列表、业务规则。
|
|
20
|
+
output: proposal.md
|
|
21
|
+
|
|
22
|
+
- id: specs
|
|
23
|
+
name: 模块规范
|
|
24
|
+
description: 定义 CRUD 接口规范
|
|
25
|
+
requires: [proposal]
|
|
26
|
+
template: spec.md
|
|
27
|
+
instruction: |
|
|
28
|
+
定义 CRUD 接口规范:
|
|
29
|
+
- GET /api/{entity} — 分页查询
|
|
30
|
+
- GET /api/{entity}/:id — 详情查询
|
|
31
|
+
- POST /api/{entity} — 新增
|
|
32
|
+
- PUT /api/{entity}/:id — 修改
|
|
33
|
+
- DELETE /api/{entity}/:id — 删除
|
|
34
|
+
每个接口定义请求参数和响应格式。
|
|
35
|
+
output: specs/spec.md
|
|
36
|
+
|
|
37
|
+
- id: design
|
|
38
|
+
name: 模块设计
|
|
39
|
+
description: 数据库设计和接口定义
|
|
40
|
+
requires: [proposal, specs]
|
|
41
|
+
template: design.md
|
|
42
|
+
instruction: |
|
|
43
|
+
设计数据库表结构和接口定义:
|
|
44
|
+
- 表结构(字段、类型、索引)
|
|
45
|
+
- 接口签名
|
|
46
|
+
- 前后端分工
|
|
47
|
+
output: design.md
|
|
48
|
+
|
|
49
|
+
- id: tasks
|
|
50
|
+
name: 任务列表
|
|
51
|
+
description: 代码生成任务拆分
|
|
52
|
+
requires: [design]
|
|
53
|
+
template: tasks.md
|
|
54
|
+
instruction: |
|
|
55
|
+
按以下顺序拆分任务:
|
|
56
|
+
1. Entity 实体类
|
|
57
|
+
2. Mapper + XML
|
|
58
|
+
3. Service 接口 + 实现
|
|
59
|
+
4. Controller
|
|
60
|
+
5. 前端 API 接口
|
|
61
|
+
6. 前端列表页
|
|
62
|
+
7. 前端表单页
|
|
63
|
+
8. 菜单注册
|
|
64
|
+
9. 单元测试
|
|
65
|
+
output: tasks.md
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# CRUD 模块设计
|
|
2
|
+
|
|
3
|
+
## 1. 数据库设计
|
|
4
|
+
|
|
5
|
+
### 表结构
|
|
6
|
+
```sql
|
|
7
|
+
CREATE TABLE `{{table_name}}` (
|
|
8
|
+
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
|
|
9
|
+
-- 业务字段(根据提案填充)
|
|
10
|
+
`create_by` varchar(64) DEFAULT '' COMMENT '创建人',
|
|
11
|
+
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
12
|
+
`update_by` varchar(64) DEFAULT '' COMMENT '更新人',
|
|
13
|
+
`update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
|
14
|
+
`is_deleted` tinyint(1) DEFAULT 0 COMMENT '逻辑删除',
|
|
15
|
+
PRIMARY KEY (`id`)
|
|
16
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='{{table_comment}}';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 2. 接口定义
|
|
20
|
+
|
|
21
|
+
| Method | Path | 描述 | 请求参数 | 响应 |
|
|
22
|
+
|--------|------|------|----------|------|
|
|
23
|
+
| GET | /api/{{entity}} | 分页查询 | page, size, 查询条件 | PageResult |
|
|
24
|
+
| GET | /api/{{entity}}/:id | 详情 | - | EntityVO |
|
|
25
|
+
| POST | /api/{{entity}} | 新增 | EntityDTO | id |
|
|
26
|
+
| PUT | /api/{{entity}}/:id | 修改 | EntityDTO | - |
|
|
27
|
+
| DELETE | /api/{{entity}}/:id | 删除 | - | - |
|
|
28
|
+
|
|
29
|
+
## 3. 前后端分工
|
|
30
|
+
|
|
31
|
+
| 功能 | 前端 | 后端 |
|
|
32
|
+
|------|------|------|
|
|
33
|
+
| 列表页 | 表格+搜索+分页 | 分页查询接口 |
|
|
34
|
+
| 新增 | 表单弹窗 | 新增接口 |
|
|
35
|
+
| 编辑 | 表单弹窗 | 修改接口 |
|
|
36
|
+
| 删除 | 确认弹窗 | 删除接口 |
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# CRUD 模块提案
|
|
2
|
+
|
|
3
|
+
## 模块名称
|
|
4
|
+
{{moduleName}}
|
|
5
|
+
|
|
6
|
+
## 核心实体
|
|
7
|
+
- 实体名:
|
|
8
|
+
- 表名:
|
|
9
|
+
- 描述:
|
|
10
|
+
|
|
11
|
+
## CRUD 操作
|
|
12
|
+
- [ ] 分页查询(列表)
|
|
13
|
+
- [ ] 详情查询
|
|
14
|
+
- [ ] 新增
|
|
15
|
+
- [ ] 修改
|
|
16
|
+
- [ ] 删除
|
|
17
|
+
- [ ] 导出(可选)
|
|
18
|
+
- [ ] 导入(可选)
|
|
19
|
+
|
|
20
|
+
## 业务规则
|
|
21
|
+
1.
|
|
22
|
+
2.
|
|
23
|
+
|
|
24
|
+
## 字段清单
|
|
25
|
+
| 字段名 | 类型 | 必填 | 说明 |
|
|
26
|
+
|--------|------|------|------|
|
|
27
|
+
| | | | |
|
|
28
|
+
|
|
29
|
+
## 非目标
|
|
30
|
+
- 不包含:
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# CRUD 接口规范
|
|
2
|
+
|
|
3
|
+
## ADDED Requirements
|
|
4
|
+
|
|
5
|
+
### API-001: 分页查询
|
|
6
|
+
系统应当提供 `GET /api/{{entity}}` 接口,支持分页查询。
|
|
7
|
+
|
|
8
|
+
**验收标准:**
|
|
9
|
+
- **Given** 数据库中存在 {{entity}} 记录
|
|
10
|
+
- **When** 用户请求 `GET /api/{{entity}}?page=1&size=10`
|
|
11
|
+
- **Then** 返回分页数据,包含 total、list、page、size
|
|
12
|
+
|
|
13
|
+
### API-002: 详情查询
|
|
14
|
+
系统应当提供 `GET /api/{{entity}}/:id` 接口。
|
|
15
|
+
|
|
16
|
+
**验收标准:**
|
|
17
|
+
- **Given** 存在 ID 为 1 的记录
|
|
18
|
+
- **When** 用户请求 `GET /api/{{entity}}/1`
|
|
19
|
+
- **Then** 返回该记录详情
|
|
20
|
+
|
|
21
|
+
### API-003: 新增
|
|
22
|
+
系统应当提供 `POST /api/{{entity}}` 接口。
|
|
23
|
+
|
|
24
|
+
**验收标准:**
|
|
25
|
+
- **Given** 用户提供必填字段
|
|
26
|
+
- **When** 用户请求 `POST /api/{{entity}}`
|
|
27
|
+
- **Then** 创建记录并返回新 ID
|
|
28
|
+
|
|
29
|
+
### API-004: 修改
|
|
30
|
+
系统应当提供 `PUT /api/{{entity}}/:id` 接口。
|
|
31
|
+
|
|
32
|
+
### API-005: 删除
|
|
33
|
+
系统应当提供 `DELETE /api/{{entity}}/:id` 接口(逻辑删除)。
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# CRUD 任务列表
|
|
2
|
+
|
|
3
|
+
## 全局约束
|
|
4
|
+
- 分支: feature/{{branch}}
|
|
5
|
+
- 基础: main 分支最新代码
|
|
6
|
+
|
|
7
|
+
## 后端任务
|
|
8
|
+
|
|
9
|
+
### Task-001: 创建 Entity
|
|
10
|
+
- 文件: `src/main/java/com/company/{{module}}/entity/{{Entity}}.java`
|
|
11
|
+
- 依赖: 无
|
|
12
|
+
- 描述: 创建实体类,字段与数据库对应
|
|
13
|
+
- 验证: 编译通过
|
|
14
|
+
|
|
15
|
+
### Task-002: 创建 Mapper
|
|
16
|
+
- 文件: `src/main/java/com/company/{{module}}/mapper/{{Entity}}Mapper.java`, `src/main/resources/mapper/{{Entity}}Mapper.xml`
|
|
17
|
+
- 依赖: Task-001
|
|
18
|
+
- 描述: 创建数据访问层
|
|
19
|
+
- 验证: 编译通过
|
|
20
|
+
|
|
21
|
+
### Task-003: 创建 Service
|
|
22
|
+
- 文件: `src/main/java/com/company/{{module}}/service/{{Entity}}Service.java`, `src/main/java/com/company/{{module}}/service/impl/{{Entity}}ServiceImpl.java`
|
|
23
|
+
- 依赖: Task-002
|
|
24
|
+
- 描述: 创建业务逻辑层(CRUD 方法)
|
|
25
|
+
- 验证: 编译通过
|
|
26
|
+
|
|
27
|
+
### Task-004: 创建 Controller
|
|
28
|
+
- 文件: `src/main/java/com/company/{{module}}/controller/{{Entity}}Controller.java`
|
|
29
|
+
- 依赖: Task-003
|
|
30
|
+
- 描述: 创建 RESTful 接口
|
|
31
|
+
- 验证: 编译通过,接口可访问
|
|
32
|
+
|
|
33
|
+
## 前端任务
|
|
34
|
+
|
|
35
|
+
### Task-005: 创建 API 接口文件
|
|
36
|
+
- 文件: `src/api/{{entity}}.js`
|
|
37
|
+
- 依赖: Task-004
|
|
38
|
+
- 描述: 封装 axios 请求
|
|
39
|
+
- 验证: 无语法错误
|
|
40
|
+
|
|
41
|
+
### Task-006: 创建列表页
|
|
42
|
+
- 文件: `src/views/{{module}}/{{entity}}/index.vue`
|
|
43
|
+
- 依赖: Task-005
|
|
44
|
+
- 描述: 列表页(搜索+表格+分页+操作按钮)
|
|
45
|
+
- 验证: 页面可渲染
|
|
46
|
+
|
|
47
|
+
### Task-007: 创建表单弹窗
|
|
48
|
+
- 文件: `src/views/{{module}}/{{entity}}/form.vue`
|
|
49
|
+
- 依赖: Task-005
|
|
50
|
+
- 描述: 新增/编辑表单弹窗
|
|
51
|
+
- 验证: 表单验证生效
|
|
52
|
+
|
|
53
|
+
### Task-008: 注册路由和菜单
|
|
54
|
+
- 文件: `src/router/modules/{{module}}.js`
|
|
55
|
+
- 依赖: Task-006
|
|
56
|
+
- 描述: 配置路由和菜单 SQL
|
|
57
|
+
- 验证: 菜单可见,页面可访问
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# SpecPow 默认 Schema: spec-driven
|
|
2
|
+
# 四阶段工件流: proposal → specs → design → tasks → apply
|
|
3
|
+
# 融合 OpenSpec 的规范驱动 + Superpowers 的执行方法论
|
|
4
|
+
|
|
5
|
+
name: spec-driven
|
|
6
|
+
description: |
|
|
7
|
+
规格驱动开发工作流。
|
|
8
|
+
在 AI 写代码之前,让人类和 AI 对"要构建什么"达成一致。
|
|
9
|
+
然后通过 SDD 子代理驱动引擎高质量地执行实现。
|
|
10
|
+
|
|
11
|
+
apply:
|
|
12
|
+
requires:
|
|
13
|
+
- tasks # 实施前必须完成所有工件
|
|
14
|
+
|
|
15
|
+
artifacts:
|
|
16
|
+
- id: proposal
|
|
17
|
+
name: 提案
|
|
18
|
+
description: 为什么做这个变更?解决什么问题?
|
|
19
|
+
requires: []
|
|
20
|
+
template: proposal.md
|
|
21
|
+
instruction: |
|
|
22
|
+
创建变更提案。回答:
|
|
23
|
+
1. 为什么要做这个变更?(动机)
|
|
24
|
+
2. 要解决什么问题?
|
|
25
|
+
3. 成功标准是什么?
|
|
26
|
+
4. 影响范围和风险?
|
|
27
|
+
|
|
28
|
+
注意:先使用 brainstorming 技能进行需求探索,再写提案。
|
|
29
|
+
output: proposal.md
|
|
30
|
+
|
|
31
|
+
- id: specs
|
|
32
|
+
name: 规范
|
|
33
|
+
description: 系统必须做什么?(行为契约,不是实现计划)
|
|
34
|
+
requires:
|
|
35
|
+
- proposal
|
|
36
|
+
template: spec.md
|
|
37
|
+
instruction: |
|
|
38
|
+
创建 Delta 规范。使用增量操作描述变更:
|
|
39
|
+
- ADDED Requirements: 新增的需求
|
|
40
|
+
- MODIFIED Requirements: 修改的需求(包含完整更新内容)
|
|
41
|
+
- REMOVED Requirements: 移除的需求(含原因和迁移方案)
|
|
42
|
+
- RENAMED Requirements: 重命名的需求
|
|
43
|
+
|
|
44
|
+
规范是行为契约,描述系统做什么,不描述怎么做。
|
|
45
|
+
每个需求必须可验证。
|
|
46
|
+
output: specs/<capability>/spec.md
|
|
47
|
+
|
|
48
|
+
- id: design
|
|
49
|
+
name: 设计
|
|
50
|
+
description: 怎么做?技术方案和架构决策
|
|
51
|
+
requires:
|
|
52
|
+
- proposal
|
|
53
|
+
- specs
|
|
54
|
+
template: design.md
|
|
55
|
+
instruction: |
|
|
56
|
+
创建技术设计文档。包含:
|
|
57
|
+
1. 架构决策(ADR 格式)
|
|
58
|
+
2. 模块划分和接口定义
|
|
59
|
+
3. 数据模型设计
|
|
60
|
+
4. 前后端分工
|
|
61
|
+
5. 关键实现路径
|
|
62
|
+
|
|
63
|
+
如果变更较小(< 3个文件),可以跳过此工件。
|
|
64
|
+
output: design.md
|
|
65
|
+
conditional: true
|
|
66
|
+
|
|
67
|
+
- id: tasks
|
|
68
|
+
name: 任务
|
|
69
|
+
description: 实施步骤(SDD 引擎将逐个执行)
|
|
70
|
+
requires:
|
|
71
|
+
- proposal
|
|
72
|
+
- specs
|
|
73
|
+
- design
|
|
74
|
+
template: tasks.md
|
|
75
|
+
instruction: |
|
|
76
|
+
创建实现任务列表。每个任务应该:
|
|
77
|
+
1. 足够小(2-5分钟完成)
|
|
78
|
+
2. 包含精确的文件路径
|
|
79
|
+
3. 包含完整的代码或明确的修改指令
|
|
80
|
+
4. 包含验证步骤
|
|
81
|
+
5. 任务之间尽量独立(便于 SDD 并行)
|
|
82
|
+
|
|
83
|
+
格式:
|
|
84
|
+
- [ ] Task 1: <标题>
|
|
85
|
+
<详细描述,包含精确文件路径和代码>
|
|
86
|
+
验证: <如何验证>
|
|
87
|
+
output: tasks.md
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# 技术设计: <变更名称>
|
|
2
|
+
|
|
3
|
+
## 架构决策
|
|
4
|
+
|
|
5
|
+
### ADR-001: <决策标题>
|
|
6
|
+
|
|
7
|
+
**状态**: 已采纳
|
|
8
|
+
|
|
9
|
+
**背景**: <为什么需要这个决策>
|
|
10
|
+
|
|
11
|
+
**决策**: <选择了什么方案>
|
|
12
|
+
|
|
13
|
+
**备选方案**:
|
|
14
|
+
- 方案 A: <描述> — 优点/缺点
|
|
15
|
+
- 方案 B: <描述> — 优点/缺点
|
|
16
|
+
|
|
17
|
+
**后果**: <这个决策带来的影响>
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## 模块划分
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
<模块图>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 接口定义
|
|
28
|
+
|
|
29
|
+
### <接口名>
|
|
30
|
+
|
|
31
|
+
- **路径**: `METHOD /api/xxx`
|
|
32
|
+
- **请求**:
|
|
33
|
+
- **响应**:
|
|
34
|
+
- **错误码**:
|
|
35
|
+
|
|
36
|
+
## 数据模型
|
|
37
|
+
|
|
38
|
+
### <表名/实体名>
|
|
39
|
+
|
|
40
|
+
| 字段 | 类型 | 说明 | 约束 |
|
|
41
|
+
|------|------|------|------|
|
|
42
|
+
| | | | |
|
|
43
|
+
|
|
44
|
+
## 前后端分工
|
|
45
|
+
|
|
46
|
+
| 功能 | 前端 | 后端 | 说明 |
|
|
47
|
+
|------|------|------|------|
|
|
48
|
+
| | | | |
|
|
49
|
+
|
|
50
|
+
## 关键实现路径
|
|
51
|
+
|
|
52
|
+
1. <步骤 1>
|
|
53
|
+
2. <步骤 2>
|
|
54
|
+
3. <步骤 3>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# 变更提案: <变更名称>
|
|
2
|
+
|
|
3
|
+
## 动机
|
|
4
|
+
|
|
5
|
+
为什么要做这个变更?解决什么问题?
|
|
6
|
+
|
|
7
|
+
## 目标
|
|
8
|
+
|
|
9
|
+
- 目标 1
|
|
10
|
+
- 目标 2
|
|
11
|
+
|
|
12
|
+
## 成功标准
|
|
13
|
+
|
|
14
|
+
- [ ] 标准 1
|
|
15
|
+
- [ ] 标准 2
|
|
16
|
+
|
|
17
|
+
## 影响范围
|
|
18
|
+
|
|
19
|
+
- 影响的模块:
|
|
20
|
+
- 影响的接口:
|
|
21
|
+
- 影响的数据表:
|
|
22
|
+
|
|
23
|
+
## 风险评估
|
|
24
|
+
|
|
25
|
+
| 风险 | 影响 | 概率 | 应对 |
|
|
26
|
+
|------|------|------|------|
|
|
27
|
+
| | | | |
|
|
28
|
+
|
|
29
|
+
## 非目标
|
|
30
|
+
|
|
31
|
+
明确列出这次不做什么。
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# 规范: <能力路径>
|
|
2
|
+
|
|
3
|
+
## ADDED Requirements
|
|
4
|
+
|
|
5
|
+
### REQ-001: <需求标题>
|
|
6
|
+
|
|
7
|
+
**描述**: <系统应该做什么>
|
|
8
|
+
|
|
9
|
+
**验收标准**:
|
|
10
|
+
- Given <前置条件>
|
|
11
|
+
- When <操作>
|
|
12
|
+
- Then <预期结果>
|
|
13
|
+
|
|
14
|
+
**约束**:
|
|
15
|
+
- <性能/安全/兼容性约束>
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## MODIFIED Requirements
|
|
20
|
+
|
|
21
|
+
### REQ-XXX: <需求标题>
|
|
22
|
+
|
|
23
|
+
**变更原因**: <为什么修改>
|
|
24
|
+
|
|
25
|
+
**更新内容**:
|
|
26
|
+
<完整的新需求描述>
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## REMOVED Requirements
|
|
31
|
+
|
|
32
|
+
### REQ-XXX: <需求标题>
|
|
33
|
+
|
|
34
|
+
**移除原因**: <为什么移除>
|
|
35
|
+
|
|
36
|
+
**迁移方案**: <现有用户/数据如何处理>
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## RENAMED Requirements
|
|
41
|
+
|
|
42
|
+
### <旧需求名称> → <新需求名称>
|