Skip to content
Merged

Rc #521

Show file tree
Hide file tree
Changes from 155 commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
e8d2675
fix: replace @Injectable() decorator with injectable() for consistency
Romakita Aug 10, 2025
8569cab
fix: update @tsed dependencies to version 8.16.0-rc.1
Romakita Aug 10, 2025
be8a421
refactor: replace Command decorator implementation and introduce comm…
Romakita Aug 10, 2025
3e13eb0
refactor: replace Command decorator with command function for improve…
Romakita Aug 11, 2025
4ddaaf8
fix: update FakeCliFs.entries to FakeCliFs.files for consistency in i…
Romakita Aug 17, 2025
a3c742d
test: update integration tests to include package.json in expected fi…
Romakita Aug 17, 2025
50ef9c8
refactor: update FakeCliFs to use files and directories for improved …
Romakita Aug 17, 2025
9529ee7
refactor: rename exists method to fileExistsSync for consistency and …
Romakita Aug 17, 2025
615a61d
feat(cli): migrate all HBS templates to typescript using defineTempla…
Romakita Aug 29, 2025
80135ba
feat: introduce CommandData interface and enhance command handling wi…
Romakita Aug 29, 2025
8b1b85e
refactor: update all plugins according to the new CLI api
Romakita Aug 29, 2025
947a68c
refactor: implement reset method in CliPlatformTest to clear static c…
Romakita Aug 30, 2025
e6b2410
refactor: implement reset method in CliPlatformTest to clear static c…
Romakita Sep 3, 2025
e8b473d
ci: update Node.js version to 22.x and restructure test jobs in build…
Romakita Sep 13, 2025
bc69a41
Github CI build: __run_2 v7.0.0-alpha.1 [ci skip]
semantic-release-bot Sep 13, 2025
a35d199
feat: enhance project initialization by adding EnvsConfigSource to co…
Romakita Sep 13, 2025
8c56733
fix: configure CliProjectService correctly to fix performance issue
Romakita Sep 13, 2025
4c4526b
feat: add task output logging and improve file existence check in CLI…
Romakita Sep 13, 2025
8b14b6f
feat: add AWS Secrets Manager configuration and update dependencies f…
Romakita Sep 13, 2025
50e68e6
Merge pull request #499 from tsedio/feat-add-config
Romakita Sep 13, 2025
713e655
Github CI build: __run_2 v7.0.0-alpha.2 [ci skip]
semantic-release-bot Sep 13, 2025
6bde193
fix: ensure dir are created correctly before writing it
Romakita Sep 14, 2025
49ce7b4
Github CI build: __run_2 v7.0.0-alpha.3 [ci skip]
semantic-release-bot Sep 15, 2025
6f4dc8e
feat: add premium configuration options and update related prompts
Romakita Sep 15, 2025
0f38c57
Github CI build: __run_2 v7.0.0-alpha.4 [ci skip]
semantic-release-bot Sep 15, 2025
ad70516
fix(cli): improve file globbing and fix template imports
Romakita Sep 16, 2025
ac5cb22
feat(cli): add create template command and new template generation logic
Romakita Sep 17, 2025
bfca288
Merge pull request #502 from tsedio/feat-create-template-command
Romakita Sep 20, 2025
29fed75
Github CI build: __run_2 v7.0.0-alpha.5 [ci skip]
semantic-release-bot Sep 20, 2025
01809c7
fix(cli): fix minors issues
Romakita Sep 23, 2025
fabc790
Github CI build: __run_2 v7.0.0-alpha.6 [ci skip]
semantic-release-bot Sep 23, 2025
a4af5e1
fix: update @tsed/monorepo-utils to version 3.0.0
Romakita Oct 7, 2025
ae9823d
fix: update @tsed dependencies to version 8.17.3
Romakita Oct 7, 2025
b19ef1e
Github CI build: __run_2 v7.0.0-alpha.7 [ci skip]
semantic-release-bot Oct 7, 2025
02c9bd1
fix: add missing logger import
Romakita Oct 7, 2025
f893bcc
Github CI build: __run_2 v7.0.0-alpha.8 [ci skip]
semantic-release-bot Oct 7, 2025
92170e5
fix(cli): remove CliConfiguration references from CLI files
Romakita Oct 14, 2025
2d772b2
Merge pull request #506 from tsedio/fix-remove-cli-configuration
Romakita Oct 27, 2025
cdf2b15
Github CI build: __run_2 v7.0.0-alpha.9 [ci skip]
semantic-release-bot Oct 27, 2025
2a53099
fix(cli): remove Cli and simplify bootstrap sequence
Romakita Oct 27, 2025
5becd26
feat(cli): add renderedFiles property to retrieve generated files fro…
Romakita Oct 27, 2025
8784440
Merge pull request #507 from tsedio/remove-cli-class
Romakita Oct 27, 2025
3ed12e8
Github CI build: __run_2 v7.0.0-alpha.10 [ci skip]
semantic-release-bot Oct 27, 2025
ea91ec6
Merge pull request #508 from tsedio/alpha
Romakita Nov 1, 2025
87e2bd0
Github CI build: __run_2 v7.0.0-beta.1 [ci skip]
semantic-release-bot Nov 1, 2025
a794314
fix(cli): refactor CliCore and simplify injector setup
Romakita Nov 10, 2025
94a7ecb
refactor(cli): centralize and simplify rootDir handling across services
Romakita Nov 10, 2025
b6dc803
fix(cli): correct platform preference assignment and adjust spacing i…
Romakita Nov 11, 2025
8dcffee
docs(cli-core): update copyright year range in readme
Romakita Nov 11, 2025
c19068b
Merge pull request #509 from tsedio/fix-issues
Romakita Nov 11, 2025
e12c01a
Github CI build: __run_2 v7.0.0-beta.2 [ci skip]
semantic-release-bot Nov 11, 2025
6bedca7
feat(cli-mcp): introduce MCP CLI package with services, utilities, an…
Romakita Nov 10, 2025
102db83
feat(cli-mcp): add MCP-specific scripts, entry point, and path config…
Romakita Nov 10, 2025
00703de
docs(cli-mcp): update readme with installation steps, usage examples,…
Romakita Nov 10, 2025
83d3773
refactor(cli-mcp): restructure `defineResource` types and improve `to…
Romakita Nov 11, 2025
59f54a1
feat(cli): implement MCP server integration with new tools, resources…
Romakita Nov 11, 2025
a049047
docs(cli): add descriptions to template definitions for improved clarity
Romakita Nov 11, 2025
1a36bd8
feat(cli): add schema validation and improve template definitions, co…
Romakita Nov 11, 2025
dad6d27
feat(cli-core): add JSON schema validation utility to utils package
Romakita Nov 11, 2025
39023a0
refactor(cli): replace `InitFileSchema` with `InitSchema` for improve…
Romakita Nov 11, 2025
2d8f714
feat(cli): add `get-template` tool and improve template handling
Romakita Nov 11, 2025
10af9c3
refactor(cli): update template options handling and improve typings f…
Romakita Nov 16, 2025
148dd5c
refactor(cli): update file filtering logic to ensure consistent handl…
Romakita Nov 16, 2025
15881d0
refactor(cli-core): remove redundant `Ajv` initialization in CliLoadFile
Romakita Nov 16, 2025
9d8e646
feat(cli-mcp): add streamable HTTP and stdio MCP server modes with tests
Romakita Nov 16, 2025
459681f
feat(cli-mcp): add streamable HTTP and stdio MCP server modes with tests
Romakita Nov 16, 2025
bbd7193
refactor(cli): update DI usage in tests and fix template type handling
Romakita Nov 16, 2025
807d0d9
fix(cli-core): correct validation logic to handle errors when result …
Romakita Nov 16, 2025
c9f86b9
feat(tools): extend MCP scripts with HTTP and stdio modes
Romakita Nov 16, 2025
ab47bf7
refactor(cli-core): simplify schema validation in CliLoadFile tests
Romakita Nov 16, 2025
8c30bf5
feat(cli): add `CliStats` service for tracking CLI usage statistics
Romakita Nov 17, 2025
1ac30be
refactor(cli-core): update DI usage to `inject` and simplify dependen…
Romakita Nov 21, 2025
0fe7738
feat(cli-mcp): enhance MCP mode configuration and file generation sup…
Romakita Nov 21, 2025
2cd0f31
Merge pull request #512 from tsedio/tsed-mcp
Romakita Nov 22, 2025
613a53c
Github CI build: __run_2 v7.0.0-beta.3 [ci skip]
semantic-release-bot Nov 22, 2025
dedd060
chore: remove missing logs
Romakita Dec 2, 2025
a04eef4
refactor(cli): update command definitions to use object token syntax
Romakita Dec 10, 2025
2504a8b
refactor(cli-core): remove unused hook decorators and simplify comman…
Romakita Dec 10, 2025
9a26397
refactor(cli): update command definitions to use object shorthand syn…
Romakita Dec 10, 2025
ef55543
refactor(cli-plugins): replace `@OnAdd` decorator usage with `$onAddP…
Romakita Dec 10, 2025
d426538
refactor(cli): restructure MCP commands and tools directories, remove…
Romakita Dec 10, 2025
e44bd12
docs(contributing): add repository guidelines and update contribution…
Romakita Dec 10, 2025
663a64e
test(cli-core): add unit tests for CliFs, CliDockerComposeYaml, CliSe…
Romakita Dec 10, 2025
305c26b
refactor(cli-mcp): remove CLIMCPServer and refactor MCP server lifecy…
Romakita Dec 10, 2025
82bea98
chore(mcp): update integration scripts and add Prisma support in tests
Romakita Dec 10, 2025
07276d5
chore: bump @tsed dependencies to v8.20.0 and update related configur…
Romakita Dec 23, 2025
619d917
refactor(cli): unify feature keys under `orm` and update TypeORM inte…
Romakita Dec 23, 2025
6f1eec0
refactor(cli-core): enhance schema metadata handling and improve comm…
Romakita Dec 23, 2025
966e4b0
feat(cli-core): add input validation via `inputSchema` for commands
Romakita Dec 23, 2025
16ae8da
refactor(cli): replace `InitFileSchema` with `InitSchema` for enhance…
Romakita Dec 23, 2025
a245701
chore: bump @tsed dependencies to v8.20.1 and update related configur…
Romakita Dec 23, 2025
20ddbe0
feat(cli): add `init-options` command to display available init optio…
Romakita Dec 23, 2025
3a956ac
fix: bump @tsed dependencies to v8.21.0 and update related configurat…
Romakita Dec 24, 2025
ad93cd7
Merge pull request #513 from tsedio/init-mpc-2
Romakita Dec 24, 2025
df0a894
Github CI build: __run_2 v7.0.0-beta.4 [ci skip]
semantic-release-bot Dec 24, 2025
57e39ad
fix(cli): enhance resource and tool handling, adjust schemas, and upd…
Romakita Dec 24, 2025
3b4ba58
Merge pull request #514 from tsedio/fix-missing-dependencies
Romakita Dec 24, 2025
f2a7ae6
Github CI build: __run_2 v7.0.0-beta.5 [ci skip]
semantic-release-bot Dec 24, 2025
4188abb
fix(cli): add logging for command execution in RunCmd
Romakita Dec 24, 2025
f76342a
fix(cli): update dependencies and refine CLI_MODE handling
Romakita Dec 24, 2025
f7f71ca
Github CI build: __run_2 v7.0.0-beta.6 [ci skip]
semantic-release-bot Dec 24, 2025
1169bea
fix(cli): update InitMCPSchema and initProjectTool description
Romakita Dec 24, 2025
5770eff
refactor(cli): replace hardcoded feature values with constants in Ini…
Romakita Jan 3, 2026
ddfd9bb
fix(cli): rename "DotenvConfigSource" to "DotEnvsConfigSource" in tra…
Romakita Jan 3, 2026
e0fffc6
Github CI build: __run_2 v7.0.0-beta.7 [ci skip]
semantic-release-bot Jan 3, 2026
3bf48dd
fix(cli): enhance eslint support and improve plugin handling
Romakita Jan 5, 2026
5859943
Github CI build: __run_2 v7.0.0-beta.8 [ci skip]
semantic-release-bot Jan 5, 2026
aa55905
feat(cli): add AGENTS.md template and integrate with init command
Romakita Jan 14, 2026
2a28080
refactor(cli): clean up unused injections and streamline plugin loader
Romakita Jan 14, 2026
320a0ed
Github CI build: __run_2 v7.0.0-beta.9 [ci skip]
semantic-release-bot Jan 14, 2026
2b3d36a
fix(cli): add `join` import to eslint template for path handling
Romakita Jan 16, 2026
1f0ef53
feat(cli): add support for home page views and update configurations
Romakita Jan 16, 2026
473817e
feat(cli): replace swagger.ejs with home.ejs and update related templ…
Romakita Jan 16, 2026
334e59d
feat(views): revamp `home.ejs` with modern design and structured reso…
Romakita Jan 16, 2026
7573274
feat(cli): replace `IndexController` with `home.ejs` and update tests…
Romakita Jan 16, 2026
5d50bb9
Github CI build: __run_2 v7.0.0-beta.10 [ci skip]
semantic-release-bot Jan 16, 2026
7c44f37
chore(plan): replace Inquirer with @clack/prompts and introduce promp…
Romakita Jan 17, 2026
a52782d
fix(cli): remove `@types/inquirer` references from dependencies
Romakita Jan 17, 2026
78c4e3f
feat(cli): implement prompt utilities and abstractions with @clack/pr…
Romakita Jan 17, 2026
db52d5b
feat(cli): introduce `@tsed/cli-prompts` package for modular prompt h…
Romakita Jan 17, 2026
45cfe51
refactor(cli): remove deprecated prompt logic and transition to @tsed…
Romakita Jan 17, 2026
c63d0e7
Merge pull request #515 from tsedio/feat-clack-prompt
Romakita Jan 17, 2026
fefec23
Github CI build: __run_2 v7.0.0-beta.11 [ci skip]
semantic-release-bot Jan 17, 2026
ae5c655
feat(cli): add passport package prompt with autocomplete support
Romakita Jan 17, 2026
194fbdf
fix(cli-prompts): remove `processPrompt` and `getValidationError` uti…
Romakita Jan 17, 2026
cf8d753
Github CI build: __run_2 v7.0.0-beta.12 [ci skip]
semantic-release-bot Jan 18, 2026
d977f92
chore(cli-tasks): add OPSX workflow for creating and applying changes
Romakita Feb 1, 2026
ab41298
feat(cli-tasks): introduce `@tsed/cli-tasks` for centralized task run…
Romakita Jan 18, 2026
bc695f6
feat(cli-tasks): finalize migration to `@tsed/cli-tasks`
Romakita Jan 18, 2026
6376451
docs(cli-tasks): migrate task runner from Listr to Clack
Romakita Jan 20, 2026
2f1b246
feat(cli-tasks): implement TaskLogger and task management utilities
Romakita Feb 1, 2026
12a0edc
refactor(cli): replace legacy task runner utilities with `@tsed/cli-t…
Romakita Feb 1, 2026
02527e0
refactor(cli): remove `bindLogger` and simplify task handling using `…
Romakita Feb 1, 2026
faeb458
docs(cli-core): update task runner references to use Clack
Romakita Feb 1, 2026
73f32bf
refactor(cli-plugin-typegraphql): remove `createSubTasks` usage in fa…
Romakita Feb 1, 2026
693a5f0
test(cli-tasks): add test for suppressing logger output when `NODE_EN…
Romakita Feb 1, 2026
6cc00f7
chore: archive plan
Romakita Feb 1, 2026
3e46880
refactor(cli): update return type of $alterGenerateTasks to Task[]
Romakita Feb 1, 2026
3f6ab84
refactor(cli-prompts): extend `Omit` in `PromptAutocompleteQuestion` …
Romakita Feb 1, 2026
d6e7f82
Merge pull request #519 from tsedio/feat-cli-clack-tasks
Romakita Feb 1, 2026
b7db5aa
Github CI build: __run_2 v7.0.0-beta.13 [ci skip]
semantic-release-bot Feb 1, 2026
965508d
fix(cli): replace `logger` with `taskLogger` for improved task loggin…
Romakita Feb 2, 2026
f3b33a3
Github CI build: __run_2 v7.0.0-beta.14 [ci skip]
semantic-release-bot Feb 2, 2026
c5a7fd0
fix(cli): include `IndexController` in generated project templates an…
Romakita Feb 2, 2026
39d8834
Github CI build: __run_2 v7.0.0-beta.15 [ci skip]
semantic-release-bot Feb 2, 2026
85725bc
fix(cli): replace `bindLogger` by `renderMode` option to enhance logg…
Romakita Feb 3, 2026
44a43e0
chore: remove deprecated docs components and unused workflow
Romakita Feb 3, 2026
daad44b
Github CI build: __run_2 v7.0.0-beta.16 [ci skip]
semantic-release-bot Feb 3, 2026
0ec0133
chore: add ai/references
Romakita Feb 4, 2026
159444c
Merge pull request #520 from tsedio/beta
Romakita Feb 4, 2026
1ae1110
Github CI build: __run_2 v7.0.0-rc.1 [ci skip]
semantic-release-bot Feb 4, 2026
5ee6683
feat(cli-mcp): migrate on zod v4
Romakita Feb 7, 2026
f1f4464
fix(cli-prisma): switch `run` to `runSync` and enhance schema initial…
Romakita Feb 7, 2026
74f0c9d
Github CI build: __run_2 v7.0.0-rc.2 [ci skip]
semantic-release-bot Feb 7, 2026
03f138e
fix(cli-eslint): pin eslint version to ^9.39.2 for compatibility
Romakita Feb 7, 2026
f17989c
Github CI build: __run_2 v7.0.0-rc.3 [ci skip]
semantic-release-bot Feb 7, 2026
f1049bf
fix(cli-prisma): update prisma initialization command and enhance gen…
Romakita Feb 8, 2026
1d4e0b8
Github CI build: __run_2 v7.0.0-rc.4 [ci skip]
semantic-release-bot Feb 8, 2026
718a66e
docs(cli-docs): introduce interactive CLI documentation for MCP, prom…
Romakita Feb 12, 2026
fe00649
docs(cli-mcp): add functional and decorator examples for tools, resou…
Romakita Feb 12, 2026
0c16c7f
docs(cli-prompts): replace multi-step flow example with decorator and…
Romakita Feb 12, 2026
a62b6d0
docs(cli): update examples and add "Commands" guide
Romakita Feb 12, 2026
220f5ab
docs(cli): add "Templates" guide and update for v7 release
Romakita Feb 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
164 changes: 164 additions & 0 deletions .claude/commands/opsx/apply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
---
name: "OPSX: Apply"
description: Implement tasks from an OpenSpec change (Experimental)
category: Workflow
tags: [workflow, artifacts, experimental]
---

Implement tasks from an OpenSpec change.

**Input**: Optionally specify a change name (e.g., `/opsx:apply add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

**Steps**

1. **Select the change**

If a name is provided, use it. Otherwise:

- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run `openspec list --json` to get available changes and use the **AskUserQuestion tool** to let the user select

Always announce: "Using change: <name>" and how to override (e.g., `/opsx:apply <other>`).

2. **Check status to understand the schema**

```bash
openspec status --change "<name>" --json
```

Parse the JSON to understand:

- `schemaName`: The workflow being used (e.g., "spec-driven")
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)

3. **Get apply instructions**

```bash
openspec instructions apply --change "<name>" --json
```

This returns:

- Context file paths (varies by schema)
- Progress (total, complete, remaining)
- Task list with status
- Dynamic instruction based on current state

**Handle states:**

- If `state: "blocked"` (missing artifacts): show message, suggest using `/opsx:continue`
- If `state: "all_done"`: congratulate, suggest archive
- Otherwise: proceed to implementation

4. **Read context files**

Read the files listed in `contextFiles` from the apply instructions output.
The files depend on the schema being used:

- **spec-driven**: proposal, specs, design, tasks
- Other schemas: follow the contextFiles from CLI output

5. **Show current progress**

Display:

- Schema being used
- Progress: "N/M tasks complete"
- Remaining tasks overview
- Dynamic instruction from CLI

6. **Implement tasks (loop until done or blocked)**

For each pending task:

- Show which task is being worked on
- Make the code changes required
- Keep changes minimal and focused
- Mark task complete in the tasks file: `- [ ]` → `- [x]`
- Continue to next task

**Pause if:**

- Task is unclear → ask for clarification
- Implementation reveals a design issue → suggest updating artifacts
- Error or blocker encountered → report and wait for guidance
- User interrupts

7. **On completion or pause, show status**

Display:

- Tasks completed this session
- Overall progress: "N/M tasks complete"
- If all done: suggest archive
- If paused: explain why and wait for guidance

**Output During Implementation**

```
## Implementing: <change-name> (schema: <schema-name>)

Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete

Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
```

**Output On Completion**

```
## Implementation Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓

### Completed This Session
- [x] Task 1
- [x] Task 2
...

All tasks complete! Ready to archive this change.
```

**Output On Pause (Issue Encountered)**

```
## Implementation Paused

**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete

### Issue Encountered
<description of the issue>

**Options:**
1. <option 1>
2. <option 2>
3. Other approach

What would you like to do?
```

**Guardrails**

- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- Use contextFiles from CLI output, don't assume specific file names

**Fluid Workflow Integration**

This skill supports the "actions on a change" model:

- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
166 changes: 166 additions & 0 deletions .claude/commands/opsx/archive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,166 @@
---
name: "OPSX: Archive"
description: Archive a completed change in the experimental workflow
category: Workflow
tags: [workflow, archive, experimental]
---

Archive a completed change in the experimental workflow.

**Input**: Optionally specify a change name after `/opsx:archive` (e.g., `/opsx:archive add-auth`). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.

**Steps**

1. **If no change name provided, prompt for selection**

Run `openspec list --json` to get available changes. Use the **AskUserQuestion tool** to let the user select.

Show only active changes (not already archived).
Include the schema used for each change if available.

**IMPORTANT**: Do NOT guess or auto-select a change. Always let the user choose.

2. **Check artifact completion status**

Run `openspec status --change "<name>" --json` to check artifact completion.

Parse the JSON to understand:

- `schemaName`: The workflow being used
- `artifacts`: List of artifacts with their status (`done` or other)

**If any artifacts are not `done`:**

- Display warning listing incomplete artifacts
- Prompt user for confirmation to continue
- Proceed if user confirms

3. **Check task completion status**

Read the tasks file (typically `tasks.md`) to check for incomplete tasks.

Count tasks marked with `- [ ]` (incomplete) vs `- [x]` (complete).

**If incomplete tasks found:**

- Display warning showing count of incomplete tasks
- Prompt user for confirmation to continue
- Proceed if user confirms

**If no tasks file exists:** Proceed without task-related warning.

4. **Assess delta spec sync state**

Check for delta specs at `openspec/changes/<name>/specs/`. If none exist, proceed without sync prompt.

**If delta specs exist:**

- Compare each delta spec with its corresponding main spec at `openspec/specs/<capability>/spec.md`
- Determine what changes would be applied (adds, modifications, removals, renames)
- Show a combined summary before prompting

**Prompt options:**

- If changes needed: "Sync now (recommended)", "Archive without syncing"
- If already synced: "Archive now", "Sync anyway", "Cancel"

If user chooses sync, execute `/opsx:sync` logic. Proceed to archive regardless of choice.

5. **Perform the archive**

Create the archive directory if it doesn't exist:

```bash
mkdir -p openspec/changes/archive
```

Generate target name using current date: `YYYY-MM-DD-<change-name>`

**Check if target already exists:**

- If yes: Fail with error, suggest renaming existing archive or using different date
- If no: Move the change directory to archive

```bash
mv openspec/changes/<name> openspec/changes/archive/YYYY-MM-DD-<name>
```

6. **Display summary**

Show archive completion summary including:

- Change name
- Schema that was used
- Archive location
- Spec sync status (synced / sync skipped / no delta specs)
- Note about any warnings (incomplete artifacts/tasks)

**Output On Success**

```
## Archive Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** ✓ Synced to main specs

All artifacts complete. All tasks complete.
```

**Output On Success (No Delta Specs)**

```
## Archive Complete

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** No delta specs

All artifacts complete. All tasks complete.
```

**Output On Success With Warnings**

```
## Archive Complete (with warnings)

**Change:** <change-name>
**Schema:** <schema-name>
**Archived to:** openspec/changes/archive/YYYY-MM-DD-<name>/
**Specs:** Sync skipped (user chose to skip)

**Warnings:**
- Archived with 2 incomplete artifacts
- Archived with 3 incomplete tasks
- Delta spec sync was skipped (user chose to skip)

Review the archive if this was not intentional.
```

**Output On Error (Archive Exists)**

```
## Archive Failed

**Change:** <change-name>
**Target:** openspec/changes/archive/YYYY-MM-DD-<name>/

Target archive directory already exists.

**Options:**
1. Rename the existing archive
2. Delete the existing archive if it's a duplicate
3. Wait until a different date to archive
```

**Guardrails**

- Always prompt for change selection if not provided
- Use artifact graph (openspec status --json) for completion checking
- Don't block archive on warnings - just inform and confirm
- Preserve .openspec.yaml when moving to archive (it moves with the directory)
- Show clear summary of what happened
- If sync is requested, use /opsx:sync approach (agent-driven)
- If delta specs exist, always run the sync assessment and show the combined summary before prompting
Loading
Loading