| name | switch |
| description | Use when changing the active spec by name or path. |
| argument-hint | <spec-name-or-path> |
| allowed-tools | Read Write Bash Glob Agent |
| disable-model-invocation | true |
Switch Active Spec
You are switching the active specification.
Multi-Directory Resolution
This command uses the plugin runtime for multi-root spec discovery:
curdx-flow specs list
curdx-flow specs resolve [name-or-path]
curdx-flow specs find <name>
Parse Arguments
From $ARGUMENTS:
- input: The spec name OR full path to switch to (required for switching)
- If starts with
./ or /: treat as full path
- Otherwise: treat as spec name to search for
Validate
- If no input provided, list available specs and ask user to choose
- If input is a full path (starts with
./):
- Check if path exists as directory
- If not, error: "Spec path '$input' not found"
- If input is a spec name:
- Use
curdx-flow specs find "$input" to search all configured specs_dirs
- Exit code 0 (found unique): proceed with switch
- Exit code 1 (not found): error with list of searched directories
- Exit code 2 (ambiguous): show disambiguation prompt
List Available (if no argument)
If $ARGUMENTS is empty:
- Use
curdx-flow specs list to gather all specs from all roots
- Read
active from the same runtime output
- Group specs by their root directory with numbered options
- Show list with current marked and directory context
- If no specs found, guide user to create one
With specs found:
Available specs:
./specs (default):
1. feature-a [ACTIVE]
2. feature-b
./packages/api/specs:
3. api-auth
4. api-users
./packages/web/specs:
5. web-login
Examples:
/curdx-flow:switch feature-b
/curdx-flow:switch api-auth
/curdx-flow:switch ./packages/api/specs/api-auth (full path for disambiguation)
No specs found:
No specs found in configured directories.
Searched:
- ./specs (default)
- ./packages/api/specs
- ./packages/web/specs
To create a new spec:
/curdx-flow:new my-feature
/curdx-flow:new my-feature --specs-dir ./packages/api/specs
Handle Disambiguation
If spec name exists in multiple roots (exit code 2 from find):
Multiple specs named 'api-auth' found:
1. ./specs/api-auth
Location: default specs directory
Run: /curdx-flow:switch ./specs/api-auth
2. ./packages/api/specs/api-auth
Location: packages/api
Run: /curdx-flow:switch ./packages/api/specs/api-auth
Select by running the command for your desired spec.
Do NOT automatically select one. User must specify the full path with the exact command shown.
Handle Not Found
If spec name does not exist (exit code 1 from find):
No spec named 'my-feature' found.
Searched directories:
- ./specs (default)
- ./packages/api/specs
- ./packages/web/specs
To see available specs: /curdx-flow:switch
To create a new spec: /curdx-flow:new my-feature
List all configured specs_dirs that were searched, helping user understand where to create the spec.
Execute Switch
-
Determine the full path:
- If input was a full path: use as-is
- If input was a name with single match: use the resolved path
-
Update ./specs/.current-spec:
- For specs in default
./specs/ root: write bare name (backward compat)
- For specs in other roots: write full path
echo "my-feature" > ./specs/.current-spec
echo "./packages/api/specs/api-auth" > ./specs/.current-spec
-
Read the spec's state:
.curdx-state.json for phase and progress
.progress.md for context
Output
Switched to spec: $name
Location: $full_path
Current phase: <phase>
Progress: <taskIndex>/<totalTasks> tasks
Files present:
- [x/blank] research.md
- [x/blank] requirements.md
- [x/blank] design.md
- [x/blank] tasks.md
Next: Run /curdx-flow:<appropriate-phase> to continue