|
| 1 | +# Allow Additional AI Tool Initialization After Setup |
| 2 | + |
| 3 | +## Summary |
| 4 | +- Let `openspec init` configure new AI coding tools for projects that already contain an OpenSpec structure. |
| 5 | +- Keep the initialization flow safe by skipping structure creation and only generating files for tools the user explicitly selects. |
| 6 | +- Provide clear feedback so users know which tool files were added versus already present. |
| 7 | + |
| 8 | +## Motivation |
| 9 | +Today `openspec init` exits with an error once an `openspec/` directory exists. That protects the directory layout, but it blocks |
| 10 | +teams that start with one assistant (for example, Claude Code) and later want to add another such as Cursor. They have to create |
| 11 | +those files by hand or rerun `init` in a clean clone, which undermines the "easy onboarding" promise. Letting the command extend |
| 12 | +an existing installation keeps the workflow consistent and avoids manual file management. |
| 13 | + |
| 14 | +## Proposal |
| 15 | +1. Detect an existing OpenSpec structure at the start of `openspec init` and branch into an "extend" mode instead of exiting. |
| 16 | + - Announce that the base structure already exists and that the command will only manage AI tool configuration files. |
| 17 | + - Keep the existing guard for directories or files we must not overwrite. |
| 18 | +2. Present the usual AI tool selection prompt even in extend mode, showing which tools are already configured. |
| 19 | + - Skip disabled options that remain "coming soon". |
| 20 | + - Mark already configured tools as such so users know whether selecting them will refresh or add files. |
| 21 | +3. When the user selects additional tools, generate the same initialization files that a fresh run would create (e.g., Cursor |
| 22 | + workspace files) while leaving untouched tools intact apart from marker-managed sections. |
| 23 | + - Do nothing when the user selects no new tools and keep the previous error messaging to avoid silently succeeding. |
| 24 | +4. Summarize the outcome (created, refreshed, skipped) before exiting with code 0 when work was performed. |
| 25 | + - Include friendly guidance that future updates to shared content still come from `openspec update`. |
| 26 | + |
| 27 | +## Out of Scope |
| 28 | +- Changing how `openspec update` discovers or updates AI tool files. |
| 29 | +- Supporting brand-new AI tools beyond those already wired into the CLI. |
| 30 | +- Adding non-interactive flags for selecting multiple tools in one run (follow-up if needed). |
| 31 | + |
| 32 | +## Risks & Mitigations |
| 33 | +- **User confusion about extend mode** → Explicitly log what will happen before prompting and summarise results afterward. |
| 34 | +- **Accidental overwrites** → Continue using marker-based updates and skip files unless the user chooses that tool. |
| 35 | +- **Inconsistent state if init fails mid-run** → Reuse existing rollback/transaction logic so partial writes clean up. |
0 commit comments