Skip to content

Commit c5e9425

Browse files
committed
Add detail to writing plans
1 parent 0b02d67 commit c5e9425

3 files changed

Lines changed: 148 additions & 30 deletions

File tree

references/writing-plans.md

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Writing Plans (shared reference)
2+
3+
**Purpose:** Guide for writing comprehensive implementation plans before touching code. Assumes engineer has zero context for the codebase and questionable taste.
4+
5+
**Used by:** Any skill that produces implementation plans for multi-step tasks.
6+
7+
## Overview
8+
9+
Document everything an engineer needs: which files to touch, code, testing, docs to check, how to verify. Give the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
10+
11+
Assume skilled developer, but knows almost nothing about the toolset or problem domain. Assume weak test design instincts.
12+
13+
**Save plans to:** `docs/plans/YYYY-MM-DD-<feature-name>.md`
14+
- (User preferences for plan location override this default)
15+
16+
## Scope Check
17+
18+
If spec covers multiple independent subsystems, suggest breaking into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
19+
20+
## File Structure
21+
22+
Before defining tasks, map out which files will be created or modified and what each one is responsible for.
23+
24+
- Design units with clear boundaries and well-defined interfaces. Each file: one clear responsibility.
25+
- Prefer smaller, focused files over large ones that do too much.
26+
- Files that change together should live together. Split by responsibility, not by technical layer.
27+
- In existing codebases, follow established patterns. If a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
28+
29+
This structure informs task decomposition. Each task should produce self-contained changes that make sense independently.
30+
31+
## Bite-Sized Task Granularity
32+
33+
**Each step is one action (2-5 minutes):**
34+
- "Write the failing test" - step
35+
- "Run it to make sure it fails" - step
36+
- "Implement the minimal code to make the test pass" - step
37+
- "Run the tests and make sure they pass" - step
38+
- "Commit" - step
39+
40+
## Plan Document Header
41+
42+
**Every plan MUST start with this header:**
43+
44+
```markdown
45+
# [Feature Name] Implementation Plan
46+
47+
**Goal:** [One sentence describing what this builds]
48+
49+
**Architecture:** [2-3 sentences about approach]
50+
51+
**Tech Stack:** [Key technologies/libraries]
52+
53+
---
54+
```
55+
56+
## Task Structure
57+
58+
````markdown
59+
### Task N: [Component Name]
60+
61+
**Files:**
62+
- Create: `exact/path/to/file.rb`
63+
- Modify: `exact/path/to/existing.rb:123-145`
64+
- Test: `spec/exact/path/to/file_spec.rb`
65+
66+
- [ ] **Step 1: Write the failing test**
67+
68+
```ruby
69+
RSpec.describe ClassName do
70+
describe "#method_name" do
71+
it "does specific behavior" do
72+
result = subject.method_name(input)
73+
expect(result).to eq(expected)
74+
end
75+
end
76+
end
77+
```
78+
79+
- [ ] **Step 2: Run test to verify it fails**
80+
81+
Run: `bundle exec rspec spec/path/file_spec.rb`
82+
Expected: FAIL with "undefined method `method_name'"
83+
84+
- [ ] **Step 3: Write minimal implementation**
85+
86+
```ruby
87+
def method_name(input)
88+
expected
89+
end
90+
```
91+
92+
- [ ] **Step 4: Run test to verify it passes**
93+
94+
Run: `bundle exec rspec spec/path/file_spec.rb`
95+
Expected: PASS
96+
97+
- [ ] **Step 5: Commit**
98+
99+
```bash
100+
git add spec/path/file_spec.rb app/path/file.rb
101+
git commit -m "feat: add specific feature"
102+
```
103+
````
104+
105+
## No Placeholders
106+
107+
Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
108+
- "TBD", "TODO", "implement later", "fill in details"
109+
- "Add appropriate error handling" / "add validation" / "handle edge cases"
110+
- "Write tests for the above" (without actual test code)
111+
- "Similar to Task N" (repeat the code — engineer may be reading tasks out of order)
112+
- Steps that describe what to do without showing how (code blocks required for code steps)
113+
- References to types, methods, or classes not defined in any task
114+
115+
## Remember
116+
- Exact file paths always
117+
- Complete code in every step — if a step changes code, show the code
118+
- Exact commands with expected output
119+
- DRY, YAGNI, TDD, frequent commits
120+
121+
## Self-Review
122+
123+
After writing the complete plan, check against spec with fresh eyes. Run yourself — not a subagent dispatch.
124+
125+
**1. Spec coverage:** Skim each section/requirement. Can you point to a task that implements it? List gaps.
126+
127+
**2. Placeholder scan:** Search for red flags — any patterns from "No Placeholders" above. Fix them.
128+
129+
**3. Type consistency:** Do method signatures and property names in later tasks match what you defined in earlier tasks? A method called `clear_layers` in Task 3 but `clear_full_layers` in Task 7 is a bug.
130+
131+
If you find issues, fix them inline. If you find a spec requirement with no task, add the task.

skills/build-using-strata-sdk/SKILL.md

Lines changed: 16 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -136,36 +136,22 @@ Interpret the output:
136136

137137
## Step 4: Write the plan document
138138

139-
Create `<RAILS_DIR>/docs/` if it doesn't exist. Write `<RAILS_DIR>/docs/<app-type>-application-form-plan.md` using the decisions captured in Step 2:
140-
141-
```markdown
142-
# <APP_TYPE> Application Form — Build Plan
143-
144-
## Application Type
145-
<APP_TYPE> → model: `<FORM_NAME>`
146-
147-
## Attributes
148-
| Attribute | Strata type | Notes |
149-
|-----------|-------------|-------|
150-
<rows from confirmed <ATTRS>>
151-
152-
## Entry Point
153-
<ENTRY_POINT description>
154-
155-
## Post-Submission Behavior
156-
<POST_SUBMIT description>
157-
158-
## Return Navigation
159-
<RETURN_BEHAVIOR description>
160-
161-
## What Will Be Built
162-
- Model: `app/models/strata/<form_name>.rb`
163-
- Migration: base columns (`status`, `user_id`, `submitted_at`) + attributes above
164-
- Controller + views for the form
165-
- Entry point wired per selection above
166-
- Post-submit flow per selection above
167-
- Return navigation per selection above
168-
```
139+
**Follow the shared reference: [`references/writing-plans.md`](references/writing-plans.md)** for plan structure, task granularity, and no-placeholder rules.
140+
141+
Create `<RAILS_DIR>/docs/` if it doesn't exist. Save the plan to `<RAILS_DIR>/docs/<app-type>-application-form-plan.md`. The plan header must cover:
142+
143+
- **Application Type:** `<APP_TYPE>` → model `<FORM_NAME>`
144+
- **Attributes table:** the confirmed `<ATTRS>` list with Strata types and notes
145+
- **Entry Point:** `<ENTRY_POINT>` description
146+
- **Post-Submission Behavior:** `<POST_SUBMIT>` description
147+
- **Return Navigation:** `<RETURN_BEHAVIOR>` description
148+
- **What Will Be Built:**
149+
- Model: `app/models/strata/<form_name>.rb`
150+
- Migration: base columns (`status`, `user_id`, `submitted_at`) + attributes above
151+
- Controller + views for the form
152+
- Entry point wired per selection above
153+
- Post-submit flow per selection above
154+
- Return navigation per selection above
169155

170156
## Step 5: User confirms plan
171157

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../references/writing-plans.md

0 commit comments

Comments
 (0)