@zalom/plastic 1.0.0-alpha.5 → 1.0.0-alpha.7

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.
@@ -0,0 +1,183 @@
1
+ ---
2
+ name: plastic:writing-plans
3
+ description: "Write implementation plans from a spec. Produces plan.md, checklist.md, and actions/ in the active intent directory."
4
+ ---
5
+
6
+ # Writing Plans
7
+
8
+ ## Overview
9
+
10
+ Write comprehensive implementation plans assuming the engineer has zero context for our codebase and questionable taste. Document everything they need to know: which files to touch for each task, code, testing, docs they might need to check, how to test it. Give them the whole plan as bite-sized tasks. DRY. YAGNI. TDD. Frequent commits.
11
+
12
+ Assume they are a skilled developer, but know almost nothing about our toolset or problem domain. Assume they don't know good test design very well.
13
+
14
+ **Announce at start:** "I'm using the writing-plans skill to plan intent {id} — {name}."
15
+
16
+ ## Active Intent Gate
17
+
18
+ Before proceeding, resolve the active intent:
19
+
20
+ 1. **Detect store:** Read `~/.plastic/projects.yml`, match CWD against registered project paths. If match → project store at `~/.plastic/projects/{slug}/store/`. If no match → global store at `~/.plastic/store/`.
21
+ 2. **Find active intent:** Read `INDEX.md` from the detected store. Look under `## Active`. If exactly one → use it. If multiple → ask which. If none → refuse: "No active intent. Create one first with /plastic:creating-intent"
22
+ 3. **Resolve intent directory:** `{store}/store/{id}--{slug}/`
23
+ 4. **Read spec:** Load `{intent_dir}/spec.md`. If no spec exists → refuse: "No spec found. Run /plastic:brainstorming first."
24
+
25
+ All artifacts go to the intent directory. Never write to external paths.
26
+
27
+ ## Scope Check
28
+
29
+ If the spec covers multiple independent subsystems, it should have been broken into sub-project specs during brainstorming. If it wasn't, suggest breaking this into separate plans — one per subsystem. Each plan should produce working, testable software on its own.
30
+
31
+ ## File Structure
32
+
33
+ Before defining tasks, map out which files will be created or modified and what each one is responsible for. This is where decomposition decisions get locked in.
34
+
35
+ - Design units with clear boundaries and well-defined interfaces. Each file should have one clear responsibility.
36
+ - You reason best about code you can hold in context at once, and your edits are more reliable when files are focused. Prefer smaller, focused files over large ones that do too much.
37
+ - Files that change together should live together. Split by responsibility, not by technical layer.
38
+ - In existing codebases, follow established patterns. If the codebase uses large files, don't unilaterally restructure - but if a file you're modifying has grown unwieldy, including a split in the plan is reasonable.
39
+
40
+ This structure informs the task decomposition. Each task should produce self-contained changes that make sense independently.
41
+
42
+ ## Bite-Sized Task Granularity
43
+
44
+ **Each step is one action (2-5 minutes):**
45
+ - "Write the failing test" - step
46
+ - "Run it to make sure it fails" - step
47
+ - "Implement the minimal code to make the test pass" - step
48
+ - "Run the tests and make sure they pass" - step
49
+ - "Commit" - step
50
+
51
+ ## Plan Document Header
52
+
53
+ **Every plan MUST start with this header:**
54
+
55
+ ```markdown
56
+ # [Feature Name] Implementation Plan
57
+
58
+ > **For agentic workers:** Use `plastic:executing-plan` to implement this plan task-by-task.
59
+
60
+ **Goal:** [One sentence describing what this builds]
61
+
62
+ **Architecture:** [2-3 sentences about approach]
63
+
64
+ **Tech Stack:** [Key technologies/libraries]
65
+
66
+ **Intent:** {id} — {name}
67
+
68
+ ---
69
+ ```
70
+
71
+ ## Task Structure
72
+
73
+ ````markdown
74
+ ### Task N: [Component Name]
75
+
76
+ **Files:**
77
+ - Create: `exact/path/to/file.rb`
78
+ - Modify: `exact/path/to/existing.rb:123-145`
79
+ - Test: `test/exact/path/to/test.rb`
80
+
81
+ - [ ] **Step 1: Write the failing test**
82
+
83
+ ```ruby
84
+ def test_specific_behavior
85
+ result = function(input)
86
+ assert_equal expected, result
87
+ end
88
+ ```
89
+
90
+ - [ ] **Step 2: Run test to verify it fails**
91
+
92
+ Run: `ruby -Itest test/path/test.rb --name test_specific_behavior`
93
+ Expected: FAIL with "undefined method"
94
+
95
+ - [ ] **Step 3: Write minimal implementation**
96
+
97
+ ```ruby
98
+ def function(input)
99
+ expected
100
+ end
101
+ ```
102
+
103
+ - [ ] **Step 4: Run test to verify it passes**
104
+
105
+ Run: `ruby -Itest test/path/test.rb --name test_specific_behavior`
106
+ Expected: PASS
107
+
108
+ - [ ] **Step 5: Commit**
109
+
110
+ ```bash
111
+ git add test/path/test.rb lib/path/file.rb
112
+ git commit -m "feat: add specific feature"
113
+ ```
114
+ ````
115
+
116
+ ## No Placeholders
117
+
118
+ Every step must contain the actual content an engineer needs. These are **plan failures** — never write them:
119
+ - "TBD", "TODO", "implement later", "fill in details"
120
+ - "Add appropriate error handling" / "add validation" / "handle edge cases"
121
+ - "Write tests for the above" (without actual test code)
122
+ - "Similar to Task N" (repeat the code — the engineer may be reading tasks out of order)
123
+ - Steps that describe what to do without showing how (code blocks required for code steps)
124
+ - References to types, functions, or methods not defined in any task
125
+
126
+ ## Remember
127
+ - Exact file paths always
128
+ - Complete code in every step — if a step changes code, show the code
129
+ - Exact commands with expected output
130
+ - DRY, YAGNI, TDD, frequent commits
131
+
132
+ ## Self-Review
133
+
134
+ After writing the complete plan, look at the spec with fresh eyes and check the plan against it. This is a checklist you run yourself — not a subagent dispatch.
135
+
136
+ **1. Spec coverage:** Skim each section/requirement in the spec. Can you point to a task that implements it? List any gaps.
137
+
138
+ **2. Placeholder scan:** Search your plan for red flags — any of the patterns from the "No Placeholders" section above. Fix them.
139
+
140
+ **3. Type consistency:** Do the types, method signatures, and property names you used in later tasks match what you defined in earlier tasks? A function called `clear_layers` in Task 3 but `clear_full_layers` in Task 7 is a bug.
141
+
142
+ If you find issues, fix them inline. No need to re-review — just fix and move on. If you find a spec requirement with no task, add the task.
143
+
144
+ ## Plastic Artifacts
145
+
146
+ After writing `plan.md`, create two additional artifacts in the intent directory:
147
+
148
+ ### checklist.md
149
+
150
+ Execution registry with one checkbox per task. Format:
151
+
152
+ ```markdown
153
+ # Checklist — Intent {id}: {name}
154
+
155
+ - [ ] Task 1: {task title}
156
+ - [ ] Task 2: {task title}
157
+ - [ ] Task 3: {task title}
158
+ ...
159
+ ```
160
+
161
+ ### actions/ACTION_N.md
162
+
163
+ One file per task. Each action is self-contained — a subagent can execute it without reading the plan.
164
+
165
+ ```markdown
166
+ # Action {N}: {task title}
167
+
168
+ {Full task text copied from plan.md — all steps, all code, all commands. Nothing omitted.}
169
+ ```
170
+
171
+ Create the `actions/` directory inside the intent directory: `{intent_dir}/actions/`
172
+
173
+ ## Git Commit
174
+
175
+ After writing all artifacts (plan.md, checklist.md, actions/), commit to the store:
176
+
177
+ ```bash
178
+ cd {store_root} && git add . && git commit -m "docs: plan for intent {id} — {name}"
179
+ ```
180
+
181
+ ## Execution Handoff
182
+
183
+ Plan complete. Invoke `plastic:executing-plan` to begin execution.
@@ -41,6 +41,22 @@ Active/Future/Completed placement is managed in INDEX.md, not in frontmatter.
41
41
  4. Set frontmatter: `id`, `intent`, `sources` (array — link to governing intent), `chain` (starts empty), `created`, `author`, `tags`
42
42
  5. Add `[[global:ID]]` backlink in `## Links`
43
43
 
44
+ ## Lifecycle Skills
45
+
46
+ Plastic has its own lifecycle skills. When a Plastic skill exists for the current phase, use it instead of any external skill (superpowers, superpowers-ruby, etc.).
47
+
48
+ | Phase | Skill | Produces |
49
+ |-------|-------|----------|
50
+ | What | `plastic:creating-intent` | Intent file |
51
+ | Why | `plastic:brainstorming` | `spec.md` |
52
+ | Why | `plastic:research` | `resources/*.md` |
53
+ | Why | `plastic:brainstorming-grill-me` | Deep interrogation |
54
+ | How | `plastic:writing-plans` | `plan.md`, `checklist.md`, `actions/` |
55
+ | Exec | `plastic:executing-plan` | Code + `outcome.md` |
56
+ | Done | `plastic:intent-curator` | Lifecycle transition |
57
+
58
+ **Artifact convention:** ALL lifecycle artifacts go to the active intent directory (`store/{id}--{slug}/`). Never write specs to `docs/superpowers/specs/` or plans to `docs/superpowers/plans/`.
59
+
44
60
  ## When You're Done
45
61
 
46
62
  When this project satisfies the governing intent's goal, report back. The orchestrator will complete the strategic intent.