Skip to content

Commit 2d4c98e

Browse files
authored
Simplify profile sync + strengthen commands-only coverage (Fission-AI#736)
* Improve profile sync flows and add coverage for commands-only edge cases * Fix migration workflow preservation and add coverage
1 parent be6659c commit 2d4c98e

19 files changed

Lines changed: 1723 additions & 369 deletions

File tree

docs/cli.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ openspec config <subcommand> [options]
767767
| `unset <key>` | Remove a key |
768768
| `reset` | Reset to defaults |
769769
| `edit` | Open in `$EDITOR` |
770+
| `profile [preset]` | Configure workflow profile interactively or via preset |
770771

771772
**Examples:**
772773

@@ -794,6 +795,37 @@ openspec config reset --all --yes
794795

795796
# Edit config in your editor
796797
openspec config edit
798+
799+
# Configure profile with action-based wizard
800+
openspec config profile
801+
802+
# Fast preset: switch workflows to core (keeps delivery mode)
803+
openspec config profile core
804+
```
805+
806+
`openspec config profile` starts with a current-state summary, then lets you choose:
807+
- Change delivery + workflows
808+
- Change delivery only
809+
- Change workflows only
810+
- Keep current settings (exit)
811+
812+
If you keep current settings, no changes are written and no update prompt is shown.
813+
If there are no config changes but the current project files are out of sync with your global profile/delivery, OpenSpec will show a warning and suggest running `openspec update`.
814+
Pressing `Ctrl+C` also cancels the flow cleanly (no stack trace) and exits with code `130`.
815+
In the workflow checklist, `[x]` means the workflow is selected in global config. To apply those selections to project files, run `openspec update` (or choose `Apply changes to this project now?` when prompted inside a project).
816+
817+
**Interactive examples:**
818+
819+
```bash
820+
# Delivery-only update
821+
openspec config profile
822+
# choose: Change delivery only
823+
# choose delivery: Skills only
824+
825+
# Workflows-only update
826+
openspec config profile
827+
# choose: Change workflows only
828+
# toggle workflows in the checklist, then confirm
797829
```
798830

799831
---

openspec/changes/simplify-skill-installation/proposal.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ After migration, subsequent `init` and `update` commands respect the migrated co
142142
- Existing users' workflows are preserved exactly as-is (no `propose` added automatically)
143143
- Both `init` (re-init) and `update` trigger migration on existing projects if no profile is set
144144
- `openspec init` on a **new** project (no existing workflows) uses global config, defaulting to `core`
145-
- `init` with a custom profile shows what will be installed and prompts to proceed or reconfigure
145+
- `init` with a custom profile applies the configured workflows directly (no profile confirmation prompt)
146146
- `init` validates `--profile` values (`core` or `custom`) and errors on invalid input
147147
- Migration message mentions `propose` and suggests `openspec config profile core` to opt in
148148
- After migration, users can opt into `core` profile via `openspec config profile core`

openspec/changes/simplify-skill-installation/specs/cli-init/spec.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,32 +148,24 @@ The init command SHALL read and apply settings from global config.
148148
- **THEN** the system SHALL exit with code 1
149149
- **THEN** the system SHALL display a validation error listing allowed profile values
150150

151-
### Requirement: Init shows profile confirmation for non-default profiles
152-
The init command SHALL show what profile is being applied when it differs from `core`, allowing the user to adjust before proceeding.
151+
### Requirement: Init applies configured profile without confirmation
152+
The init command SHALL apply the resolved profile (`--profile` override or global config) directly without prompting for confirmation.
153153

154154
#### Scenario: Init with custom profile (interactive)
155155
- **WHEN** user runs `openspec init` interactively
156156
- **AND** global config specifies `profile: "custom"` with workflows
157-
- **THEN** the system SHALL display: "Applying custom profile (<count> workflows): <workflow-names>"
158-
- **THEN** the system SHALL prompt: "Proceed? (y/n) Or run 'openspec config profile' to change."
159-
- **WHEN** user confirms
160-
- **THEN** the system SHALL proceed with init using the custom profile
161-
162-
#### Scenario: Init with custom profile — user declines
163-
- **WHEN** user declines the profile confirmation prompt
164-
- **THEN** the system SHALL display: "Run 'openspec config profile' to update your profile, then try again."
165-
- **THEN** the system SHALL exit with code 0 (no error)
166-
167-
#### Scenario: Init with core profile (no confirmation needed)
168-
- **WHEN** user runs `openspec init` interactively
169-
- **AND** profile is `core` (default)
170-
- **THEN** the system SHALL NOT show a profile confirmation prompt
171-
- **THEN** the system SHALL proceed directly
157+
- **THEN** the system SHALL proceed directly using the custom profile workflows
158+
- **AND** the system SHALL NOT show a profile confirmation prompt
172159

173160
#### Scenario: Non-interactive init with custom profile
174161
- **WHEN** user runs `openspec init` non-interactively
175162
- **AND** global config specifies a custom profile
176-
- **THEN** the system SHALL proceed without confirmation (CI assumes intentional config)
163+
- **THEN** the system SHALL proceed without confirmation
164+
165+
#### Scenario: Init with core profile
166+
- **WHEN** user runs `openspec init` interactively
167+
- **AND** profile is `core` (default)
168+
- **THEN** the system SHALL proceed directly without a profile confirmation prompt
177169

178170
### Requirement: Init preserves existing workflows
179171
The init command SHALL NOT remove workflows that are already installed, but SHALL respect delivery setting.

openspec/changes/simplify-skill-installation/specs/cli-update/spec.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ The update command SHALL notify the user if new AI tool directories are detected
139139
- **THEN** the system SHALL NOT automatically add the new tool
140140
- **THEN** the system SHALL proceed with update for currently configured tools only
141141

142+
#### Scenario: Multiple new tool directories detected
143+
- **WHEN** user runs `openspec update`
144+
- **AND** multiple new tool directories are detected (e.g., `.github/` and `.windsurf/` exist but neither tool is configured)
145+
- **THEN** the system SHALL display one consolidated message listing all detected tools, for example: "Detected new tools: GitHub Copilot, Windsurf. Run 'openspec init' to add them."
146+
- **THEN** the system SHALL NOT automatically add any new tools
147+
- **THEN** the system SHALL proceed with update for currently configured tools only
148+
142149
#### Scenario: No new tool directories
143150
- **WHEN** user runs `openspec update`
144151
- **AND** no new tool directories are detected

openspec/changes/simplify-skill-installation/tasks.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@
6464
- [x] 7.2 Update init to read global config for profile/delivery defaults
6565
- [x] 7.3 Add migration check to init: call shared `migrateIfNeeded()` before profile resolution
6666
- [x] 7.4 Change tool selection to show pre-selected detected tools
67-
- [x] 7.5 Add profile confirmation for non-default profiles: display what will be installed and prompt to proceed or reconfigure
67+
- [x] 7.5 Apply configured profile directly in init (no profile confirmation prompt)
6868
- [x] 7.6 Update success message to show `/opsx:propose` prompt (only if propose is in the active profile)
6969
- [x] 7.7 Add `--profile` flag to override global config
7070
- [x] 7.8 Update non-interactive mode to use defaults without prompting
71-
- [x] 7.9 Add tests for init flow with various scenarios (including migration on re-init, custom profile confirmation)
71+
- [x] 7.9 Add tests for init flow with various scenarios (including migration on re-init and custom profile behavior)
7272

7373
## 8. Update Command (Profile Support + Migration)
7474

@@ -119,7 +119,7 @@
119119
- [x] 12.4 Update CLI help text for new commands
120120
- [x] 12.5 Manual: interactive init — verify detected tools are pre-selected, confirm prompt works, success message is correct
121121
- [x] 12.6 Manual: `openspec config profile` picker — verify delivery toggle, workflow toggles, pre-selection of current values, core preset shortcut
122-
- [x] 12.7 Manual: init with custom profile — verify confirmation prompt shows what will be installed
122+
- [x] 12.7 Manual: init with custom profile — verify init proceeds without profile confirmation prompt
123123
- [x] 12.8 Manual: delivery change via update — verify correct files are deleted/created when switching between skills/commands/both
124124
- [x] 12.9 Manual: migration flow — run update on a pre-existing project with no profile in config, verify migration message and resulting config
125125

openspec/project.md

Lines changed: 0 additions & 53 deletions
This file was deleted.

openspec/specs/cli-config/spec.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,53 @@ The config command SHALL open the config file in the user's editor.
167167
- **THEN** display error message suggesting to set `$EDITOR`
168168
- **AND** exit with code 1
169169

170+
### Requirement: Profile Configuration Flow
171+
172+
The `openspec config profile` command SHALL provide an action-first interactive flow that allows users to modify delivery and workflow settings independently.
173+
174+
#### Scenario: Current profile summary appears first
175+
176+
- **WHEN** user runs `openspec config profile` in an interactive terminal
177+
- **THEN** display a current-state header with:
178+
- current delivery value
179+
- workflow count with profile label (core or custom)
180+
181+
#### Scenario: Action-first menu offers skippable paths
182+
183+
- **WHEN** user runs `openspec config profile` interactively
184+
- **THEN** the first prompt SHALL offer:
185+
- `Change delivery + workflows`
186+
- `Change delivery only`
187+
- `Change workflows only`
188+
- `Keep current settings (exit)`
189+
190+
#### Scenario: Delivery prompt marks current selection
191+
192+
- **WHEN** delivery selection is shown in `openspec config profile`
193+
- **THEN** the currently configured delivery option SHALL include `[current]` in its label
194+
- **AND** that value SHALL be preselected by default
195+
196+
#### Scenario: No-op exits without saving or apply prompt
197+
198+
- **WHEN** user chooses `Keep current settings (exit)` OR makes selections that do not change effective config values
199+
- **THEN** the command SHALL print `No config changes.`
200+
- **AND** SHALL NOT write config changes
201+
- **AND** SHALL NOT ask to apply updates to the current project
202+
203+
#### Scenario: No-op warns when current project is out of sync
204+
205+
- **WHEN** `openspec config profile` exits with `No config changes.` inside an OpenSpec project
206+
- **AND** project files are out of sync with the current global profile/delivery
207+
- **THEN** display a non-blocking warning that global config is not yet applied to this project
208+
- **AND** include guidance to run `openspec update` to sync project files
209+
210+
#### Scenario: Apply prompt is gated on actual changes
211+
212+
- **WHEN** config values were changed and saved
213+
- **AND** current directory is an OpenSpec project
214+
- **THEN** prompt `Apply changes to this project now?`
215+
- **AND** if confirmed, run `openspec update` for the current project
216+
170217
### Requirement: Key Naming Convention
171218

172219
The config command SHALL use camelCase keys matching the JSON structure.

0 commit comments

Comments
 (0)