Skip to content

Commit 33513f5

Browse files
authored
docs: plan making skill (#265)
* docs: plan making skill wip * docs: round 2 * docs: round 3 * docs: last bit of plan cleanup
1 parent d0f153e commit 33513f5

3 files changed

Lines changed: 292 additions & 0 deletions

File tree

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: plan-making
3+
description: Creates development plan documents in docs/dev_todo/ using size-appropriate templates. Use when the user asks to plan a feature, write an RFC, create a dev plan, or when a task is complex enough to warrant a written plan before implementation.
4+
---
5+
6+
# Plan Making
7+
8+
## CRITICAL: Never Use Cursor Plan Mode
9+
10+
**Do NOT use Cursor's built-in Plan Mode or create `.cursor/plans/*.plan.md` files.** That format is proprietary, throwaway-oriented, and not suitable for long-lived documentation. Plans in this project are learning artifacts kept in `docs/dev_todo/` (active) and `docs/dev_completed/` (done).
11+
12+
## Workflow
13+
14+
### Step 1: Gather Context
15+
16+
Before writing a plan:
17+
- Read the GitHub issue (if linked)
18+
- Check `docs/README.md` for related architecture docs
19+
- Search `docs/dev_completed/` for prior art on similar work
20+
- Search `docs/dev_todo/` for related active plans
21+
22+
### Step 2: Determine T-Shirt Size
23+
24+
Size based on **conceptual complexity**, not file count (a variable rename across 20 files is still small). Use these signals:
25+
26+
| Signal | S | M | L | XL |
27+
|--------|---|---|---|-----|
28+
| Scope boundary | One bug, one pattern, one screen | Single feature, single concern | End-to-end feature slice across layers | Multi-milestone program with child plans |
29+
| Subsystem fan-out | Single subsystem | 1-2 subsystems | Multiple (UI + storage + background + settings) | Broad (nav + tabs + data + calendar + sync + tests) |
30+
| Design decisions | None or obvious | 1-2 minor choices | Multiple options with tradeoffs | Decision tables, library evaluations |
31+
| New architectural components | None | Maybe a helper | Named new class/pattern (e.g. `NotificationContext`, `FilterState`) | New navigation patterns, new packages |
32+
| Independent deliverable phases | 1 | 2-3 | 4-6 across layers | 7+ grouped into milestones |
33+
| Risk / rollback story | Trivial | Low | Feature flags, migration concerns | Legacy fallback, data loss prevention, phased rollout |
34+
35+
Pick the size that matches the majority of signals. When borderline, size down — you can always expand later.
36+
37+
### Step 3: Select Template
38+
39+
- **S or M** → Read [template-small.md](template-small.md) and follow it
40+
- **L or XL** → Read [template-large.md](template-large.md) and follow it
41+
42+
### Step 4: Write the Plan
43+
44+
Output location: `docs/dev_todo/<snake_case_name>.md`
45+
46+
Filename should be descriptive and concise (e.g., `data_sync_improvements.md`, `events_view_lookahead.md`).
47+
48+
### Step 5: README Linking
49+
50+
**Do NOT add the plan to `docs/README.md` at creation time.** The README index is updated only when a feature is complete and the plan moves to `docs/dev_completed/`. During active development the plan lives in `docs/dev_todo/` without a README entry.
51+
52+
## Repo Conventions to Embed
53+
54+
Every plan should respect these project rules:
55+
56+
- **Tests first** — New features require tests before or during implementation
57+
- **`CNPlusClockInterface`** — Never use `System.currentTimeMillis()` directly; use the clock interface for testable time-dependent code
58+
- **No broad `Exception` catching** — Always catch specific exception types
59+
- **Robolectric preferred** — Use Robolectric for logic tests; instrumentation only for real Android APIs (Calendar Provider, notifications, etc.)
60+
- **Check existing docs** — Reference `docs/architecture/` and `docs/dev_completed/` for patterns and prior decisions
61+
- **MockK limitations**`mockkStatic`, `mockkConstructor`, `anyConstructed` fail in instrumentation tests; use dependency injection (see `docs/dev_completed/constructor-mocking-android.md`)
62+
- **Concise code** — Everything it needs, nothing it doesn't
63+
64+
## Anti-Patterns
65+
66+
- **Over-specifying small plans**: Full code listings and test stubs in an S/M plan waste tokens and will change during implementation anyway
67+
- **Implementation weeds in S/M plans**: Focus on *what* and *why*, not *how* — the how is discovered during implementation
68+
- **Missing non-goals in L/XL plans**: Every large plan must explicitly state what is out of scope to prevent scope creep
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
# Large/XL Plan Template (L-XL)
2+
3+
Use for work with high subsystem fan-out, architecture decisions, new components, or phased rollout.
4+
5+
## Key Principle
6+
7+
Hit the right level of specificity — everything the plan needs, nothing it doesn't. Large plans are long-lived reference documents that future you (and the AI) will re-read during implementation. Invest in design decisions, non-goals, and scope boundaries. But don't pre-specify implementation details that will change during the build — TO BE CLEAR ONLY INCLUDE code snippets, test stubs, layouts, etc. when they're genuinely the clearest way to communicate an approach.
8+
9+
## Template
10+
11+
```markdown
12+
# Feature: [Title]
13+
14+
**GitHub Issue:** [#NNN](link)
15+
16+
## Background
17+
18+
[Problem statement, how it works today, history of related issues. Include tables of related issues if there's a trail.]
19+
20+
## Goal
21+
22+
[What we're building and what it enables for the user. 2-5 sentences.]
23+
24+
## Non-Goals
25+
26+
[Explicitly state what this plan does NOT cover. This is critical for preventing scope creep. Each item should be a concrete thing someone might reasonably expect to be included but isn't.]
27+
28+
- **[Thing A]**[why it's out of scope or deferred]
29+
- **[Thing B]**[why]
30+
31+
## Key Decisions Summary
32+
33+
| Decision | Choice | Rationale |
34+
|----------|--------|-----------|
35+
36+
## Current Architecture (if modifying existing systems)
37+
38+
[Tables of existing components, data flow, key insight that unlocks the approach.]
39+
40+
## Design Decisions
41+
42+
[Detailed sections for non-obvious choices. Each with options considered and rationale.]
43+
44+
## Implementation Plan
45+
46+
### Phase 0: [Infrastructure / Setup]
47+
48+
[Substeps (0a, 0b, 0c if needed), each independently verifiable. Describe what changes and why. Only include code snippets or layouts when prose alone can't convey the approach clearly.]
49+
50+
### Phase N: [Name]
51+
52+
[Same pattern. Large plans typically have 4-10 phases grouped into milestones.]
53+
54+
### Milestone Checkpoint
55+
56+
[What milestone N delivers. Validate before proceeding.]
57+
58+
## Files to Modify/Create
59+
60+
### New Files
61+
62+
| File | Purpose |
63+
|------|---------|
64+
65+
### Modified Files
66+
67+
| File | Changes |
68+
|------|---------|
69+
70+
## Testing Plan
71+
72+
[Describe what needs to be tested and why, organized by Robolectric vs instrumentation. Name the scenarios to cover — including edge cases and error handling — but don't write full test stubs. The implementation will determine the exact test shape.]
73+
74+
### Unit Tests (Robolectric)
75+
76+
[Key scenarios per component. Edge case and error handling scenarios inline with the component they cover.]
77+
78+
### Instrumentation Tests
79+
80+
[Only for things requiring real Android APIs. Name what must be validated on a real device/emulator.]
81+
82+
## Future Enhancements (if applicable)
83+
84+
[Numbered phases beyond current scope. Brief descriptions only.]
85+
86+
## Notes
87+
88+
[Design principles, behavior clarifications, technical notes that don't fit elsewhere.]
89+
90+
## Related Work
91+
92+
[Links to related docs in docs/architecture/, docs/dev_completed/, docs/dev_todo/.]
93+
```
94+
95+
## Reference Examples
96+
97+
### events_view_lookahead.md (Size XL)
98+
99+
`docs/dev_todo/events_view_lookahead.md` — the gold standard for a large plan:
100+
101+
- **Key Decisions Summary** table up front for quick reference
102+
- **UI Vision** with ASCII mockups
103+
- **Current Architecture** tables showing existing components
104+
- **Implementation Plan** with 7 phases grouped into 3 milestones
105+
- **Phase substeps** (0a, 0b, 0c) each independently verifiable
106+
- **Code snippets** where they clarify non-obvious approaches
107+
- **Testing Plan** organized by Robolectric vs instrumentation, with edge cases (empty states, error handling, refresh triggers) as named scenarios
108+
- **Files to Modify/Create** split into New and Modified tables
109+
- **Future Enhancements** as numbered phases beyond current scope
110+
- **Notes** with design principles and technical clarifications
111+
- Total: ~2000 lines
112+
113+
### settings_backup.md (Size L)
114+
115+
`docs/dev_completed/settings_backup.md` — good example of a large (not XL) plan:
116+
117+
- **Research Notes** documenting investigation findings
118+
- **Current Architecture** of settings storage
119+
- **4 phases** with clear boundaries
120+
- **Permission Strategy** as a dedicated section (domain-specific concern)
121+
- **Open Questions** with recommendations
122+
- **Appendix** for implementation notes discovered during the build
123+
- Total: ~360 lines
124+
125+
## Non-Goals Section Guidance
126+
127+
The Non-Goals section is **mandatory** for L/XL plans. Good non-goals are:
128+
129+
- Things adjacent to the feature that someone might assume are included
130+
- Explicitly deferred work (with reasoning)
131+
- Scope boundaries that prevent creep
132+
133+
**Example** (from a hypothetical navigation refactor):
134+
135+
```markdown
136+
## Non-Goals
137+
138+
- **Bidirectional sync** — stays as-is; the delete+reupload approach sidesteps sync issues
139+
- **Animated tab transitions** — visual polish deferred to a future phase
140+
- **Deep link support** — existing deep links continue to work; new deep link routes are future work
141+
- **Tablet layout** — single-column layout only; responsive layouts are a separate effort
142+
```
143+
144+
## What L/XL Plans MUST Include (that S-M plans skip)
145+
146+
- Non-Goals section
147+
- Key Decisions Summary table
148+
- Testing Plan with named scenarios (including edge cases and error handling), split by Robolectric vs instrumentation
149+
- Files to Modify/Create split into New and Modified
150+
- Milestone checkpoints between major phases
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Small/Medium Plan Template (S-M)
2+
3+
Use for single-concern work with few or no design decisions.
4+
5+
## Key Principle
6+
7+
Focus on **what** and **why**, not implementation details. Code will change during the build — don't waste tokens specifying it upfront. Brief illustrative snippets are fine when they clarify an approach; full listings are not.
8+
9+
## Template
10+
11+
```markdown
12+
# [Feature/Fix/Refactor]: [Title]
13+
14+
**GitHub Issue:** [#NNN](link)
15+
16+
## Overview
17+
18+
[1-3 sentences: what we're doing, why, and the key insight or approach]
19+
20+
## Background (if needed)
21+
22+
[Brief context: how it works today, related issues, why the current state is a problem. Skip if the overview is sufficient.]
23+
24+
## Plan
25+
26+
### Phase 1: [Name]
27+
28+
[What changes and why. List files involved. If a design choice exists, state the choice and rationale in 1-2 sentences. No full code listings.]
29+
30+
### Phase 2: [Name]
31+
32+
[Same pattern. Most S/M plans have 1-3 phases.]
33+
34+
## Files Changed Summary
35+
36+
| File | Change |
37+
|------|--------|
38+
39+
## Testing
40+
41+
[What to test and how (Robolectric vs instrumentation). Describe test scenarios, don't write full test stubs.]
42+
43+
## Open Questions (if any)
44+
45+
[Unresolved decisions. Remove this section if there are none.]
46+
```
47+
48+
## Example: Data Sync Improvements (Size M)
49+
50+
This is the plan from [#260](https://github.com/williscool/CalendarNotification/issues/260) — an excellent example of the right detail level for a medium plan:
51+
52+
- **Overview** frames the problem and goal in 2 sentences
53+
- **Background** explains current workflow and why it's broken
54+
- **Phases** name files and describe changes without full code
55+
- **Phase 3 (future)** explicitly defers investigation — keeps scope tight
56+
- Total: ~90 lines
57+
58+
## Example: Search Bar X of Y Count (Size S-M)
59+
60+
`docs/dev_todo/search_bar_x_of_y_count.md` — good example of a small-medium plan:
61+
62+
- **Design Decisions** table for the few choices that exist
63+
- **Phases** include brief code fragments (5-10 lines) only where they clarify the approach
64+
- **Testing** names specific test cases without writing full stubs
65+
- Total: ~160 lines
66+
67+
## What NOT to Include in S-M Plans
68+
69+
- Full Kotlin/XML code listings (save for implementation)
70+
- Full `@Test` method stubs with Given/When/Then
71+
- ASCII UI mockups (if UI is simple enough to describe in words)
72+
- Edge cases section (handle during implementation)
73+
- Architecture diagrams
74+
- Future enhancements beyond the immediate scope

0 commit comments

Comments
 (0)