Skip to content

Commit dab5d93

Browse files
authored
Merge pull request #68 from Fission-AI/codex/add-support-for-multiple-coding-agents
feat(cli-init): propose additional agent init flow
2 parents dd7ba71 + 7b0f494 commit dab5d93

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
## MODIFIED Requirements
2+
### Requirement: Safety Checks
3+
The command SHALL perform safety checks to prevent overwriting existing structures and ensure proper permissions.
4+
5+
#### Scenario: Detecting existing initialization
6+
- **WHEN** the `openspec/` directory already exists
7+
- **THEN** inform the user that OpenSpec is already initialized and skip recreating the base structure
8+
- **AND** continue to the AI tool selection step so additional tools can be configured
9+
- **AND** display the existing-initialization error message only when the user declines to add any AI tools
10+
11+
## ADDED Requirements
12+
### Requirement: Additional AI Tool Initialization
13+
`openspec init` SHALL allow users to add configuration files for new AI coding assistants after the initial setup.
14+
15+
#### Scenario: Configuring an extra tool after initial setup
16+
- **GIVEN** an `openspec/` directory already exists and at least one AI tool file is present
17+
- **WHEN** the user runs `openspec init` and selects a different supported AI tool
18+
- **THEN** generate that tool's configuration files with OpenSpec markers the same way as during first-time initialization
19+
- **AND** leave existing tool configuration files unchanged except for managed sections that need refreshing
20+
- **AND** exit with code 0 and display a success summary highlighting the newly added tool files
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Implementation Tasks
2+
3+
## 1. Extend Init Guard
4+
- [ ] 1.1 Detect existing OpenSpec structures at the start of `openspec init` and enter an extend mode instead of failing.
5+
- [ ] 1.2 Log that core scaffolding will be skipped while still protecting against missing write permissions.
6+
7+
## 2. Update AI Tool Selection
8+
- [ ] 2.1 Present AI tool choices even in extend mode, indicating which tools are already configured.
9+
- [ ] 2.2 Ensure disabled "coming soon" tools remain non-selectable.
10+
11+
## 3. Generate Additional Tool Files
12+
- [ ] 3.1 Create configuration files for newly selected tools while leaving untouched tools unaffected apart from marker-managed sections.
13+
- [ ] 3.2 Summarize created, refreshed, and skipped tools before exiting with the appropriate code.
14+
15+
## 4. Verification
16+
- [ ] 4.1 Add tests covering rerunning `openspec init` to add another tool and the scenario where the user declines to add anything.

0 commit comments

Comments
 (0)