Skip to content

Commit 938d03b

Browse files
authored
feat(init): add IDE restart instruction after init (Fission-AI#323)
Add prominent restart instruction in success message to inform users they need to restart their IDE/coding tool for slash commands to appear. Applies to all tools when slash commands are created or refreshed. Also updates cli-init spec to document the restart instruction requirement.
1 parent 19ccaab commit 938d03b

File tree

4 files changed

+50
-7
lines changed

4 files changed

+50
-7
lines changed

openspec/specs/cli-init/spec.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ The command SHALL properly configure selected AI tools with OpenSpec-specific in
7676
- **THEN** create or update `CLINE.md` in the project root directory (not inside openspec/)
7777
- **AND** populate the managed block with a short stub that points teammates to `@/openspec/AGENTS.md`
7878

79+
#### Scenario: Configuring iFlow CLI
80+
81+
- **WHEN** iFlow CLI is selected
82+
- **THEN** create or update `IFLOW.md` in the project root directory (not inside openspec/)
83+
- **AND** populate the managed block with a short stub that points teammates to `@/openspec/AGENTS.md`
84+
7985
#### Scenario: Creating new CLAUDE.md
8086

8187
- **WHEN** CLAUDE.md does not exist
@@ -118,6 +124,12 @@ The command SHALL provide clear, actionable next steps upon successful initializ
118124
- **WHEN** initialization completes successfully
119125
- **THEN** include prompt: "Please explain the OpenSpec workflow from openspec/AGENTS.md and how I should work with you on this project"
120126

127+
#### Scenario: Displaying restart instruction
128+
- **WHEN** initialization completes successfully and tools were created or refreshed
129+
- **THEN** display a prominent restart instruction before the "Next steps" section
130+
- **AND** inform users that slash commands are loaded at startup
131+
- **AND** instruct users to restart their coding assistant to ensure /openspec commands appear
132+
121133
### Requirement: Exit Codes
122134

123135
The command SHALL use consistent exit codes to indicate different failure modes.
@@ -238,6 +250,14 @@ The init command SHALL generate slash command files for supported editors using
238250
- **AND** wrap the OpenSpec managed markers (`<!-- OPENSPEC:START -->` / `<!-- OPENSPEC:END -->`) inside the `prompt` value so `openspec update` can safely refresh the body between markers without touching the TOML framing
239251
- **AND** ensure the slash-command copy matches the existing proposal/apply/archive templates used by other tools
240252

253+
#### Scenario: Generating slash commands for iFlow CLI
254+
- **WHEN** the user selects iFlow CLI during initialization
255+
- **THEN** create `.iflow/commands/openspec-proposal.md`, `.iflow/commands/openspec-apply.md`, and `.iflow/commands/openspec-archive.md`
256+
- **AND** populate each file from shared templates so command text matches other tools
257+
- **AND** include YAML frontmatter with `name`, `id`, `category`, and `description` fields for each command
258+
- **AND** wrap the generated content in OpenSpec managed markers so `openspec update` can safely refresh the commands
259+
- **AND** each template includes instructions for the relevant OpenSpec workflow stage
260+
241261
#### Scenario: Generating slash commands for RooCode
242262
- **WHEN** the user selects RooCode during initialization
243263
- **THEN** create `.roo/commands/openspec-proposal.md`, `.roo/commands/openspec-apply.md`, and `.roo/commands/openspec-archive.md`

openspec/specs/cli-update/spec.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,13 @@ The update command SHALL refresh existing slash command files for configured too
123123
- **AND** replace only the content between `<!-- OPENSPEC:START -->` and `<!-- OPENSPEC:END -->` markers inside the `prompt = """` block so the TOML framing (`description`, `prompt`) stays intact
124124
- **AND** skip creating any missing `.toml` files during update; only pre-existing Gemini commands are refreshed
125125

126+
#### Scenario: Updating slash commands for iFlow CLI
127+
- **WHEN** `.iflow/commands/` contains `openspec-proposal.md`, `openspec-apply.md`, and `openspec-archive.md`
128+
- **THEN** refresh each file using shared templates
129+
- **AND** preserve the YAML frontmatter with `name`, `id`, `category`, and `description` fields
130+
- **AND** update only the OpenSpec-managed block between markers
131+
- **AND** ensure templates include instructions for the relevant workflow stage
132+
126133
#### Scenario: Missing slash command file
127134
- **WHEN** a tool lacks a slash command file
128135
- **THEN** do not create a new file during update

src/core/config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ export interface AIToolOption {
1717
}
1818

1919
export const AI_TOOLS: AIToolOption[] = [
20+
{ name: 'Amazon Q Developer', value: 'amazon-q', available: true, successLabel: 'Amazon Q Developer' },
21+
{ name: 'Antigravity', value: 'antigravity', available: true, successLabel: 'Antigravity' },
2022
{ name: 'Auggie (Augment CLI)', value: 'auggie', available: true, successLabel: 'Auggie' },
2123
{ name: 'Claude Code', value: 'claude', available: true, successLabel: 'Claude Code' },
2224
{ name: 'Cline', value: 'cline', available: true, successLabel: 'Cline' },
23-
{ name: 'RooCode', value: 'roocode', available: true, successLabel: 'RooCode' },
25+
{ name: 'Codex', value: 'codex', available: true, successLabel: 'Codex' },
2426
{ name: 'CodeBuddy Code (CLI)', value: 'codebuddy', available: true, successLabel: 'CodeBuddy Code' },
2527
{ name: 'CoStrict', value: 'costrict', available: true, successLabel: 'CoStrict' },
2628
{ name: 'Crush', value: 'crush', available: true, successLabel: 'Crush' },
2729
{ name: 'Cursor', value: 'cursor', available: true, successLabel: 'Cursor' },
2830
{ name: 'Factory Droid', value: 'factory', available: true, successLabel: 'Factory Droid' },
2931
{ name: 'Gemini CLI', value: 'gemini', available: true, successLabel: 'Gemini CLI' },
32+
{ name: 'GitHub Copilot', value: 'github-copilot', available: true, successLabel: 'GitHub Copilot' },
3033
{ name: 'iFlow', value: 'iflow', available: true, successLabel: 'iFlow' },
31-
{ name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode' },
3234
{ name: 'Kilo Code', value: 'kilocode', available: true, successLabel: 'Kilo Code' },
35+
{ name: 'OpenCode', value: 'opencode', available: true, successLabel: 'OpenCode' },
3336
{ name: 'Qoder (CLI)', value: 'qoder', available: true, successLabel: 'Qoder' },
34-
{ name: 'Antigravity', value: 'antigravity', available: true, successLabel: 'Antigravity' },
35-
{ name: 'Windsurf', value: 'windsurf', available: true, successLabel: 'Windsurf' },
36-
{ name: 'Codex', value: 'codex', available: true, successLabel: 'Codex' },
37-
{ name: 'GitHub Copilot', value: 'github-copilot', available: true, successLabel: 'GitHub Copilot' },
38-
{ name: 'Amazon Q Developer', value: 'amazon-q', available: true, successLabel: 'Amazon Q Developer' },
3937
{ name: 'Qwen Code', value: 'qwen', available: true, successLabel: 'Qwen Code' },
38+
{ name: 'RooCode', value: 'roocode', available: true, successLabel: 'RooCode' },
39+
{ name: 'Windsurf', value: 'windsurf', available: true, successLabel: 'Windsurf' },
4040
{ name: 'AGENTS.md (works with Amp, VS Code, …)', value: 'agents', available: false, successLabel: 'your AGENTS.md-compatible assistant' }
4141
];

src/core/init.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,22 @@ export class InitCommand {
862862
)
863863
);
864864

865+
// Show restart instruction if any tools were configured
866+
if (created.length > 0 || refreshed.length > 0) {
867+
console.log();
868+
console.log(PALETTE.white('Important: Restart your IDE'));
869+
console.log(
870+
PALETTE.midGray(
871+
'Slash commands are loaded at startup. Please restart your coding assistant'
872+
)
873+
);
874+
console.log(
875+
PALETTE.midGray(
876+
'to ensure the new /openspec commands appear in your command palette.'
877+
)
878+
);
879+
}
880+
865881
// Get the selected tool name(s) for display
866882
const toolName = this.formatToolNames(selectedTools);
867883

0 commit comments

Comments
 (0)