@jspg-ai/coding-bb 0.0.3-beta.3 → 0.0.3-beta.31

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 (145) hide show
  1. package/cbb/dev-standards/rules/cbb-ai-behavior.md +135 -116
  2. package/cbb/lib/external/index.js +228 -0
  3. package/cbb/lib/install/agents-nav.js +92 -0
  4. package/cbb/lib/install/claude-code.js +7 -2
  5. package/cbb/lib/install/command-skill.js +105 -0
  6. package/cbb/lib/install/init.js +502 -168
  7. package/cbb/lib/install/minimax.js +60 -0
  8. package/cbb/lib/install/opencode.js +3 -5
  9. package/cbb/lib/install/qoder.js +1 -3
  10. package/cbb/lib/install/rule-rewrite.js +27 -0
  11. package/cbb/lib/install/setup-decision.js +48 -0
  12. package/cbb/lib/install/tool-selection.js +45 -0
  13. package/cbb/lib/install/trae.js +43 -0
  14. package/cbb/lib/install/workbuddy.js +36 -0
  15. package/cbb/lib/install/workspaces.js +21 -17
  16. package/cbb/lib/openspec/index.js +337 -554
  17. package/cbb/lib/superpowers/index.js +246 -265
  18. package/cbb/lib/utils/check-update.js +17 -2
  19. package/cbb/lib/utils/githook.js +226 -0
  20. package/cbb/lib/utils/gitignore.js +16 -3
  21. package/cbb/lib/utils/plugin-hook.js +92 -0
  22. package/cbb/lib/utils/settings.js +17 -4
  23. package/cbb/lib/utils/tar.js +92 -0
  24. package/cbb/lib/utils/upstream.js +90 -0
  25. package/cbb/worktrees/_shared/scripts/check-local-state.js +114 -0
  26. package/cbb/worktrees/_shared/scripts/find-target-worktree.js +148 -96
  27. package/cbb/worktrees/_shared/scripts/find-workspace-root.js +7 -7
  28. package/cbb/worktrees/_shared/scripts/install-git-hook.js +70 -0
  29. package/cbb/worktrees/_shared/scripts/junction-ai-config.js +127 -0
  30. package/cbb/worktrees/_shared/scripts/start-local.js +180 -0
  31. package/cbb/worktrees/skills/cbb-local-mode/SKILL.md +158 -0
  32. package/cbb/worktrees/skills/cbb-local-mode/scripts/check-local-state.js +114 -0
  33. package/cbb/worktrees/skills/cbb-local-mode/scripts/install-git-hook.js +70 -0
  34. package/cbb/worktrees/skills/cbb-local-mode/scripts/silence-popup.js +23 -0
  35. package/cbb/worktrees/skills/cbb-local-mode/scripts/start-local.js +180 -0
  36. package/cbb/worktrees/skills/cbb-worktree-close/SKILL.md +60 -43
  37. package/cbb/worktrees/skills/cbb-worktree-close/scripts/check-env.js +3 -3
  38. package/cbb/worktrees/skills/cbb-worktree-close/scripts/check-unarchived.js +75 -48
  39. package/cbb/worktrees/skills/cbb-worktree-close/scripts/delete-branches.js +1 -1
  40. package/cbb/worktrees/skills/cbb-worktree-close/scripts/discover-apps.js +14 -5
  41. package/cbb/worktrees/skills/cbb-worktree-close/scripts/find-target-worktree.js +148 -96
  42. package/cbb/worktrees/skills/cbb-worktree-close/scripts/find-workspace-root.js +7 -7
  43. package/cbb/worktrees/skills/cbb-worktree-close/scripts/remove-worktrees.js +13 -4
  44. package/cbb/worktrees/skills/cbb-worktree-close/scripts/safety-check.js +11 -2
  45. package/cbb/worktrees/skills/cbb-worktree-init/SKILL.md +138 -129
  46. package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-env.js +1 -1
  47. package/cbb/worktrees/skills/cbb-worktree-init/scripts/check-repos.js +2 -2
  48. package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-branches.js +33 -8
  49. package/cbb/worktrees/skills/cbb-worktree-init/scripts/create-worktrees.js +60 -46
  50. package/cbb/worktrees/skills/cbb-worktree-init/scripts/find-workspace-root.js +7 -7
  51. package/cbb/worktrees/skills/cbb-worktree-init/scripts/install-git-hook.js +70 -0
  52. package/cbb/worktrees/skills/cbb-worktree-init/scripts/junction-ai-config.js +127 -0
  53. package/cbb/worktrees/skills/cbb-worktree-init/scripts/parse-config.js +7 -7
  54. package/cbb/worktrees/skills/cbb-worktree-init/scripts/push-branches.js +3 -3
  55. package/cbb/worktrees/skills/cbb-worktree-init/scripts/sync-repos.js +11 -7
  56. package/cbb/worktrees/skills/cbb-worktree-init/scripts/update-gitignore.js +37 -9
  57. package/cbb/worktrees/skills/cbb-worktree-push/SKILL.md +140 -71
  58. package/cbb/worktrees/skills/cbb-worktree-push/scripts/commit-worktrees.js +70 -12
  59. package/cbb/worktrees/skills/cbb-worktree-push/scripts/find-target-worktree.js +148 -96
  60. package/cbb/worktrees/skills/cbb-worktree-push/scripts/find-workspace-root.js +7 -7
  61. package/cbb/worktrees/skills/cbb-worktree-push/scripts/make-mr-urls.js +211 -0
  62. package/cbb/worktrees/skills/cbb-worktree-push/scripts/push-worktrees.js +67 -20
  63. package/config/{workspace-config.sample.json → CBB-WORKSPACE.sample.json} +1 -1
  64. package/config/openspec/schemas/spec-driven/schema.yaml +40 -30
  65. package/config/openspec/schemas/spec-driven/templates/design.md +0 -18
  66. package/config/openspec/schemas/spec-driven/templates/proposal.md +4 -3
  67. package/config/upstream-mirrors.json +17 -0
  68. package/config/workspace-agents.sample.md +4 -33
  69. package/external/frontend-design/.version +6 -0
  70. package/external/frontend-design/LICENSE.txt +177 -0
  71. package/external/frontend-design/SKILL.md +71 -0
  72. package/openspec/.version +2 -3
  73. package/openspec/commands/apply.md +189 -175
  74. package/openspec/commands/archive.md +244 -216
  75. package/openspec/commands/bulk-archive.md +362 -327
  76. package/openspec/commands/continue.md +115 -105
  77. package/openspec/commands/explore.md +230 -199
  78. package/openspec/commands/ff.md +115 -104
  79. package/openspec/commands/new.md +74 -63
  80. package/openspec/commands/onboard.md +562 -548
  81. package/openspec/commands/propose.md +161 -150
  82. package/openspec/commands/sync.md +277 -249
  83. package/openspec/commands/update.md +98 -80
  84. package/openspec/commands/verify.md +206 -162
  85. package/openspec/skills/openspec-apply-change/SKILL.md +20 -5
  86. package/openspec/skills/openspec-archive-change/SKILL.md +40 -11
  87. package/openspec/skills/openspec-bulk-archive-change/SKILL.md +46 -9
  88. package/openspec/skills/openspec-continue-change/SKILL.md +14 -3
  89. package/openspec/skills/openspec-explore/SKILL.md +22 -10
  90. package/openspec/skills/openspec-ff-change/SKILL.md +15 -3
  91. package/openspec/skills/openspec-new-change/SKILL.md +13 -1
  92. package/openspec/skills/openspec-onboard/SKILL.md +58 -43
  93. package/openspec/skills/openspec-propose/SKILL.md +15 -3
  94. package/openspec/skills/openspec-sync-specs/SKILL.md +31 -2
  95. package/openspec/skills/openspec-update-change/SKILL.md +34 -15
  96. package/openspec/skills/openspec-verify-change/SKILL.md +72 -26
  97. package/package.json +3 -2
  98. package/superpowers/.version +4 -4
  99. package/superpowers/skills/brainstorming/SKILL.md +47 -12
  100. package/superpowers/skills/brainstorming/scripts/frame-template.html +213 -213
  101. package/superpowers/skills/brainstorming/scripts/server.cjs +723 -723
  102. package/superpowers/skills/brainstorming/visual-companion.md +6 -6
  103. package/superpowers/skills/diagnosing-superpowers/SKILL.md +120 -0
  104. package/superpowers/skills/diagnosing-superpowers/prompts/analyst-common.md +38 -0
  105. package/superpowers/skills/diagnosing-superpowers/prompts/cost-and-time.md +28 -0
  106. package/superpowers/skills/diagnosing-superpowers/prompts/plan-adherence.md +29 -0
  107. package/superpowers/skills/diagnosing-superpowers/prompts/quality-evidence.md +26 -0
  108. package/superpowers/skills/diagnosing-superpowers/prompts/repeated-work.md +30 -0
  109. package/superpowers/skills/diagnosing-superpowers/prompts/request-conflicts.md +20 -0
  110. package/superpowers/skills/diagnosing-superpowers/prompts/scrub-audit.md +33 -0
  111. package/superpowers/skills/diagnosing-superpowers/prompts/scrub.md +29 -0
  112. package/superpowers/skills/diagnosing-superpowers/prompts/similar-session.md +38 -0
  113. package/superpowers/skills/diagnosing-superpowers/prompts/skill-timeline.md +30 -0
  114. package/superpowers/skills/diagnosing-superpowers/prompts/stumbles.md +28 -0
  115. package/superpowers/skills/diagnosing-superpowers/references/context-safety.md +22 -0
  116. package/superpowers/skills/diagnosing-superpowers/references/github-issues.md +47 -0
  117. package/superpowers/skills/diagnosing-superpowers/references/redaction-policy.md +34 -0
  118. package/superpowers/skills/diagnosing-superpowers/references/session-discovery.md +31 -0
  119. package/superpowers/skills/diagnosing-superpowers/templates/bundle-README.md +77 -0
  120. package/superpowers/skills/diagnosing-superpowers/templates/case.md +64 -0
  121. package/superpowers/skills/diagnosing-superpowers/templates/issue.md +51 -0
  122. package/superpowers/skills/diagnosing-superpowers/templates/report.md +82 -0
  123. package/superpowers/skills/executing-plans/SKILL.md +350 -41
  124. package/superpowers/skills/executing-plans/scripts/task-done +52 -0
  125. package/superpowers/skills/executing-plans/scripts/task-start +28 -0
  126. package/superpowers/skills/requesting-code-review/SKILL.md +1 -1
  127. package/superpowers/skills/requesting-code-review/code-reviewer.md +17 -0
  128. package/superpowers/skills/subagent-driven-development/SKILL.md +18 -18
  129. package/superpowers/skills/subagent-driven-development/re-review-prompt.md +1 -1
  130. package/superpowers/skills/subagent-driven-development/scripts/review-package +53 -46
  131. package/superpowers/skills/subagent-driven-development/scripts/sdd-workspace +82 -40
  132. package/superpowers/skills/subagent-driven-development/scripts/task-brief +43 -41
  133. package/superpowers/skills/subagent-driven-development/task-reviewer-prompt.md +2 -2
  134. package/superpowers/skills/systematic-debugging/root-cause-tracing.md +1 -1
  135. package/superpowers/skills/test-driven-development/SKILL.md +10 -0
  136. package/superpowers/skills/using-superpowers/SKILL.md +2 -0
  137. package/superpowers/skills/using-superpowers/references/claude-code-tools.md +29 -0
  138. package/superpowers/skills/using-superpowers/references/muse-tools.md +35 -0
  139. package/superpowers/skills/writing-plans/SKILL.md +62 -29
  140. package/superpowers/skills/writing-skills/SKILL.md +4 -2
  141. package/superpowers/skills/writing-skills/graphviz-conventions.dot +171 -171
  142. package/cbb/worktrees/commands/worktree-close.md +0 -64
  143. package/cbb/worktrees/commands/worktree-init.md +0 -51
  144. package/cbb/worktrees/commands/worktree-push.md +0 -42
  145. package/superpowers/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
@@ -4,331 +4,366 @@ description: Archive multiple completed changes at once
4
4
  category: Workflow
5
5
  tags: [workflow, archive, experimental, bulk]
6
6
  ---
7
- Archive multiple completed changes in a single operation.
8
-
9
- This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
10
-
11
- **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`). Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
12
-
13
- `<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
14
-
15
- **Input**: None required (prompts for selection)
16
-
17
- **Steps**
18
-
19
- 1. **Get active changes**
20
-
21
- Run `openspec list --json` to get all active changes.
22
-
23
- If no active changes exist, inform user and stop.
24
-
25
- 2. **Prompt for change selection**
26
-
27
- Ask the user to choose changes (multi-select):
28
- - Show each change with its schema
29
- - Include an option for "All changes"
30
- - Allow any number of selections (1+ works, 2+ is the typical use case)
31
-
32
- **IMPORTANT**: Do NOT auto-select. Always let the user choose.
33
-
34
- **Load current archive inputs once for the selected root before batch validation:**
35
-
36
- Choose one selected change from this root and run
37
- `openspec instructions archive --change "<selected-change>" --json` with the
38
- same selected-root flags. This lookup is advisory and optional: it only supplies
39
- extra prompt inputs, so it must never block the batch. If it fails or returns
40
- invalid JSON — for example on an older CLI that does not support this command
41
- yet — continue the batch with no context and no operation guidance. Do not
42
- report an error and do not stop.
43
-
44
- A valid response may omit `context` and `operationGuidance`. Treat
45
- `context` as a required prompt-level input across the batch: read and consider
46
- it, and apply relevant project facts, conventions, and constraints. Treat
47
- `operationGuidance` as optional additive advice: read and consider every
48
- entry, and follow entries that are applicable and compatible with the built-in
49
- batch workflow.
50
-
51
- Keep both fields separate from conflict analysis, explicit user choices,
52
- resolved paths, CLI checks, and command contracts. If context conflicts with one
53
- of those controlling inputs, report the conflict and preserve the controlling
54
- value. If guidance is inapplicable or conflicts with a controlling input, do not
55
- follow it and explain why. Do not infer skipped prompts, replacement paths, or
56
- flags from either field, and do not copy their text verbatim into specs, changes,
57
- or summaries. These are prompt-level behavior contracts, not enforceable checks.
58
-
59
- 3. **Batch validation - gather status for all selected changes**
60
-
61
- For each selected change, collect:
62
-
63
- a. **Artifact status** - Run `openspec status --change "<name>" --json`
64
- - Parse `schemaName`, `artifacts`, `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`
65
- - Note which artifacts are `done` vs other states
66
-
67
- b. **Task completion** - Read `artifactPaths.tasks.existingOutputPaths` from status JSON
68
- - Count `- [ ]` (incomplete) vs `- [x]` (complete)
69
- - If no tasks file exists, note as "No tasks"
70
-
71
- c. **Delta specs** - Check `artifactPaths.specs.existingOutputPaths` from status JSON
72
- - List which capability specs exist
73
- - For each, extract requirement names (lines matching `### Requirement: <name>`)
74
- - Treat this list as the only delta-spec source. If the `specs` entry is
75
- missing or the list is empty, perform no spec sync or specs-instruction
76
- lookup for that change; do not infer deltas from unrelated artifacts.
77
- - Evaluate this independently for every change, including mixed-schema
78
- batches where some schemas have no `specs` artifact.
79
-
80
- 4. **Detect spec conflicts**
81
-
82
- Build a map keyed by `<capability-path>`, the exact path relative to `specs/`:
83
-
84
- ```text
85
- identity/user-auth -> [change-a, change-b] <- CONFLICT (2+ changes)
86
- billing/user-auth -> [change-c] <- OK (different full path)
87
- ```
88
-
89
- A conflict exists when 2+ selected changes have delta specs for the exact same `<capability-path>`.
90
-
91
- 5. **Resolve conflicts agentically**
92
-
93
- **For each conflict**, investigate the codebase:
94
-
95
- a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
96
-
97
- b. **Search the codebase** for implementation evidence:
98
- - Look for code implementing requirements from each delta spec
99
- - Check for related files, functions, or tests
100
-
101
- c. **Determine resolution**:
102
- - If only one change is actually implemented -> sync that one's specs
103
- - If both implemented -> apply in chronological order (older first, newer overwrites)
104
- - If neither implemented -> skip spec sync, warn user
105
-
106
- d. **Record resolution** for each conflict:
107
- - An inclusion or exclusion decision for every delta spec, keyed by change and `<capability-path>`
108
- - Which included delta specs to apply and in what order
109
- - Which delta specs to exclude from sync because their implementation is missing
110
- - Rationale (what was found in codebase)
111
-
112
- 6. **Show consolidated status table**
113
-
114
- Display a table summarizing all changes:
115
-
116
- ```markdown
117
- | Change | Artifacts | Tasks | Specs | Conflicts | Status |
118
- |---------------------|-----------|-------|---------|-----------|--------|
119
- | schema-management | Done | 5/5 | 2 delta | None | Ready |
120
- | project-config | Done | 3/3 | 1 delta | None | Ready |
121
- | add-oauth | Done | 4/4 | 1 delta | identity/user-auth (!) | Ready* |
122
- | add-verify-skill | 1 left | 2/5 | None | None | Warn |
123
- ```
124
-
125
- For conflicts, show the resolution:
126
- ```text
127
- * Conflict resolution:
128
- - identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
129
- ```
130
-
131
- For incomplete changes, show warnings:
132
- ```text
133
- Warnings:
134
- - add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
135
- ```
136
-
137
- 7. **Confirm batch operation**
138
-
139
- Ask the user a single confirmation question:
140
-
141
- - "Archive N changes?" with options based on status
142
- - Options might include:
143
- - "Archive all N changes"
144
- - "Archive only N ready changes (skip incomplete)"
145
- - "Cancel"
146
-
147
- If there are incomplete changes, make clear they'll be archived with warnings.
148
-
149
- Route on the answer by intent, not by exact label — you wrote these labels,
150
- so match what the user picked rather than the wording above:
151
- - "Cancel" — stop, do not archive. Report that nothing was archived and skip the remaining steps.
152
- - The archive-everything option — proceed with every selected change
153
- - The ready-only option — proceed with only the changes the step 6 table marks `Ready` or `Ready*`, and record the rest as Skipped in step 8d. If a `Ready*` change's conflict partner is skipped, re-derive that conflict's resolution using only the changes being archived.
154
- - Anything else — ask again rather than archiving
155
-
156
- Before step 8 writes the first main spec or moves any change, fetch every
157
- required specs-rule snapshot for the confirmed batch. For each change that will
158
- sync concrete `artifactPaths.specs.existingOutputPaths`, run
159
- `openspec instructions specs --change "<name>" --json` exactly once with the
160
- same selected-root flags. Obtain all snapshots before the first write or move.
161
- If any lookup exits non-zero or returns invalid artifact-instruction JSON,
162
- identify the affected change, report the error, and stop the whole batch before
163
- any main-spec write or change move. Do not treat lookup failure as omitted
164
- rules. A valid response without `rules` is the no-rules case.
165
-
166
- 8. **Execute archive for each confirmed change**
167
-
168
- Before processing, carry the recorded decisions from step 5 (after any step 7 re-derivation) into two per-delta sets:
169
- - `includedDeltas`: all non-conflicting delta specs from confirmed changes plus conflict deltas selected for sync
170
- - `excludedDeltas`: conflict deltas from confirmed changes excluded because their implementation is missing
171
- - A single change can have both included and excluded delta specs. Keep the decision per delta; do not collapse it into a per-change sync flag.
172
-
173
- Process changes in the determined order (respecting conflict resolution):
174
-
175
- a. **Sync included delta specs**:
176
- - Run the `/opsx:sync` workflow inline (agent-driven intelligent merge) only for changes with entries in `includedDeltas`, passing only the included delta paths and explicitly instructing it to ignore that change's `excludedDeltas`. Wait for it to finish.
177
- - For conflicts, apply in resolved order.
178
- - Pass that change's fetched specs-rule snapshot into inline sync; inline
179
- sync must reuse it without fetching instructions again
180
- - Apply artifact rules only to main specs produced by that change. They do
181
- not change conflict resolution, archive behavior, or CLI contracts, and
182
- their text is not copied into an output file
183
- - Do not delegate to a background task — step 8c would move `changeRoot` out from under a sync that is still reading it.
184
- - If a change has no included delta specs, do not run the sync workflow for it.
185
-
186
- b. **Verify included delta specs before moving changeRoot**:
187
- - Re-run the comparison only for delta specs in `includedDeltas` against main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 3 status JSON, not a hardcoded repo path).
188
- - Verify that main specs are updated:
189
- - ADDED requirements present
190
- - MODIFIED requirements carrying scenario and description changes named in the delta, with their other scenarios intact
191
- - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
192
- - RENAMED requirements present under the new name and absent under the old one
193
- - Do not verify delta specs in `excludedDeltas`; they are intentionally left unsynced.
194
- - If sync failed or any capability does not match verification, report what differs and fail/skip moving that change's `changeRoot` — do not archive that change. `changeRoot` remains intact.
195
-
196
- c. **Perform the archive**:
197
-
198
- Target name: use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<name>` (same rule as `openspec archive`).
199
-
200
- ```bash
201
- mkdir -p "<planningHome.changesDir>/archive"
202
- mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
203
- ```
204
-
205
- d. **Track outcome** for each change:
206
- - Success: archived successfully
207
- - Failed: error during archive or spec verification (record error)
208
- - Skipped: user chose not to archive (if applicable)
209
- - Sync skipped: for every delta in `excludedDeltas`, report `sync skipped` with the change, `<capability-path>`, and recorded reason. This is distinct from skipping the archive.
210
-
211
- 9. **Display summary**
212
-
213
- Show final results:
214
-
215
- ```markdown
216
- ## Bulk Archive Complete
217
-
218
- Archived 3 changes:
219
- - schema-management-cli -> archive/2026-01-19-schema-management-cli/
220
- - project-config -> archive/2026-01-19-project-config/
221
- - add-oauth -> archive/2026-01-19-add-oauth/
222
-
223
- Skipped 1 change:
224
- - add-verify-skill (user chose not to archive incomplete)
225
-
226
- Spec sync summary:
227
- - 4 delta specs synced to main specs
228
- - 1 delta spec sync skipped (add-jwt, identity/user-auth: implementation not found)
229
- - 1 conflict resolved (identity/user-auth: synced add-oauth, skipped add-jwt)
230
- ```
231
-
232
- If any failures:
233
- ```text
234
- Failed 1 change:
235
- - some-change: Archive directory already exists
236
- ```
237
-
238
- **Conflict Resolution Examples**
239
-
240
- Example 1: Only one implemented
241
- ```text
242
- Conflict: <planningHome.root>/openspec/specs/auth/spec.md touched by [add-oauth, add-jwt]
243
-
244
- Checking add-oauth:
245
- - Delta adds "OAuth Provider Integration" requirement
246
- - Searching codebase... found src/auth/oauth.ts implementing OAuth flow
247
-
248
- Checking add-jwt:
249
- - Delta adds "JWT Token Handling" requirement
250
- - Searching codebase... no JWT implementation found
251
-
252
- Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
253
- ```
254
-
255
- Example 2: Both implemented
256
- ```text
257
- Conflict: <planningHome.root>/openspec/specs/api/spec.md touched by [add-rest-api, add-graphql]
258
-
259
- Checking add-rest-api (created 2026-01-10):
260
- - Delta adds "REST Endpoints" requirement
261
- - Searching codebase... found src/api/rest.ts
262
-
263
- Checking add-graphql (created 2026-01-15):
264
- - Delta adds "GraphQL Schema" requirement
265
- - Searching codebase... found src/api/graphql.ts
266
-
267
- Resolution: Both implemented. Will apply add-rest-api specs first,
268
- then add-graphql specs (chronological order, newer takes precedence).
269
- ```
270
-
271
- **Output On Success**
272
-
273
- ```markdown
274
- ## Bulk Archive Complete
275
-
276
- Archived N changes:
277
- - <change-1> -> archive/<target-name-1>/
278
- - <change-2> -> archive/<target-name-2>/
279
-
280
- Spec sync summary:
281
- - N delta specs synced to main specs
282
- - No conflicts (or: M conflicts resolved)
283
- ```
284
-
285
- **Output On Partial Success**
286
-
287
- ```markdown
288
- ## Bulk Archive Complete (partial)
289
-
290
- Archived N changes:
291
- - <change-1> -> archive/<target-name-1>/
292
-
293
- Skipped M changes:
294
- - <change-2> (user chose not to archive incomplete)
295
-
296
- Failed K changes:
297
- - <change-3>: Archive directory already exists
298
- ```
299
-
300
- **Output When No Changes**
301
-
302
- ```markdown
303
- ## No Changes to Archive
304
-
305
- No active changes found. Create a new change to get started.
306
- ```
307
-
308
- **Guardrails**
309
- - Allow any number of changes (1+ is fine, 2+ is the typical use case)
310
- - Always prompt for selection, never auto-select
311
- - Detect spec conflicts early and resolve by checking codebase
312
- - When both changes are implemented, apply specs in chronological order
313
- - Skip spec sync only when implementation is missing (warn user)
314
- - Show clear per-change status before confirming
315
- - Use single confirmation for entire batch
316
- - Never archive after the user cancels the confirmation — a cancelled batch archives nothing
317
- - Track and report all outcomes (success/skip/fail)
318
- - Preserve .openspec.yaml when moving to archive
319
- - Archive directory target uses current date: YYYY-MM-DD-<name>; a name that already starts with a `YYYY-MM-DD-` prefix is used as-is (never stack a second date)
320
- - If archive target exists, fail that change but continue with others
321
- - If sync is requested, run the `/opsx:sync` workflow inline (agent-driven) for each change with included delta specs
322
- - Carry the per-delta `includedDeltas` and `excludedDeltas` decisions into execution; sync and verify only included deltas
323
- - Report every excluded delta as `sync skipped` without treating the archive itself as skipped
324
- - Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` before moving `changeRoot`
325
- - Fetch archive inputs once per selected root before spec inspection or moves
326
- - Fetch all required specs-rule snapshots before the batch's first main-spec write or move
327
- - A failed archive-inputs lookup never blocks the batch; it proceeds with no context or guidance
328
- - A failed specs instruction lookup stops the whole batch atomically
329
- - Changes without concrete `artifactPaths.specs.existingOutputPaths` continue without spec sync
330
- - Apply relevant runtime context across the batch and report conflicts
331
- - Operation guidance remains advisory; consider every entry and explain rejected advice
332
- - Keep runtime inputs, conflict analysis, CLI-derived values, and artifact rules separate
333
- - Artifact rules constrain only written specs
7
+ Archive multiple completed changes in a single operation.
8
+
9
+ This skill allows you to batch-archive changes, handling spec conflicts intelligently by checking the codebase to determine what's actually implemented.
10
+
11
+ **Store selection:** If the user names a store (a store is a standalone OpenSpec repo registered on this machine) or the work lives in one, run `openspec store list --json` to discover registered store ids, then pass `--store <id>` on the commands that read or write specs and changes (`new change`, `status`, `instructions`, `list`, `show`, `validate`, `archive`, `doctor`, `context`, `schemas`, `view`). Once selected, treat `--store <id>` as sticky for the rest of the workflow. Every unscoped example of those commands below is shorthand: before running it, append the flag. For example, run `openspec status --change "<name>" --json --store "<id>"`, not the unscoped form shown below. Other commands do not take the flag. Hints printed by commands already carry the flag; keep it on follow-ups. Without a store, commands act on the nearest local `openspec/` root.
12
+
13
+ **Project check:** These steps expect a project that already uses OpenSpec. Before the first step that writes anything (`new change`, `archive`, `sync specs`, or authoring an artifact file), confirm the project has a root: run `openspec list --json` (with `--store <id>` when a store is selected, since the store is then the root) and read `root`. A root object means the project is set up. `"root": null` means it is not - there is no `openspec/` directory here, and a write such as `openspec new change` would create one as a side effect. The command also exits non-zero, which is that answer rather than a broken CLI, so read the JSON instead of retrying or working around it.
14
+
15
+ One `"root": null` is not about setup: when a `status` error message starts with `Declared in` or `Invalid store declaration in` and names this project's `openspec/config.yaml` (or `config.yml`), the project does use OpenSpec through a store it declares, which this machine cannot resolve (the store is not registered, or the `store:` line is malformed). Do not treat it as uninitialized and skip the branches below: stop before writing and show the user that error's `message` and `fix`.
16
+
17
+ Otherwise, with no root, what happens next depends on how this workflow was reached:
18
+
19
+ - **Auto-selected**: you chose this workflow yourself, without the user naming OpenSpec, naming this skill, or running its slash command. Stop using OpenSpec and answer the request normally, as you would with no OpenSpec installed. Do not ask them to set anything up and do not mention OpenSpec setup.
20
+ - **Explicit OpenSpec request**: the user named OpenSpec, named this skill, or ran its slash command. Stop before writing and ask how to proceed: set this project up (`openspec init`), target a store they already have (`--store <id>`), or continue without OpenSpec for this request. Wait for their answer.
21
+
22
+ In both branches, never create the root as a side effect: do not run `openspec init` until the user asks for it, do not hand-create `openspec/` files, and do not let a command create it.
23
+
24
+ `<capability-path>` is the spec directory relative to `specs/` (for example, `user-auth` or `identity/user-auth`). Preserve the full path from each delta spec when resolving its main spec.
25
+
26
+ **Input**: None required (prompts for selection)
27
+
28
+ **Steps**
29
+
30
+ 1. **Get active changes**
31
+
32
+ Run `openspec list --json` to get all active changes.
33
+
34
+ If no active changes exist, inform user and stop.
35
+
36
+ 2. **Prompt for change selection**
37
+
38
+ Ask the user to choose changes (multi-select):
39
+ - Show each change name and task status from the list output
40
+ - Include an option for "All changes"
41
+ - Allow any number of selections (1+ works, 2+ is the typical use case)
42
+
43
+ **IMPORTANT**: Do NOT auto-select. Always let the user choose.
44
+
45
+ **Load current archive inputs once for the selected root before batch validation:**
46
+
47
+ Choose one selected change from this root and run
48
+ `openspec instructions archive --change "<selected-change>" --json` with the
49
+ same selected-root flags. This lookup is advisory and optional: it only supplies
50
+ extra prompt inputs, so it must never block the batch. If it fails or returns
51
+ invalid JSON — for example on an older CLI that does not support this command
52
+ yet — continue the batch with no context and no operation guidance. Do not
53
+ report an error and do not stop.
54
+
55
+ A valid response may omit `context` and `operationGuidance`. Treat
56
+ `context` as a required prompt-level input across the batch: read and consider
57
+ it, and apply relevant project facts, conventions, and constraints. Treat
58
+ `operationGuidance` as optional additive advice: read and consider every
59
+ entry, and follow entries that are applicable and compatible with the built-in
60
+ batch workflow.
61
+
62
+ Keep both fields separate from conflict analysis, explicit user choices,
63
+ resolved paths, CLI checks, and command contracts. If context conflicts with one
64
+ of those controlling inputs, report the conflict and preserve the controlling
65
+ value. If guidance is inapplicable or conflicts with a controlling input, do not
66
+ follow it and explain why. Do not infer skipped prompts, replacement paths, or
67
+ flags from either field, and do not copy their text verbatim into specs, changes,
68
+ or summaries. These are prompt-level behavior contracts, not enforceable checks.
69
+
70
+ 3. **Batch validation - gather status for all selected changes**
71
+
72
+ Run `openspec list --json` once with the same selected-root flags for task
73
+ progress. If the lookup fails, returns invalid JSON, or omits any selected
74
+ change, contains a duplicate selected change, or returns invalid counts,
75
+ report the problem and stop before syncing or archiving the batch.
76
+
77
+ For each selected change, collect:
78
+
79
+ a. **Artifact status** - Run `openspec status --change "<name>" --json`
80
+ - Parse `schemaName`, `artifacts`, `planningHome`, `changeRoot`, `artifactPaths`, and `actionContext`
81
+ - Note which artifacts are `done` vs other states
82
+
83
+ b. **Task completion** - Find the `changes` entry from the list response whose `name` exactly matches this change
84
+ - Require nonnegative integer `totalTasks` and `completedTasks`, with `completedTasks <= totalTasks`
85
+ - Incomplete tasks = `totalTasks - completedTasks`
86
+ - The CLI resolves the schema's tracked task files, including custom artifact names, output paths, and globs
87
+ - Do not infer task completion from artifact status, an artifact id of `tasks`, or the absence of a top-level `tasks.md`
88
+ - The CLI counts only `x`/`X` checkbox markers as complete; other markers remain incomplete
89
+ - If `totalTasks` is zero, note as "No tasks"
90
+
91
+ c. **Delta specs** - Check `artifactPaths.specs.existingOutputPaths` from status JSON
92
+ - List which capability specs exist
93
+ - For each, extract requirement names (lines matching `### Requirement: <name>`)
94
+ - Treat this list as the only delta-spec source. If the `specs` entry is
95
+ missing or the list is empty, perform no spec sync or specs-instruction
96
+ lookup for that change; do not infer deltas from unrelated artifacts.
97
+ - Evaluate this independently for every change, including mixed-schema
98
+ batches where some schemas have no `specs` artifact.
99
+
100
+ d. **Archive target** - Compute each change's target name once and record it as that change's `<target-name>`
101
+ - Use the change name as-is when it already starts with a `YYYY-MM-DD-` prefix; otherwise prepend the current date as `YYYY-MM-DD-<name>` (same rule as `openspec archive`)
102
+ - Check whether `<planningHome.changesDir>/archive/<target-name>` already exists
103
+ - If it exists, or another selected change resolves to the same target name, mark every such change `Blocked` with `Archive directory already exists`
104
+ - A blocked change is never synced or moved: show it as `Blocked` in the step 6 table, leave it out of conflict resolution (resolve its conflicts using only the other changes), and record it as Failed in step 8d
105
+ - Checking here, before any main spec is written, matches `openspec archive`: a collision found after sync would leave main specs rewritten for an archive that never happened
106
+
107
+ 4. **Detect spec conflicts**
108
+
109
+ Build a map keyed by `<capability-path>`, the exact path relative to `specs/`:
110
+
111
+ ```text
112
+ identity/user-auth -> [change-a, change-b] <- CONFLICT (2+ changes)
113
+ billing/user-auth -> [change-c] <- OK (different full path)
114
+ ```
115
+
116
+ A conflict exists when 2+ selected changes have delta specs for the exact same `<capability-path>`.
117
+
118
+ 5. **Resolve conflicts agentically**
119
+
120
+ **For each conflict**, investigate the codebase:
121
+
122
+ a. **Read the delta specs** from each conflicting change to understand what each claims to add/modify
123
+
124
+ b. **Search the codebase** for implementation evidence:
125
+ - Look for code implementing requirements from each delta spec
126
+ - Check for related files, functions, or tests
127
+
128
+ c. **Determine resolution**:
129
+ - If only one change is actually implemented -> sync that one's specs
130
+ - If both implemented -> apply in chronological order (older first, newer overwrites)
131
+ - If neither implemented -> skip spec sync, warn user
132
+
133
+ d. **Record resolution** for each conflict:
134
+ - An inclusion or exclusion decision for every delta spec, keyed by change and `<capability-path>`
135
+ - Which included delta specs to apply and in what order
136
+ - Which delta specs to exclude from sync because their implementation is missing
137
+ - Rationale (what was found in codebase)
138
+
139
+ 6. **Show consolidated status table**
140
+
141
+ Display a table summarizing all changes:
142
+
143
+ ```markdown
144
+ | Change | Artifacts | Tasks | Specs | Conflicts | Status |
145
+ |---------------------|-----------|-------|---------|-----------|--------|
146
+ | schema-management | Done | 5/5 | 2 delta | None | Ready |
147
+ | project-config | Done | 3/3 | 1 delta | None | Ready |
148
+ | add-oauth | Done | 4/4 | 1 delta | identity/user-auth (!) | Ready* |
149
+ | add-verify-skill | 1 left | 2/5 | None | None | Warn |
150
+ ```
151
+
152
+ For conflicts, show the resolution:
153
+ ```text
154
+ * Conflict resolution:
155
+ - identity/user-auth spec: Will apply add-oauth then add-jwt (both implemented, chronological order)
156
+ ```
157
+
158
+ For incomplete changes, show warnings:
159
+ ```text
160
+ Warnings:
161
+ - add-verify-skill: 1 incomplete artifact, 3 incomplete tasks
162
+ ```
163
+
164
+ 7. **Confirm batch operation**
165
+
166
+ Ask the user a single confirmation question:
167
+
168
+ - "Archive N changes?" with options based on status
169
+ - Options might include:
170
+ - "Archive all N changes"
171
+ - "Archive only N ready changes (skip incomplete)"
172
+ - "Cancel"
173
+
174
+ If there are incomplete changes, make clear they'll be archived with warnings.
175
+
176
+ Route on the answer by intent, not by exact label — you wrote these labels,
177
+ so match what the user picked rather than the wording above:
178
+ - "Cancel" — stop, do not archive. Report that nothing was archived and skip the remaining steps.
179
+ - The archive-everything option — proceed with every selected change that is not `Blocked`
180
+ - The ready-only option — proceed with only the changes the step 6 table marks `Ready` or `Ready*`, and record the rest as Skipped in step 8d, except `Blocked` changes, which stay Failed with `Archive directory already exists`. If a `Ready*` change's conflict partner is skipped, re-derive that conflict's resolution using only the changes being archived.
181
+ - Anything else — ask again rather than archiving
182
+
183
+ Before step 8 writes the first main spec or moves any change, fetch every
184
+ required specs-rule snapshot for the confirmed batch. For each change that will
185
+ sync concrete `artifactPaths.specs.existingOutputPaths`, run
186
+ `openspec instructions specs --change "<name>" --json` exactly once with the
187
+ same selected-root flags. Obtain all snapshots before the first write or move.
188
+ If any lookup exits non-zero or returns invalid artifact-instruction JSON,
189
+ identify the affected change, report the error, and stop the whole batch before
190
+ any main-spec write or change move. Do not treat lookup failure as omitted
191
+ rules. A valid response without `rules` is the no-rules case.
192
+
193
+ 8. **Execute archive for each confirmed change**
194
+
195
+ Before processing, carry the recorded decisions from step 5 (after any step 7 re-derivation) into two per-delta sets:
196
+ - `includedDeltas`: all non-conflicting delta specs from confirmed changes plus conflict deltas selected for sync
197
+ - `excludedDeltas`: conflict deltas from confirmed changes excluded because their implementation is missing
198
+ - A single change can have both included and excluded delta specs. Keep the decision per delta; do not collapse it into a per-change sync flag.
199
+
200
+ Process changes in the determined order (respecting conflict resolution):
201
+
202
+ a. **Sync included delta specs**:
203
+ - Run the `/opsx:sync` workflow inline (agent-driven intelligent merge) only for changes with entries in `includedDeltas`, passing only the included delta paths and explicitly instructing it to ignore that change's `excludedDeltas`. Wait for it to finish.
204
+ - For conflicts, apply in resolved order.
205
+ - Pass that change's fetched specs-rule snapshot into inline sync; inline
206
+ sync must reuse it without fetching instructions again
207
+ - Apply artifact rules only to main specs produced by that change. They do
208
+ not change conflict resolution, archive behavior, or CLI contracts, and
209
+ their text is not copied into an output file
210
+ - Do not delegate to a background task — step 8c would move `changeRoot` out from under a sync that is still reading it.
211
+ - If a change has no included delta specs, do not run the sync workflow for it.
212
+
213
+ b. **Verify included delta specs before moving changeRoot**:
214
+ - Re-run the comparison only for delta specs in `includedDeltas` against main spec at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` (use the store-aware `planningHome.root` from step 3 status JSON, not a hardcoded repo path).
215
+ - Verify that main specs are updated:
216
+ - ADDED requirements present
217
+ - MODIFIED requirements carrying scenario and description changes named in the delta, with their other scenarios intact
218
+ - REMOVED requirements gone — and where this sync retired a capability (removed its last requirement, leaving `## Requirements` empty), its main spec deleted rather than left empty; a spec the sync deliberately kept and reported is also a match
219
+ - RENAMED requirements present under the new name and absent under the old one
220
+ - Do not verify delta specs in `excludedDeltas`; they are intentionally left unsynced.
221
+ - If sync failed or any capability does not match verification, report what differs and fail/skip moving that change's `changeRoot` — do not archive that change. `changeRoot` remains intact.
222
+
223
+ c. **Perform the archive**:
224
+
225
+ Target name: use the `<target-name>` recorded for this change in step 3d, unchanged. Never recompute it here: a batch that runs past midnight would check one date in step 3 and move to another.
226
+
227
+ **Check if target already exists:**
228
+ - Check again immediately before the move, even though step 3 already checked: the target can appear mid-batch
229
+ - If yes: record this change as Failed with `Archive directory already exists`, leave `changeRoot` where it is, report any main specs step 8a already synced for it, and continue with the remaining changes
230
+ - If no: move `changeRoot` to the archive directory
231
+
232
+ ```bash
233
+ mkdir -p "<planningHome.changesDir>/archive"
234
+ mv "<changeRoot>" "<planningHome.changesDir>/archive/<target-name>"
235
+ ```
236
+
237
+ **Confirm the move did not nest:** `mv` exits 0 even when the target appeared after the check, moving the change *inside* it. If `<planningHome.changesDir>/archive/<target-name>/<change-directory-name>` now exists (the last path segment of `changeRoot`), move that directory back to `changeRoot` and record this change as Failed with `Archive directory already exists`. Never report it as archived.
238
+
239
+ d. **Track outcome** for each change:
240
+ - Success: archived successfully
241
+ - Failed: error during archive or spec verification (record error)
242
+ - Skipped: user chose not to archive (if applicable)
243
+ - Sync skipped: for every delta in `excludedDeltas`, report `sync skipped` with the change, `<capability-path>`, and recorded reason. This is distinct from skipping the archive.
244
+
245
+ 9. **Display summary**
246
+
247
+ Show final results:
248
+
249
+ ```markdown
250
+ ## Bulk Archive Complete
251
+
252
+ Archived 3 changes:
253
+ - schema-management-cli -> archive/2026-01-19-schema-management-cli/
254
+ - project-config -> archive/2026-01-19-project-config/
255
+ - add-oauth -> archive/2026-01-19-add-oauth/
256
+
257
+ Skipped 1 change:
258
+ - add-verify-skill (user chose not to archive incomplete)
259
+
260
+ Spec sync summary:
261
+ - 4 delta specs synced to main specs
262
+ - 1 delta spec sync skipped (add-jwt, identity/user-auth: implementation not found)
263
+ - 1 conflict resolved (identity/user-auth: synced add-oauth, skipped add-jwt)
264
+ ```
265
+
266
+ If any failures:
267
+ ```text
268
+ Failed 1 change:
269
+ - some-change: Archive directory already exists
270
+ ```
271
+
272
+ **Conflict Resolution Examples**
273
+
274
+ Example 1: Only one implemented
275
+ ```text
276
+ Conflict: <planningHome.root>/openspec/specs/auth/spec.md touched by [add-oauth, add-jwt]
277
+
278
+ Checking add-oauth:
279
+ - Delta adds "OAuth Provider Integration" requirement
280
+ - Searching codebase... found src/auth/oauth.ts implementing OAuth flow
281
+
282
+ Checking add-jwt:
283
+ - Delta adds "JWT Token Handling" requirement
284
+ - Searching codebase... no JWT implementation found
285
+
286
+ Resolution: Only add-oauth is implemented. Will sync add-oauth specs only.
287
+ ```
288
+
289
+ Example 2: Both implemented
290
+ ```text
291
+ Conflict: <planningHome.root>/openspec/specs/api/spec.md touched by [add-rest-api, add-graphql]
292
+
293
+ Checking add-rest-api (created 2026-01-10):
294
+ - Delta adds "REST Endpoints" requirement
295
+ - Searching codebase... found src/api/rest.ts
296
+
297
+ Checking add-graphql (created 2026-01-15):
298
+ - Delta adds "GraphQL Schema" requirement
299
+ - Searching codebase... found src/api/graphql.ts
300
+
301
+ Resolution: Both implemented. Will apply add-rest-api specs first,
302
+ then add-graphql specs (chronological order, newer takes precedence).
303
+ ```
304
+
305
+ **Output On Success**
306
+
307
+ ```markdown
308
+ ## Bulk Archive Complete
309
+
310
+ Archived N changes:
311
+ - <change-1> -> archive/<target-name-1>/
312
+ - <change-2> -> archive/<target-name-2>/
313
+
314
+ Spec sync summary:
315
+ - N delta specs synced to main specs
316
+ - No conflicts (or: M conflicts resolved)
317
+ ```
318
+
319
+ **Output On Partial Success**
320
+
321
+ ```markdown
322
+ ## Bulk Archive Complete (partial)
323
+
324
+ Archived N changes:
325
+ - <change-1> -> archive/<target-name-1>/
326
+
327
+ Skipped M changes:
328
+ - <change-2> (user chose not to archive incomplete)
329
+
330
+ Failed K changes:
331
+ - <change-3>: Archive directory already exists
332
+ ```
333
+
334
+ **Output When No Changes**
335
+
336
+ ```markdown
337
+ ## No Changes to Archive
338
+
339
+ No active changes found. Create a new change to get started.
340
+ ```
341
+
342
+ **Guardrails**
343
+ - Allow any number of changes (1+ is fine, 2+ is the typical use case)
344
+ - Always prompt for selection, never auto-select
345
+ - Detect spec conflicts early and resolve by checking codebase
346
+ - When both changes are implemented, apply specs in chronological order
347
+ - Skip spec sync only when implementation is missing (warn user)
348
+ - Show clear per-change status before confirming
349
+ - Use single confirmation for entire batch
350
+ - Never archive after the user cancels the confirmation — a cancelled batch archives nothing
351
+ - Track and report all outcomes (success/skip/fail)
352
+ - Preserve .openspec.yaml when moving to archive
353
+ - Archive directory target uses the current date, computed once in step 3d and reused at the move: YYYY-MM-DD-<name>; a name that already starts with a `YYYY-MM-DD-` prefix is used as-is (never stack a second date)
354
+ - If archive target exists, fail that change but continue with others
355
+ - Check every archive target in step 3, before the first main-spec write; a change whose target exists is never synced or moved
356
+ - If sync is requested, run the `/opsx:sync` workflow inline (agent-driven) for each change with included delta specs
357
+ - Carry the per-delta `includedDeltas` and `excludedDeltas` decisions into execution; sync and verify only included deltas
358
+ - Report every excluded delta as `sync skipped` without treating the archive itself as skipped
359
+ - Never archive a change while a spec sync is still in flight — run the sync inline and verify main specs at `<planningHome.root>/openspec/specs/<capability-path>/spec.md` before moving `changeRoot`
360
+ - Fetch archive inputs once per selected root before spec inspection or moves
361
+ - Fetch all required specs-rule snapshots before the batch's first main-spec write or move
362
+ - A failed archive-inputs lookup never blocks the batch; it proceeds with no context or guidance
363
+ - A failed specs instruction lookup stops the whole batch atomically
364
+ - Changes without concrete `artifactPaths.specs.existingOutputPaths` continue without spec sync
365
+ - Apply relevant runtime context across the batch and report conflicts
366
+ - Operation guidance remains advisory; consider every entry and explain rejected advice
367
+ - Keep runtime inputs, conflict analysis, CLI-derived values, and artifact rules separate
368
+ - Artifact rules constrain only written specs
334
369
  - Never copy runtime input or artifact-rule text verbatim into output files