@martinffx/atelier 3.0.1 → 3.1.0

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +19 -1
  3. package/dist/atelier.js +237 -44
  4. package/package.json +1 -1
  5. package/skills/atelier-orchestrator/SKILL.md +16 -3
  6. package/skills/atelier-setup/SKILL.md +43 -20
  7. package/skills/atelier-setup/references/domain.md +22 -0
  8. package/skills/atelier-setup/references/issue-tracker.md +35 -0
  9. package/skills/code-commit/SKILL.md +4 -3
  10. package/skills/code-pull-request/references/common.md +4 -4
  11. package/skills/code-pull-request/references/create-pr.md +15 -15
  12. package/skills/code-pull-request/references/merge-pr.md +3 -3
  13. package/skills/code-pull-request/references/read-comments.md +2 -2
  14. package/skills/code-review/SKILL.md +27 -8
  15. package/skills/code-review/references/output.md +52 -0
  16. package/skills/code-review/references/reviewers.md +113 -13
  17. package/skills/code-review/references/rq.md +195 -53
  18. package/skills/code-review/references/rs.md +41 -5
  19. package/skills/code-subagents/SKILL.md +4 -2
  20. package/skills/code-subagents/references/batch-reviewer-prompt.md +9 -0
  21. package/skills/code-subagents/references/implementor-prompt.md +7 -0
  22. package/skills/oracle-debug/SKILL.md +17 -10
  23. package/skills/oracle-debug/references/techniques.md +41 -137
  24. package/skills/oracle-domain-modelling/SKILL.md +5 -2
  25. package/skills/oracle-grill-me/SKILL.md +4 -1
  26. package/skills/spec-brainstorm/SKILL.md +34 -9
  27. package/skills/spec-finish/SKILL.md +40 -36
  28. package/skills/spec-implement/SKILL.md +38 -47
  29. package/skills/spec-plan/SKILL.md +64 -32
  30. package/skills/spec-plan/references/plan_template.md +15 -2
  31. package/skills/oracle-debug/references/language-tools.md +0 -139
@@ -23,7 +23,8 @@ Before starting, verify these exist:
23
23
 
24
24
  1. Approved `docs/specs/YYYY-MM-DD-<feature>/design.md`
25
25
  2. Approved `docs/specs/YYYY-MM-DD-<feature>/plan.json`
26
- 3. Any tracker entries selected during planning are available
26
+ 3. Any tracker entries selected during planning are available, along with
27
+ `docs/agents/issue-tracker.md` when tracking is configured
27
28
  4. You are not on main/master without explicit user consent. Create a branch or use a git
28
29
  worktree first.
29
30
 
@@ -39,9 +40,17 @@ Read plan.json critically before writing code. Look for:
39
40
  - Missing file paths or incomplete validation criteria
40
41
  - Tasks that conflict with each other
41
42
  - Dependencies that don't match what you see in the codebase
43
+ - Existing code or platform behavior that already satisfies a planned capability
44
+ - Duplicate IDs, parsers, errors, schemas, lifecycle handling, or test utilities
45
+ - Shared abstractions with fewer than two current consumers
46
+ - Tests whose only purpose is validating a new wrapper
42
47
 
43
- If you find concerns, **raise them with the human before starting**. Don't guess. Don't
44
- assume. Don't force through blockers.
48
+ If planned machinery fails these checks, stop before implementing it and return to
49
+ `spec-plan` with a smaller revision for human review. Preserve the approved behavior and scope;
50
+ do not force an unsupported structure through implementation.
51
+
52
+ For other concerns, **raise them with the human before starting**. Don't guess. Don't assume.
53
+ Don't force through blockers.
45
54
 
46
55
  If no concerns, proceed. Use existing tracker entries when present.
47
56
 
@@ -83,36 +92,22 @@ Default to batched if the human hasn't expressed a preference.
83
92
 
84
93
  ## Step 3: Execute the Plan
85
94
 
86
- Follow the approved plan exactly.
87
-
88
- For each task, find the next ready task:
89
-
90
- **With beads (preferred):**
91
- ```bash
92
- bd ready --label <feature> --json
93
- ```
94
-
95
- **With harness todos:** Check the todo list for the next unblocked task, respecting
96
- `depends_on` from plan.json.
97
-
98
- **Without a tracker:** Read the next unblocked task directly from plan.json.
95
+ Preserve the approved behavior and scope. Treat the plan's proposed structure as a hypothesis
96
+ that must remain supported by repository evidence.
99
97
 
100
- When a tracker exists, mark it in progress:
98
+ For each task, find the next unblocked task directly from `plan.json`. When tracker entries
99
+ exist, use `docs/agents/issue-tracker.md` to keep their execution state in sync; tracker state
100
+ never overrides the plan's dependency graph.
101
101
 
102
- **With beads:**
103
- ```bash
104
- bd update <task-id> --status in_progress
105
- ```
106
-
107
- **With harness todos:**
108
- Update the todo status to in_progress.
102
+ When a tracker exists, mark it in progress according to `docs/agents/issue-tracker.md`.
109
103
 
110
104
  ### For each task
111
105
 
112
106
  Read the task's **inputs** and **description** first.
113
107
 
114
- Write tests that cover the validation criteria before writing implementation.
115
- Invoke an installed language-specific testing skill when needed.
108
+ For behavior-changing code tasks, write tests that cover the validation criteria before writing
109
+ implementation. For documentation, configuration, migration, or verification-only tasks, use the
110
+ task's stated validation instead. Invoke an installed language-specific testing skill when needed.
116
111
 
117
112
  ```
118
113
  1. Read task inputs and description
@@ -122,28 +117,22 @@ Invoke an installed language-specific testing skill when needed.
122
117
  5. Refactor if needed (tests stay green)
123
118
  ```
124
119
 
125
- Do NOT write implementation before tests. Do NOT skip "verify it fails." Do NOT write
126
- more code than needed to pass the test.
120
+ For behavior-changing code, do NOT write implementation before tests. Do NOT skip "verify it
121
+ fails." Do NOT write more code than needed to pass the test.
127
122
 
128
123
  Verify the task against its **validation** and acceptance criteria.
129
124
 
130
- ### After each batch: Review and commit
125
+ ### After each batch: Validate and commit
131
126
 
132
- In Subagent Mode, use **code-subagents** for one combined batch review. In other modes,
133
- invoke **code-review** once for the batch. Resolve blocking findings and revalidate, then the
134
- coordinator commits the reviewed batch serially using **code-commit**.
127
+ Run the task's focused validation and inspect the local diff for accidental or out-of-scope
128
+ changes. Report deviations and unexpected findings. Use **code-commit** for any commit; plan
129
+ approval does not bypass its approval gate. Comprehensive **code-review** happens in
130
+ **spec-finish**.
135
131
 
136
132
  ### On completion
137
133
 
138
- When a tracker exists, mark the task done:
139
-
140
- **With beads:**
141
- ```bash
142
- bd close <task-id> --reason "Implemented with tests"
143
- ```
144
-
145
- **With harness todos:**
146
- Mark the task as completed.
134
+ When a tracker exists, mark the task complete according to
135
+ `docs/agents/issue-tracker.md`.
147
136
 
148
137
  ### Referencing existing code
149
138
 
@@ -231,8 +220,11 @@ If the design was wrong:
231
220
  ## When to Revisit Earlier Steps
232
221
 
233
222
  **Return to spec-plan when:**
234
- - Partner updates the plan based on your feedback
235
- - Tasks can't be completed as specified
223
+ - A material change affects approved behavior, scope, architecture, public contracts, or major dependencies
224
+ - Tasks cannot be completed without one of those material changes
225
+
226
+ Minor deviations may be recorded inline and reflected in plan.json when useful. Report them in the
227
+ next progress update.
236
228
 
237
229
  **Return to spec-brainstorm when:**
238
230
  - The fundamental approach needs rethinking
@@ -248,9 +240,8 @@ When all planned work is done, verify and present it.
248
240
 
249
241
  1. **Run full test suite** — all tests must pass, not just the new ones
250
242
  2. **Run type check / lint** — clean output, no new warnings
251
- 3. **Invoke code-review** — full review of all changes
252
- 4. **Verify completion** — close every tracker entry when tracking is used
253
- 5. **Diff review** — review the full diff against main/master. Look for:
243
+ 3. **Verify completion** — close every tracker entry when tracking is used
244
+ 4. **Diff review** — review the full diff against the intended base branch. Look for:
254
245
  - Files that changed but shouldn't have
255
246
  - Debug code or temporary hacks left behind
256
247
  - Inconsistencies between what was planned and what was built
@@ -274,7 +265,7 @@ Present to the human:
274
265
  - Test suite: ✓ all passing
275
266
  - Type check: ✓ clean
276
267
  - Lint: ✓ clean
277
- - Code review: ✓ complete
268
+ - Comprehensive code review: pending spec-finish
278
269
 
279
270
  ### Ready for review
280
271
  ```
@@ -20,6 +20,23 @@ skill is directly invoked without a selected mode, use Spec-backed Plan. If Inli
20
20
  reveals substantial design or coordination needs, ask the human whether to switch to a
21
21
  Spec-backed Plan before presenting the plan.
22
22
 
23
+ ## Planning Rules
24
+
25
+ - Organize tasks around required behavior, not one task per layer.
26
+ - Record a short list of behavior the change must preserve.
27
+ - For each task, identify existing code to reuse, modify, or delete.
28
+ - Map every new abstraction to a present requirement and its current consumers.
29
+ - Introduce shared infrastructure only when at least two current consumers demonstrate the
30
+ same need.
31
+ - Group tests by changed contract and active boundary. Do not repeat the CRUD matrix across
32
+ layers.
33
+
34
+ ### Proportionality Gate
35
+
36
+ Before presenting any plan, compare its size and concepts with the requested behavior. If a
37
+ bounded migration or refactor introduces shared infrastructure, unrelated behavior, or a plan
38
+ substantially larger than the behavior being changed, stop and simplify it.
39
+
23
40
  ## Outputs
24
41
 
25
42
  ### Inline Plan (when explicitly selected)
@@ -33,10 +50,11 @@ structure. Omit optional subsections rather than rendering empty headings.
33
50
  Read enough of the codebase to identify the current behavior, boundaries, affected files,
34
51
  and concrete validation. Keep the plan proportional to implementation risk. Fill the
35
52
  template with confirmed, file-and-symbol-level details, including cross-file wiring or
36
- ordering constraints where they matter.
53
+ ordering constraints where they matter. Apply the Planning Rules and Proportionality Gate
54
+ before presenting it.
37
55
 
38
56
  Do not manufacture phases, task IDs, dependency graphs, acceptance matrices, `design.md`,
39
- `plan.json`, Beads issues, or harness todos. The conversation is the plan artifact.
57
+ `plan.json`, tracker entries, or harness todos. The conversation is the plan artifact.
40
58
 
41
59
  **Tell the human:** "Inline Plan ready for review."
42
60
 
@@ -76,14 +94,17 @@ structured plan.json when approved.
76
94
  "feature": "user-authentication",
77
95
  "spec": "docs/specs/2026-03-08-user-auth/design.md",
78
96
  "goal": "Add email/password authentication with session management",
97
+ "preserved_behavior": [
98
+ "Existing sessions remain valid"
99
+ ],
79
100
  "phases": [
80
101
  {
81
102
  "id": "P1",
82
- "name": "Domain Model",
103
+ "name": "Authenticate with email and password",
83
104
  "tasks": [
84
105
  {
85
106
  "id": "T1",
86
- "name": "Implement UserEntity with validation",
107
+ "name": "Accept valid credentials and reject invalid credentials",
87
108
  "depends_on": [],
88
109
  "inputs": [
89
110
  "User schema from design.md",
@@ -91,9 +112,18 @@ structured plan.json when approved.
91
112
  ],
92
113
  "description": "Create UserEntity with email and password fields. Implement validation using a Result type. Password must be hashed, never stored plaintext.",
93
114
  "files": {
115
+ "reuse": ["src/auth/password.ts"],
94
116
  "create": ["src/entities/user.ts", "tests/entities/user.test.ts"],
95
- "modify": []
117
+ "modify": [],
118
+ "delete": []
96
119
  },
120
+ "new_abstractions": [
121
+ {
122
+ "name": "UserEntity",
123
+ "requirement": "Validate email/password credentials",
124
+ "consumers": ["POST /sessions"]
125
+ }
126
+ ],
97
127
  "validation": {
98
128
  "tests": [
99
129
  "rejects empty email",
@@ -121,6 +151,7 @@ structured plan.json when approved.
121
151
  | feature | string | Kebab-case feature name |
122
152
  | spec | string | Path to the approved design.md |
123
153
  | goal | string | One-sentence goal |
154
+ | preserved_behavior | string[] | Short list of existing behavior that must remain unchanged |
124
155
  | phases | Phase[] | Implementation phases in dependency order |
125
156
 
126
157
  #### Phase fields
@@ -140,7 +171,8 @@ structured plan.json when approved.
140
171
  | depends_on | string[] | Task IDs that must complete first |
141
172
  | inputs | string[] | What you need to know before starting |
142
173
  | description | string | What to build, key decisions, constraints |
143
- | files | {create, modify} | Files to create and modify |
174
+ | files | {reuse, create, modify, delete} | Existing code to reuse, modify, or delete, plus files to create |
175
+ | new_abstractions | {name, requirement, consumers}[] | New abstractions mapped to a present requirement and current consumers |
144
176
  | validation | {tests, acceptance} | How to verify the task is done |
145
177
 
146
178
  ---
@@ -164,19 +196,18 @@ Each task should be self-contained and include:
164
196
 
165
197
  - **Inputs**: What you need to know or have before starting (from spec, existing code)
166
198
  - **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
199
+ - **Files**: Exact existing code to reuse, modify, or delete, and files to create
200
+ - **New abstractions**: Present requirement and current consumers for each; use an empty list
201
+ when the task adds none
202
+ - **Validation**: Tests grouped by changed contract and active boundary, plus acceptance criteria
169
203
 
170
204
  No exact code snippets. No implementation details. The task says WHAT and HOW TO VERIFY,
171
205
  not HOW to write the code.
172
206
 
173
207
  ### Task ordering
174
208
 
175
- Follow bottom-up dependency ordering:
176
-
177
- ```
178
- Entity → Repository → Service → Router/Consumer
179
- ```
209
+ Order tasks by required behavior and real dependencies. Keep changes across layers in one task
210
+ when they implement and verify one contract; do not create one task per layer.
180
211
 
181
212
  ### Task size
182
213
 
@@ -227,27 +258,21 @@ into plan.json.
227
258
 
228
259
  ### Task Tracking
229
260
 
230
- Create tracker entries when they add execution value. For multi-task or dependency-ordered
231
- work, **prefer beads**:
232
- ```bash
233
- # Create epic and tasks with dependencies
234
- bd create "Feature: {name}" --label {feature} --type epic
235
- bd create "Task: {name}" --label {feature} --type task --epic {epic-id}
236
- bd dep add --type blocks {task-a} {task-b} # task-a blocks task-b
237
- ```
238
-
239
- If tracking is useful and beads is unavailable, use the harness's native todo system.
240
- Do not duplicate a simple plan.json into a tracker merely to satisfy the workflow.
261
+ Read `docs/agents/issue-tracker.md` when it exists. Create tracker entries only when that
262
+ document configures a tracker, mirroring is enabled, and tracking adds execution value. Do not
263
+ choose or configure a tracker here. Do not duplicate a simple plan.json into a tracker merely to
264
+ satisfy the workflow.
241
265
 
242
266
  ### What to do
243
267
 
244
268
  1. Convert the annotated plan draft into structured plan.json
245
269
  2. Each task maps to a unit with inputs, description, files, and validation
246
270
  3. Dependencies between tasks are captured in `depends_on` fields
247
- 4. When execution benefits from task tracking, create tasks using beads or harness todos:
248
- - Create an epic/feature container
249
- - Add tasks per phase with clear descriptions
250
- - Mark dependencies between tasks (beads: `bd dep add`, harness: manual ordering)
271
+ 4. When execution benefits from configured task tracking, create entries according to
272
+ `docs/agents/issue-tracker.md`:
273
+ - Create any configured feature container
274
+ - Add tasks with clear descriptions
275
+ - Mirror dependencies when the configured tracker supports them
251
276
  5. The plan.json is the source of truth for task details; the task tracker
252
277
  tracks execution state
253
278
 
@@ -257,14 +282,19 @@ After creating plan.json, verify:
257
282
  - Every task has an ID and depends_on field
258
283
  - Dependencies form a valid DAG (no cycles)
259
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
260
289
  - File paths are complete and specific
261
- - 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
262
292
 
263
293
  ---
264
294
 
265
295
  ## Handoff
266
296
 
267
- When plan.json is created, and any useful tracker entries have been created, the next
297
+ When plan.json is created, and any useful configured tracker entries have been created, the next
268
298
  step is **spec-implement** in Spec-backed mode.
269
299
 
270
300
  Tell the human:
@@ -277,8 +307,10 @@ Tell the human:
277
307
 
278
308
  Do not start implementing. That's spec-implement's job.
279
309
 
280
- If implementation reveals missing tasks, update plan.json. If design is wrong,
281
- loop back to research. See **atelier-orchestrator** for iteration patterns.
310
+ Minor implementation deviations may be recorded inline and reflected in plan.json when they do
311
+ not change approved behavior, scope, architecture, public contracts, or major dependencies.
312
+ Material changes return to spec-plan for renewed approval; design changes return to
313
+ spec-brainstorm. See **atelier-orchestrator** for iteration patterns.
282
314
 
283
315
  ---
284
316
 
@@ -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
@@ -1,139 +0,0 @@
1
- # Debugging Tools by Language
2
-
3
- ## Node.js
4
-
5
- ### Node Inspector / Chrome DevTools
6
-
7
- ```bash
8
- # Start with debugging
9
- node --inspect server.js
10
-
11
- # Break on first line
12
- node --inspect-brk server.js
13
- ```
14
-
15
- Then open chrome://inspect in Chrome.
16
-
17
- ### VS Code Debugging
18
-
19
- Create .vscode/launch.json:
20
-
21
- ```json
22
- {
23
- "type": "node",
24
- "request": "launch",
25
- "name": "Debug Server",
26
- "program": "${workspaceFolder}/server.js",
27
- "console": "integratedTerminal"
28
- }
29
- ```
30
-
31
- ### ndb
32
-
33
- Better debugging for Node:
34
-
35
- ```bash
36
- npm install -g ndb
37
- ndb server.js
38
- ```
39
-
40
- ### console.table
41
-
42
- ```javascript
43
- const users = [{id: 1, name: 'Alice'}, {id: 2, name: 'Bob'}];
44
- console.table(users);
45
- ```
46
-
47
- ---
48
-
49
- ## Python
50
-
51
- ### pdb
52
-
53
- ```python
54
- import pdb
55
-
56
- def calculate():
57
- x = 10
58
- pdb.set_trace() # Break here
59
- y = x * 2
60
- return y
61
-
62
- # Commands: n (next), s (step), p x (print), l (list), w (where), c (continue)
63
- ```
64
-
65
- ### ipdb (better pdb)
66
-
67
- ```bash
68
- pip install ipdb
69
- import ipdb; ipdb.set_trace()
70
- ```
71
-
72
- ### VS Code
73
-
74
- Just set breakpoint and press F5.
75
-
76
- ### PyCharm
77
-
78
- Right-click → Debug.
79
-
80
- ---
81
-
82
- ## Go
83
-
84
- ### Delve
85
-
86
- ```bash
87
- # Install
88
- go install github.com/go-delve/delve/cmd/dlv@latest
89
-
90
- # Run
91
- dlv debug main.go
92
-
93
- # Commands: n (next), s (step), p x (print), bt (backtrace), c (continue)
94
- ```
95
-
96
- ### VS Code
97
-
98
- Just set breakpoint and press F5.
99
-
100
- ---
101
-
102
- ## Rust
103
-
104
- ### LLDB with VS Code
105
-
106
- ```json
107
- {
108
- "type": "lldb",
109
- "request": "launch",
110
- "program": "${workspaceFolder}/target/debug/myapp",
111
- "args": ["--arg1", "value"]
112
- }
113
- ```
114
-
115
- ### Rust Analyzer
116
-
117
- Hover over variable → "Debug" button.
118
-
119
- ---
120
-
121
- ## Browser (JavaScript)
122
-
123
- ### Chrome DevTools
124
-
125
- 1. F12 → Sources tab
126
- 2. Find file
127
- 3. Set breakpoint
128
- 4. Refresh page
129
-
130
- ### Firefox DevTools
131
-
132
- 1. F12 → Debugger tab
133
- 2. Find file
134
- 3. Set breakpoint
135
- 4. Refresh page
136
-
137
- ### VS Code
138
-
139
- Use "Debug JavaScript" or "Debug Edge" configuration.