sillyspec 2.6.0 → 2.6.1

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.
@@ -77,12 +77,24 @@ cat .sillyspec/codebase/CONVENTIONS.md 2>/dev/null
77
77
  🔴 RED → 先写测试,运行确认失败
78
78
  🟢 GREEN → 写最少代码让测试通过
79
79
  🔵 REFACTOR → 清理,保持测试通过
80
- ✅ COMMIT → git 提交
80
+ ✅ COMMIT → git 提交(测试文件必须包含在提交中)
81
+ ☑️ CHECK → 勾选 tasks.md 中对应的 checkbox
81
82
  ```
82
83
 
83
84
  **Git 提交:** 检查 Git 仓库 → `git add -A && git commit`。工作区模式下在子项目目录提交。跳过不可提交的情况但记录在报告中。
84
85
 
85
- **违反 TDD 删掉代码从测试重新开始。例外(需人工确认):** 抛弃型原型、生成代码、配置文件。
86
+ **勾选 tasks:** 每个 Task 完成后,**必须立即**在 `.sillyspec/changes/<变更名>/tasks.md` 中将对应 checkbox 标记为 `[x]`。这是 Task 完成的最后一步,不允许跳过。
87
+
88
+ **测试文件必须保留:** 测试是产出物,不是草稿。写完的测试文件必须保留在项目中,随代码一起 commit,不能删除。
89
+
90
+ **哪些任务可以跳过 TDD(不需要人工确认):**
91
+ - 纯配置文件(YAML、properties、.env、JSON 配置)
92
+ - 纯数据文件(SQL seed、fixture)
93
+ - 纯文档(README、注释)
94
+
95
+ **其他情况一律走 TDD:** Service、Controller、Mapper、组件、工具类、DTO(需要验证序列化/校验逻辑时)、API 接口 — 全部先写测试。
96
+
97
+ **违反 TDD → 删掉代码从测试重新开始。没有例外。**
86
98
 
87
99
  ## 写代码前必须读取现有源码(先读后写)
88
100
 
@@ -126,6 +138,7 @@ find . \( -name "*Service*" -o -name "*Manager*" -o -name "*UseCase*" -o -name "
126
138
  ## 自检门控
127
139
 
128
140
  - [ ] 完成任务与 plan 一致?
141
+ - [ ] tasks.md 所有 checkbox 都已勾选为 `[x]`?
129
142
  - [ ] 未意外修改计划外文件?
130
143
  - [ ] 每个任务有 git commit?
131
144
  - [ ] 测试全部通过?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sillyspec",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "SillySpec CLI — 流程状态机,让 AI 严格按步骤来",
5
5
  "type": "module",
6
6
  "bin": {
package/src/init.js CHANGED
@@ -186,10 +186,16 @@ async function doInstall(projectDir, tools, isWorkspace, subprojects = []) {
186
186
  mkdirSync(join(projectDir, '.sillyspec', 'workspace'), { recursive: true });
187
187
  }
188
188
 
189
- // .gitignore
189
+ // .gitignore — 确保 STATE.md 被忽略
190
190
  const gitignorePath = join(projectDir, '.gitignore');
191
- if (!existsSync(gitignorePath)) {
192
- writeFileSync(gitignorePath, '.sillyspec/STATE.md\n');
191
+ const stateIgnoreRule = '.sillyspec/STATE.md';
192
+ if (existsSync(gitignorePath)) {
193
+ const content = readFileSync(gitignorePath, 'utf8');
194
+ if (!content.includes(stateIgnoreRule)) {
195
+ writeFileSync(gitignorePath, content.trimEnd() + '\n' + stateIgnoreRule + '\n');
196
+ }
197
+ } else {
198
+ writeFileSync(gitignorePath, stateIgnoreRule + '\n');
193
199
  }
194
200
 
195
201
  // 生成文件
@@ -77,12 +77,24 @@ cat .sillyspec/codebase/CONVENTIONS.md 2>/dev/null
77
77
  🔴 RED → 先写测试,运行确认失败
78
78
  🟢 GREEN → 写最少代码让测试通过
79
79
  🔵 REFACTOR → 清理,保持测试通过
80
- ✅ COMMIT → git 提交
80
+ ✅ COMMIT → git 提交(测试文件必须包含在提交中)
81
+ ☑️ CHECK → 勾选 tasks.md 中对应的 checkbox
81
82
  ```
82
83
 
83
84
  **Git 提交:** 检查 Git 仓库 → `git add -A && git commit`。工作区模式下在子项目目录提交。跳过不可提交的情况但记录在报告中。
84
85
 
85
- **违反 TDD 删掉代码从测试重新开始。例外(需人工确认):** 抛弃型原型、生成代码、配置文件。
86
+ **勾选 tasks:** 每个 Task 完成后,**必须立即**在 `.sillyspec/changes/<变更名>/tasks.md` 中将对应 checkbox 标记为 `[x]`。这是 Task 完成的最后一步,不允许跳过。
87
+
88
+ **测试文件必须保留:** 测试是产出物,不是草稿。写完的测试文件必须保留在项目中,随代码一起 commit,不能删除。
89
+
90
+ **哪些任务可以跳过 TDD(不需要人工确认):**
91
+ - 纯配置文件(YAML、properties、.env、JSON 配置)
92
+ - 纯数据文件(SQL seed、fixture)
93
+ - 纯文档(README、注释)
94
+
95
+ **其他情况一律走 TDD:** Service、Controller、Mapper、组件、工具类、DTO(需要验证序列化/校验逻辑时)、API 接口 — 全部先写测试。
96
+
97
+ **违反 TDD → 删掉代码从测试重新开始。没有例外。**
86
98
 
87
99
  ## 写代码前必须读取现有源码(先读后写)
88
100
 
@@ -126,6 +138,7 @@ find . \( -name "*Service*" -o -name "*Manager*" -o -name "*UseCase*" -o -name "
126
138
  ## 自检门控
127
139
 
128
140
  - [ ] 完成任务与 plan 一致?
141
+ - [ ] tasks.md 所有 checkbox 都已勾选为 `[x]`?
129
142
  - [ ] 未意外修改计划外文件?
130
143
  - [ ] 每个任务有 git commit?
131
144
  - [ ] 测试全部通过?