|
| 1 | +# Spec Draft Procedure |
| 2 | + |
| 3 | +Generate order.md based on the task description (issue body or user input). |
| 4 | + |
| 5 | +## Steps |
| 6 | + |
| 7 | +1. Read the task description and understand the purpose and scope of the implementation |
| 8 | + |
| 9 | +2. Investigate existing code: |
| 10 | + - Identify files likely to be changed |
| 11 | + - Review existing structure, patterns, and dependencies |
| 12 | + - Check for test files and their organization |
| 13 | + |
| 14 | +3. Generate order.md (with the following structure): |
| 15 | + |
| 16 | + ```markdown |
| 17 | + # Task Name |
| 18 | + |
| 19 | + ## Overview |
| 20 | + |
| 21 | + What to do (1-3 sentences) |
| 22 | + |
| 23 | + ## Background |
| 24 | + |
| 25 | + Why this is needed (may quote from the issue) |
| 26 | + |
| 27 | + ## Files to Change |
| 28 | + |
| 29 | + - path/to/file.ts — Summary of changes |
| 30 | + |
| 31 | + ## Implementation Details |
| 32 | + |
| 33 | + - List specific changes as bullet points |
| 34 | + - Do not include code examples (describe what to do, not how) |
| 35 | + |
| 36 | + ## Database Changes (if applicable) |
| 37 | + |
| 38 | + - Schema file to modify: `db/shared.sql` or `db/tenant.sql` |
| 39 | + - New/modified tables and columns |
| 40 | + - Migration safety considerations (existing data, destructive operations) |
| 41 | + |
| 42 | + ## Completion Criteria |
| 43 | + |
| 44 | + - [ ] List verifiable conditions |
| 45 | + - [ ] pnpm validate passes |
| 46 | + - [ ] pnpm db:setup passes (if schema changes) |
| 47 | + |
| 48 | + ## Out of Scope |
| 49 | + |
| 50 | + - Explicitly state what will not be done |
| 51 | + ``` |
| 52 | + |
| 53 | +4. Run the quality checklist before finalizing |
| 54 | + |
| 55 | +## Quality Checklist |
| 56 | + |
| 57 | +Before completing order.md, verify each item: |
| 58 | + |
| 59 | +- [ ] For refactoring tasks: existing behaviors that must be preserved are listed as explicit completion criteria (not just "keep behavior unchanged") |
| 60 | +- [ ] Negative test cases are required where applicable (e.g., "X does NOT happen when Y") |
| 61 | +- [ ] Each completion criterion is independently verifiable (can be checked Yes/No without ambiguity) |
| 62 | +- [ ] Files to change are confirmed by reading the actual code (not guessed from names) |
| 63 | +- [ ] Out of scope items do not contradict the implementation details or files to change |
| 64 | +- [ ] Implicit dependencies of changed files are accounted for (e.g., if a function signature changes, callers are in scope) |
| 65 | +- [ ] DB schema changes: migration safety is addressed (existing data preservation, IF EXISTS on manual DROP TABLE) |
| 66 | +- [ ] DB schema changes: `pnpm db:setup` is included in completion criteria |
| 67 | +- [ ] Multi-tenant security: mutations are scoped to org, auth guards are before form parsing |
| 68 | + |
| 69 | +## Rules |
| 70 | + |
| 71 | +- Do not include code examples or snippets (keep it at the requirements level) |
| 72 | +- Only list files to change after actually reading the code to confirm |
| 73 | +- Completion criteria must be granular enough to be judged as Yes/No |
| 74 | +- Do not use vague expressions ("appropriately", "as needed") |
0 commit comments