Skip to content

Commit 5ff0c92

Browse files
committed
proposal: rename SlashCommandConfigurator to WorkflowConfigurator
Fix semantic mismatch with diverse tool terminology (skills, prompts, commands). Old names kept as deprecated aliases for compatibility. Amp-Thread-ID: https://ampcode.com/threads/T-019b6a90-6107-755b-8087-942d9b5460ac
1 parent 3b6b2f2 commit 5ff0c92

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
## Why
2+
3+
The base class `SlashCommandConfigurator` has a semantic mismatch with the actual tool ecosystem. Different AI tools use different terminology for their integration files:
4+
- Claude/Cursor/Windsurf: "slash commands" or "workflows"
5+
- Amp: "skills" (`.agents/skills/`)
6+
- Codex/GitHub Copilot: "prompts"
7+
- Gemini: "commands" (TOML format)
8+
9+
The current naming misleadingly implies these configurators only handle slash commands, when they actually configure "OpenSpec workflow operations" (proposal/apply/archive) across diverse tool formats.
10+
11+
## What Changes
12+
13+
- Rename `SlashCommandConfigurator``WorkflowConfigurator` in `src/core/configurators/slash/base.ts`
14+
- Rename `SlashCommandRegistry``WorkflowRegistry` in `src/core/configurators/slash/registry.ts`
15+
- Rename `SlashCommandTarget``WorkflowTarget` interface
16+
- Rename `SlashCommandId``WorkflowId` type in templates
17+
- Rename directory `src/core/configurators/slash/``src/core/configurators/workflow/`
18+
- Export old names as type aliases for backward compatibility
19+
- Update all configurator subclasses and consumers to use new names
20+
- Remove explanatory documentation workarounds added during Amp implementation
21+
22+
## Impact
23+
24+
- Affected specs: `cli-init`, `cli-update` (terminology in scenarios)
25+
- Affected code: All files in `src/core/configurators/slash/`, template exports, init/update command implementations
26+
- Breaking changes: None if aliases are maintained; internal refactor only
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
## MODIFIED Requirements
2+
3+
### Requirement: Slash Command Configuration
4+
5+
The init command SHALL generate workflow configuration files for supported editors using shared templates.
6+
7+
#### Scenario: Generating workflow files for Claude Code
8+
9+
- **WHEN** the user selects Claude Code during initialization
10+
- **THEN** create `.claude/commands/openspec/proposal.md`, `.claude/commands/openspec/apply.md`, and `.claude/commands/openspec/archive.md`
11+
- **AND** populate each file from shared templates so command text matches other tools
12+
- **AND** each template includes instructions for the relevant OpenSpec workflow stage
13+
14+
#### Scenario: Generating workflow files for Amp
15+
16+
- **WHEN** the user selects Amp during initialization
17+
- **THEN** create `.agents/skills/openspec-proposal/SKILL.md`, `.agents/skills/openspec-apply/SKILL.md`, and `.agents/skills/openspec-archive/SKILL.md`
18+
- **AND** populate each file with YAML frontmatter containing `name` and `description` fields
19+
- **AND** wrap the body in OpenSpec markers so `openspec update` can refresh the content
20+
- **AND** each template includes instructions for the relevant OpenSpec workflow stage
21+
22+
#### Scenario: Generating workflow files for Codex
23+
24+
- **WHEN** the user selects Codex during initialization
25+
- **THEN** create global prompt files at `~/.codex/prompts/openspec-proposal.md`, `~/.codex/prompts/openspec-apply.md`, and `~/.codex/prompts/openspec-archive.md` (or under `$CODEX_HOME/prompts` if set)
26+
- **AND** populate each file from shared templates that map the first numbered placeholder (`$1`) to the primary user input (e.g., change identifier or question text)
27+
- **AND** wrap the generated content in OpenSpec markers so `openspec update` can refresh the prompts without touching surrounding custom notes
28+
29+
#### Scenario: Generating workflow files for GitHub Copilot
30+
31+
- **WHEN** the user selects GitHub Copilot during initialization
32+
- **THEN** create `.github/prompts/openspec-proposal.prompt.md`, `.github/prompts/openspec-apply.prompt.md`, and `.github/prompts/openspec-archive.prompt.md`
33+
- **AND** populate each file with YAML frontmatter containing a `description` field that summarizes the workflow stage
34+
- **AND** include `$ARGUMENTS` placeholder to capture user input
35+
- **AND** wrap the shared template body with OpenSpec markers so `openspec update` can refresh the content
36+
- **AND** each template includes instructions for the relevant OpenSpec workflow stage
37+
38+
#### Scenario: Generating workflow files for Gemini CLI
39+
40+
- **WHEN** the user selects Gemini CLI during initialization
41+
- **THEN** create `.gemini/commands/openspec/proposal.toml`, `.gemini/commands/openspec/apply.toml`, and `.gemini/commands/openspec/archive.toml`
42+
- **AND** populate each file as TOML that sets a stage-specific `description = "<summary>"` and a multi-line `prompt = """` block with the shared OpenSpec template
43+
- **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
44+
- **AND** ensure the workflow copy matches the existing proposal/apply/archive templates used by other tools
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## 1. Core renaming
2+
3+
- [ ] 1.1 Rename `SlashCommandConfigurator``WorkflowConfigurator` in `src/core/configurators/slash/base.ts`
4+
- [ ] 1.2 Rename `SlashCommandTarget``WorkflowTarget` interface in `base.ts`
5+
- [ ] 1.3 Rename `SlashCommandRegistry``WorkflowRegistry` in `registry.ts`
6+
- [ ] 1.4 Rename `SlashCommandId``WorkflowId` in `src/core/templates/slash-command-templates.ts`
7+
- [ ] 1.5 Rename directory `src/core/configurators/slash/``src/core/configurators/workflow/`
8+
9+
## 2. Compatibility aliases
10+
11+
- [ ] 2.1 Export `SlashCommandConfigurator` as alias for `WorkflowConfigurator`
12+
- [ ] 2.2 Export `SlashCommandTarget` as alias for `WorkflowTarget`
13+
- [ ] 2.3 Export `SlashCommandRegistry` as alias for `WorkflowRegistry`
14+
- [ ] 2.4 Export `SlashCommandId` as alias for `WorkflowId`
15+
- [ ] 2.5 Add deprecation JSDoc comments to all aliases
16+
17+
## 3. Update consumers
18+
19+
- [ ] 3.1 Update all configurator subclasses to extend `WorkflowConfigurator`
20+
- [ ] 3.2 Update init command to use `WorkflowRegistry`
21+
- [ ] 3.3 Update update command to use `WorkflowRegistry`
22+
- [ ] 3.4 Update template exports in `src/core/templates/index.ts`
23+
- [ ] 3.5 Remove workaround documentation from `amp.ts` explaining the naming mismatch
24+
25+
## 4. Tests and validation
26+
27+
- [ ] 4.1 Update existing unit tests to use new names
28+
- [ ] 4.2 Verify backward compatibility by testing alias imports
29+
- [ ] 4.3 Run full test suite to ensure no regressions
30+
- [ ] 4.4 Run typecheck and lint

0 commit comments

Comments
 (0)