@martinffx/atelier 3.0.2 → 3.1.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.
@@ -3,7 +3,8 @@ name: spec-plan
3
3
  description: >
4
4
  Write approved implementation plans in one of two modes. Explicit Inline mode creates a
5
5
  conversational plan for bounded work. Spec-backed Plan converts an approved design.md into
6
- plan.json and optional tracked tasks. Trigger after atelier-orchestrator selects a mode, when
6
+ plan.json. Both modes stop after producing their plan output. Trigger after
7
+ atelier-orchestrator selects a mode, when
7
8
  the user asks to plan work, or after spec-brainstorm completes. Direct invocation without a
8
9
  selected mode uses Spec-backed Plan. Do NOT use for research or execution.
9
10
  user-invocable: true
@@ -13,13 +14,42 @@ user-invocable: true
13
14
 
14
15
  Write a proportional plan so clear that any engineer can follow it. The selected planning
15
16
  mode determines whether the plan stays in the conversation or becomes a persisted structured
16
- artifact. This skill does not write code.
17
+ artifact. This skill does not write code or start implementation.
17
18
 
18
19
  `atelier-orchestrator` owns automatic classification and the human may override it. When this
19
20
  skill is directly invoked without a selected mode, use Spec-backed Plan. If Inline planning
20
21
  reveals substantial design or coordination needs, ask the human whether to switch to a
21
22
  Spec-backed Plan before presenting the plan.
22
23
 
24
+ ## Terminal boundary
25
+
26
+ This skill produces exactly one plan output and then stops:
27
+
28
+ - Inline mode presents the plan in conversation and changes no repository files.
29
+ - Spec-backed mode creates or updates only `plan.json` from an approved `design.md`.
30
+
31
+ Planning drafts and annotation cycles stay in conversation. Do not modify `design.md`, persist
32
+ a Markdown plan draft, create tracker entries, invoke another workflow skill, or edit
33
+ implementation files. These rules still apply when the human asks to plan and implement in one
34
+ request. Implementation requires a later, explicit request after this skill has finished.
35
+
36
+ ## Planning Rules
37
+
38
+ - Organize tasks around required behavior, not one task per layer.
39
+ - Record a short list of behavior the change must preserve.
40
+ - For each task, identify existing code to reuse, modify, or delete.
41
+ - Map every new abstraction to a present requirement and its current consumers.
42
+ - Introduce shared infrastructure only when at least two current consumers demonstrate the
43
+ same need.
44
+ - Group tests by changed contract and active boundary. Do not repeat the CRUD matrix across
45
+ layers.
46
+
47
+ ### Proportionality Gate
48
+
49
+ Before presenting any plan, compare its size and concepts with the requested behavior. If a
50
+ bounded migration or refactor introduces shared infrastructure, unrelated behavior, or a plan
51
+ substantially larger than the behavior being changed, stop and simplify it.
52
+
23
53
  ## Outputs
24
54
 
25
55
  ### Inline Plan (when explicitly selected)
@@ -33,7 +63,8 @@ structure. Omit optional subsections rather than rendering empty headings.
33
63
  Read enough of the codebase to identify the current behavior, boundaries, affected files,
34
64
  and concrete validation. Keep the plan proportional to implementation risk. Fill the
35
65
  template with confirmed, file-and-symbol-level details, including cross-file wiring or
36
- ordering constraints where they matter.
66
+ ordering constraints where they matter. Apply the Planning Rules and Proportionality Gate
67
+ before presenting it.
37
68
 
38
69
  Do not manufacture phases, task IDs, dependency graphs, acceptance matrices, `design.md`,
39
70
  `plan.json`, tracker entries, or harness todos. The conversation is the plan artifact.
@@ -52,11 +83,11 @@ Every revision invalidates prior approval. End each revised plan with "Inline Pl
52
83
  for review." and stop until the human explicitly approves that complete version. Do not
53
84
  implement until the current plan is approved.
54
85
 
55
- Approval authorizes implementation. Implement the approved conversational plan directly using
56
- the Inline execution safeguards in `atelier-orchestrator`. Do not invoke `spec-implement`,
57
- `spec-finish`, `code-subagents`, or task tracking.
58
-
59
- Do not create planning artifacts or tracker entries during this handoff.
86
+ When the human approves the Inline Plan, acknowledge that the plan is approved and stop. Do not
87
+ implement it in the same invocation. A later explicit implementation request may execute the
88
+ approved conversational plan directly using the Inline execution safeguards in
89
+ `atelier-orchestrator`; it does not use `spec-implement`, `spec-finish`, `code-subagents`, or
90
+ task tracking.
60
91
 
61
92
  ## Spec-backed Plan Artifacts
62
93
 
@@ -66,8 +97,8 @@ docs/specs/YYYY-MM-DD-<feature-name>/
66
97
  └── plan.json ← This skill's output
67
98
  ```
68
99
 
69
- The plan starts as a markdown draft for human annotation, then gets converted to
70
- structured plan.json when approved.
100
+ The plan starts as a conversational draft for human annotation, then gets converted to
101
+ structured `plan.json` when approved.
71
102
 
72
103
  ### plan.json Schema
73
104
 
@@ -76,14 +107,17 @@ structured plan.json when approved.
76
107
  "feature": "user-authentication",
77
108
  "spec": "docs/specs/2026-03-08-user-auth/design.md",
78
109
  "goal": "Add email/password authentication with session management",
110
+ "preserved_behavior": [
111
+ "Existing sessions remain valid"
112
+ ],
79
113
  "phases": [
80
114
  {
81
115
  "id": "P1",
82
- "name": "Domain Model",
116
+ "name": "Authenticate with email and password",
83
117
  "tasks": [
84
118
  {
85
119
  "id": "T1",
86
- "name": "Implement UserEntity with validation",
120
+ "name": "Accept valid credentials and reject invalid credentials",
87
121
  "depends_on": [],
88
122
  "inputs": [
89
123
  "User schema from design.md",
@@ -91,9 +125,18 @@ structured plan.json when approved.
91
125
  ],
92
126
  "description": "Create UserEntity with email and password fields. Implement validation using a Result type. Password must be hashed, never stored plaintext.",
93
127
  "files": {
128
+ "reuse": ["src/auth/password.ts"],
94
129
  "create": ["src/entities/user.ts", "tests/entities/user.test.ts"],
95
- "modify": []
130
+ "modify": [],
131
+ "delete": []
96
132
  },
133
+ "new_abstractions": [
134
+ {
135
+ "name": "UserEntity",
136
+ "requirement": "Validate email/password credentials",
137
+ "consumers": ["POST /sessions"]
138
+ }
139
+ ],
97
140
  "validation": {
98
141
  "tests": [
99
142
  "rejects empty email",
@@ -121,6 +164,7 @@ structured plan.json when approved.
121
164
  | feature | string | Kebab-case feature name |
122
165
  | spec | string | Path to the approved design.md |
123
166
  | goal | string | One-sentence goal |
167
+ | preserved_behavior | string[] | Short list of existing behavior that must remain unchanged |
124
168
  | phases | Phase[] | Implementation phases in dependency order |
125
169
 
126
170
  #### Phase fields
@@ -140,15 +184,16 @@ structured plan.json when approved.
140
184
  | depends_on | string[] | Task IDs that must complete first |
141
185
  | inputs | string[] | What you need to know before starting |
142
186
  | description | string | What to build, key decisions, constraints |
143
- | files | {create, modify} | Files to create and modify |
187
+ | files | {reuse, create, modify, delete} | Existing code to reuse, modify, or delete, plus files to create |
188
+ | new_abstractions | {name, requirement, consumers}[] | New abstractions mapped to a present requirement and current consumers |
144
189
  | validation | {tests, acceptance} | How to verify the task is done |
145
190
 
146
191
  ---
147
192
 
148
193
  ## Spec-backed Step 1: Write the Plan Draft
149
194
 
150
- Read the approved design.md, then write a plan as a markdown section in the same
151
- document or as a separate draft.
195
+ Read the approved `design.md`, then present the plan draft in conversation. Do not write the
196
+ draft into `design.md` or create a separate draft file.
152
197
 
153
198
  ### Plan quality
154
199
 
@@ -164,19 +209,18 @@ Each task should be self-contained and include:
164
209
 
165
210
  - **Inputs**: What you need to know or have before starting (from spec, existing code)
166
211
  - **Description**: What to build, key design decisions, constraints
167
- - **Files**: Exact paths to create and modify
168
- - **Validation**: Tests that must pass and acceptance criteria
212
+ - **Files**: Exact existing code to reuse, modify, or delete, and files to create
213
+ - **New abstractions**: Present requirement and current consumers for each; use an empty list
214
+ when the task adds none
215
+ - **Validation**: Tests grouped by changed contract and active boundary, plus acceptance criteria
169
216
 
170
217
  No exact code snippets. No implementation details. The task says WHAT and HOW TO VERIFY,
171
218
  not HOW to write the code.
172
219
 
173
220
  ### Task ordering
174
221
 
175
- Follow bottom-up dependency ordering:
176
-
177
- ```
178
- Entity → Repository → Service → Router/Consumer
179
- ```
222
+ Order tasks by required behavior and real dependencies. Keep changes across layers in one task
223
+ when they implement and verify one contract; do not create one task per layer.
180
224
 
181
225
  ### Task size
182
226
 
@@ -225,25 +269,12 @@ explicitly approves it.
225
269
  When the human approves — "looks good", "approved", "create tasks" — convert the plan
226
270
  into plan.json.
227
271
 
228
- ### Task Tracking
229
-
230
- Read `docs/agents/issue-tracker.md` when it exists. Create tracker entries only when that
231
- document configures a tracker, mirroring is enabled, and tracking adds execution value. Do not
232
- choose or configure a tracker here. Do not duplicate a simple plan.json into a tracker merely to
233
- satisfy the workflow.
234
-
235
272
  ### What to do
236
273
 
237
274
  1. Convert the annotated plan draft into structured plan.json
238
275
  2. Each task maps to a unit with inputs, description, files, and validation
239
276
  3. Dependencies between tasks are captured in `depends_on` fields
240
- 4. When execution benefits from configured task tracking, create entries according to
241
- `docs/agents/issue-tracker.md`:
242
- - Create any configured feature container
243
- - Add tasks with clear descriptions
244
- - Mirror dependencies when the configured tracker supports them
245
- 5. The plan.json is the source of truth for task details; the task tracker
246
- tracks execution state
277
+ 4. Do not create tracker entries or modify any file other than `plan.json`
247
278
 
248
279
  ### Verification
249
280
 
@@ -251,25 +282,27 @@ After creating plan.json, verify:
251
282
  - Every task has an ID and depends_on field
252
283
  - Dependencies form a valid DAG (no cycles)
253
284
  - Every task has inputs, description, and validation
285
+ - Preserved behavior is short and explicit
286
+ - Every task identifies code to reuse, modify, or delete
287
+ - Every new abstraction names its present requirement and current consumers
288
+ - Shared infrastructure has at least two current consumers with the same demonstrated need
254
289
  - File paths are complete and specific
255
- - Validation criteria are concrete and testable
290
+ - Validation criteria are concrete, testable, and grouped by changed contract and active boundary
291
+ - The plan passes the Proportionality Gate
256
292
 
257
293
  ---
258
294
 
259
295
  ## Handoff
260
296
 
261
- When plan.json is created, and any useful configured tracker entries have been created, the next
262
- step is **spec-implement** in Spec-backed mode.
297
+ When `plan.json` is created, report its path and stop.
263
298
 
264
299
  Tell the human:
265
300
 
266
- > "Spec-backed Plan is approved. Ready to start implementation?"
267
- >
268
- > **Autonomous** — I'll work through all tasks, only stopping if blocked.
269
- >
270
- > **Batched** — I'll do 3-5 tasks at a time, then report and wait for feedback.
301
+ > "Planning complete. Plan written to `docs/specs/<path>/plan.json`. A separate
302
+ > `spec-implement` invocation can execute it."
271
303
 
272
- Do not start implementing. That's spec-implement's job.
304
+ Do not invoke `spec-implement`, offer execution modes, or start implementing. The human must
305
+ start implementation with a separate request.
273
306
 
274
307
  Minor implementation deviations may be recorded inline and reflected in plan.json when they do
275
308
  not change approved behavior, scope, architecture, public contracts, or major dependencies.
@@ -284,7 +317,7 @@ spec-brainstorm. See **atelier-orchestrator** for iteration patterns.
284
317
  |----------------------------|--------|
285
318
  | Inline / "write a plan" | Present the complete Inline Plan from the template, stop |
286
319
  | Inline / "I added notes" | Apply the changes, re-present the entire updated Inline Plan, and stop for renewed approval |
287
- | Inline / "approved" | Implement the approved conversational plan directly; create no artifacts |
320
+ | Inline / "approved" | Acknowledge approval and stop; create no artifacts and do not implement |
288
321
  | Spec-backed / "write a plan" | Write the plan draft from design.md, stop |
289
322
  | Spec-backed / "I added notes" | Re-read, address all notes, do NOT implement |
290
- | Spec-backed / "approved" / "create tasks" | Create plan.json and useful task tracking |
323
+ | Spec-backed / "approved" / "create tasks" | Create only plan.json, report its path, and stop |
@@ -7,6 +7,11 @@ implementation must preserve. Contrast the current and desired states when usefu
7
7
  Write enough for an engineer unfamiliar with the immediate problem to understand
8
8
  the plan. Do not repeat implementation steps that belong under Changes.
9
9
 
10
+ ### Preserved Behavior
11
+
12
+ List the existing behavior that must remain unchanged. Keep the list short and tied to
13
+ observable contracts.
14
+
10
15
  ### Decisions
11
16
 
12
17
  Include this subsection when the plan depends on meaningful implementation choices.
@@ -38,18 +43,26 @@ is more than one change.
38
43
 
39
44
  For each change:
40
45
 
41
- - Start with the exact file path and a concise description.
46
+ - Start with the required behavior and the exact affected file paths.
42
47
  - Name the affected functions, types, routes, configuration keys, or other symbols.
43
48
  - Explain the current behavior when it matters to the change.
44
49
  - Describe the required behavior and important implementation constraints.
50
+ - Identify existing code to reuse, modify, or delete.
51
+ - Map each new abstraction to a present requirement and its current consumers. Shared
52
+ infrastructure requires at least two current consumers with the same demonstrated need.
45
53
  - Explain cross-file wiring, data flow, error handling, and execution order where relevant.
46
54
  - Identify files to create, modify, rename, or delete.
47
- - Mention corresponding test changes alongside the behavior they verify.
55
+ - Group tests by changed contract and active boundary. Do not repeat the CRUD matrix across
56
+ layers.
48
57
  - Use a short signature or pseudocode only when it removes material ambiguity.
49
58
 
50
59
  The plan should provide enough detail for another engineer to implement without
51
60
  rediscovering the approach, while avoiding line-by-line coding instructions.
52
61
 
62
+ Before presenting the plan, compare its size with the requested behavior. If a bounded
63
+ migration or refactor introduces shared infrastructure, unrelated behavior, or a plan
64
+ substantially larger than the behavior being changed, simplify it first.
65
+
53
66
  ## Known Limitations
54
67
 
55
68
  Include this section only when the planned implementation intentionally leaves