spec-canon 0.1.7 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.js +2 -0
- package/package.json +5 -2
- package/templates/claude-md-section.md +8 -2
- package/templates/prompts/guide.md +6 -4
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ npx spec-canon --help
|
|
|
66
66
|
→ 阅读 [guide/04_new_project_sop.md](docs/guide/04_new_project_sop.md),然后使用 `spec-canon prompt guide` 查看决策树
|
|
67
67
|
|
|
68
68
|
### 我要在已有项目中开发新需求
|
|
69
|
-
→ 先运行 `spec-canon change start --goal ...` 建立 active change
|
|
69
|
+
→ 先运行 `spec-canon change start --goal ...` 建立 active change(待命名状态),运行 `ctx` 后 AI 会建议 change 名,再用 `change start -g <goal> -c <name>` 确认命名;然后用 `spec-canon change next` 查看候选步骤
|
|
70
70
|
|
|
71
71
|
### 我要为已有项目引入 SDD
|
|
72
72
|
→ 阅读 [guide/05_iterative_project_sop.md](docs/guide/05_iterative_project_sop.md) 的冷启动策略,然后使用 `spec-canon prompt list --stage iterative`
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
|
+
import updateNotifier from 'update-notifier';
|
|
2
3
|
import { registerChangeCommand } from './commands/change.js';
|
|
3
4
|
import { registerInitCommand } from './commands/init.js';
|
|
4
5
|
import { registerPromptCommand } from './commands/prompt.js';
|
|
5
6
|
import { registerSyncCommand } from './commands/sync.js';
|
|
6
7
|
import { CLI_VERSION } from './version.js';
|
|
8
|
+
updateNotifier({ pkg: { name: 'spec-canon', version: CLI_VERSION } }).notify();
|
|
7
9
|
const program = new Command();
|
|
8
10
|
program
|
|
9
11
|
.name('spec-canon')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spec-canon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "CLI toolkit for Spec-Driven Development (SDD)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"dev": "tsx src/index.ts",
|
|
31
31
|
"test": "vitest run",
|
|
32
32
|
"preversion": "npm test",
|
|
33
|
+
"version": "node scripts/sync-site-version.mjs",
|
|
33
34
|
"prepublishOnly": "npm run build"
|
|
34
35
|
},
|
|
35
36
|
"files": [
|
|
@@ -41,10 +42,12 @@
|
|
|
41
42
|
"node": ">=20"
|
|
42
43
|
},
|
|
43
44
|
"dependencies": {
|
|
44
|
-
"commander": "^13.0.0"
|
|
45
|
+
"commander": "^13.0.0",
|
|
46
|
+
"update-notifier": "^7.3.1"
|
|
45
47
|
},
|
|
46
48
|
"devDependencies": {
|
|
47
49
|
"@types/node": "^22.0.0",
|
|
50
|
+
"@types/update-notifier": "^6.0.8",
|
|
48
51
|
"tsx": "^4.0.0",
|
|
49
52
|
"typescript": "^5.7.0",
|
|
50
53
|
"vitest": "^4.0.18"
|
|
@@ -35,7 +35,10 @@ Change Spec 生成顺序(后者依赖前者作为上下文):
|
|
|
35
35
|
| 中等需求 | `01` + `02_interface` + `AI_CHANGELOG` | 回填接口 + 业务规则 |
|
|
36
36
|
| 复杂需求 | 完整 `00`→`01`→`02`→`03`→`04` + `AI_CHANGELOG` | 完整回填 + 检查跨域依赖 |
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
裁剪三问(逐项判断最小文档集):
|
|
39
|
+
1. AI 是否需要理解系统现状?→ 是则需要 `00_context`
|
|
40
|
+
2. 是否涉及接口或数据模型变更?→ 是则需要 `02_interface`
|
|
41
|
+
3. 是否产生需要长期保留的系统级知识?→ 是则需要归档回填 `domain_spec`
|
|
39
42
|
|
|
40
43
|
### 日常工作流
|
|
41
44
|
|
|
@@ -45,6 +48,7 @@ Change Spec 生成顺序(后者依赖前者作为上下文):
|
|
|
45
48
|
|---|---|---|---|
|
|
46
49
|
| Step -1 | `change start --goal` | active change | 确认 goal 描述准确;若未确认 change 名,先接受待命名状态 |
|
|
47
50
|
| Step 0 | `ctx` | `00_context.md` | 审阅系统现状快照,确认 AI 自动识别的域、模块和待补充项 |
|
|
51
|
+
| Step 0.5 | `change start -g <goal> -c <name>` | 确认 change 名 | 采纳或修改 ctx 建议的 change 名 |
|
|
48
52
|
| Step 1 | `req` | `01_requirement.md` | 审阅验收标准,Sign-off |
|
|
49
53
|
| Step 2 | `iface` → `impl-spec` → `test-spec` | `02` / `03` / `04` | 审阅接口设计、文件路径、步骤顺序 |
|
|
50
54
|
| Step 3 | `impl` | 分步编码 | 逐步确认,Gate 验证 |
|
|
@@ -59,7 +63,9 @@ domain_spec 生命周期:变更启动时由 AI 从 change goal 出发,结合
|
|
|
59
63
|
|
|
60
64
|
```bash
|
|
61
65
|
spec-canon sync # 给已初始化项目安全补齐 SDD 骨架
|
|
62
|
-
spec-canon change start -g @docs/prd.md # 建立当前 active change
|
|
66
|
+
spec-canon change start -g @docs/prd.md # 建立当前 active change(待命名)
|
|
67
|
+
# → 运行 ctx 后 AI 建议 change 名
|
|
68
|
+
spec-canon change start -g @docs/prd.md -c feat-001-checkin # 确认命名
|
|
63
69
|
spec-canon change status # 查看当前进度与推荐下一步
|
|
64
70
|
spec-canon change next # 查看当前候选 next prompts
|
|
65
71
|
spec-canon change -d /path status # 指定目标项目目录
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
## 全新项目
|
|
23
23
|
|
|
24
24
|
1. 运行 `spec-canon init --domain <首个业务域名>` 初始化项目结构
|
|
25
|
-
2. 使用 `change start --goal
|
|
25
|
+
2. 使用 `change start --goal -c <name>` 建立 active change(新项目跳过 ctx,直接命名)
|
|
26
26
|
3. 可先用 `change next` 查看当前候选步骤
|
|
27
27
|
4. 使用 `req` 生成 01_requirement.md(人工审阅 AC 并 Sign-off)
|
|
28
28
|
5. 依次使用 `iface` → `impl-spec` → `test-spec` → `impl` → `review` 完成首个变更
|
|
@@ -39,9 +39,10 @@
|
|
|
39
39
|
1. 运行 `spec-canon init` 初始化结构
|
|
40
40
|
2. 使用 `change start --goal` 建立 active change
|
|
41
41
|
3. 可先用 `change next` 查看当前候选步骤
|
|
42
|
-
4. 使用 `ctx` 生成 00_context.md
|
|
43
|
-
5.
|
|
44
|
-
6.
|
|
42
|
+
4. 使用 `ctx` 生成 00_context.md,AI 自动识别主域并建议 change 名
|
|
43
|
+
5. 用 `change start -g <goal> -c <name>` 确认命名
|
|
44
|
+
6. 按日常流程完成变更(req → iface → impl-spec → test-spec → impl → review)
|
|
45
|
+
7. 在 Archive 步骤使用 `domain-sync` 创建首份 domain_spec(可省略 `-d` 自动发现受影响域)
|
|
45
46
|
|
|
46
47
|
### 路径 B:专项批量基线
|
|
47
48
|
|
|
@@ -69,6 +70,7 @@
|
|
|
69
70
|
| Step -1 | `change start --goal` | 建立 active change | 确认 goal 描述准确;若未确认 change 名,先接受待命名状态 |
|
|
70
71
|
| Step -0.5 | `change next` | 查看候选 next prompts | 关注默认宽松模式下保留的 `iface` / `domain-sync` 候选,自己做判断 |
|
|
71
72
|
| Step 0 | `ctx` | 生成 00_context.md | 审阅系统现状快照,确认 AI 自动识别的域、模块和待补充项 |
|
|
73
|
+
| Step 0.5 | `change start -g <goal> -c <name>` | 确认 change 名 | AI 在 ctx 中建议的名称是否准确 |
|
|
72
74
|
| Step 1 | `req` | 生成 01_requirement.md | 审阅 AC,Sign-off |
|
|
73
75
|
| Step 2 | `iface` → `impl-spec` → `test-spec` | 生成 02/03/04 文档 | 审阅文件路径、步骤顺序 |
|
|
74
76
|
| Step 3 | `impl` | 分步编码 | 逐步确认 |
|