@tamsensedev/runner 0.10.0 → 0.18.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/LICENSE +5 -5
- package/README.md +61 -50
- package/dist/cli.js +1188 -324
- package/dist/cli.js.map +1 -1
- package/dist/recorder.cjs +42 -6
- package/dist/recorder.cjs.map +1 -1
- package/library/.claude-plugin/plugin.json +5 -5
- package/library/THIRD_PARTY_NOTICES.md +123 -123
- package/library/agents/code-architect.md +67 -67
- package/library/agents/code-explorer.md +61 -61
- package/library/agents/code-reviewer.md +73 -73
- package/library/agents/code-simplifier.md +62 -62
- package/library/agents/design-critic.md +52 -52
- package/library/agents/second-opinion.md +64 -64
- package/library/agents/security-auditor.md +86 -86
- package/library/agents/silent-failure-hunter.md +70 -70
- package/library/agents/test-coverage-analyzer.md +78 -78
- package/library/agents/test-runner.md +48 -48
- package/library/agents/ui-tester.md +50 -50
- package/library/licenses/Apache-2.0.txt +202 -202
- package/library/skills/accessibility/SKILL.md +144 -144
- package/library/skills/accessibility/references/wcag-checks.md +168 -168
- package/library/skills/addressing-review-feedback/SKILL.md +109 -109
- package/library/skills/app-screens/SKILL.md +96 -96
- package/library/skills/app-screens/references/shell-kpis-charts.md +108 -108
- package/library/skills/app-screens/references/states-density-phone.md +54 -54
- package/library/skills/app-screens/references/tables-forms-settings.md +104 -104
- package/library/skills/avoiding-generic-ai-design/SKILL.md +92 -92
- package/library/skills/avoiding-generic-ai-design/references/tells.md +112 -112
- package/library/skills/clean-commits/SKILL.md +85 -85
- package/library/skills/design-review/SKILL.md +107 -107
- package/library/skills/design-review/references/critique-passes.md +101 -101
- package/library/skills/design-review/references/screenshot-procedure.md +121 -121
- package/library/skills/differential-security-review/LICENSE +427 -427
- package/library/skills/differential-security-review/SKILL.md +105 -105
- package/library/skills/differential-security-review/references/adversarial.md +115 -115
- package/library/skills/differential-security-review/references/methodology.md +145 -145
- package/library/skills/differential-security-review/references/patterns.md +108 -108
- package/library/skills/false-positive-check/LICENSE +427 -427
- package/library/skills/false-positive-check/SKILL.md +95 -95
- package/library/skills/false-positive-check/references/bug-class-verification.md +128 -128
- package/library/skills/false-positive-check/references/deep-verification.md +113 -113
- package/library/skills/false-positive-check/references/evidence-templates.md +93 -93
- package/library/skills/false-positive-check/references/false-positive-patterns.md +122 -122
- package/library/skills/false-positive-check/references/gate-reviews.md +36 -36
- package/library/skills/false-positive-check/references/standard-verification.md +80 -80
- package/library/skills/focused-implementation/SKILL.md +104 -104
- package/library/skills/implementation-plan/SKILL.md +66 -66
- package/library/skills/interface-design/SKILL.md +144 -144
- package/library/skills/interface-design/references/craft-defaults.md +130 -130
- package/library/skills/interface-design/references/new-direction.md +62 -62
- package/library/skills/interface-design/references/writing.md +52 -52
- package/library/skills/interface-polish/SKILL.md +103 -103
- package/library/skills/interface-polish/references/detail-rules.md +154 -154
- package/library/skills/interface-polish/references/worst-case-data.md +158 -158
- package/library/skills/motion-design/SKILL.md +106 -106
- package/library/skills/motion-design/references/recipes.md +243 -243
- package/library/skills/postgres-performance/SKILL.md +97 -97
- package/library/skills/postgres-performance/references/rules.md +265 -265
- package/library/skills/project-orientation/SKILL.md +77 -77
- package/library/skills/reviewing-changes/SKILL.md +183 -183
- package/library/skills/safe-database-changes/SKILL.md +111 -111
- package/library/skills/safe-database-changes/references/backfills.md +75 -75
- package/library/skills/safe-database-changes/references/migration-tools.md +69 -69
- package/library/skills/safe-database-changes/references/postgres-ddl.md +199 -199
- package/library/skills/security-review/SKILL.md +132 -132
- package/library/skills/security-review/references/checks-by-area.md +107 -107
- package/library/skills/security-review/references/do-not-report.md +86 -86
- package/library/skills/spec-writing/SKILL.md +144 -144
- package/library/skills/systematic-debugging/SKILL.md +130 -130
- package/library/skills/systematic-debugging/references/flaky-tests.md +51 -51
- package/library/skills/systematic-debugging/references/root-cause-tracing.md +55 -55
- package/library/skills/task-interview/SKILL.md +84 -84
- package/library/skills/test-driven-development/SKILL.md +116 -116
- package/library/skills/test-driven-development/references/writing-good-tests.md +85 -85
- package/library/skills/ui-testing/SKILL.md +102 -102
- package/library/skills/ui-testing/references/headless-check.md +295 -280
- package/library/skills/ui-testing/references/local-stand.md +51 -51
- package/library/skills/ui-testing/references/playwright-patterns.md +134 -134
- package/library/skills/ui-testing/references/recording.md +61 -58
- package/library/skills/verification-before-completion/SKILL.md +113 -113
- package/library/skills/web-interface-guidelines/SKILL.md +202 -202
- package/package.json +46 -46
|
@@ -1,104 +1,104 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: focused-implementation
|
|
3
|
-
description: Use when implementing a feature, change or fix in the code step, especially one that touches several files: turn the task into checkable goals, build it in small working slices, keep every changed line tied to the task, and record assumptions and side findings for the report instead of asking.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Focused implementation
|
|
7
|
-
|
|
8
|
-
The reviewer should be able to read your diff and see the task in every line. Nobody answers questions during the run, so you decide, write the decision down, and keep going.
|
|
9
|
-
|
|
10
|
-
Start with `project-orientation` if you have not done it in this run. When the spec has several changes, write the plan first with `implementation-plan`.
|
|
11
|
-
|
|
12
|
-
## 1. Turn the task into goals you can check
|
|
13
|
-
|
|
14
|
-
Before writing code, write a short list:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
Goal: invoices show the VAT amount per line
|
|
18
|
-
Checks:
|
|
19
|
-
- [ ] unit test: 3 lines at 20% VAT give per-line VAT 2.00, 4.00, 0.50
|
|
20
|
-
- [ ] invoice page renders a VAT column (component test or screenshot)
|
|
21
|
-
- [ ] existing invoice tests still pass
|
|
22
|
-
Assumptions:
|
|
23
|
-
- Rounding per line, half up, as in src/money/round.ts (spec does not say)
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
- Take the acceptance criteria from the spec as they are. Each one becomes at least one check.
|
|
27
|
-
- A vague goal ("make it work", "improve") becomes a concrete check you can run.
|
|
28
|
-
- Where the task or spec is ambiguous, pick the reading that best matches the spec, the existing code and the smallest change. Write it under Assumptions. Do not stop to ask; `task-interview` says which open points deserve a question in the report.
|
|
29
|
-
- If the task as written is impossible or contradicts the code (an API that does not exist, a field that is not stored), do the closest useful thing that stays inside the task, and explain the gap in the report.
|
|
30
|
-
|
|
31
|
-
## 2. Choose the simplest design that meets the goals
|
|
32
|
-
|
|
33
|
-
- Prefer the plain, obvious solution: a function call over an event bus, two similar components over a configurable framework for two cases. Three similar lines beat a premature abstraction.
|
|
34
|
-
- No speculative features, options, flags or extension points that the task does not need.
|
|
35
|
-
- Reuse what the project already has (helpers, components, error types, query builders) before writing new ones.
|
|
36
|
-
- For a change that spans many modules or needs a real design decision, ask the `code-architect` agent for one concrete blueprint, then follow it unless you find a reason not to (and say why).
|
|
37
|
-
|
|
38
|
-
## 3. Build in thin slices
|
|
39
|
-
|
|
40
|
-
Work in slices that each leave the project working:
|
|
41
|
-
|
|
42
|
-
1. Implement the smallest complete piece (vertical: from storage to API to UI for one case, rather than all of the storage first).
|
|
43
|
-
2. Test it: write the test first where the project has tests (`test-driven-development`), then run the tests near the change.
|
|
44
|
-
3. Check it builds and type-checks.
|
|
45
|
-
4. Move to the next slice.
|
|
46
|
-
|
|
47
|
-
Rules:
|
|
48
|
-
- Do not write more than roughly 100 lines without running something.
|
|
49
|
-
- Put the riskiest or least certain piece first, so a dead end shows up early.
|
|
50
|
-
- Never leave the build broken between slices.
|
|
51
|
-
- Commit a slice when it is green if that makes the history clearer (`clean-commits`); one commit at the end is also fine.
|
|
52
|
-
- New behaviour defaults to the safe, conservative option (off, opt-in, read-only) unless the task says otherwise.
|
|
53
|
-
|
|
54
|
-
## 4. Keep changes surgical
|
|
55
|
-
|
|
56
|
-
Every changed line should trace back to the task.
|
|
57
|
-
|
|
58
|
-
- Do not reformat, rename, reorder imports or "modernise" code you are not otherwise changing.
|
|
59
|
-
- Do not delete comments, code or tests you do not fully understand.
|
|
60
|
-
- Match the surrounding style even if you would write it differently.
|
|
61
|
-
- Clean up what your own change made unused (imports, helpers, variables). Leave older dead code alone.
|
|
62
|
-
- When you notice something wrong outside the task, do not fix it. Add it to a "Noticed, not changed" list for the report:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
Noticed, not changed:
|
|
66
|
-
- src/utils/format.ts: unused import of `dayjs` (unrelated)
|
|
67
|
-
- Login form shows the raw server error text (separate task)
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
Exception: if the task cannot be done correctly without touching it (the bug you are fixing lives there), change it and say why.
|
|
71
|
-
|
|
72
|
-
## 5. Flag these in the report
|
|
73
|
-
|
|
74
|
-
Do them only when the task needs them, choose the smaller option, and list them in the report so the reviewer looks closely:
|
|
75
|
-
|
|
76
|
-
- New dependencies, or upgrades of existing ones.
|
|
77
|
-
- Database schema changes or migrations (follow `safe-database-changes`).
|
|
78
|
-
- Changes to authentication, authorisation, sessions, CORS, uploads, rate limits, roles or permissions.
|
|
79
|
-
- New external services or new kinds of stored sensitive data.
|
|
80
|
-
- Changes to a public API, a shared contract, CI config or build config.
|
|
81
|
-
- Deleting files, features or tests.
|
|
82
|
-
- Changes in a repository that the task did not obviously involve.
|
|
83
|
-
|
|
84
|
-
Never: commit secrets, edit vendored or generated files by hand (regenerate them the way the project does), weaken or delete a failing test to get green, or disable lint rules to silence your own code.
|
|
85
|
-
|
|
86
|
-
## 6. Finish
|
|
87
|
-
|
|
88
|
-
1. Tidy your own diff: remove debug output, leftover TODOs you created, commented-out code. For a large change, the `code-simplifier` agent can do a behaviour-preserving pass over the changed files.
|
|
89
|
-
2. Run `verification-before-completion`.
|
|
90
|
-
3. Commit with `clean-commits`.
|
|
91
|
-
4. Write the report: what changed, how it was checked (commands and results), assumptions, flagged items, noticed-not-changed list, anything left open.
|
|
92
|
-
|
|
93
|
-
## Common mistakes
|
|
94
|
-
|
|
95
|
-
| Thought | What to do instead |
|
|
96
|
-
|---|---|
|
|
97
|
-
| "While I'm here I'll clean this up" | Note it under "Noticed, not changed". |
|
|
98
|
-
| "I'll test it all at the end" | Test each slice; a bug in slice 1 makes slices 2 to 5 wrong. |
|
|
99
|
-
| "Let me make it configurable, just in case" | Build what the task needs; add options when a second case exists. |
|
|
100
|
-
| "The spec is unclear, I'll wait" | Pick the most reasonable reading, write it under Assumptions, continue. |
|
|
101
|
-
| "This refactor is small enough to include" | Keep refactors out of feature changes unless the task needs them. |
|
|
102
|
-
| "Lint fails on my line, I'll add an ignore comment" | Fix the code; ignore comments only where the project already uses them for the same case, with a reason. |
|
|
103
|
-
|
|
104
|
-
Sources: addyosmani/agent-skills (MIT, commit aeac41d) incremental-implementation, plus ideas restated from the Karpathy coding guidelines. Changed: rewritten for unattended runs.
|
|
1
|
+
---
|
|
2
|
+
name: focused-implementation
|
|
3
|
+
description: Use when implementing a feature, change or fix in the code step, especially one that touches several files: turn the task into checkable goals, build it in small working slices, keep every changed line tied to the task, and record assumptions and side findings for the report instead of asking.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Focused implementation
|
|
7
|
+
|
|
8
|
+
The reviewer should be able to read your diff and see the task in every line. Nobody answers questions during the run, so you decide, write the decision down, and keep going.
|
|
9
|
+
|
|
10
|
+
Start with `project-orientation` if you have not done it in this run. When the spec has several changes, write the plan first with `implementation-plan`.
|
|
11
|
+
|
|
12
|
+
## 1. Turn the task into goals you can check
|
|
13
|
+
|
|
14
|
+
Before writing code, write a short list:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
Goal: invoices show the VAT amount per line
|
|
18
|
+
Checks:
|
|
19
|
+
- [ ] unit test: 3 lines at 20% VAT give per-line VAT 2.00, 4.00, 0.50
|
|
20
|
+
- [ ] invoice page renders a VAT column (component test or screenshot)
|
|
21
|
+
- [ ] existing invoice tests still pass
|
|
22
|
+
Assumptions:
|
|
23
|
+
- Rounding per line, half up, as in src/money/round.ts (spec does not say)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
- Take the acceptance criteria from the spec as they are. Each one becomes at least one check.
|
|
27
|
+
- A vague goal ("make it work", "improve") becomes a concrete check you can run.
|
|
28
|
+
- Where the task or spec is ambiguous, pick the reading that best matches the spec, the existing code and the smallest change. Write it under Assumptions. Do not stop to ask; `task-interview` says which open points deserve a question in the report.
|
|
29
|
+
- If the task as written is impossible or contradicts the code (an API that does not exist, a field that is not stored), do the closest useful thing that stays inside the task, and explain the gap in the report.
|
|
30
|
+
|
|
31
|
+
## 2. Choose the simplest design that meets the goals
|
|
32
|
+
|
|
33
|
+
- Prefer the plain, obvious solution: a function call over an event bus, two similar components over a configurable framework for two cases. Three similar lines beat a premature abstraction.
|
|
34
|
+
- No speculative features, options, flags or extension points that the task does not need.
|
|
35
|
+
- Reuse what the project already has (helpers, components, error types, query builders) before writing new ones.
|
|
36
|
+
- For a change that spans many modules or needs a real design decision, ask the `code-architect` agent for one concrete blueprint, then follow it unless you find a reason not to (and say why).
|
|
37
|
+
|
|
38
|
+
## 3. Build in thin slices
|
|
39
|
+
|
|
40
|
+
Work in slices that each leave the project working:
|
|
41
|
+
|
|
42
|
+
1. Implement the smallest complete piece (vertical: from storage to API to UI for one case, rather than all of the storage first).
|
|
43
|
+
2. Test it: write the test first where the project has tests (`test-driven-development`), then run the tests near the change.
|
|
44
|
+
3. Check it builds and type-checks.
|
|
45
|
+
4. Move to the next slice.
|
|
46
|
+
|
|
47
|
+
Rules:
|
|
48
|
+
- Do not write more than roughly 100 lines without running something.
|
|
49
|
+
- Put the riskiest or least certain piece first, so a dead end shows up early.
|
|
50
|
+
- Never leave the build broken between slices.
|
|
51
|
+
- Commit a slice when it is green if that makes the history clearer (`clean-commits`); one commit at the end is also fine.
|
|
52
|
+
- New behaviour defaults to the safe, conservative option (off, opt-in, read-only) unless the task says otherwise.
|
|
53
|
+
|
|
54
|
+
## 4. Keep changes surgical
|
|
55
|
+
|
|
56
|
+
Every changed line should trace back to the task.
|
|
57
|
+
|
|
58
|
+
- Do not reformat, rename, reorder imports or "modernise" code you are not otherwise changing.
|
|
59
|
+
- Do not delete comments, code or tests you do not fully understand.
|
|
60
|
+
- Match the surrounding style even if you would write it differently.
|
|
61
|
+
- Clean up what your own change made unused (imports, helpers, variables). Leave older dead code alone.
|
|
62
|
+
- When you notice something wrong outside the task, do not fix it. Add it to a "Noticed, not changed" list for the report:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Noticed, not changed:
|
|
66
|
+
- src/utils/format.ts: unused import of `dayjs` (unrelated)
|
|
67
|
+
- Login form shows the raw server error text (separate task)
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Exception: if the task cannot be done correctly without touching it (the bug you are fixing lives there), change it and say why.
|
|
71
|
+
|
|
72
|
+
## 5. Flag these in the report
|
|
73
|
+
|
|
74
|
+
Do them only when the task needs them, choose the smaller option, and list them in the report so the reviewer looks closely:
|
|
75
|
+
|
|
76
|
+
- New dependencies, or upgrades of existing ones.
|
|
77
|
+
- Database schema changes or migrations (follow `safe-database-changes`).
|
|
78
|
+
- Changes to authentication, authorisation, sessions, CORS, uploads, rate limits, roles or permissions.
|
|
79
|
+
- New external services or new kinds of stored sensitive data.
|
|
80
|
+
- Changes to a public API, a shared contract, CI config or build config.
|
|
81
|
+
- Deleting files, features or tests.
|
|
82
|
+
- Changes in a repository that the task did not obviously involve.
|
|
83
|
+
|
|
84
|
+
Never: commit secrets, edit vendored or generated files by hand (regenerate them the way the project does), weaken or delete a failing test to get green, or disable lint rules to silence your own code.
|
|
85
|
+
|
|
86
|
+
## 6. Finish
|
|
87
|
+
|
|
88
|
+
1. Tidy your own diff: remove debug output, leftover TODOs you created, commented-out code. For a large change, the `code-simplifier` agent can do a behaviour-preserving pass over the changed files.
|
|
89
|
+
2. Run `verification-before-completion`.
|
|
90
|
+
3. Commit with `clean-commits`.
|
|
91
|
+
4. Write the report: what changed, how it was checked (commands and results), assumptions, flagged items, noticed-not-changed list, anything left open.
|
|
92
|
+
|
|
93
|
+
## Common mistakes
|
|
94
|
+
|
|
95
|
+
| Thought | What to do instead |
|
|
96
|
+
|---|---|
|
|
97
|
+
| "While I'm here I'll clean this up" | Note it under "Noticed, not changed". |
|
|
98
|
+
| "I'll test it all at the end" | Test each slice; a bug in slice 1 makes slices 2 to 5 wrong. |
|
|
99
|
+
| "Let me make it configurable, just in case" | Build what the task needs; add options when a second case exists. |
|
|
100
|
+
| "The spec is unclear, I'll wait" | Pick the most reasonable reading, write it under Assumptions, continue. |
|
|
101
|
+
| "This refactor is small enough to include" | Keep refactors out of feature changes unless the task needs them. |
|
|
102
|
+
| "Lint fails on my line, I'll add an ignore comment" | Fix the code; ignore comments only where the project already uses them for the same case, with a reason. |
|
|
103
|
+
|
|
104
|
+
Sources: addyosmani/agent-skills (MIT, commit aeac41d) incremental-implementation, plus ideas restated from the Karpathy coding guidelines. Changed: rewritten for unattended runs.
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: implementation-plan
|
|
3
|
-
description: Use at the start of a code step when the spec or task touches more than one file or more than one repository: turn it into an ordered plan of small tasks with exact files, the interfaces passed between them, the checks that prove each one, and a review focus of the inputs no test covers yet.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Implementation plan
|
|
7
|
-
|
|
8
|
-
A plan is the set of decisions an implementer cannot make alone: which files, which names and signatures, which values from the spec, which tests prove each step. Write those down, nothing more. A plan longer than the code it describes has written the code instead.
|
|
9
|
-
|
|
10
|
-
Start with `project-orientation` if you have not done it in this run. Keep the plan in your working notes; it does not go into the repository unless the project asks for plans there.
|
|
11
|
-
|
|
12
|
-
## 1. Read the spec as the contract
|
|
13
|
-
|
|
14
|
-
- The acceptance criteria (AC-1, AC-2 and so on) are the finish line. Each one must end up proven by a test or a check.
|
|
15
|
-
- Out of scope is a hard limit: nothing from it goes into the plan.
|
|
16
|
-
- Decisions, assumptions and the code map are settled: follow them. If the code contradicts one, note it for the report and pick the reading closest to the spec.
|
|
17
|
-
- Values the spec pins (texts, limits, names, status codes) are copied verbatim into a "Constraints" list at the top of the plan.
|
|
18
|
-
|
|
19
|
-
## 2. Map the files
|
|
20
|
-
|
|
21
|
-
List every file you will create or change, with one line on its responsibility. Files that change together live together; follow the project's existing layout.
|
|
22
|
-
|
|
23
|
-
## 3. Order the tasks
|
|
24
|
-
|
|
25
|
-
Each task is the smallest unit with its own test cycle that a reviewer could accept or reject on its own:
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
Task 2: CSV export endpoint
|
|
29
|
-
Files: create server/api/boards/[id]/export.get.ts; test test/boardExport.test.ts
|
|
30
|
-
Consumes: canSeeBoard(userId, boardId) from server/utils/boardAccess.ts
|
|
31
|
-
Produces: GET /api/boards/:id/export -> text/csv, header "Title,Status,Owner"
|
|
32
|
-
Proves: AC-1, AC-2
|
|
33
|
-
Steps:
|
|
34
|
-
1. Test: 3 tasks give 4 lines; no access gives 404 (fails first)
|
|
35
|
-
2. Implement exportCsv(boardId: number): string and the route
|
|
36
|
-
3. Run: pnpm test test/boardExport.test.ts -> 2 passed
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
- Order by dependency: a task uses only what earlier tasks or the existing code provide. Put the riskiest or least certain task as early as its dependencies allow.
|
|
40
|
-
- **Interfaces:** write Consumes and Produces with exact names, parameters, return types and data shapes. This is how the next task learns the names; check that every name used later is produced earlier.
|
|
41
|
-
- **Steps:** each step is one action with a checkable result, and lets you write exactly one reasonable thing. Lines that decide nothing ("handle edge cases", "add validation", "write tests") are gaps: replace them with the case, the rule or the test name.
|
|
42
|
-
- **Tests at the highest seam** that covers the behaviour: an endpoint, a page or a public function, not private helpers. Follow `test-driven-development`.
|
|
43
|
-
|
|
44
|
-
## 4. Verification
|
|
45
|
-
|
|
46
|
-
Split it in two:
|
|
47
|
-
|
|
48
|
-
- **Automated:** the exact commands (tests, type check, lint, build) and what passing looks like. Take them from the spec's test plan and from `project-orientation`.
|
|
49
|
-
- **Manual:** what a person does and sees, naming the page or command. For interface work, the screens to render with `ui-testing` or `design-review`.
|
|
50
|
-
|
|
51
|
-
Map every acceptance criterion to the task and the check that proves it. A criterion without a check is a gap: add the test.
|
|
52
|
-
|
|
53
|
-
## 5. Review focus
|
|
54
|
-
|
|
55
|
-
Write up to five input classes or failure modes the spec implies but no planned test exercises, most likely to bite a person first: an empty list, a very long name, a second click, an expired session, a slow network. The spec's silence on an input is not permission for that input to break the program. For each line, add the test to the task that owns the code, or say in the report why it is left.
|
|
56
|
-
|
|
57
|
-
## 6. Self-check before coding
|
|
58
|
-
|
|
59
|
-
1. **Coverage:** every criterion has a task and a check; every task proves a criterion.
|
|
60
|
-
2. **Names:** names and signatures match between Produces and Consumes.
|
|
61
|
-
3. **Scope:** nothing from out of scope, nothing the spec did not ask for.
|
|
62
|
-
4. **Proportion:** the plan is shorter than the code it describes.
|
|
63
|
-
|
|
64
|
-
Then build it with `focused-implementation`, one task at a time, and finish with `verification-before-completion`. Put the plan's Review Focus and any deviations from the spec in the report.
|
|
65
|
-
|
|
66
|
-
Sources: adapted from obra/superpowers writing-plans (MIT, commit b739a8a), the plan template and ready-for-development rules of bmad-code-org/BMAD-METHOD (MIT, commit 61e01f8), humanlayer/humanlayer create_plan (Apache-2.0, commit 99abe67) and mattpocock/skills to-spec testing seams (MIT, commit 5beb35b). Changed: condensed into one process for unattended code steps, the plan stays in working notes, execution choices removed.
|
|
1
|
+
---
|
|
2
|
+
name: implementation-plan
|
|
3
|
+
description: Use at the start of a code step when the spec or task touches more than one file or more than one repository: turn it into an ordered plan of small tasks with exact files, the interfaces passed between them, the checks that prove each one, and a review focus of the inputs no test covers yet.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Implementation plan
|
|
7
|
+
|
|
8
|
+
A plan is the set of decisions an implementer cannot make alone: which files, which names and signatures, which values from the spec, which tests prove each step. Write those down, nothing more. A plan longer than the code it describes has written the code instead.
|
|
9
|
+
|
|
10
|
+
Start with `project-orientation` if you have not done it in this run. Keep the plan in your working notes; it does not go into the repository unless the project asks for plans there.
|
|
11
|
+
|
|
12
|
+
## 1. Read the spec as the contract
|
|
13
|
+
|
|
14
|
+
- The acceptance criteria (AC-1, AC-2 and so on) are the finish line. Each one must end up proven by a test or a check.
|
|
15
|
+
- Out of scope is a hard limit: nothing from it goes into the plan.
|
|
16
|
+
- Decisions, assumptions and the code map are settled: follow them. If the code contradicts one, note it for the report and pick the reading closest to the spec.
|
|
17
|
+
- Values the spec pins (texts, limits, names, status codes) are copied verbatim into a "Constraints" list at the top of the plan.
|
|
18
|
+
|
|
19
|
+
## 2. Map the files
|
|
20
|
+
|
|
21
|
+
List every file you will create or change, with one line on its responsibility. Files that change together live together; follow the project's existing layout.
|
|
22
|
+
|
|
23
|
+
## 3. Order the tasks
|
|
24
|
+
|
|
25
|
+
Each task is the smallest unit with its own test cycle that a reviewer could accept or reject on its own:
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Task 2: CSV export endpoint
|
|
29
|
+
Files: create server/api/boards/[id]/export.get.ts; test test/boardExport.test.ts
|
|
30
|
+
Consumes: canSeeBoard(userId, boardId) from server/utils/boardAccess.ts
|
|
31
|
+
Produces: GET /api/boards/:id/export -> text/csv, header "Title,Status,Owner"
|
|
32
|
+
Proves: AC-1, AC-2
|
|
33
|
+
Steps:
|
|
34
|
+
1. Test: 3 tasks give 4 lines; no access gives 404 (fails first)
|
|
35
|
+
2. Implement exportCsv(boardId: number): string and the route
|
|
36
|
+
3. Run: pnpm test test/boardExport.test.ts -> 2 passed
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
- Order by dependency: a task uses only what earlier tasks or the existing code provide. Put the riskiest or least certain task as early as its dependencies allow.
|
|
40
|
+
- **Interfaces:** write Consumes and Produces with exact names, parameters, return types and data shapes. This is how the next task learns the names; check that every name used later is produced earlier.
|
|
41
|
+
- **Steps:** each step is one action with a checkable result, and lets you write exactly one reasonable thing. Lines that decide nothing ("handle edge cases", "add validation", "write tests") are gaps: replace them with the case, the rule or the test name.
|
|
42
|
+
- **Tests at the highest seam** that covers the behaviour: an endpoint, a page or a public function, not private helpers. Follow `test-driven-development`.
|
|
43
|
+
|
|
44
|
+
## 4. Verification
|
|
45
|
+
|
|
46
|
+
Split it in two:
|
|
47
|
+
|
|
48
|
+
- **Automated:** the exact commands (tests, type check, lint, build) and what passing looks like. Take them from the spec's test plan and from `project-orientation`.
|
|
49
|
+
- **Manual:** what a person does and sees, naming the page or command. For interface work, the screens to render with `ui-testing` or `design-review`.
|
|
50
|
+
|
|
51
|
+
Map every acceptance criterion to the task and the check that proves it. A criterion without a check is a gap: add the test.
|
|
52
|
+
|
|
53
|
+
## 5. Review focus
|
|
54
|
+
|
|
55
|
+
Write up to five input classes or failure modes the spec implies but no planned test exercises, most likely to bite a person first: an empty list, a very long name, a second click, an expired session, a slow network. The spec's silence on an input is not permission for that input to break the program. For each line, add the test to the task that owns the code, or say in the report why it is left.
|
|
56
|
+
|
|
57
|
+
## 6. Self-check before coding
|
|
58
|
+
|
|
59
|
+
1. **Coverage:** every criterion has a task and a check; every task proves a criterion.
|
|
60
|
+
2. **Names:** names and signatures match between Produces and Consumes.
|
|
61
|
+
3. **Scope:** nothing from out of scope, nothing the spec did not ask for.
|
|
62
|
+
4. **Proportion:** the plan is shorter than the code it describes.
|
|
63
|
+
|
|
64
|
+
Then build it with `focused-implementation`, one task at a time, and finish with `verification-before-completion`. Put the plan's Review Focus and any deviations from the spec in the report.
|
|
65
|
+
|
|
66
|
+
Sources: adapted from obra/superpowers writing-plans (MIT, commit b739a8a), the plan template and ready-for-development rules of bmad-code-org/BMAD-METHOD (MIT, commit 61e01f8), humanlayer/humanlayer create_plan (Apache-2.0, commit 99abe67) and mattpocock/skills to-spec testing seams (MIT, commit 5beb35b). Changed: condensed into one process for unattended code steps, the plan stays in working notes, execution choices removed.
|