@tianhai/pi-workflow-kit 0.15.0 → 0.17.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.
- package/README.md +23 -13
- package/docs/plans/2026-06-03-karpathy-guidelines-ab-comparison.md +166 -0
- package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-design.md +77 -0
- package/docs/plans/completed/2026-05-22-agentic-agile-enhancements-implementation.md +473 -0
- package/docs/plans/completed/2026-05-25-design-review-split-implementation.md +622 -0
- package/docs/plans/completed/2026-05-25-design-review-split-progress.md +16 -0
- package/docs/plans/completed/2026-05-25-pr5-improvements-implementation.md +273 -0
- package/docs/plans/completed/2026-05-25-pr5-improvements-progress.md +17 -0
- package/docs/plans/completed/2026-06-03-add-verify-skill-design.md +51 -0
- package/docs/plans/completed/2026-06-03-add-verify-skill-implementation.md +111 -0
- package/docs/plans/completed/2026-06-03-add-verify-skill-progress.md +11 -0
- package/docs/plans/completed/2026-06-03-verify-skill-design.md +176 -0
- package/extensions/workflow-guard.ts +174 -185
- package/package.json +1 -1
- package/skills/brainstorming/SKILL.md +6 -1
- package/skills/design-review/SKILL.md +113 -0
- package/skills/executing-tasks/SKILL.md +17 -8
- package/skills/finalizing/SKILL.md +5 -3
- package/skills/verify/SKILL.md +170 -0
- package/skills/writing-plans/SKILL.md +121 -1
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verify
|
|
3
|
+
description: "Post-implementation code verification with three expert review passes — security, optimization, and traceability. Use after executing-tasks and before finalizing to catch issues that pass tests but break in production. Runs the 'last prompt' pattern: adversarial security review, dead code and duplication audit, and end-to-end contract verification across every layer. Use this skill whenever the user says 'verify', 'review the code', 'check for issues', 'security review', 'the last prompt', 'audit', or when code has been implemented and needs a quality gate before shipping."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Verify
|
|
7
|
+
|
|
8
|
+
Three expert review passes over the implemented codebase. Read-only — you **may** write the verification report to `docs/plans/`, but you **may not** modify source code.
|
|
9
|
+
|
|
10
|
+
The core insight: code that passes tests is not code that's ready. Working code can have security holes, dead branches, duplicated logic, and broken contracts between layers — especially when AI generates across many files without maintaining a single mental model of the whole system. This skill catches what tests miss.
|
|
11
|
+
|
|
12
|
+
## Process
|
|
13
|
+
|
|
14
|
+
1. **Check what's been done** — run `git log --oneline` and `git diff --stat` to understand the scope of recent changes. If nothing has been implemented, say "No code changes found. Run `/skill:executing-tasks` first." and stop.
|
|
15
|
+
|
|
16
|
+
2. **Identify the project's layers** — before reviewing, map the codebase's architecture. Look for layer boundaries: UI/handlers/routes → services/business logic → repositories/data access → database/models. Note the patterns: does the project use controllers, handlers, or routes? Services or use cases? Repositories or DAOs? This map drives the traceability pass.
|
|
17
|
+
|
|
18
|
+
3. **Run three expert review passes** — each pass adopts a distinct adversarial framing. Do them sequentially. For each pass, read the relevant code deeply — don't skim. Then write findings.
|
|
19
|
+
|
|
20
|
+
4. **Compile the report** — write all findings to `docs/plans/*-verification-report.md`. Present the report to the user and wait for feedback.
|
|
21
|
+
|
|
22
|
+
5. **Offer to create a remediation plan** — after the report, ask: "Want me to create a fix plan from these findings? Run `/skill:writing-plans` to turn the task list into executable tasks."
|
|
23
|
+
|
|
24
|
+
## Pass 1 — Security Review 🔴
|
|
25
|
+
|
|
26
|
+
**Framing:** A junior developer wrote this code. Now the best security expert on the team is reviewing it — adversarial, suspicious of everything. Trust nothing.
|
|
27
|
+
|
|
28
|
+
**What to look for:**
|
|
29
|
+
|
|
30
|
+
- **Input validation** — every external input (HTTP params, form data, headers, query strings, environment variables) must be validated and sanitized. Unvalidated input is a critical finding.
|
|
31
|
+
- **Authentication & authorization** — every endpoint that handles user data must have auth checks. Are there endpoints that skip auth? Can one user access another user's data by changing an ID?
|
|
32
|
+
- **Injection** — SQL queries built by string concatenation, unsanitized shell commands, template injection, XSS in HTML output. Any raw variable interpolated into a query or command is critical.
|
|
33
|
+
- **Secrets** — API keys, passwords, tokens hardcoded in source files. Check environment variable loading — are defaults set to empty or to actual secrets?
|
|
34
|
+
- **Data exposure** — are sensitive fields (passwords, tokens, PII) logged, returned in API responses, or stored unencrypted?
|
|
35
|
+
- **Dependency risks** — known-vulnerable packages (if `package.json`/`go.mod`/`requirements.txt` is present).
|
|
36
|
+
|
|
37
|
+
**Severity classification:**
|
|
38
|
+
|
|
39
|
+
| Severity | Definition |
|
|
40
|
+
|----------|-----------|
|
|
41
|
+
| Critical | Exploitable right now — auth bypass, injection, data leak |
|
|
42
|
+
| High | Likely exploitable — missing validation on sensitive endpoint, weak auth |
|
|
43
|
+
| Medium | Harder to exploit but real risk — verbose error messages leaking internals, missing rate limits |
|
|
44
|
+
| Low | Best practice violations — missing CSP headers, no HSTS, long session timeouts |
|
|
45
|
+
|
|
46
|
+
## Pass 2 — Optimization Review 🟡
|
|
47
|
+
|
|
48
|
+
**Framing:** A code quality expert looking for waste — things that make the codebase harder to maintain, slower to run, or more confusing than necessary.
|
|
49
|
+
|
|
50
|
+
**What to look for:**
|
|
51
|
+
|
|
52
|
+
- **Dead code** — functions, methods, types, or exports that are never called anywhere in the codebase. Search for definitions and verify they have callers.
|
|
53
|
+
- **Duplication** — the same logic implemented in slightly different ways across multiple files. AI-generated code is especially prone to this — if context was lost between sessions, the AI solved the same sub-problem differently in two places. Flag each pair with file paths and line numbers.
|
|
54
|
+
- **Over-engineering** — abstractions, interfaces, or layers that add complexity without earning their keep (only one implementation, no real variation across the seam).
|
|
55
|
+
- **Under-engineering** — god functions, 200-line blocks, deeply nested conditionals that should be extracted.
|
|
56
|
+
- **Performance concerns** — N+1 queries, unbounded loops, unnecessary copies of large data structures, missing pagination on list endpoints.
|
|
57
|
+
|
|
58
|
+
**Priority classification:**
|
|
59
|
+
|
|
60
|
+
| Priority | Definition |
|
|
61
|
+
|----------|-----------|
|
|
62
|
+
| P0 | Dead code in a critical path or duplicated logic that will diverge |
|
|
63
|
+
| P1 | Significant duplication or over-engineering that increases maintenance cost |
|
|
64
|
+
| P2 | Minor cleanups — long functions, missing pagination, style inconsistencies |
|
|
65
|
+
|
|
66
|
+
## Pass 3 — Traceability Review 🔵
|
|
67
|
+
|
|
68
|
+
**Framing:** An integration expert tracing every user-facing action end-to-end — from UI to database and back. The AI generates code file-by-file, and the seams between files are where bugs hide.
|
|
69
|
+
|
|
70
|
+
**What to look for:**
|
|
71
|
+
|
|
72
|
+
1. **Map every entry point** — list all handlers, routes, controllers, or event listeners that receive external input.
|
|
73
|
+
2. **Trace each call chain** — for each entry point, follow the call: handler → service → repository → database. At each boundary, verify:
|
|
74
|
+
- **Function name** — does the caller use the exact function name the callee exposes?
|
|
75
|
+
- **Argument names** — does the caller pass `userId` when the function expects `user_id`? Does `id` mean the same thing in both layers?
|
|
76
|
+
- **Argument types** — is a string passed where an integer is expected? Is an object shape different from what the next layer destructures?
|
|
77
|
+
- **Return shape** — does the caller expect fields that the callee actually returns? Are response DTOs consistent across layers?
|
|
78
|
+
3. **Check error propagation** — when a database query returns no results, does the service layer handle it? Does the handler return 404 or 500? Do errors propagate cleanly or get swallowed silently?
|
|
79
|
+
4. **Verify the round-trip** — if the UI calls `getUser(id)` and displays `user.name`, trace that `name` actually exists in the DB schema, gets selected by the query, mapped by the repository, passed through the service, included in the response, and rendered by the UI.
|
|
80
|
+
|
|
81
|
+
**This is the pass that catches the most bugs.** AI-generated code will often have a frontend calling `getUserProfile(userId)` and a backend exposing `get_user_profile(user_id)` — both work in isolation, neither works together.
|
|
82
|
+
|
|
83
|
+
**Severity classification:**
|
|
84
|
+
|
|
85
|
+
| Severity | Definition |
|
|
86
|
+
|----------|-----------|
|
|
87
|
+
| Critical | Call chain is completely broken — function doesn't exist or signature is fundamentally wrong |
|
|
88
|
+
| High | Signature mismatch — wrong arg names, wrong types, missing required fields |
|
|
89
|
+
| Medium | Silent error handling — errors swallowed without logging or user feedback |
|
|
90
|
+
| Low | Inconsistent naming conventions that could confuse future developers |
|
|
91
|
+
|
|
92
|
+
## Report Format
|
|
93
|
+
|
|
94
|
+
Write findings to `docs/plans/*-verification-report.md` using this structure:
|
|
95
|
+
|
|
96
|
+
```markdown
|
|
97
|
+
# Verification Report: <feature/topic>
|
|
98
|
+
|
|
99
|
+
**Date:** <ISO date>
|
|
100
|
+
**Scope:** <summary of what was reviewed>
|
|
101
|
+
**Reviewer:** AI verify skill (security + optimization + traceability)
|
|
102
|
+
|
|
103
|
+
## Summary
|
|
104
|
+
|
|
105
|
+
| Pass | Critical | High | Medium | Low |
|
|
106
|
+
|------|----------|------|--------|-----|
|
|
107
|
+
| Security | X | X | X | X |
|
|
108
|
+
| Optimization | — | X | X | X |
|
|
109
|
+
| Traceability | X | X | X | X |
|
|
110
|
+
| **Total** | **X** | **X** | **X** | **X** |
|
|
111
|
+
|
|
112
|
+
## 🔴 Security Findings
|
|
113
|
+
|
|
114
|
+
### [S-001] Critical — <short title>
|
|
115
|
+
|
|
116
|
+
**Location:** `path/to/file.ts:line`
|
|
117
|
+
|
|
118
|
+
**Issue:** <what's wrong and why it matters>
|
|
119
|
+
|
|
120
|
+
**Fix:** <concrete remediation step>
|
|
121
|
+
|
|
122
|
+
### [S-002] High — <short title>
|
|
123
|
+
...
|
|
124
|
+
|
|
125
|
+
## 🟡 Optimization Findings
|
|
126
|
+
|
|
127
|
+
### [O-001] P0 — <short title>
|
|
128
|
+
|
|
129
|
+
**Location:** `path/to/file.ts:line` and `path/to/other.ts:line`
|
|
130
|
+
|
|
131
|
+
**Issue:** <what's wrong>
|
|
132
|
+
|
|
133
|
+
**Fix:** <concrete remediation step>
|
|
134
|
+
|
|
135
|
+
### [O-002] P1 — <short title>
|
|
136
|
+
...
|
|
137
|
+
|
|
138
|
+
## 🔵 Traceability Findings
|
|
139
|
+
|
|
140
|
+
### [T-001] Critical — <short title>
|
|
141
|
+
|
|
142
|
+
**Entry point:** `path/to/handler.ts:line`
|
|
143
|
+
**Call chain:** handler → service → repository → DB
|
|
144
|
+
**Broken at:** <which boundary>
|
|
145
|
+
**Issue:** <what's wrong — e.g., handler passes `userId` but service expects `user_id`>
|
|
146
|
+
|
|
147
|
+
**Fix:** <concrete remediation step>
|
|
148
|
+
|
|
149
|
+
### [T-002] High — <short title>
|
|
150
|
+
...
|
|
151
|
+
|
|
152
|
+
## Remediation Task List
|
|
153
|
+
|
|
154
|
+
Convert findings into actionable tasks:
|
|
155
|
+
|
|
156
|
+
| ID | Priority | Finding | Estimated Effort |
|
|
157
|
+
|----|----------|---------|-----------------|
|
|
158
|
+
| S-001 | Critical | <one-liner> | <small/medium/large> |
|
|
159
|
+
| T-001 | Critical | <one-liner> | <small/medium/large> |
|
|
160
|
+
| O-001 | P0 | <one-liner> | <small/medium/large> |
|
|
161
|
+
| ...
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Principles
|
|
165
|
+
|
|
166
|
+
- **Be specific** — every finding must include a file path and line reference. "There might be security issues" is useless.
|
|
167
|
+
- **Be adversarial** — actively look for problems. If you don't find any, say so — but don't phone it in.
|
|
168
|
+
- **Be proportional** — a small config change doesn't need the same depth as a new API endpoint. Adjust your review depth to the scope of changes.
|
|
169
|
+
- **Don't fix anything** — this is read-only. Find and report. The user decides what to fix and when.
|
|
170
|
+
- **Focus on seams** — the traceability pass is where the most value lives. Code within a single file is usually coherent; the bugs hide between files.
|
|
@@ -10,18 +10,43 @@ You may only create or edit files under `docs/plans/`. Do not modify source code
|
|
|
10
10
|
## Process
|
|
11
11
|
|
|
12
12
|
1. **Check for a design doc** — look for `docs/plans/*-design.md`. If one exists, use it as the basis for the plan. If the design doc is incomplete, fill gaps by asking the human. If no design doc exists, ask the user to describe what they want to build and read relevant code. **Read `docs/lessons.md`** if it exists — incorporate known patterns into the task breakdown (e.g., if a lesson says "always run lint before commit," include that in relevant task instructions).
|
|
13
|
+
|
|
14
|
+
Then evaluate whether the design — whether from the design doc or from the user's description and codebase exploration — involves any of the following:
|
|
15
|
+
|
|
16
|
+
- Database schema changes or migrations
|
|
17
|
+
- Authentication or authorization logic
|
|
18
|
+
- External API or service integrations
|
|
19
|
+
- Concurrency or batch processing
|
|
20
|
+
- File uploads or large data flows
|
|
21
|
+
- Redis, caching, or message queues
|
|
22
|
+
|
|
23
|
+
If any apply AND the design doc does not already have an `## Architectural Review` section, prompt the user: "This design involves [list what you found] but hasn't been reviewed for production risks. Run `/skill:design-review` first, or type 'proceed' to skip."
|
|
24
|
+
|
|
25
|
+
If the design doc explicitly notes "Simple change — no design review needed", skip this check.
|
|
13
26
|
2. **Write the implementation plan** — break the design into tasks. Save to `docs/plans/YYYY-MM-DD-<topic>-implementation.md`. If the design is too large for ~15 tasks, flag this to the human and ask whether to reduce scope or proceed with the full plan.
|
|
14
27
|
3. **Present the plan** — show the complete plan to the human. Wait for approval before suggesting execution.
|
|
15
28
|
|
|
29
|
+
Before presenting, run the **Plan Acceptance Audit**:
|
|
30
|
+
- **Vertical Slices**: Is every task a complete vertical slice (not horizontal)?
|
|
31
|
+
- **Task Sizing**: Is any single task too large or covering multiple complex behaviors? If so, split it.
|
|
32
|
+
- **QA Coverage**: Does every task have both a Happy Path and at least one Edge Case in its Acceptance Criteria?
|
|
33
|
+
- **Checkpoint Alignment**: Are `checkpoint: test` and `checkpoint: done` gates placed on the most critical or risky tasks?
|
|
34
|
+
- **Risk Enforcement**: If the design doc's Architectural Review section flagged any hazards as `[TRIGGERED]`, verify the corresponding tasks have `checkpoint: done` and a `Hazard Mitigation Verification` section.
|
|
35
|
+
|
|
36
|
+
If any check fails, fix the plan before presenting.
|
|
37
|
+
|
|
16
38
|
## Task format
|
|
17
39
|
|
|
18
40
|
Each task should produce one testable change. The executing-tasks skill handles committing — do not include `git commit` in the task body.
|
|
19
41
|
|
|
20
42
|
Each task must include:
|
|
21
43
|
- Exact file paths to create/modify
|
|
44
|
+
- **Acceptance Criteria (QA Engineer Hat)** — Put on your **QA Engineer Hat** to design exhaustive test coverage. Explicitly define:
|
|
45
|
+
- **Happy Path**: Expected behavior under normal operations.
|
|
46
|
+
- **Edge Cases & Error Paths**: What happens with empty inputs, limits exceeded, authentication failures, or error states.
|
|
47
|
+
Ensure every criteria block specifies the expected state and returned results using `Given/When/Then` behavioral blocks.
|
|
22
48
|
- **Concrete code** — include the actual implementation, not a summary. Write out SQL schemas, type definitions, function signatures with bodies, route handler code, and test assertions. A developer should be able to copy-paste from the plan and have working code. For tasks that depend on types or utilities from earlier tasks, reference them explicitly (e.g., `import { User } from Task 2`) and include only the new code
|
|
23
49
|
- Exact commands with expected output (e.g., `npx vitest run src/user/model.test.ts` → shows 1 test passing)
|
|
24
|
-
- Each task's tests should cover the happy path and at least one edge case or error path, with concrete assertions
|
|
25
50
|
|
|
26
51
|
Each task must use a numbered heading with optional metadata comments:
|
|
27
52
|
|
|
@@ -95,6 +120,16 @@ The examples below show the structure — headings, metadata comments, checkpoin
|
|
|
95
120
|
|
|
96
121
|
<!-- tdd: new-feature -->
|
|
97
122
|
|
|
123
|
+
Acceptance Criteria (QA Engineer Hat):
|
|
124
|
+
- **Happy Path**:
|
|
125
|
+
- Given: Valid user data with name and email
|
|
126
|
+
- When: The User model is created
|
|
127
|
+
- Then: The model contains the correct fields and a generated ID
|
|
128
|
+
- **Edge Case (duplicate email)**:
|
|
129
|
+
- Given: A user with email "test@example.com" already exists
|
|
130
|
+
- When: Another user is created with the same email
|
|
131
|
+
- Then: Creation fails with a unique constraint error
|
|
132
|
+
|
|
98
133
|
Files:
|
|
99
134
|
- `src/user/model.ts`
|
|
100
135
|
- `src/user/model.test.ts`
|
|
@@ -113,6 +148,16 @@ Steps:
|
|
|
113
148
|
<!-- tdd: new-feature -->
|
|
114
149
|
<!-- checkpoint: test -->
|
|
115
150
|
|
|
151
|
+
Acceptance Criteria (QA Engineer Hat):
|
|
152
|
+
- **Happy Path**:
|
|
153
|
+
- Given: A user with valid credentials exists
|
|
154
|
+
- When: Login is attempted
|
|
155
|
+
- Then: A valid session token is returned
|
|
156
|
+
- **Edge Case (wrong password)**:
|
|
157
|
+
- Given: A user exists but password is incorrect
|
|
158
|
+
- When: Login is attempted
|
|
159
|
+
- Then: An authentication error is returned
|
|
160
|
+
|
|
116
161
|
Files:
|
|
117
162
|
- `src/auth/login.test.ts`
|
|
118
163
|
|
|
@@ -135,6 +180,20 @@ Steps:
|
|
|
135
180
|
<!-- tdd: new-feature -->
|
|
136
181
|
<!-- checkpoint: done -->
|
|
137
182
|
|
|
183
|
+
Acceptance Criteria (QA Engineer Hat):
|
|
184
|
+
- **Happy Path**:
|
|
185
|
+
- Given: A user with email "user@example.com" and password "secure123" exists
|
|
186
|
+
- When: A POST request with those credentials is sent to `/api/login`
|
|
187
|
+
- Then: Response returns `200 OK` with a signed JWT token
|
|
188
|
+
- **Edge Case (invalid password)**:
|
|
189
|
+
- Given: A user exists but the password sent is "wrong-pass"
|
|
190
|
+
- When: A POST request is sent to `/api/login`
|
|
191
|
+
- Then: Response returns `401 Unauthorized`
|
|
192
|
+
- **Edge Case (rate limiting)**:
|
|
193
|
+
- Given: 5 failed login attempts from the same IP
|
|
194
|
+
- When: A 6th attempt is sent
|
|
195
|
+
- Then: Response returns `429 Too Many Requests`
|
|
196
|
+
|
|
138
197
|
Files:
|
|
139
198
|
- `src/auth/login.ts`
|
|
140
199
|
- `src/auth/login.test.ts`
|
|
@@ -159,6 +218,16 @@ Steps:
|
|
|
159
218
|
<!-- checkpoint: test -->
|
|
160
219
|
<!-- checkpoint: done -->
|
|
161
220
|
|
|
221
|
+
Acceptance Criteria (QA Engineer Hat):
|
|
222
|
+
- **Happy Path**:
|
|
223
|
+
- Given: A valid OAuth2 authorization code
|
|
224
|
+
- When: The auth callback is invoked
|
|
225
|
+
- Then: A user session is created and the user is redirected to the dashboard
|
|
226
|
+
- **Edge Case (expired code)**:
|
|
227
|
+
- Given: An expired or invalid authorization code
|
|
228
|
+
- When: The auth callback is invoked
|
|
229
|
+
- Then: The user is redirected to login with an error message
|
|
230
|
+
|
|
162
231
|
Steps:
|
|
163
232
|
1. Write failing test for auth flow
|
|
164
233
|
2. Run test — confirm it fails
|
|
@@ -221,3 +290,54 @@ Use judgment when assigning checkpoints. Prefer `checkpoint: test` for new featu
|
|
|
221
290
|
## After the plan
|
|
222
291
|
|
|
223
292
|
Ask: "Ready to execute? Run `/skill:executing-tasks`"
|
|
293
|
+
|
|
294
|
+
## Behavioral Guidelines
|
|
295
|
+
|
|
296
|
+
Guidelines to reduce overcomplication and hidden assumptions in plans. Derived from [Andrej Karpathy's observations](https://x.com/karpathy/status/2015883857489522876) on LLM coding pitfalls, adapted for the planning context.
|
|
297
|
+
|
|
298
|
+
**Tradeoff:** These guidelines bias toward caution over speed. For trivial plans (1-2 tasks), use judgment.
|
|
299
|
+
|
|
300
|
+
### Surface Assumptions
|
|
301
|
+
|
|
302
|
+
**When the design is ambiguous, annotate — don't silently pick.**
|
|
303
|
+
|
|
304
|
+
When writing a plan, you'll encounter gaps: the design says "paginated" but doesn't specify how, says "validate input" but doesn't say which fields, or leaves the data layer unspecified. Your instinct will be to fill the gap and keep writing. Resist that.
|
|
305
|
+
|
|
306
|
+
Instead, add a brief `> **Assumption:** ...` note in the plan at the point where you made the call:
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
> **Assumption:** Using offset/limit pagination because the design just says
|
|
310
|
+
> "paginated". Cursor-based would be better for large datasets.
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
> **Assumption:** No service layer — handler calls store directly. Add one
|
|
315
|
+
> if cross-cutting concerns (logging, auth checks) emerge later.
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
This lets the reviewer see what you chose and why, without blocking progress. Common gaps worth annotating:
|
|
319
|
+
- Pagination style, error handling strategy, concurrency model
|
|
320
|
+
- Whether to add a service/middleware layer
|
|
321
|
+
- Whether to add external dependencies
|
|
322
|
+
- Naming conventions when the design doesn't specify
|
|
323
|
+
|
|
324
|
+
### Build Only What Each Task Needs
|
|
325
|
+
|
|
326
|
+
**Minimum code to deliver the task's observable behavior. Nothing more.**
|
|
327
|
+
|
|
328
|
+
- No interface methods that no task exercises yet. If Task 2 creates a `Store` interface, it should have only the methods Task 2 calls. Add methods in the task that first needs them.
|
|
329
|
+
- No layers (service, middleware, repository) unless the design explicitly requires them.
|
|
330
|
+
- No error types, helper files, or shared packages until a task actually uses them.
|
|
331
|
+
- No external dependencies when stdlib suffices. Every `go get` or `npm install` is a choice — default to no.
|
|
332
|
+
- No "flexible" or "configurable" code that wasn't requested.
|
|
333
|
+
|
|
334
|
+
If you find yourself writing a store with 4 methods where only 1 is used in this task, stop. Write 1 method. Add the rest when the tasks that need them arrive.
|
|
335
|
+
|
|
336
|
+
### One Task, One Change
|
|
337
|
+
|
|
338
|
+
**Each task should trace to exactly one user-facing behavior.**
|
|
339
|
+
|
|
340
|
+
- If a task creates more than 4 new files, it's probably doing too much — split it.
|
|
341
|
+
- If a task modifies existing files unrelated to its acceptance criteria, trim the scope.
|
|
342
|
+
- Infrastructure (types, interfaces, module scaffolding) should live in the same task as the first code that uses it, not in a separate "setup" task — unless the infrastructure alone is complex enough to warrant its own task.
|
|
343
|
+
- Every file listed in a task's `Files:` section should be directly necessary for that task's acceptance criteria to pass.
|