Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,7 @@ openspec config <subcommand> [options]
| `unset <key>` | Remove a key |
| `reset` | Reset to defaults |
| `edit` | Open in `$EDITOR` |
| `profile [preset]` | Configure workflow profile interactively or via preset |

**Examples:**

Expand Down Expand Up @@ -794,6 +795,37 @@ openspec config reset --all --yes

# Edit config in your editor
openspec config edit

# Configure profile with action-based wizard
openspec config profile

# Fast preset: switch workflows to core (keeps delivery mode)
openspec config profile core
```

`openspec config profile` starts with a current-state summary, then lets you choose:
- Change delivery + workflows
- Change delivery only
- Change workflows only
- Keep current settings (exit)

If you keep current settings, no changes are written and no update prompt is shown.
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`.
Pressing `Ctrl+C` also cancels the flow cleanly (no stack trace) and exits with code `130`.
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).

**Interactive examples:**

```bash
# Delivery-only update
openspec config profile
# choose: Change delivery only
# choose delivery: Skills only

# Workflows-only update
openspec config profile
# choose: Change workflows only
# toggle workflows in the checklist, then confirm
```

---
Expand Down
2 changes: 1 addition & 1 deletion openspec/changes/simplify-skill-installation/proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ After migration, subsequent `init` and `update` commands respect the migrated co
- Existing users' workflows are preserved exactly as-is (no `propose` added automatically)
- Both `init` (re-init) and `update` trigger migration on existing projects if no profile is set
- `openspec init` on a **new** project (no existing workflows) uses global config, defaulting to `core`
- `init` with a custom profile shows what will be installed and prompts to proceed or reconfigure
- `init` with a custom profile applies the configured workflows directly (no profile confirmation prompt)
- `init` validates `--profile` values (`core` or `custom`) and errors on invalid input
- Migration message mentions `propose` and suggests `openspec config profile core` to opt in
- After migration, users can opt into `core` profile via `openspec config profile core`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,32 +148,24 @@ The init command SHALL read and apply settings from global config.
- **THEN** the system SHALL exit with code 1
- **THEN** the system SHALL display a validation error listing allowed profile values

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

#### Scenario: Init with custom profile (interactive)
- **WHEN** user runs `openspec init` interactively
- **AND** global config specifies `profile: "custom"` with workflows
- **THEN** the system SHALL display: "Applying custom profile (<count> workflows): <workflow-names>"
- **THEN** the system SHALL prompt: "Proceed? (y/n) Or run 'openspec config profile' to change."
- **WHEN** user confirms
- **THEN** the system SHALL proceed with init using the custom profile

#### Scenario: Init with custom profile — user declines
- **WHEN** user declines the profile confirmation prompt
- **THEN** the system SHALL display: "Run 'openspec config profile' to update your profile, then try again."
- **THEN** the system SHALL exit with code 0 (no error)

#### Scenario: Init with core profile (no confirmation needed)
- **WHEN** user runs `openspec init` interactively
- **AND** profile is `core` (default)
- **THEN** the system SHALL NOT show a profile confirmation prompt
- **THEN** the system SHALL proceed directly
- **THEN** the system SHALL proceed directly using the custom profile workflows
- **AND** the system SHALL NOT show a profile confirmation prompt

#### Scenario: Non-interactive init with custom profile
- **WHEN** user runs `openspec init` non-interactively
- **AND** global config specifies a custom profile
- **THEN** the system SHALL proceed without confirmation (CI assumes intentional config)
- **THEN** the system SHALL proceed without confirmation

#### Scenario: Init with core profile
- **WHEN** user runs `openspec init` interactively
- **AND** profile is `core` (default)
- **THEN** the system SHALL proceed directly without a profile confirmation prompt

### Requirement: Init preserves existing workflows
The init command SHALL NOT remove workflows that are already installed, but SHALL respect delivery setting.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ The update command SHALL notify the user if new AI tool directories are detected
- **THEN** the system SHALL NOT automatically add the new tool
- **THEN** the system SHALL proceed with update for currently configured tools only

#### Scenario: Multiple new tool directories detected
- **WHEN** user runs `openspec update`
- **AND** multiple new tool directories are detected (e.g., `.github/` and `.windsurf/` exist but neither tool is configured)
- **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."
- **THEN** the system SHALL NOT automatically add any new tools
- **THEN** the system SHALL proceed with update for currently configured tools only

#### Scenario: No new tool directories
- **WHEN** user runs `openspec update`
- **AND** no new tool directories are detected
Expand Down
6 changes: 3 additions & 3 deletions openspec/changes/simplify-skill-installation/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@
- [x] 7.2 Update init to read global config for profile/delivery defaults
- [x] 7.3 Add migration check to init: call shared `migrateIfNeeded()` before profile resolution
- [x] 7.4 Change tool selection to show pre-selected detected tools
- [x] 7.5 Add profile confirmation for non-default profiles: display what will be installed and prompt to proceed or reconfigure
- [x] 7.5 Apply configured profile directly in init (no profile confirmation prompt)
- [x] 7.6 Update success message to show `/opsx:propose` prompt (only if propose is in the active profile)
- [x] 7.7 Add `--profile` flag to override global config
- [x] 7.8 Update non-interactive mode to use defaults without prompting
- [x] 7.9 Add tests for init flow with various scenarios (including migration on re-init, custom profile confirmation)
- [x] 7.9 Add tests for init flow with various scenarios (including migration on re-init and custom profile behavior)

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

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

Expand Down
53 changes: 0 additions & 53 deletions openspec/project.md

This file was deleted.

47 changes: 47 additions & 0 deletions openspec/specs/cli-config/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,53 @@ The config command SHALL open the config file in the user's editor.
- **THEN** display error message suggesting to set `$EDITOR`
- **AND** exit with code 1

### Requirement: Profile Configuration Flow

The `openspec config profile` command SHALL provide an action-first interactive flow that allows users to modify delivery and workflow settings independently.

#### Scenario: Current profile summary appears first

- **WHEN** user runs `openspec config profile` in an interactive terminal
- **THEN** display a current-state header with:
- current delivery value
- workflow count with profile label (core or custom)

#### Scenario: Action-first menu offers skippable paths

- **WHEN** user runs `openspec config profile` interactively
- **THEN** the first prompt SHALL offer:
- `Change delivery + workflows`
- `Change delivery only`
- `Change workflows only`
- `Keep current settings (exit)`

#### Scenario: Delivery prompt marks current selection

- **WHEN** delivery selection is shown in `openspec config profile`
- **THEN** the currently configured delivery option SHALL include `[current]` in its label
- **AND** that value SHALL be preselected by default

#### Scenario: No-op exits without saving or apply prompt

- **WHEN** user chooses `Keep current settings (exit)` OR makes selections that do not change effective config values
- **THEN** the command SHALL print `No config changes.`
- **AND** SHALL NOT write config changes
- **AND** SHALL NOT ask to apply updates to the current project

#### Scenario: No-op warns when current project is out of sync

- **WHEN** `openspec config profile` exits with `No config changes.` inside an OpenSpec project
- **AND** project files are out of sync with the current global profile/delivery
- **THEN** display a non-blocking warning that global config is not yet applied to this project
- **AND** include guidance to run `openspec update` to sync project files

#### Scenario: Apply prompt is gated on actual changes

- **WHEN** config values were changed and saved
- **AND** current directory is an OpenSpec project
- **THEN** prompt `Apply changes to this project now?`
- **AND** if confirmed, run `openspec update` for the current project

### Requirement: Key Naming Convention

The config command SHALL use camelCase keys matching the JSON structure.
Expand Down
Loading
Loading