cc-devflow 1.0.2 → 2.4.0
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/.claude/CLAUDE.md +123 -4
- package/.claude/agents/code-quality-reviewer.md +205 -0
- package/.claude/agents/spec-reviewer.md +221 -0
- package/.claude/commands/cancel-ralph.md +59 -0
- package/.claude/commands/flow-dev.md +202 -21
- package/.claude/commands/flow-epic.md +33 -0
- package/.claude/commands/flow-fix.md +138 -20
- package/.claude/commands/flow-init.md +104 -15
- package/.claude/commands/flow-new.md +84 -35
- package/.claude/commands/flow-prd.md +16 -3
- package/.claude/commands/flow-release.md +33 -0
- package/.claude/commands/flow-review.md +257 -0
- package/.claude/docs/templates/ATTEMPT_TEMPLATE.md +156 -0
- package/.claude/docs/templates/BRAINSTORM_TEMPLATE.md +148 -0
- package/.claude/docs/templates/ERROR_LOG_TEMPLATE.md +80 -0
- package/.claude/docs/templates/INIT_FLOW_TEMPLATE.md +22 -14
- package/.claude/guides/workflow-guides/flow-orchestrator.md +2 -2
- package/.claude/hooks/hooks.json +15 -0
- package/.claude/hooks/ralph-stop-hook.sh +190 -0
- package/.claude/rules/devflow-conventions.md +3 -1
- package/.claude/rules/project-constitution.md +256 -2
- package/.claude/rules/rationalization-library.md +282 -0
- package/.claude/scripts/create-requirement.sh +19 -6
- package/.claude/scripts/setup-ralph-loop.sh +155 -0
- package/.claude/scripts/verify-gate.sh +269 -0
- package/.claude/skills/cc-devflow-orchestrator/SKILL.md +70 -20
- package/.claude/skills/file-header-guardian/SKILL.md +56 -0
- package/.claude/skills/flow-attention-refresh/SKILL.md +170 -0
- package/.claude/skills/flow-brainstorming/SKILL.md +161 -0
- package/.claude/skills/flow-debugging/SKILL.md +221 -0
- package/.claude/skills/flow-finishing-branch/SKILL.md +189 -0
- package/.claude/skills/flow-receiving-review/SKILL.md +153 -0
- package/.claude/skills/flow-tdd/SKILL.md +218 -0
- package/.claude/skills/fractal-docs-generator/SKILL.md +45 -0
- package/.claude/skills/skill-rules.json +75 -0
- package/.claude/skills/verification-before-completion/SKILL.md +158 -0
- package/.claude/tsc-cache/777aa1de-497e-411b-a40f-13b74efcec58/edited-files.log +2 -1
- package/README.md +104 -19
- package/README.zh-CN.md +79 -1
- package/docs/commands/flow-init.md +3 -1
- package/docs/commands/flow-init.zh-CN.md +3 -1
- package/package.json +2 -2
- package/.claude/tsc-cache/777aa1de-497e-411b-a40f-13b74efcec58/affected-repos.txt +0 -1
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flow-tdd
|
|
3
|
+
description: "Enforces TDD Iron Law in flow-dev. NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Flow TDD - Test-Driven Development Enforcement
|
|
7
|
+
|
|
8
|
+
## The Iron Law
|
|
9
|
+
|
|
10
|
+
```
|
|
11
|
+
NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
This is NON-NEGOTIABLE. No exceptions. No "just this once."
|
|
15
|
+
|
|
16
|
+
## The TDD Cycle
|
|
17
|
+
|
|
18
|
+
```
|
|
19
|
+
RED: Write a failing test
|
|
20
|
+
→ Run it
|
|
21
|
+
→ Confirm it FAILS
|
|
22
|
+
→ If it passes immediately → ERROR (invalid test)
|
|
23
|
+
|
|
24
|
+
GREEN: Write minimal code to pass
|
|
25
|
+
→ Only enough to make the test pass
|
|
26
|
+
→ No extra features
|
|
27
|
+
→ No "while I'm here" additions
|
|
28
|
+
|
|
29
|
+
REFACTOR: Clean up
|
|
30
|
+
→ Keep tests green
|
|
31
|
+
→ Improve structure
|
|
32
|
+
→ Remove duplication
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Enforcement in flow-dev
|
|
36
|
+
|
|
37
|
+
### Phase 2: Tests First
|
|
38
|
+
|
|
39
|
+
```yaml
|
|
40
|
+
TASKS.md Phase 2 (Tests):
|
|
41
|
+
- Write contract tests
|
|
42
|
+
- Write integration tests
|
|
43
|
+
- Write unit tests
|
|
44
|
+
- Run all tests → ALL MUST FAIL
|
|
45
|
+
|
|
46
|
+
⚠️ TEST VERIFICATION CHECKPOINT:
|
|
47
|
+
→ Run: npm test (or equivalent)
|
|
48
|
+
→ Expected: All new tests FAIL
|
|
49
|
+
→ If any test passes immediately → STOP
|
|
50
|
+
→ Passing test = invalid test or code already exists
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Phase 3: Implementation
|
|
54
|
+
|
|
55
|
+
```yaml
|
|
56
|
+
TASKS.md Phase 3 (Implementation):
|
|
57
|
+
- Implement to make tests pass
|
|
58
|
+
- One test at a time
|
|
59
|
+
- Minimal code only
|
|
60
|
+
|
|
61
|
+
After each implementation:
|
|
62
|
+
→ Run tests
|
|
63
|
+
→ Verify previously failing test now passes
|
|
64
|
+
→ Verify no regressions
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## What If Code Already Exists?
|
|
68
|
+
|
|
69
|
+
If you've written code before tests:
|
|
70
|
+
|
|
71
|
+
```yaml
|
|
72
|
+
Option A: DELETE AND RESTART (Recommended)
|
|
73
|
+
1. Delete the implementation code
|
|
74
|
+
2. Keep only the interface/contract
|
|
75
|
+
3. Write failing tests
|
|
76
|
+
4. Re-implement with TDD
|
|
77
|
+
|
|
78
|
+
Option B: WRITE TESTS THAT FAIL FIRST
|
|
79
|
+
1. Comment out the implementation
|
|
80
|
+
2. Write tests
|
|
81
|
+
3. Run tests → verify they fail
|
|
82
|
+
4. Uncomment implementation
|
|
83
|
+
5. Run tests → verify they pass
|
|
84
|
+
|
|
85
|
+
NEVER: Keep code and write passing tests
|
|
86
|
+
→ This is "testing after" disguised as TDD
|
|
87
|
+
→ Tests that pass immediately prove nothing
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Rationalization Prevention
|
|
91
|
+
|
|
92
|
+
| Excuse | Reality |
|
|
93
|
+
|--------|---------|
|
|
94
|
+
| "Too simple to test" | Simple code breaks. Test takes 30 seconds. |
|
|
95
|
+
| "I'll test after" | Tests passing immediately prove nothing. |
|
|
96
|
+
| "Tests after achieve same goals" | Tests-after = "what does this do?" Tests-first = "what should this do?" |
|
|
97
|
+
| "Already manually tested" | Ad-hoc ≠ systematic. No record, can't re-run. |
|
|
98
|
+
| "Deleting X hours is wasteful" | Sunk cost fallacy. Keeping unverified code is technical debt. |
|
|
99
|
+
| "Keep as reference, write tests first" | You'll adapt it. That's testing after. Delete means delete. |
|
|
100
|
+
| "Need to explore first" | Fine. Throw away exploration, start with TDD. |
|
|
101
|
+
| "Test hard = design unclear" | Listen to test. Hard to test = hard to use. |
|
|
102
|
+
| "TDD slows me down" | TDD faster than debugging. Pragmatic = test-first. |
|
|
103
|
+
| "This is different because..." | No. This is rationalization. Follow the law. |
|
|
104
|
+
| "Spirit not letter" | Violating letter IS violating spirit. No loopholes. |
|
|
105
|
+
| "I'm being pragmatic, not dogmatic" | TDD IS pragmatic. Shortcuts = debugging in production = slower. |
|
|
106
|
+
| "Just this once" | No exceptions. Rules exist for this exact moment. |
|
|
107
|
+
|
|
108
|
+
## Red Flags - STOP
|
|
109
|
+
|
|
110
|
+
If you find yourself:
|
|
111
|
+
- Writing code before tests
|
|
112
|
+
- Tests passing immediately
|
|
113
|
+
- Saying "just this once"
|
|
114
|
+
- Keeping "exploration" code
|
|
115
|
+
- Writing tests that describe existing code
|
|
116
|
+
|
|
117
|
+
**STOP. Delete the code. Write the test first.**
|
|
118
|
+
|
|
119
|
+
## Test Quality Requirements
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
Good Tests:
|
|
123
|
+
✅ Test behavior, not implementation
|
|
124
|
+
✅ Use realistic data
|
|
125
|
+
✅ Cover edge cases
|
|
126
|
+
✅ Independent (no shared state)
|
|
127
|
+
✅ Fast (< 1 second each)
|
|
128
|
+
✅ Descriptive names
|
|
129
|
+
|
|
130
|
+
Bad Tests (Cheater Tests):
|
|
131
|
+
❌ assert True
|
|
132
|
+
❌ assert result is not None
|
|
133
|
+
❌ Mock everything, test nothing
|
|
134
|
+
❌ Test implementation details
|
|
135
|
+
❌ Depend on execution order
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Error Recording Protocol
|
|
139
|
+
|
|
140
|
+
当测试失败或构建错误发生时,必须立即记录到 ERROR_LOG.md:
|
|
141
|
+
|
|
142
|
+
```yaml
|
|
143
|
+
Error Recording Workflow:
|
|
144
|
+
1. Capture Error Context:
|
|
145
|
+
- Phase (flow-dev / T###)
|
|
146
|
+
- Error Type (Test Failure | Build Error | Runtime Error)
|
|
147
|
+
- Full error message
|
|
148
|
+
- Timestamp
|
|
149
|
+
|
|
150
|
+
2. Create ERROR_LOG.md if not exists:
|
|
151
|
+
→ Use .claude/docs/templates/ERROR_LOG_TEMPLATE.md
|
|
152
|
+
→ Location: devflow/requirements/${REQ_ID}/ERROR_LOG.md
|
|
153
|
+
|
|
154
|
+
3. Append Error Record:
|
|
155
|
+
## [TIMESTAMP] E###: TITLE
|
|
156
|
+
**Phase**: flow-dev / T###
|
|
157
|
+
**Error Type**: Test Failure
|
|
158
|
+
**Error Message**:
|
|
159
|
+
```
|
|
160
|
+
[完整错误信息]
|
|
161
|
+
```
|
|
162
|
+
**Root Cause**: [分析后填写]
|
|
163
|
+
**Resolution**: [解决后填写]
|
|
164
|
+
**Prevention**: [可选]
|
|
165
|
+
|
|
166
|
+
4. Debug with Error Context:
|
|
167
|
+
→ Read ERROR_LOG.md for similar past errors
|
|
168
|
+
→ Apply attention refresh (Protocol 4)
|
|
169
|
+
→ Fix the root cause, not symptoms
|
|
170
|
+
|
|
171
|
+
5. Update Record After Fix:
|
|
172
|
+
→ Fill Root Cause
|
|
173
|
+
→ Fill Resolution
|
|
174
|
+
→ Add Prevention if applicable
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### Error Recording Example
|
|
178
|
+
|
|
179
|
+
```markdown
|
|
180
|
+
## [2026-01-08T14:30:00] E001: Test Failure - User Login Validation
|
|
181
|
+
|
|
182
|
+
**Phase**: flow-dev / T005
|
|
183
|
+
**Error Type**: Test Failure
|
|
184
|
+
**Error Message**:
|
|
185
|
+
\`\`\`
|
|
186
|
+
FAIL src/auth/login.test.ts
|
|
187
|
+
× should reject invalid email format
|
|
188
|
+
Expected: false
|
|
189
|
+
Received: true
|
|
190
|
+
\`\`\`
|
|
191
|
+
|
|
192
|
+
**Root Cause**: 正则表达式 `/^.+@.+$/` 过于宽松,接受了 `user@` 这样的无效邮箱
|
|
193
|
+
**Resolution**: 更新正则为 `/^[^\s@]+@[^\s@]+\.[^\s@]+$/` 要求至少有域名和顶级域
|
|
194
|
+
**Prevention**: 扩充测试用例,添加边界情况(无域名、无顶级域、特殊字符等)
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Integration with Constitution
|
|
198
|
+
|
|
199
|
+
- **Article I**: Complete implementation includes tests
|
|
200
|
+
- **Article VI**: TDD Mandate (this skill)
|
|
201
|
+
- **Article IX**: Integration-first testing
|
|
202
|
+
|
|
203
|
+
## Integration with Attention Refresh
|
|
204
|
+
|
|
205
|
+
- **Protocol 4**: Error Recovery 时读取 ERROR_LOG.md
|
|
206
|
+
- 避免重复犯相同错误
|
|
207
|
+
- 从历史错误中学习
|
|
208
|
+
|
|
209
|
+
## Cross-Reference
|
|
210
|
+
|
|
211
|
+
- [flow-attention-refresh](../flow-attention-refresh/SKILL.md) - Protocol 4
|
|
212
|
+
- [ERROR_LOG_TEMPLATE.md](../../docs/templates/ERROR_LOG_TEMPLATE.md)
|
|
213
|
+
- [rationalization-library.md](../../rules/rationalization-library.md#article-vi-test-first-development---rationalization-table)
|
|
214
|
+
- [project-constitution.md](../../rules/project-constitution.md#article-vi-test-first-development-测试优先开发)
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fractal-docs-generator
|
|
3
|
+
description: 目录级 CLAUDE.md 生成。触发:mkdir、create directory、目录结构变更。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 分形文档生成器
|
|
7
|
+
|
|
8
|
+
触发:创建/移动/重命名目录,目录内文件变化。
|
|
9
|
+
|
|
10
|
+
## 模板
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
<!-- 若此目录变更,立即更新本文件 -->
|
|
14
|
+
# {目录名} - {一句话定位}
|
|
15
|
+
|
|
16
|
+
| 文件 | 地位 | 职责 |
|
|
17
|
+
|------|------|------|
|
|
18
|
+
| foo.ts | 入口 | 对外唯一接口 |
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## 地位
|
|
22
|
+
|
|
23
|
+
| 地位 | 典型文件 |
|
|
24
|
+
|------|----------|
|
|
25
|
+
| 入口 | index.ts, main.ts |
|
|
26
|
+
| 核心 | service.ts, engine.ts |
|
|
27
|
+
| 辅助 | utils.ts, helpers.ts |
|
|
28
|
+
| 类型 | types.ts |
|
|
29
|
+
| 配置 | config.ts |
|
|
30
|
+
| 测试 | *.test.ts |
|
|
31
|
+
|
|
32
|
+
## 示例
|
|
33
|
+
|
|
34
|
+
```markdown
|
|
35
|
+
<!-- 若此目录变更,立即更新本文件 -->
|
|
36
|
+
# auth - 认证授权
|
|
37
|
+
|
|
38
|
+
| 文件 | 地位 | 职责 |
|
|
39
|
+
|------|------|------|
|
|
40
|
+
| index.ts | 入口 | 导出 AuthService |
|
|
41
|
+
| auth.service.ts | 核心 | 登录、令牌刷新 |
|
|
42
|
+
| jwt.helper.ts | 辅助 | JWT 签发验证 |
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
协作:本 skill 管目录,file-header-guardian 管文件。
|
|
@@ -129,6 +129,81 @@
|
|
|
129
129
|
"envOverride": "SKIP_CONSTITUTION_CHECK"
|
|
130
130
|
}
|
|
131
131
|
},
|
|
132
|
+
"fractal-docs-generator": {
|
|
133
|
+
"type": "domain",
|
|
134
|
+
"enforcement": "suggest",
|
|
135
|
+
"priority": "high",
|
|
136
|
+
"description": "分形文档生成器。创建目录时自动生成目录级 CLAUDE.md,实现 GEB 式递归架构文档",
|
|
137
|
+
"promptTriggers": {
|
|
138
|
+
"keywords": [
|
|
139
|
+
"创建目录",
|
|
140
|
+
"新建文件夹",
|
|
141
|
+
"mkdir",
|
|
142
|
+
"add folder",
|
|
143
|
+
"create directory",
|
|
144
|
+
"目录结构",
|
|
145
|
+
"CLAUDE.md",
|
|
146
|
+
"架构文档",
|
|
147
|
+
"分形文档"
|
|
148
|
+
],
|
|
149
|
+
"intentPatterns": [
|
|
150
|
+
"(创建|新建|添加).*?(目录|文件夹|folder|directory)",
|
|
151
|
+
"(mkdir|create|add).*?(folder|directory|dir)",
|
|
152
|
+
"目录.*?(结构|变更|调整)",
|
|
153
|
+
"(更新|同步).*?CLAUDE\\.md"
|
|
154
|
+
]
|
|
155
|
+
},
|
|
156
|
+
"fileTriggers": {
|
|
157
|
+
"pathPatterns": [
|
|
158
|
+
"**/CLAUDE.md"
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"file-header-guardian": {
|
|
163
|
+
"type": "domain",
|
|
164
|
+
"enforcement": "suggest",
|
|
165
|
+
"priority": "high",
|
|
166
|
+
"description": "文件头注释守护者。创建/修改代码文件时确保 @input/@output/@pos 三行契约注释存在",
|
|
167
|
+
"promptTriggers": {
|
|
168
|
+
"keywords": [
|
|
169
|
+
"创建文件",
|
|
170
|
+
"新建文件",
|
|
171
|
+
"write file",
|
|
172
|
+
"create file",
|
|
173
|
+
"add file",
|
|
174
|
+
"文件头注释",
|
|
175
|
+
"头注释",
|
|
176
|
+
"@input",
|
|
177
|
+
"@output",
|
|
178
|
+
"@pos"
|
|
179
|
+
],
|
|
180
|
+
"intentPatterns": [
|
|
181
|
+
"(创建|新建|添加|编写).*?(文件|模块|组件)",
|
|
182
|
+
"(create|write|add).*?(file|module|component)",
|
|
183
|
+
"(检查|更新|添加).*?(头注释|header comment)",
|
|
184
|
+
"文件.*?(注释|documentation)"
|
|
185
|
+
]
|
|
186
|
+
},
|
|
187
|
+
"fileTriggers": {
|
|
188
|
+
"pathPatterns": [
|
|
189
|
+
"**/*.ts",
|
|
190
|
+
"**/*.tsx",
|
|
191
|
+
"**/*.js",
|
|
192
|
+
"**/*.jsx",
|
|
193
|
+
"**/*.py",
|
|
194
|
+
"**/*.go",
|
|
195
|
+
"**/*.rs",
|
|
196
|
+
"**/*.sh"
|
|
197
|
+
],
|
|
198
|
+
"pathExclusions": [
|
|
199
|
+
"**/*.test.ts",
|
|
200
|
+
"**/*.spec.ts",
|
|
201
|
+
"**/*.d.ts",
|
|
202
|
+
"**/node_modules/**",
|
|
203
|
+
"**/.claude/**"
|
|
204
|
+
]
|
|
205
|
+
}
|
|
206
|
+
},
|
|
132
207
|
"devflow-file-standards": {
|
|
133
208
|
"type": "domain",
|
|
134
209
|
"enforcement": "suggest",
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verification-before-completion
|
|
3
|
+
description: "Use when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verification Before Completion
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
This skill enforces a critical discipline: **never claim completion without fresh verification evidence**.
|
|
11
|
+
|
|
12
|
+
The most common failure mode for AI agents is claiming success without actually verifying. This skill prevents that by requiring explicit verification steps before any completion claim.
|
|
13
|
+
|
|
14
|
+
## The Iron Law
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
NO COMPLETION CLAIMS WITHOUT FRESH VERIFICATION EVIDENCE
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## The Process
|
|
21
|
+
|
|
22
|
+
### Before ANY Completion Claim
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
1. IDENTIFY: What command proves this claim?
|
|
26
|
+
→ "Tests pass" requires: npm test / pytest / go test
|
|
27
|
+
→ "Build succeeds" requires: npm run build / make
|
|
28
|
+
→ "Lint clean" requires: npm run lint / eslint
|
|
29
|
+
→ "Type check passes" requires: tsc --noEmit / mypy
|
|
30
|
+
|
|
31
|
+
2. RUN: Execute the FULL command (fresh, complete)
|
|
32
|
+
→ Not cached results
|
|
33
|
+
→ Not partial output
|
|
34
|
+
→ Not "I ran it earlier"
|
|
35
|
+
|
|
36
|
+
3. READ: Full output, check exit code, count failures
|
|
37
|
+
→ Exit code 0 = success
|
|
38
|
+
→ Exit code non-zero = failure
|
|
39
|
+
→ Count actual pass/fail numbers
|
|
40
|
+
|
|
41
|
+
4. VERIFY: Does output confirm the claim?
|
|
42
|
+
→ "All tests pass" = 0 failures in output
|
|
43
|
+
→ "Build succeeds" = no errors, artifacts created
|
|
44
|
+
→ "No lint errors" = 0 problems found
|
|
45
|
+
|
|
46
|
+
5. ONLY THEN: Make the claim with evidence
|
|
47
|
+
→ Quote the relevant output
|
|
48
|
+
→ Include exit code
|
|
49
|
+
→ Show pass/fail counts
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Verification Commands by Context
|
|
53
|
+
|
|
54
|
+
### Flow Exit Gates
|
|
55
|
+
|
|
56
|
+
| Flow | Verification Command | Success Criteria |
|
|
57
|
+
|------|---------------------|------------------|
|
|
58
|
+
| /flow-prd | `validate-constitution --type prd` | Exit 0, no violations |
|
|
59
|
+
| /flow-epic | `validate-constitution --type epic` | Exit 0, no violations |
|
|
60
|
+
| /flow-dev | `npm test && npm run build` | All tests pass, build succeeds |
|
|
61
|
+
| /flow-qa | `npm test && npm run lint` | All pass, no blockers |
|
|
62
|
+
| /flow-release | `gh pr checks` | All checks pass |
|
|
63
|
+
|
|
64
|
+
### Common Development Tasks
|
|
65
|
+
|
|
66
|
+
| Claim | Required Verification |
|
|
67
|
+
|-------|----------------------|
|
|
68
|
+
| "Tests pass" | Run full test suite, show output |
|
|
69
|
+
| "Build succeeds" | Run build command, show output |
|
|
70
|
+
| "Lint clean" | Run linter, show 0 errors |
|
|
71
|
+
| "Type check passes" | Run type checker, show output |
|
|
72
|
+
| "No regressions" | Run affected tests, compare before/after |
|
|
73
|
+
| "Bug fixed" | Show failing test → fix → passing test |
|
|
74
|
+
|
|
75
|
+
## Rationalization Prevention
|
|
76
|
+
|
|
77
|
+
| Excuse | Reality |
|
|
78
|
+
|--------|---------|
|
|
79
|
+
| "I just ran it" | Run it again. Fresh evidence required. |
|
|
80
|
+
| "It was passing before" | Before ≠ now. Verify current state. |
|
|
81
|
+
| "The change is trivial" | Trivial changes break things. Verify. |
|
|
82
|
+
| "I'm confident it works" | Confidence ≠ evidence. Run the command. |
|
|
83
|
+
| "Tests are slow" | Slow tests > broken production. Run them. |
|
|
84
|
+
| "I'll verify after commit" | Verify BEFORE commit. Always. |
|
|
85
|
+
| "The CI will catch it" | You catch it first. Don't waste CI cycles. |
|
|
86
|
+
| "It's just documentation" | Doc changes can break builds. Verify. |
|
|
87
|
+
|
|
88
|
+
## Red Flags - STOP
|
|
89
|
+
|
|
90
|
+
If you find yourself:
|
|
91
|
+
- Saying "should work" without running verification
|
|
92
|
+
- Claiming "tests pass" without showing output
|
|
93
|
+
- Saying "I believe" instead of "I verified"
|
|
94
|
+
- Skipping verification "just this once"
|
|
95
|
+
- Trusting cached or stale results
|
|
96
|
+
|
|
97
|
+
**STOP. Run the verification command. Show the evidence.**
|
|
98
|
+
|
|
99
|
+
## Evidence Format
|
|
100
|
+
|
|
101
|
+
When claiming completion, always include:
|
|
102
|
+
|
|
103
|
+
```markdown
|
|
104
|
+
## Verification Evidence
|
|
105
|
+
|
|
106
|
+
**Command**: `npm test`
|
|
107
|
+
**Exit Code**: 0
|
|
108
|
+
**Output Summary**:
|
|
109
|
+
- Tests: 42 passed, 0 failed
|
|
110
|
+
- Coverage: 85%
|
|
111
|
+
- Duration: 12.3s
|
|
112
|
+
|
|
113
|
+
**Conclusion**: All tests pass. Ready for commit.
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Integration with CC-DevFlow
|
|
117
|
+
|
|
118
|
+
### Every Flow Exit Gate
|
|
119
|
+
|
|
120
|
+
```yaml
|
|
121
|
+
Exit Gate Verification:
|
|
122
|
+
1. Identify required verification commands
|
|
123
|
+
2. Run each command fresh
|
|
124
|
+
3. Capture full output
|
|
125
|
+
4. Verify success criteria met
|
|
126
|
+
5. Document evidence in EXECUTION_LOG.md
|
|
127
|
+
6. Only then proceed to next stage
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Task Completion
|
|
131
|
+
|
|
132
|
+
```yaml
|
|
133
|
+
Task Completion Verification:
|
|
134
|
+
1. Run task-specific tests
|
|
135
|
+
2. Verify acceptance criteria met
|
|
136
|
+
3. Show evidence in task completion message
|
|
137
|
+
4. Mark task complete only with evidence
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## The Discipline
|
|
141
|
+
|
|
142
|
+
This skill is about **intellectual honesty**. It's easy to believe something works. It's harder to prove it.
|
|
143
|
+
|
|
144
|
+
The discipline is:
|
|
145
|
+
1. **Assume nothing** - Don't trust memory or intuition
|
|
146
|
+
2. **Verify everything** - Run the actual commands
|
|
147
|
+
3. **Show evidence** - Quote output, not beliefs
|
|
148
|
+
4. **Fresh results only** - No stale or cached data
|
|
149
|
+
|
|
150
|
+
## Cross-Reference
|
|
151
|
+
|
|
152
|
+
- Constitution Article I: Quality First (complete implementation)
|
|
153
|
+
- Constitution Article VI: Test-First Development (TDD)
|
|
154
|
+
- rationalization-library.md: Cross-Article rationalizations
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
**[PROTOCOL]**: 变更时更新此头部,然后检查 CLAUDE.md
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
1766298649 Edit /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/package.json root
|
|
2
|
+
1766298660 Edit /Users/dimon/001Area/80-CodeWorld/002-devflow/cc-devflow/package.json root
|