@caseyharalson/orrery 0.7.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.
Files changed (40) hide show
  1. package/.devcontainer.example/Dockerfile +149 -0
  2. package/.devcontainer.example/devcontainer.json +61 -0
  3. package/.devcontainer.example/init-firewall.sh +175 -0
  4. package/LICENSE +21 -0
  5. package/README.md +139 -0
  6. package/agent/skills/discovery/SKILL.md +428 -0
  7. package/agent/skills/discovery/schemas/plan-schema.yaml +138 -0
  8. package/agent/skills/orrery-execute/SKILL.md +107 -0
  9. package/agent/skills/orrery-report/SKILL.md +119 -0
  10. package/agent/skills/orrery-review/SKILL.md +105 -0
  11. package/agent/skills/orrery-verify/SKILL.md +105 -0
  12. package/agent/skills/refine-plan/SKILL.md +291 -0
  13. package/agent/skills/simulate-plan/SKILL.md +244 -0
  14. package/bin/orrery.js +5 -0
  15. package/lib/cli/commands/help.js +21 -0
  16. package/lib/cli/commands/ingest-plan.js +56 -0
  17. package/lib/cli/commands/init.js +21 -0
  18. package/lib/cli/commands/install-devcontainer.js +97 -0
  19. package/lib/cli/commands/install-skills.js +182 -0
  20. package/lib/cli/commands/orchestrate.js +27 -0
  21. package/lib/cli/commands/resume.js +146 -0
  22. package/lib/cli/commands/status.js +137 -0
  23. package/lib/cli/commands/validate-plan.js +288 -0
  24. package/lib/cli/index.js +57 -0
  25. package/lib/orchestration/agent-invoker.js +595 -0
  26. package/lib/orchestration/condensed-plan.js +128 -0
  27. package/lib/orchestration/config.js +213 -0
  28. package/lib/orchestration/dependency-resolver.js +149 -0
  29. package/lib/orchestration/edit-invoker.js +115 -0
  30. package/lib/orchestration/index.js +1065 -0
  31. package/lib/orchestration/plan-loader.js +212 -0
  32. package/lib/orchestration/progress-tracker.js +208 -0
  33. package/lib/orchestration/report-format.js +80 -0
  34. package/lib/orchestration/review-invoker.js +305 -0
  35. package/lib/utils/agent-detector.js +47 -0
  36. package/lib/utils/git.js +297 -0
  37. package/lib/utils/paths.js +43 -0
  38. package/lib/utils/plan-detect.js +24 -0
  39. package/lib/utils/skill-copier.js +79 -0
  40. package/package.json +58 -0
@@ -0,0 +1,428 @@
1
+ ---
2
+ name: discovery
3
+ description: >
4
+ Create executable plans for building systems, features, or modules. Use for
5
+ planning requests, architectural decisions, or when decomposing big ideas
6
+ into concrete implementation steps.
7
+ hooks:
8
+ PostToolUse:
9
+ - matcher: "Write"
10
+ hooks:
11
+ - type: command
12
+ command: "orrery validate-plan"
13
+ ---
14
+
15
+ # Discovery Skill
16
+
17
+ ## When to Use
18
+
19
+ Use this skill for **all planning requests**, regardless of size. Discovery transforms ideas into concrete, executable plans.
20
+
21
+ **Triggers:**
22
+
23
+ - "Build a [system/platform/module]"
24
+ - Request spans multiple features or domains
25
+ - Unclear what "done" looks like
26
+ - Requires architectural decisions before implementation
27
+
28
+ **Also use Discovery when:**
29
+
30
+ - Request is a single, scoped feature
31
+ - Outcomes and scope are already clear
32
+ - You can articulate the task in 1-3 sentences
33
+
34
+ ---
35
+
36
+ ## The Decomposition Ladder
37
+
38
+ Discovery works top-down through five levels:
39
+
40
+ ```
41
+ IDEA "We need better analytics"
42
+
43
+ OUTCOMES "Users can see trends; Admins can export reports"
44
+
45
+ CAPABILITIES "Trend visualization; Data aggregation; Export service"
46
+
47
+ FEATURES "Line chart component; Daily rollup job; CSV export endpoint"
48
+
49
+ STEPS "1.1 Create chart component; 1.2 Add API route; 1.3 Wire up data"
50
+ ```
51
+
52
+ Each level must be concrete enough that the next level can be derived.
53
+ The final output is an **orchestrator-ready plan** with implementation steps.
54
+
55
+ ---
56
+
57
+ ## How to Do It
58
+
59
+ ### Step 1: Capture the Idea
60
+
61
+ Get the raw vision from the user. Don't judge scope yet.
62
+
63
+ - What problem are we solving?
64
+ - Who is this for?
65
+ - What sparked this idea?
66
+
67
+ ### Step 2: Define Outcomes (the "why")
68
+
69
+ Outcomes are **user-visible results**, not technical deliverables.
70
+
71
+ Ask:
72
+
73
+ - "What will users be able to do that they can't today?"
74
+ - "How will we know this succeeded?"
75
+ - "What does 'done' look like from the user's perspective?"
76
+
77
+ **Output:** 2-5 concrete outcome statements.
78
+
79
+ Example:
80
+
81
+ - "Implement caching" (technical, not outcome)
82
+ - "Dashboard loads in under 2 seconds" (user-visible result)
83
+
84
+ ### Step 3: Map Capabilities (the "what")
85
+
86
+ Capabilities are **system abilities** that enable outcomes.
87
+
88
+ For each outcome, ask:
89
+
90
+ - "What must the system be able to do to deliver this?"
91
+ - "What new behaviors or services are needed?"
92
+
93
+ **Output:** Capabilities grouped by outcome.
94
+
95
+ Example:
96
+
97
+ - Outcome: "Dashboard loads in under 2 seconds"
98
+ - Capability: Query result caching
99
+ - Capability: Incremental data loading
100
+ - Capability: Pre-computed aggregations
101
+
102
+ ### Step 4: Decompose into Features (the "how")
103
+
104
+ Features are **implementable units of work** that deliver capabilities.
105
+
106
+ For each capability, ask:
107
+
108
+ - "What specific features implement this?"
109
+ - "Can this be shipped independently?"
110
+ - "What's the minimum viable version?"
111
+
112
+ **Output:** Feature list with clear boundaries.
113
+
114
+ ### Step 5: Gather Context per Feature
115
+
116
+ This is critical for "fire and forget" plans. For each feature:
117
+
118
+ 1. **Search the codebase** - find related files, patterns, dependencies
119
+ 2. **Identify constraints** - what must this integrate with?
120
+ 3. **Define acceptance criteria** - specific, testable conditions
121
+ 4. **Note risks** - what could go wrong?
122
+ 5. **List input files** - what must an agent read to understand context?
123
+
124
+ ### Step 6: Decompose Features into Implementation Steps
125
+
126
+ Each feature becomes 2-5 concrete implementation steps. This is what makes the plan orchestrator-ready.
127
+
128
+ For each feature, ask:
129
+
130
+ - "What are the individual pieces of work?"
131
+ - "What order must they happen in?"
132
+ - "Can any run in parallel?"
133
+
134
+ **Step characteristics:**
135
+
136
+ - **Scoped** - completable in a single focused session
137
+ - **Specific files** - lists exactly which files to create/modify
138
+ - **Testable** - has clear acceptance criteria
139
+ - **Self-contained** - an agent can execute without asking questions
140
+
141
+ **Naming convention:**
142
+
143
+ - Use `{feature-number}.{step-number}` format: `1.1`, `1.2`, `2.1`, etc.
144
+ - Group related steps by feature for readability
145
+
146
+ **Example decomposition:**
147
+
148
+ ```
149
+ Feature: "Line chart component"
150
+ → Step 1.1: Create TrendChart.tsx with basic Chart.js setup
151
+ → Step 1.2: Add time range toggle (7d/30d/90d)
152
+ → Step 1.3: Connect to trends API endpoint
153
+ → Step 1.4: Add loading state and error handling
154
+ ```
155
+
156
+ #### Dependency Installation Steps
157
+
158
+ If a plan requires installing dependencies, handle them explicitly:
159
+
160
+ - **Create a dedicated install step** (e.g., "0.1 Install project dependencies") as the first step in the plan (after project creation/structuring if relevant)
161
+ - **All subsequent steps MUST list the install step in their `deps` array** - otherwise parallel execution or out-of-order execution will fail because dependencies aren't available
162
+ - **Include test dependencies if acceptance criteria involve testing** - use `npm install --include=dev`, `pip install -e ".[test]"`, or the equivalent for the project's package manager
163
+
164
+ Example:
165
+
166
+ ```
167
+ Step 0.1: Install project dependencies (including test frameworks)
168
+ → deps: []
169
+ Step 1.1: Create TrendChart component
170
+ → deps: ["0.1"] ← Must reference the install step!
171
+ Step 1.2: Add unit tests for TrendChart
172
+ → deps: ["0.1", "1.1"] ← Also depends on install step
173
+ ```
174
+
175
+ ### Step 7: Validate with User
176
+
177
+ Before producing the plan:
178
+
179
+ - Present the step breakdown (not just features)
180
+ - Confirm priorities and ordering
181
+ - Resolve any remaining ambiguities
182
+ - Get explicit sign-off that this captures the intent
183
+
184
+ ### Step 8: Output the Plan
185
+
186
+ Generate an orchestrator-ready plan file with implementation steps.
187
+ Each step must be **self-contained** - an agent should be able to execute
188
+ it without asking questions.
189
+
190
+ Use the schema defined in `./schemas/plan-schema.yaml`.
191
+
192
+ **Output Location:**
193
+
194
+ - Directory: `.agent-work/plans/`
195
+ - Filename: `<date>-<plan-name>.yaml`
196
+ - Date format: YYYY-MM-DD (e.g., `2026-01-11`)
197
+ - Plan name: kebab-case description of the task (e.g., `fix-clone-agent-skills`)
198
+
199
+ **Document Project Context in Notes:**
200
+
201
+ Use the `notes` field in metadata to capture project-specific context that agents need throughout execution. This is critical because when plans are broken into substeps, agents executing individual steps might not know project conventions.
202
+
203
+ Include in notes:
204
+
205
+ - **Testing commands**: How to run tests (e.g., `uv run pytest`, `npm test`, `make test`) (check the README, pyproject.toml, package.json, etc. if applicable to understand: project manager, how to run tests, project conventions)
206
+ - **Build commands**: How to build the project (e.g., `uv run build`, `npm run build`)
207
+ - **Linting/formatting**: How to check code quality (e.g., `uv run ruff check .`)
208
+ - **Environment setup**: Required environment variables, virtual environments, etc.
209
+ - **Project conventions**: Naming conventions, file organization, coding standards
210
+ - **Tool-specific notes**: e.g., "Always prefix Python commands with 'uv run'"
211
+
212
+ ### Validate the Plan
213
+
214
+ Plans are automatically validated via the PostToolUse hook when written.
215
+ For manual validation, run:
216
+
217
+ ```bash
218
+ orrery validate-plan .agent-work/plans/<plan>.yaml
219
+ ```
220
+
221
+ This catches common YAML issues like unquoted colons and normalizes formatting.
222
+
223
+ ### YAML Formatting Rules
224
+
225
+ - Always quote strings containing special characters (colons, brackets, etc.)
226
+ - BAD: `criteria: Output shows: timestamp value`
227
+ - GOOD: `criteria: "Output shows: timestamp value"`
228
+ - Common gotchas: colons followed by space, special character prefixes, multi-line strings
229
+ - Rule: When in doubt, use double quotes around the entire value
230
+
231
+ ---
232
+
233
+ ## Output Format
234
+
235
+ ```yaml
236
+ # plan.yaml
237
+ metadata:
238
+ created_at: "2026-01-11T10:00:00Z"
239
+ created_by: "Discovery-Agent"
240
+ version: "1.0"
241
+ source_idea: "We need better analytics"
242
+ outcomes:
243
+ - "Users can see usage trends over time"
244
+ - "Admins can export reports for stakeholders"
245
+ notes: |
246
+ This project uses uv for dependency management.
247
+ - Run tests: uv run pytest
248
+ - Run linting: uv run ruff check .
249
+ Always prefix Python commands with 'uv run'.
250
+
251
+ steps:
252
+ # ============================================================================
253
+ # Step 0: Setup (Dependencies)
254
+ # ============================================================================
255
+
256
+ - id: "0.1"
257
+ description: "Install project dependencies including test frameworks"
258
+ status: "pending"
259
+ deps: []
260
+ parallel: false
261
+ context: |
262
+ Install all dependencies required for the project. Include dev/test
263
+ dependencies since acceptance criteria involve running tests.
264
+ requirements:
265
+ - "Run npm install (or equivalent for the project)"
266
+ - "Include dev dependencies for testing"
267
+ criteria:
268
+ - "All dependencies install without errors"
269
+ - "Test framework is available (e.g., jest, pytest)"
270
+ files: []
271
+ commands:
272
+ - "npm install"
273
+
274
+ # ============================================================================
275
+ # Feature 1: Trends API Endpoint
276
+ # ============================================================================
277
+
278
+ - id: "1.1"
279
+ description: "Create trends service with data aggregation logic"
280
+ status: "pending"
281
+ deps: ["0.1"]
282
+ parallel: false
283
+ context: |
284
+ Stats are currently computed on-demand in statsService.ts. This step
285
+ creates a new service that aggregates historical data into time-series
286
+ format for the trends endpoint.
287
+ requirements:
288
+ - "Create src/api/services/trendsService.ts"
289
+ - "Function: getTrends(range: '7d' | '30d' | '90d')"
290
+ - "Returns { dates: string[], values: number[] }"
291
+ - "Query existing stats table, group by date"
292
+ criteria:
293
+ - "Service exports getTrends function"
294
+ - "Returns correctly shaped data for all range values"
295
+ - "Unit test with mocked data passes"
296
+ files:
297
+ - "src/api/services/trendsService.ts"
298
+ - "src/api/services/trendsService.test.ts"
299
+ context_files:
300
+ - "src/api/services/statsService.ts"
301
+
302
+ - id: "1.2"
303
+ description: "Add trends API route with caching"
304
+ status: "pending"
305
+ deps: ["1.1"]
306
+ parallel: false
307
+ context: |
308
+ Wire up the trends service to an HTTP endpoint. Use existing cache
309
+ middleware pattern from other routes.
310
+ requirements:
311
+ - "GET /api/stats/trends?range=7d|30d|90d"
312
+ - "Cache responses for 1 hour"
313
+ - "Validate range parameter"
314
+ criteria:
315
+ - "Endpoint returns 200 with valid JSON"
316
+ - "Invalid range returns 400"
317
+ - "Response time < 200ms (cached)"
318
+ files:
319
+ - "src/api/routes/stats.ts"
320
+ context_files:
321
+ - "src/api/middleware/cache.ts"
322
+
323
+ # ============================================================================
324
+ # Feature 2: Trend Visualization Component
325
+ # ============================================================================
326
+
327
+ - id: "2.1"
328
+ description: "Create base TrendChart component with Chart.js"
329
+ status: "pending"
330
+ deps: ["0.1", "1.2"]
331
+ parallel: false
332
+ context: |
333
+ Users currently see only current-day stats. This adds a line chart
334
+ using the existing Chart.js setup in src/components/charts/.
335
+ requirements:
336
+ - "Create TrendChart.tsx extending BaseChart"
337
+ - "Line chart with responsive sizing"
338
+ - "Accept data prop: { dates: string[], values: number[] }"
339
+ criteria:
340
+ - "Component renders with mock data"
341
+ - "Chart displays correctly at mobile and desktop widths"
342
+ files:
343
+ - "src/components/TrendChart.tsx"
344
+ context_files:
345
+ - "src/components/charts/BaseChart.tsx"
346
+ - "src/styles/charts.css"
347
+ risk_notes: "Chart.js bundle size - verify no significant increase"
348
+
349
+ - id: "2.2"
350
+ description: "Add time range toggle to TrendChart"
351
+ status: "pending"
352
+ deps: ["2.1"]
353
+ parallel: false
354
+ context: |
355
+ Add toggle buttons for 7d/30d/90d. Selecting a range should trigger
356
+ a data refetch.
357
+ requirements:
358
+ - "Toggle buttons: 7 days, 30 days, 90 days"
359
+ - "Active state styling for selected range"
360
+ - "onChange callback when range changes"
361
+ criteria:
362
+ - "Toggle switches time range"
363
+ - "Visual indication of selected range"
364
+ files:
365
+ - "src/components/TrendChart.tsx"
366
+
367
+ - id: "2.3"
368
+ description: "Connect TrendChart to API and add loading states"
369
+ status: "pending"
370
+ deps: ["2.2"]
371
+ parallel: false
372
+ context: |
373
+ Wire up the component to fetch from the trends API. Handle loading
374
+ and error states gracefully.
375
+ requirements:
376
+ - "Fetch from GET /api/stats/trends on mount and range change"
377
+ - "Loading skeleton while fetching"
378
+ - "Error state if API fails"
379
+ criteria:
380
+ - "Data loads from API on initial render"
381
+ - "Range change triggers new API call"
382
+ - "Loading skeleton appears during fetch"
383
+ - "Error message displays on API failure"
384
+ files:
385
+ - "src/components/TrendChart.tsx"
386
+ - "src/components/TrendChart.test.tsx"
387
+ ```
388
+
389
+ ---
390
+
391
+ ## When Discovery is Complete
392
+
393
+ Discovery is complete when:
394
+
395
+ - [ ] All outcomes are defined and user-validated
396
+ - [ ] Each outcome maps to concrete capabilities
397
+ - [ ] Each capability has implementable features
398
+ - [ ] Each feature is decomposed into implementation steps
399
+ - [ ] Each step has sufficient context for autonomous execution
400
+ - [ ] The plan file passes schema validation
401
+ - [ ] User has approved the plan
402
+
403
+ ### Final Output
404
+
405
+ When the plan is complete and validated, output the plan file path and present the user with their next options:
406
+
407
+ ```
408
+ Plan created: .agent-work/plans/<date>-<plan-name>.yaml
409
+
410
+ Next steps:
411
+ - /refine-plan .agent-work/plans/<plan-file> — Analyze and improve the plan before execution
412
+ - /simulate-plan .agent-work/plans/<plan-file> — Explore the plan through dialogue, ask "what if" questions
413
+ - orrery exec — (Command run from the terminal) Execute the plan with the orrery orchestrator
414
+ ```
415
+
416
+ This ensures the user knows exactly what they can do next and has the full path to reference the plan.
417
+
418
+ ---
419
+
420
+ ## Common Pitfalls
421
+
422
+ - **Skipping outcome definition:** Jumping to features without knowing "why" leads to building the wrong thing
423
+ - **Thin context:** A description like "Add caching" isn't enough. Include what, where, why, constraints.
424
+ - **Implicit dependencies:** If feature B needs feature A's output, say so explicitly
425
+ - **No user validation:** Don't assume you understood the idea correctly. Confirm the decomposition.
426
+ - **Premature detail:** Don't write implementation code during Discovery. Just define what to build.
427
+ - **Missing dependency step dependencies:** If step "0.1" installs dependencies, all steps that use those dependencies must include "0.1" in their deps array. Otherwise, parallel execution or out-of-order execution will fail.
428
+ - **Forgetting test dependencies:** If acceptance criteria include running tests, ensure the dependency installation step includes dev/test dependencies (e.g., `npm install --include=dev`, `pip install -e ".[test]"`).
@@ -0,0 +1,138 @@
1
+ $schema: http://json-schema.org/draft-07/schema#
2
+ type: object
3
+ title: Plan Schema
4
+ description: >
5
+ Extended plan schema for planning output. Includes additional fields for
6
+ rich context, enabling agents to execute steps autonomously without further
7
+ user input.
8
+
9
+ properties:
10
+ metadata:
11
+ type: object
12
+ description: Plan metadata including creation info and high-level context
13
+ properties:
14
+ created_at:
15
+ type: string
16
+ format: date-time
17
+ created_by:
18
+ type: string
19
+ version:
20
+ type: string
21
+ source_idea:
22
+ type: string
23
+ description: The original idea or request that triggered discovery
24
+ outcomes:
25
+ type: array
26
+ description: User-visible results this plan delivers
27
+ items:
28
+ type: string
29
+ notes:
30
+ type: string
31
+ description: >
32
+ General notes for agents executing this plan. Include testing commands,
33
+ environment setup, project conventions, or any context that applies
34
+ across all steps.
35
+ required:
36
+ - created_at
37
+ - created_by
38
+ - outcomes
39
+
40
+ steps:
41
+ type: array
42
+ description: Array of plan steps defining the work to be done
43
+ items:
44
+ $ref: "#/definitions/Step"
45
+
46
+ required:
47
+ - metadata
48
+ - steps
49
+
50
+ definitions:
51
+ Step:
52
+ type: object
53
+ description: Individual step in the plan, representing a feature or work unit
54
+ required:
55
+ - id
56
+ - description
57
+ - context
58
+ - requirements
59
+ - criteria
60
+ properties:
61
+ id:
62
+ type: string
63
+ description: Unique identifier for the step
64
+
65
+ description:
66
+ type: string
67
+ description: Concise summary of what this step accomplishes
68
+
69
+ status:
70
+ type: string
71
+ enum:
72
+ - pending
73
+ - in_progress
74
+ - complete
75
+ - blocked
76
+ default: pending
77
+ description: Current status of the step
78
+
79
+ deps:
80
+ type: array
81
+ description: List of step IDs this step depends on
82
+ items:
83
+ type: string
84
+ default: []
85
+
86
+ parallel:
87
+ type: boolean
88
+ description: Whether this step can run in parallel with others
89
+ default: false
90
+
91
+ context:
92
+ type: string
93
+ description: >
94
+ Background information needed to execute this step. Should include
95
+ why this step exists, how it fits into the larger picture, and any
96
+ relevant technical context an agent needs to understand before starting.
97
+
98
+ requirements:
99
+ type: array
100
+ description: Specific requirements for this step
101
+ items:
102
+ type: string
103
+ minItems: 1
104
+
105
+ criteria:
106
+ type: array
107
+ description: Acceptance criteria - specific, testable conditions for completion
108
+ items:
109
+ type: string
110
+ minItems: 1
111
+
112
+ files:
113
+ type: array
114
+ description: Files this step will create or modify
115
+ items:
116
+ type: string
117
+ default: []
118
+
119
+ context_files:
120
+ type: array
121
+ description: >
122
+ Files the agent should read for context before starting. These are
123
+ not modified, but provide patterns, interfaces, or background needed
124
+ to complete the step.
125
+ items:
126
+ type: string
127
+ default: []
128
+
129
+ commands:
130
+ type: array
131
+ description: Specific commands to execute (build, test, etc.)
132
+ items:
133
+ type: string
134
+ default: []
135
+
136
+ risk_notes:
137
+ type: string
138
+ description: Warnings, edge cases, or things to watch out for
@@ -0,0 +1,107 @@
1
+ ---
2
+ name: orrery-execute
3
+ description: >
4
+ Write or modify code according to a plan step. Handle implementation.
5
+ user-invocable: false
6
+ ---
7
+
8
+ # Execute Skill
9
+
10
+ ## When to Use
11
+
12
+ Use this skill to **implement code changes** defined in a plan step.
13
+
14
+ **Triggers:**
15
+
16
+ - You are invoked by the Orchestrator to work on specific `stepIds`.
17
+ - A plan exists with pending steps.
18
+
19
+ **Prerequisites:**
20
+
21
+ - Plan exists with clear step descriptions.
22
+ - You understand what needs to be built.
23
+
24
+ ---
25
+
26
+ ## How to Do It
27
+
28
+ ### Repository Guidelines
29
+
30
+ Before implementing, check for project-specific guidelines:
31
+
32
+ 1. **Check for guideline files** - Look for project guideline files at the repo root (e.g., `CLAUDE.md`, `AGENTS.md`, `COPILOT.md`, or similar). Read and follow their working agreements (formatting commands, validation steps, changelog requirements, etc.)
33
+
34
+ 2. **Check Plan Notes** - Read the plan's `metadata.notes` field for project-specific commands and conventions (testing commands, build commands, tool-specific notes).
35
+
36
+ 3. **Check CONTRIBUTING.md** - If present, follow commit message conventions and coding standards.
37
+
38
+ These guidelines override generic examples in this skill. For example, if a guideline file says "run `npm run fix` after changes", do that instead of generic lint commands.
39
+
40
+ ### Git State
41
+
42
+ The orchestrator modifies `.agent-work/` files before you start (marking steps `in_progress`, creating temp files). This is expected. **Ignore changes in `.agent-work/`** when checking git status - these are orchestrator bookkeeping files, not unexpected changes.
43
+
44
+ ### Step 1: Read the Plan
45
+
46
+ Read the plan file provided in your instructions.
47
+
48
+ - Identify the steps you are assigned to (via `stepIds`).
49
+ - Read the `description`, `criteria`, `files`, and `risk_notes` for those steps.
50
+ - **Do not edit the plan file.**
51
+
52
+ ### Step 2: Implement the Change
53
+
54
+ Write the code:
55
+
56
+ - Follow project conventions and patterns.
57
+ - Keep changes focused on the step's scope.
58
+ - Write clean, readable code.
59
+ - **Do not** add comments to the plan file.
60
+
61
+ ### Step 3: Initial Check
62
+
63
+ Before handing off:
64
+
65
+ - **Compile/Build:** Ensure no syntax errors.
66
+ - **Smoke Test:** Does it run?
67
+
68
+ ### Step 4: Handoff to Verify
69
+
70
+ Once implementation is complete, invoke the `orrery-verify` skill using the Skill tool.
71
+
72
+ **Important:** Do NOT commit your changes. The orchestrator handles all commits after receiving your report.
73
+
74
+ ---
75
+
76
+ ## Example
77
+
78
+ **Plan Step:**
79
+
80
+ ```yaml
81
+ - id: "2"
82
+ description: "Implement backend API endpoint for CSV upload"
83
+ ```
84
+
85
+ **Execution:**
86
+
87
+ 1. **Read** the plan to understand Step 2.
88
+ 2. **Implement** `src/api/routes/upload.ts`.
89
+ 3. **Run** `npm build` -> Passes.
90
+ 4. **Invoke** the `orrery-verify` skill using the Skill tool.
91
+
92
+ ---
93
+
94
+ ## Error Handling
95
+
96
+ ### When Code Doesn't Work
97
+
98
+ 1. **Read error messages.**
99
+ 2. **Fix specific issues.**
100
+ 3. **If stuck:** You may mark the step as blocked by invoking the `orrery-report` skill directly using the Skill tool with a "Blocked" status (see Report skill for details).
101
+
102
+ ### Rollback Strategy
103
+
104
+ If a change breaks things badly and you cannot fix it:
105
+
106
+ 1. `git stash` or `git checkout` to revert.
107
+ 2. Invoke the `orrery-report` skill using the Skill tool to report the blockage.