synarcx 0.3.1 → 0.3.3

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,177 +3,224 @@ export function getSynReviewSkillTemplate() {
3
3
  return {
4
4
  name: 'syn-review',
5
5
  description: 'Quality gate that verifies implementation, runs sanity checks (test/lint/typecheck), and presents a three-way decision: archive, add more work, or start a new change.',
6
- instructions: `Review a completed change — verify implementation, run sanity checks, and decide next steps.
7
-
8
- ---
9
-
10
- ## Steps
11
-
12
- 1. **Select the change**
13
-
14
- If a name is provided, use it. Otherwise:
15
- - Infer from conversation context if the user mentioned a change
16
- - Auto-select if only one active change exists
17
- - If ambiguous, run \`synarcx list --json\` to get available changes and use the **AskUserQuestion tool** to let the user select
18
-
19
- Always announce: "Reviewing change: <name>" and how to override (e.g., \`/syn:review <other>\`).
20
-
21
- 2. **Check status**
22
-
23
- \`\`\`bash
24
- synarcx status --change "<name>" --json
25
- \`\`\`
26
-
27
- Parse the JSON to get \`schemaName\` and \`artifacts\` status.
28
-
29
- **Verify artifact completion**: If all apply-required artifacts are not done, stop and tell the user to use \`/syn:propose\` or \`/syn:apply\` first.
30
-
31
- 3. **Gate on task completion**
32
-
33
- Read \`tasks.md\` and count checkboxes. If any tasks remain unchecked:
34
- - Show progress: "N/M tasks complete"
35
- - Do NOT run any checks
36
- - Suggest: "/syn:apply to finish the remaining tasks, then run /syn:review again"
37
- - Stop here
38
-
39
- 4. **Collect change state**
40
-
41
- - \`git diff --stat\` to get files changed, additions, deletions
42
- - Read \`tasks.md\` for complete/incomplete counts
43
-
44
- 5. **Discover and run sanity checks**
45
-
46
- Probe the project for check commands. Discovery order:
47
- 1. Check \`package.json\` scripts for \`test\`, \`lint\`, \`typecheck\`
48
- 2. If \`Cargo.toml\` exists, check for \`cargo test\`
49
- 3. If no check commands found, skip with a note
50
-
51
- For each discovered command, run it and capture:
52
- - **Pass**: note the pass count
53
- - **Fail**: capture error details, route to \`/syn:apply\`
54
- - **Crash/error**: note "command crashed" with error message, do NOT block the fork
55
-
56
- **Important**: For any failed check, capture only summary counts (pass/fail), not full logs — unless user asks for details.
57
-
58
- 6. **Build the output**
59
-
60
- **Structured summary first** (scanable at a glance):
61
-
62
- \`\`\`
63
- Tasks: N/M ✓
64
- Files: N changed (+A -D)
65
- Tests: N/N passed ✓ (or "N failed" or "ERR — command crashed" or "skipped")
66
- Lint: 0 errors ✓ (or "N errors" or "ERR — command crashed" or "skipped")
67
- Typecheck: clean ✓ (or "N errors" or "ERR — command crashed" or "skipped")
68
- \`\`\`
69
-
70
- **Then a narrative paragraph** (context):
71
-
72
- "Change <name> completed N of N tasks across N files (+A -D). All N tests pass, lint is clean, type checking passes. No issues detected."
73
-
74
- Or for failures: "Change <name> completed N of N tasks. N tests failed, lint found N errors. Review the findings below."
75
-
76
- 7. **Present the fork**
77
-
78
- **If ALL checks pass** (clean):
79
-
80
- Present three options:
81
-
82
- | Option | Label | What happens | Next |
83
- |---|---|---|---|
84
- | A | Archive now | AI moves change to archive/ | Done |
85
- | B | Add more work | AI appends new tasks, suggests refinement loop | /syn:clarify/syn:analyze /syn:apply |
86
- | C | Start a new change | AI suggests creating a fresh change | /syn:propose |
87
-
88
- **For option B (add more work)**: Ask the user what else is needed. If the new work fits within the existing change's scope (same capabilities, same specs, related code), append unchecked tasks to \`tasks.md\` and say: "Run /syn:clarify to refine the new requirements, then /syn:analyze, then /syn:apply." If the new work involves different capabilities, different specs, or unrelated code, tell the user: "This is outside this change's scope. Start a new change with /syn:propose instead."
89
-
90
- **If any checks failed** (dirty):
91
-
92
- Show each finding with context and route to the correct command:
93
-
94
- | Finding | Route |
95
- |---|---|
96
- | Test failures | /syn:apply — fix implementation |
97
- | Lint errors | /syn:apply — fix implementation |
98
- | Artifact inconsistency | /syn:analyze reconcile |
99
- | Unclear requirement | /syn:clarify refine |
100
- | Incomplete artifacts | /syn:analyzecomplete artifacts |
101
-
102
- List ALL findings in a single output. Let the user decide which to address first.
103
-
104
- **Note**: /syn:quick bypasses review entirely. Quick is the low-risk fast path.
105
-
106
- 8. **Archive inline** (when user picks option A)
107
-
108
- - Create \`synspec/changes/archive/\` if it doesn't exist
109
- - Target name: \`YYYY-MM-DD-<change-name>\`
110
- - If target already exists: fail with error, suggest renaming existing archive or using a different approach
111
- - Move: \`mv synspec/changes/<name> synspec/changes/archive/YYYY-MM-DD-<name>\`
112
- - Confirm: "Archived <change-name> to synspec/changes/archive/YYYY-MM-DD-<name>/"
113
-
114
- ---
115
-
116
- ## Output (Clean)
117
-
118
- \`\`\`
119
- Tasks: 7/7 ✓
120
- Files: 5 changed (+124 -12)
121
- Tests: 42/42 passed ✓
122
- Lint: 0 errors ✓
123
- Typecheck: clean ✓
124
-
125
- Change add-user-auth completed 7 of 7 tasks across 5 files (+124 -12). All 42 tests pass, lint is clean, type checking passes. No issues detected.
126
-
127
- This change is clean. What would you like to do?
128
- [A] Archive now [B] Add more work [C] Start a new change
129
- \`\`\`
130
-
131
- ## Output (Dirty)
132
-
133
- \`\`\`
134
- Tasks: 7/7 ✓
135
- Files: 5 changed (+124 -12)
136
- Tests: 38/42 passed ⚠ 4 failing
137
- Lint: 3 errors ⚠
138
- Typecheck: clean ✓
139
-
140
- Change add-user-auth completed 7 of 7 tasks. 4 tests failing in auth.test.ts, lint found 3 style issues. Type checking passes.
141
-
142
- Findings:
143
- 4 tests failing in auth.test.ts
144
- → Try /syn:apply to fix the implementation
145
-
146
- ╳ 3 lint errors in src/auth.ts
147
- Try /syn:apply to fix the implementation
148
- \`\`\`
149
-
150
- ## Output (Tasks Incomplete — Gate)
151
-
152
- \`\`\`
153
- Tasks: 4/7 tasks complete
154
-
155
- This change still has 3 tasks remaining.
156
- Use /syn:apply to finish the remaining tasks, then run /syn:review again.
157
- \`\`\`
158
-
159
- ## Output (Archived)
160
-
161
- \`\`\`
162
- ## Archive Complete
163
-
164
- **Change:** <change-name>
165
- **Archived to:** synspec/changes/archive/YYYY-MM-DD-<name>/
166
-
167
- All tasks complete. All checks passed. Change archived.
168
- \`\`\`
169
-
170
- ## Guardrails
171
- - Do NOT run checks if tasks are incomplete gate at step 3
172
- - Checks are read-only — do not modify project files during checks
173
- - Archive move is the only write operation (step 8)
174
- - Always list ALL findings at once, don't ask "fix one at a time"
175
- - For failed checks, show only summary counts unless user asks for details
176
- - If user picks "add more work," evaluate scope before appending tasks
6
+ instructions: `Review a completed change — verify implementation, run sanity checks, and decide next steps.
7
+
8
+ ---
9
+
10
+ ## Steps
11
+
12
+ 1. **Select the change**
13
+
14
+ If a name is provided, use it. Otherwise:
15
+ - Infer from conversation context if the user mentioned a change
16
+ - Auto-select if only one active change exists
17
+ - If ambiguous, run \`synarcx list --json\` to get available changes and use the **AskUserQuestion tool** to let the user select
18
+
19
+ Always announce: "Reviewing change: <name>" and how to override (e.g., \`/syn:review <other>\`).
20
+
21
+ 2. **Check status**
22
+
23
+ \`\`\`bash
24
+ synarcx status --change "<name>" --json
25
+ \`\`\`
26
+
27
+ Parse the JSON to get \`schemaName\` and \`artifacts\` status.
28
+
29
+ **Verify artifact completion**: If all apply-required artifacts are not done, stop and tell the user to use \`/syn:propose\` or \`/syn:apply\` first.
30
+
31
+ 3. **Gate on task completion**
32
+
33
+ Read \`tasks.md\` and count checkboxes. If any tasks remain unchecked:
34
+ - Show progress: "N/M tasks complete"
35
+ - Do NOT run any checks
36
+ - Suggest: "/syn:apply to finish the remaining tasks, then run /syn:review again"
37
+ - Stop here
38
+
39
+ 4. **Collect change state**
40
+
41
+ - \`git diff --stat\` to get files changed, additions, deletions
42
+ - Read \`tasks.md\` for complete/incomplete counts
43
+
44
+ 5. **Discover and run sanity checks**
45
+
46
+ Probe the project for check commands. Discovery order:
47
+ 1. Check \`package.json\` scripts for \`test\`, \`lint\`, \`typecheck\`
48
+ 2. If \`Cargo.toml\` exists, check for \`cargo test\`
49
+ 3. If no check commands found, skip with a note
50
+
51
+ For each discovered command, run it and capture:
52
+ - **Pass**: note the pass count
53
+ - **Fail**: capture error details, route to \`/syn:apply\`
54
+ - **Crash/error**: note "command crashed" with error message, do NOT block the fork
55
+
56
+ **Important**: For any failed check, capture only summary counts (pass/fail), not full logs — unless user asks for details.
57
+
58
+ 6. **Build the output**
59
+
60
+ **Structured summary first** (scanable at a glance):
61
+
62
+ \`\`\`
63
+ Tasks: N/M ✓
64
+ Files: N changed (+A -D)
65
+ Tests: N/N passed ✓ (or "N failed" or "ERR — command crashed" or "skipped")
66
+ Lint: 0 errors ✓ (or "N errors" or "ERR — command crashed" or "skipped")
67
+ Typecheck: clean ✓ (or "N errors" or "ERR — command crashed" or "skipped")
68
+ \`\`\`
69
+
70
+ **Then a narrative paragraph** (context):
71
+
72
+ "Change <name> completed N of N tasks across N files (+A -D). All N tests pass, lint is clean, type checking passes. No issues detected."
73
+
74
+ Or for failures: "Change <name> completed N of N tasks. N tests failed, lint found N errors. Review the findings below."
75
+
76
+ 7. **Present the fork**
77
+
78
+ **If ALL checks pass** (clean):
79
+
80
+ Present three options:
81
+
82
+ | Option | Label | What happens | Next |
83
+ |---|---|---|---|
84
+ | A | Archive now | AI moves change to archive/ with auto spec sync | Done (specs merged to main) |
85
+ | B | Add more work | AI reads proposal+design for scope boundary, checks scope gate | Scope check update or route |
86
+ | C | Start a new change | AI suggests creating a fresh change | /syn:propose |
87
+
88
+ **For option B (add more work)**: Use the scope gate protocol:
89
+
90
+ 1. Read \`proposal.md\` capabilities section and \`design.md\` goals/non-goals to establish scope boundary
91
+ 2. Ask the user what additional work is needed
92
+ 3. **IN SCOPE** (same capabilities, same concern, no non-goal violation):
93
+ - Update \`proposal.md\` if scope description needs widening
94
+ - Update spec with ADDED requirements
95
+ - Update \`design.md\` if new technical decisions
96
+ - Append unchecked tasks to \`tasks.md\`
97
+ - MUST run \`/syn:clarify\` then \`/syn:apply\`no skipping refinement, no escape hatch for trivial changes
98
+ 4. **OUT OF SCOPE** (new capability, different concern, violates non-goal):
99
+ - Inform user: "This is outside the current change's scope."
100
+ - Offer: "Archive current change first?" YES archives with spec sync, NO leaves active
101
+ - Route: "Start a new change with \`/syn:propose\`"
102
+
103
+ **If any checks failed** (dirty):
104
+
105
+ Show each finding with context and route to the correct command:
106
+
107
+ | Finding | Route |
108
+ |---|---|
109
+ | Test failures | /syn:apply — fix implementation |
110
+ | Lint errors | /syn:apply fix implementation |
111
+ | Artifact inconsistency | /syn:analyze — reconcile |
112
+ | Unclear requirement | /syn:clarify refine |
113
+ | Incomplete artifacts | /syn:analyze — complete artifacts |
114
+
115
+ List ALL findings in a single output. Let the user decide which to address first.
116
+
117
+ **Note**: /syn:quick bypasses review entirely. Quick is the low-risk fast path.
118
+
119
+ 8. **Archive inline** (when user picks option A, or in Option B out-of-scope with "yes" to archive)
120
+
121
+ a. **Check for delta specs**: Look for any \`synspec/changes/<name>/specs/<capability>/spec.md\` files. If any exist, proceed with spec sync. If none exist (infrastructure, doc-only change), skip the marker and just do the directory move.
122
+
123
+ b. **Write marker** (only if delta specs exist):
124
+ - Create \`synspec/.pending-sync.json\` if it doesn't exist
125
+ - Add entry: \`{ change: "YYYY-MM-DD-<change-name>", archivedAt: "<ISO timestamp>", syncedAt: null }\`
126
+ - Use the full archive directory name (with date prefix) in the \`change\` field
127
+
128
+ c. **Move to archive**:
129
+ - Create \`synspec/changes/archive/\` if missing
130
+ - Target: \`YYYY-MM-DD-<change-name>\`
131
+ - If target already exists: fail with error, suggest renaming
132
+ - Move: \`mv synspec/changes/<name> synspec/changes/archive/YYYY-MM-DD-<name>\`
133
+
134
+ d. **Sync specs** (only if delta specs existed):
135
+ - Call \`findSpecUpdates(archivePath, synspec/specs/)\` to discover delta specs
136
+ - For each delta: call \`buildUpdatedSpec()\`, write atomically (\`.tmp\` + rename)
137
+ - Show per-capability progress: "Syncing specs for <capability>: +N added, ~M modified"
138
+ - Update marker entry with \`syncedAt\` timestamp
139
+ - On failure: change is already safely archived, show error, marker stays \`null\` for backstop retry
140
+
141
+ e. **Confirm**:
142
+ - "Archived <change-name> to synspec/changes/archive/YYYY-MM-DD-<name>/"
143
+ - If specs were synced: "Specs synced: <capability>: +N ~M"
144
+
145
+ ---
146
+
147
+ ## Output (Clean)
148
+
149
+ \`\`\`
150
+ Tasks: 7/7 ✓
151
+ Files: 5 changed (+124 -12)
152
+ Tests: 42/42 passed ✓
153
+ Lint: 0 errors ✓
154
+ Typecheck: clean ✓
155
+
156
+ Change add-user-auth completed 7 of 7 tasks across 5 files (+124 -12). All 42 tests pass, lint is clean, type checking passes. No issues detected.
157
+
158
+ This change is clean. What would you like to do?
159
+ [A] Archive now [B] Add more work [C] Start a new change
160
+ \`\`\`
161
+
162
+ ## Output (Dirty)
163
+
164
+ \`\`\`
165
+ Tasks: 7/7 ✓
166
+ Files: 5 changed (+124 -12)
167
+ Tests: 38/42 passed ⚠ 4 failing
168
+ Lint: 3 errors ⚠
169
+ Typecheck: clean ✓
170
+
171
+ Change add-user-auth completed 7 of 7 tasks. 4 tests failing in auth.test.ts, lint found 3 style issues. Type checking passes.
172
+
173
+ Findings:
174
+ 4 tests failing in auth.test.ts
175
+ Try /syn:apply to fix the implementation
176
+
177
+ ╳ 3 lint errors in src/auth.ts
178
+ → Try /syn:apply to fix the implementation
179
+ \`\`\`
180
+
181
+ ## Output (Tasks Incomplete — Gate)
182
+
183
+ \`\`\`
184
+ Tasks: 4/7 tasks complete
185
+
186
+ This change still has 3 tasks remaining.
187
+ → Use /syn:apply to finish the remaining tasks, then run /syn:review again.
188
+ \`\`\`
189
+
190
+ ## Output (Archived with Spec Sync)
191
+
192
+ \`\`\`
193
+ ## Archive Complete
194
+
195
+ **Change:** <change-name>
196
+ **Archived to:** synspec/changes/archive/YYYY-MM-DD-<name>/
197
+
198
+ Specs synced:
199
+ review-command: +2 added, ~1 modified
200
+
201
+ All tasks complete. All checks passed. Change archived.
202
+ \`\`\`
203
+
204
+ ## Output (Archived — No Delta Specs)
205
+
206
+ \`\`\`
207
+ ## Archive Complete
208
+
209
+ **Change:** <change-name>
210
+ **Archived to:** synspec/changes/archive/YYYY-MM-DD-<name>/
211
+
212
+ No delta specs to sync. Change archived.
213
+ \`\`\`
214
+
215
+ ## Guardrails
216
+ - Do NOT run checks if tasks are incomplete — gate at step 3
217
+ - Checks are read-only — do not modify project files during checks
218
+ - Archive happens BEFORE spec sync — if sync fails, change is safely archived
219
+ - Always list ALL findings at once, don't ask "fix one at a time"
220
+ - For failed checks, show only summary counts unless user asks for details
221
+ - If user picks "add more work," use scope gate protocol: read proposal capabilities + design goals/non-goals before acting
222
+ - MUST run clarify after any in-scope expansion — no escape hatch for trivial changes
223
+ - Out-of-scope work: offer to archive first, then route to \`/syn:propose\`
177
224
  - Quick bypasses review — do not suggest review to users who used /syn:quick`,
178
225
  license: 'MIT',
179
226
  compatibility: 'Requires synarcx CLI.',
@@ -185,108 +232,112 @@ export function getSynReviewCommandTemplate() {
185
232
  name: 'syn:review',
186
233
  description: 'Review a completed change — verify implementation, run sanity checks, and decide next steps',
187
234
  tags: ['workflow', 'review'],
188
- content: `Review a completed change — verify implementation, run sanity checks, and decide next steps.
189
-
190
- ---
191
-
192
- ## Steps
193
-
194
- 1. **Select the change**
195
-
196
- If a name is provided (e.g., \`/syn:review add-auth\`), use it. Otherwise:
197
- - Infer from conversation context
198
- - Auto-select if only one active change exists
199
- - If ambiguous, run \`synarcx list --json\` and prompt
200
-
201
- 2. **Check status**
202
-
203
- \`\`\`bash
204
- synarcx status --change "<name>" --json
205
- \`\`\`
206
-
207
- Verify all apply-required artifacts are done. If not, stop.
208
-
209
- 3. **Gate on task completion**
210
-
211
- Read \`tasks.md\`. If any tasks remain unchecked:
212
- - Show "N/M tasks complete"
213
- - Suggest \`/syn:apply\` to finish
214
- - Stop
215
-
216
- 4. **Collect change state**
217
- - \`git diff --stat\` for file summary
218
- - Read tasks.md for progress
219
-
220
- 5. **Discover and run sanity checks**
221
-
222
- Probe \`package.json\` scripts for \`test\`, \`lint\`, \`typecheck\`. Fall back to known tools (cargo test, ruff, etc.). Omit if none found.
223
-
224
- For each command: capture pass/fail/crash. Summary only, not full logs.
225
-
226
- 6. **Build output**
227
-
228
- Structured summary first:
229
- \`\`\`
230
- Tasks: N/M ✓
231
- Files: N changed (+A -D)
232
- Tests: N/N passed ✓
233
- Lint: 0 errors ✓
234
- Typecheck: clean ✓
235
- \`\`\`
236
-
237
- Then narrative paragraph.
238
-
239
- 7. **Present the fork**
240
-
241
- **If all checks pass:**
242
- - Archive now → AI moves to archive/
243
- - Add more work → AI appends tasks (scope-checked), suggests \`/syn:clarify\` \`/syn:analyze\` \`/syn:apply\`
244
- - Start a new change → \`/syn:propose\`
245
-
246
- **If issues found:**
247
- - Show each finding with route: \`/syn:apply\`, \`/syn:clarify\`, \`/syn:analyze\`
248
- - List all findings at once
249
-
250
- 8. **Archive inline** (when user picks archive)
251
-
252
- - Create \`synspec/changes/archive/\` if missing
253
- - Target: \`YYYY-MM-DD-<change-name>\`
254
- - Fail if target exists
255
- - Move: \`mv synspec/changes/<name> synspec/changes/archive/YYYY-MM-DD-<name>\`
256
- - Confirm
257
-
258
- ---
259
-
260
- ## Output (Clean)
261
-
262
- \`\`\`
263
- Tasks: 7/7 ✓
264
- Files: 5 changed (+124 -12)
265
- Tests: 42/42 passed ✓
266
- Lint: 0 errors
267
- Typecheck: clean
268
-
269
- All checks pass. What would you like to do?
270
- [A] Archive now [B] Add more work [C] Start a new change
271
- \`\`\`
272
-
273
- ## Output (Dirty)
274
-
275
- \`\`\`
276
- Tasks: 7/7 ✓
277
- Files: 5 changed (+124 -12)
278
- Tests: 38/42 passed ⚠
279
- Lint: 3 errors
280
-
281
- Findings:
282
- ╳ 4 tests failing → /syn:apply to fix
283
- 3 lint errors → /syn:apply to fix
284
- \`\`\`
285
-
286
- ## Guardrails
287
- - Gate on task completion — no checks until all tasks are done
288
- - Summary only for failed checks (not full logs)
289
- - Scope-check before appending tasks
235
+ content: `Review a completed change — verify implementation, run sanity checks, and decide next steps.
236
+
237
+ ---
238
+
239
+ ## Steps
240
+
241
+ 1. **Select the change**
242
+
243
+ If a name is provided (e.g., \`/syn:review add-auth\`), use it. Otherwise:
244
+ - Infer from conversation context
245
+ - Auto-select if only one active change exists
246
+ - If ambiguous, run \`synarcx list --json\` and prompt
247
+
248
+ 2. **Check status**
249
+
250
+ \`\`\`bash
251
+ synarcx status --change "<name>" --json
252
+ \`\`\`
253
+
254
+ Verify all apply-required artifacts are done. If not, stop.
255
+
256
+ 3. **Gate on task completion**
257
+
258
+ Read \`tasks.md\`. If any tasks remain unchecked:
259
+ - Show "N/M tasks complete"
260
+ - Suggest \`/syn:apply\` to finish
261
+ - Stop
262
+
263
+ 4. **Collect change state**
264
+ - \`git diff --stat\` for file summary
265
+ - Read tasks.md for progress
266
+
267
+ 5. **Discover and run sanity checks**
268
+
269
+ Probe \`package.json\` scripts for \`test\`, \`lint\`, \`typecheck\`. Fall back to known tools (cargo test, ruff, etc.). Omit if none found.
270
+
271
+ For each command: capture pass/fail/crash. Summary only, not full logs.
272
+
273
+ 6. **Build output**
274
+
275
+ Structured summary first:
276
+ \`\`\`
277
+ Tasks: N/M ✓
278
+ Files: N changed (+A -D)
279
+ Tests: N/N passed ✓
280
+ Lint: 0 errors ✓
281
+ Typecheck: clean ✓
282
+ \`\`\`
283
+
284
+ Then narrative paragraph.
285
+
286
+ 7. **Present the fork**
287
+
288
+ **If all checks pass:**
289
+ - Archive now → write marker, move to archive, sync specs, update marker
290
+ - Add more work → scope gate: read proposal capabilities + design goals/non-goals. If in scope: update artifacts, MUST run \`/syn:clarify\` then \`/syn:apply\`. If out of scope: offer to archive first (with spec sync), route to \`/syn:propose\`.
291
+ - Start a new change → \`/syn:propose\`
292
+
293
+ **If issues found:**
294
+ - Show each finding with route: \`/syn:apply\`, \`/syn:clarify\`, \`/syn:analyze\`
295
+ - List all findings at once
296
+
297
+ 8. **Archive inline** (when user picks archive)
298
+
299
+ a. Check for delta specs. If none, skip marker and just move.
300
+ b. Write \`synspec/.pending-sync.json\` with \`syncedAt: null\` using full \`YYYY-MM-DD-<name>\` as change field
301
+ c. Move: \`mv synspec/changes/<name> synspec/changes/archive/YYYY-MM-DD-<name>\`
302
+ d. Sync specs: \`findSpecUpdates(archivePath)\` \`buildUpdatedSpec()\` → atomic write (\`.tmp\` + rename) → per-capability output
303
+ e. Update marker with \`syncedAt\` timestamp
304
+ f. On failure: archive is already moved, marker stays \`null\`, backstop retries on next sync
305
+
306
+ ---
307
+
308
+ ## Output (Clean)
309
+
310
+ \`\`\`
311
+ Tasks: 7/7 ✓
312
+ Files: 5 changed (+124 -12)
313
+ Tests: 42/42 passed
314
+ Lint: 0 errors
315
+ Typecheck: clean ✓
316
+
317
+ All checks pass. What would you like to do?
318
+ [A] Archive now (with spec sync) [B] Add more work (scope-gated) [C] Start a new change
319
+ \`\`\`
320
+
321
+ ## Output (Dirty)
322
+
323
+ \`\`\`
324
+ Tasks: 7/7 ✓
325
+ Files: 5 changed (+124 -12)
326
+ Tests: 38/42 passed
327
+ Lint: 3 errors ⚠
328
+
329
+ Findings:
330
+ 4 tests failing → /syn:apply to fix
331
+ ╳ 3 lint errors → /syn:apply to fix
332
+ \`\`\`
333
+
334
+ ## Guardrails
335
+ - Gate on task completion — no checks until all tasks are done
336
+ - Summary only for failed checks (not full logs)
337
+ - Scope gate for Option B: read proposal capabilities + design goals/non-goals before acting
338
+ - In-scope expansion MUST run clarify then apply — no escape hatch
339
+ - Out-of-scope work: offer archive first, then route to /syn:propose
340
+ - Archive happens before spec sync — if sync fails, change is safely archived
290
341
  - Quick bypasses review — do not suggest review after /syn:quick`
291
342
  });
292
343
  }