Skip to content

Commit 65e6347

Browse files
authored
feat(plan): add machine-checkable success-criteria gate (#209)
1 parent f2b2b0f commit 65e6347

8 files changed

Lines changed: 54 additions & 33 deletions

File tree

skills/build/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ls docs/plan/
4545

4646
Do not proceed without a plan.
4747

48-
**After loading the plan:** parse title, type, acceptance criteria, tasks, and file paths. Summarize scope to the user, then use **AskUserQuestion** to confirm:
48+
**After loading the plan:** parse title, type, the `success-criteria` block, tasks, and file paths. Summarize scope to the user, then use **AskUserQuestion** to confirm:
4949

5050
- **Start building (Recommended)**: proceed with implementation
5151
- **Review the plan first**: open the plan file for review
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../shared/references/plan-templates/success-criteria.md

skills/plan/SKILL.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,25 @@ After planning the issue structure, run the **user-flow-analysis-agent** to anal
119119

120120
- [ ] Review flow analysis results
121121
- [ ] Incorporate any identified gaps or edge cases into the issue
122-
- [ ] Update acceptance criteria based on flow analysis findings
122+
- [ ] Update success criteria based on flow analysis findings
123123

124-
### 4. Select implementation detail template
124+
### 4. Success Criteria Gate
125+
126+
Before selecting a template, derive the plan's success criteria and make each one machine-checkable. This block is the contract `/build` consumes, so it must be precise.
127+
128+
**For each criterion, apply one rule — can a command prove this without human judgment?**
129+
130+
- **Yes** → attach `verify: <command>` (exit code 0 = pass).
131+
- **No, but a human can check it** → attach `verify: manual <numbered steps>`.
132+
- **Neither (vacuous or unmeasurable, e.g. "make it work", "code is clean")** → reject it and rewrite it into a concrete, provable criterion.
133+
134+
Surface every rejected or rewritten criterion to the user with **AskUserQuestion** before writing the plan file — do not silently change the spec they approved.
135+
136+
These criteria populate the `success-criteria` block defined in [success-criteria.md](references/success-criteria.md); fill it in when you write the plan file in Step 6. That reference shows the block's shape and the `verify:` convention.
137+
138+
`verify:` commands reflect the project's own toolchain. If the project has a companion verification skill available, its gates are the canonical `verify:` commands.
139+
140+
### 5. Select implementation detail template
125141

126142
**Default to Standard.** Use a different level only when the task clearly warrants it.
127143

@@ -131,13 +147,13 @@ After planning the issue structure, run the **user-flow-analysis-agent** to anal
131147
| **Standard** (default) | Most features and bug fixes needing moderate detail | [standard](references/standard.md) |
132148
| **Extensive** | Major features, architectural changes, significant risk or uncertainty | [extensive](references/extensive.md) |
133149

134-
### 4.1. Set up workspace
150+
### 5.1. Set up workspace
135151

136152
Before writing the plan file, ensure the session is on a feature branch:
137153

138154
- Call /create-branch to check and optionally create a working branch or worktree.
139155

140-
### 5. Issue creation and formatting
156+
### 6. Issue creation and formatting
141157

142158
**Formatting checklist:**
143159

@@ -147,15 +163,15 @@ Before writing the plan file, ensure the session is on a feature branch:
147163
- [ ] Include prompts or instructions that worked well during research
148164
- [ ] Emphasize comprehensive testing given rapid AI-assisted implementation
149165

150-
### 6. Final review
166+
### 7. Final review
151167

152168
**Pre-submission Checklist:**
153169

154170
- [ ] Title is searchable and descriptive
155171
- [ ] Labels accurately categorize the issue
156172
- [ ] All template sections are complete
157173
- [ ] Links and references are working
158-
- [ ] Acceptance criteria are measurable
174+
- [ ] Success criteria each carry a `verify:` command (or `verify: manual <steps>`)
159175
- [ ] Add names of files in pseudo code examples and todo lists
160176
- [ ] Add an ERD mermaid diagram if applicable for new model changes
161177

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../shared/references/plan-templates/success-criteria.md

skills/shared/references/plan-templates/extensive.md

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,28 @@ date: YYYY-MM-DD
2929
#### Phase 1: [Foundation]
3030

3131
- Tasks and deliverables
32-
- Success criteria
32+
- Phase exit condition
3333
- Estimated effort
3434

3535
#### Phase 2: [Core Implementation]
3636

3737
- Tasks and deliverables
38-
- Success criteria
38+
- Phase exit condition
3939
- Estimated effort
4040

4141
#### Phase 3: [Polish & Optimization]
4242

4343
- Tasks and deliverables
44-
- Success criteria
44+
- Phase exit condition
4545
- Estimated effort
4646

4747
## Alternative Approaches Considered
4848

4949
[Other solutions evaluated and why rejected]
5050

51-
## Acceptance Criteria
51+
## Success Criteria
5252

53-
### Functional Requirements
54-
55-
- [ ] Detailed functional criteria
56-
57-
### Non-Functional Requirements
58-
59-
- [ ] Performance targets
60-
- [ ] Security requirements
61-
- [ ] Accessibility standards
62-
63-
### Quality Gates
64-
65-
- [ ] Test coverage requirements
66-
- [ ] Documentation completeness
67-
- [ ] Code review approval
53+
Embed the machine-checkable block defined in [success-criteria.md](success-criteria.md), with the placeholders filled in. For an extensive plan, cover functional, non-functional, and quality-gate requirements as concrete criteria.
6854

6955
## Success Metrics
7056

skills/shared/references/plan-templates/minimal.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@ date: YYYY-MM-DD
88

99
[Brief problem/feature description]
1010

11-
## Acceptance Criteria
11+
## Success Criteria
1212

13-
- [ ] Core requirement 1
14-
- [ ] Core requirement 2
13+
Embed the machine-checkable block defined in [success-criteria.md](success-criteria.md), with the placeholders filled in.
1514

1615
## Context
1716

skills/shared/references/plan-templates/standard.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ date: YYYY-MM-DD
2424
- Performance implications
2525
- Security considerations
2626

27-
## Acceptance Criteria
27+
## Success Criteria
2828

29-
- [ ] Detailed requirement 1
30-
- [ ] Detailed requirement 2
31-
- [ ] Testing requirements
29+
Embed the machine-checkable block defined in [success-criteria.md](success-criteria.md), with the placeholders filled in.
3230

3331
## Success Metrics
3432

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Success Criteria block
2+
3+
The single source for the machine-checkable success-criteria block. Every plan template and the `/plan` Success Criteria Gate reference this file so it is maintained once.
4+
5+
Each criterion names the command that proves it. Use `verify: <command>` (exit 0 = pass) when a command can prove it without human judgment, or `verify: manual <steps>` when only a human can. Reject vacuous criteria like "make it work" — rewrite them as something provable. Fold functional, non-functional, and quality-gate requirements into concrete criteria.
6+
7+
Embed this block verbatim in the plan's `## Success Criteria` section, filling in the placeholders:
8+
9+
```success-criteria
10+
GOAL: <one sentence describing the intended end state>
11+
12+
SUCCESS CRITERIA:
13+
- <observable criterion> | verify: <shell command; exit 0 = pass>
14+
- <observable criterion> | verify: manual <numbered human steps>
15+
16+
NON-GOALS:
17+
- <explicitly out of scope>
18+
19+
VERIFICATION COMMAND: <the non-manual verify commands above joined into one runnable command (e.g. with &&); exit 0 = all green>
20+
```

0 commit comments

Comments
 (0)