Conversation
- Update all 24 command adapter file paths from opsx to openspec - Update adapter name fields (continue, cursor, iflow) from opsx- to openspec- - Update CommandTemplate display names from OPSX: to OpenSpec: in 11 workflow files - Update /opsx:* instruction references to /openspec:* in workflow templates - Update transformToHyphenCommands utility for opencode (/openspec: -> /openspec-) - Update init.ts, update.ts, migration.ts, welcome-screen.ts console messages - Update README.md and docs/opsx.md command references - Update legacy-cleanup patterns to detect old opsx-* files instead of openspec-* - Update all test files to match new paths and naming conventions Agent-Logs-Url: https://github.com/chenxizhang/OpenSpec/sessions/2f6b7d67-5478-414d-998b-0766bc8dce3f Co-authored-by: chenxizhang <1996954+chenxizhang@users.noreply.github.com>
…ands Agent-Logs-Url: https://github.com/chenxizhang/OpenSpec/sessions/2f6b7d67-5478-414d-998b-0766bc8dce3f Co-authored-by: chenxizhang <1996954+chenxizhang@users.noreply.github.com>
…consistency Complete migration from /opsx:* to /openspec:* command prefix
|
Task completed. I'll review this PR by examining the changes. Let me start by fetching the PR details and diff. Powered by 1Code |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 WalkthroughWalkthroughThis PR systematically renames the slash command namespace across the entire codebase from Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/commands.md (1)
631-645:⚠️ Potential issue | 🟡 MinorInconsistent terminology: "OPSX" references remain in Legacy Commands section.
The commands have been renamed from
/opsx:*to/openspec:*, but lines 631 and 644 still reference "OPSX commands" and "Migrating to OPSX". These should be updated for consistency.Suggested fix
-These commands use the older "all-at-once" workflow. They still work but OPSX commands are recommended. +These commands use the older "all-at-once" workflow. They still work but the newer OpenSpec commands are recommended.-**Migrating to OPSX:** -Legacy changes can be continued with OPSX commands. The artifact structure is compatible. +**Migrating to OpenSpec commands:** +Legacy changes can be continued with the newer OpenSpec commands. The artifact structure is compatible.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@docs/commands.md` around lines 631 - 645, Update the inconsistent terminology: replace references to "OPSX" and the phrase "Migrating to OPSX" with the correct new name "openspec" (e.g., "openspec commands" or "Migrating to openspec") so the Legacy Commands paragraph and the migration note match the renamed command prefix (/openspec:*); search for the literal tokens "OPSX" and "Migrating to OPSX" in the shown block and swap them to "openspec" or "Migrating to openspec" as appropriate.
🧹 Nitpick comments (3)
src/core/templates/workflows/archive-change.ts (1)
122-124: Consider renaming the exported function for consistency.Line 122 still uses
getOpsxArchiveCommandTemplate, which now conflicts with the renamed namespace and can cause confusion during maintenance.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/templates/workflows/archive-change.ts` around lines 122 - 124, The exported function getOpsxArchiveCommandTemplate should be renamed for consistency with the new namespace (e.g., rename getOpsxArchiveCommandTemplate to getOpenSpecArchiveCommandTemplate or getOpenSpecArchiveCommandTemplate) and all references updated; change the function declaration and its export symbol in src/core/templates/workflows/archive-change.ts, then update any imports/usages across the codebase to use the new name (search for getOpsxArchiveCommandTemplate and replace with the chosen new symbol).src/core/templates/workflows/bulk-archive-change.ts (1)
254-257: Consider renaming the exported helper to remove legacyOpsxnaming.The template title is now
OpenSpec, butgetOpsxBulkArchiveCommandTemplatestill carries the old namespace. Renaming this symbol would make internal naming consistent and reduce confusion during future cleanup.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/templates/workflows/bulk-archive-change.ts` around lines 254 - 257, Rename the exported helper function getOpsxBulkArchiveCommandTemplate to match the new OpenSpec naming (e.g., getOpenSpecBulkArchiveCommandTemplate) and update all internal references/imports/exports to use the new symbol; ensure the exported CommandTemplate object returned (name: 'OpenSpec: Bulk Archive') stays unchanged and run tests/TS build to catch any missed usages of getOpsxBulkArchiveCommandTemplate.src/core/templates/workflows/apply-change.ts (1)
164-166: Consider renaming internal function for consistency.The function
getOpsxApplyCommandTemplatestill uses the old "Opsx" prefix while returning user-facing content with "OpenSpec" naming. This is an internal API, so it doesn't affect users, but renaming togetOpenSpecApplyCommandTemplatewould align with the PR's naming convention.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/core/templates/workflows/apply-change.ts` around lines 164 - 166, Rename the internal function getOpsxApplyCommandTemplate to getOpenSpecApplyCommandTemplate for naming consistency: update the function declaration/export and every reference/import of getOpsxApplyCommandTemplate across the codebase (including any tests or callers), ensuring the returned CommandTemplate and its contents remain unchanged and TypeScript types/exports are updated accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@docs/migration-guide.md`:
- Around line 319-321: The fenced command snippets containing the literal lines
"/openspec:continue" and "/openspec:explore" use bare ``` fences and should
include a language/info tag to satisfy markdownlint MD040; update the fences
around the blocks that wrap the "/openspec:continue" and "/openspec:explore"
snippets (e.g., the fences shown in the diff) to use ```text instead of ``` so
the blocks become ```text ... ``` and avoid the lint warning.
In `@docs/opsx.md`:
- Around line 175-177: The markdown uses bare triple backticks for short command
examples (e.g. the blocks containing "/openspec:explore", "/openspec:propose",
"/openspec:continue", "/openspec:ff add-dark-mode", "/openspec:apply", and
"/openspec:archive"), which triggers MD040; update each of those fenced code
blocks to include a language tag such as "text" (i.e., replace ``` with ```text)
for all occurrences noted (around the command lines and the other ranges:
182-184, 195-197, 200-202, 207-209, 213-214) so the examples are properly
fenced.
In `@docs/supported-tools.md`:
- Around line 27-43: The table entries for Claude Code, CodeBuddy, Crush, Gemini
CLI, and Qoder use the wrong command path segment "opsx"; update the right-hand
column for the rows with symbols "Claude Code (`claude`)", "CodeBuddy
(`codebuddy`)", "Crush (`crush`)", "Gemini CLI (`gemini`)", and "Qoder
(`qoder`)" to use "openspec" instead of "opsx" (i.e., replace
`.claude/commands/opsx/<id>.md` → `.claude/commands/openspec/<id>.md`,
`.codebuddy/commands/opsx/<id>.md` → `.codebuddy/commands/openspec/<id>.md`,
`.crush/commands/opsx/<id>.md` → `.crush/commands/openspec/<id>.md`,
`.gemini/commands/opsx/<id>.toml` → `.gemini/commands/openspec/<id>.toml`, and
`.qoder/commands/opsx/<id>.md` → `.qoder/commands/openspec/<id>.md`).
In `@src/core/command-generation/adapters/codebuddy.ts`:
- Line 19: The legacy cleanup patterns are missing CodeBuddy's command dirs, so
add entries for CodeBuddy (at minimum ".codebuddy/commands/opsx") to the list in
src/core/legacy-cleanup.ts (e.g., the array or constant that contains cleanup
patterns such as LEGACY_DIRS or LEGACY_CLEANUP_PATTERNS); also consider adding
".codebuddy/commands/openspec" to cover the new path produced by the return in
the codebuddy adapter (the line returning
path.join('.codebuddy','commands','openspec',`${commandId}.md`)), ensuring stale
slash-command files are removed during cleanup.
In `@src/core/command-generation/adapters/factory.ts`:
- Line 19: The factory filename pattern changed to generate
.factory/commands/openspec-*.md, so update the cleanup rules in
legacy-cleanup.ts (the cleanup patterns map/constant for "factory") to also
match openspec-*.md (either add a second glob for
.factory/commands/openspec-*.md or change the existing opsx-*.md glob/regex to
include both opsx and openspec, e.g., opsx-*.md|openspec-*.md or use a combined
pattern like {opsx,openspec}-*.md) so newly generated openspec artifacts are
removed by the legacy cleanup.
In `@src/core/command-generation/adapters/opencode.ts`:
- Line 20: The generator path in
src/core/command-generation/adapters/opencode.ts uses
'.opencode/commands/openspec-<id>.md' but legacy-cleanup expects
'.opencode/command/...', causing orphaned files; update the path segment in the
return expression (the path.join call that currently uses 'commands') to use the
singular 'command' so the generated files match legacy-cleanup and existing
tests, or alternatively change legacy-cleanup and tests to the plural — pick one
canonical form and make the corresponding change in opencode.ts (or
legacy-cleanup.ts/tests) so both generator (the path.join in opencode.ts) and
cleanup use the exact same directory name.
---
Outside diff comments:
In `@docs/commands.md`:
- Around line 631-645: Update the inconsistent terminology: replace references
to "OPSX" and the phrase "Migrating to OPSX" with the correct new name
"openspec" (e.g., "openspec commands" or "Migrating to openspec") so the Legacy
Commands paragraph and the migration note match the renamed command prefix
(/openspec:*); search for the literal tokens "OPSX" and "Migrating to OPSX" in
the shown block and swap them to "openspec" or "Migrating to openspec" as
appropriate.
---
Nitpick comments:
In `@src/core/templates/workflows/apply-change.ts`:
- Around line 164-166: Rename the internal function getOpsxApplyCommandTemplate
to getOpenSpecApplyCommandTemplate for naming consistency: update the function
declaration/export and every reference/import of getOpsxApplyCommandTemplate
across the codebase (including any tests or callers), ensuring the returned
CommandTemplate and its contents remain unchanged and TypeScript types/exports
are updated accordingly.
In `@src/core/templates/workflows/archive-change.ts`:
- Around line 122-124: The exported function getOpsxArchiveCommandTemplate
should be renamed for consistency with the new namespace (e.g., rename
getOpsxArchiveCommandTemplate to getOpenSpecArchiveCommandTemplate or
getOpenSpecArchiveCommandTemplate) and all references updated; change the
function declaration and its export symbol in
src/core/templates/workflows/archive-change.ts, then update any imports/usages
across the codebase to use the new name (search for
getOpsxArchiveCommandTemplate and replace with the chosen new symbol).
In `@src/core/templates/workflows/bulk-archive-change.ts`:
- Around line 254-257: Rename the exported helper function
getOpsxBulkArchiveCommandTemplate to match the new OpenSpec naming (e.g.,
getOpenSpecBulkArchiveCommandTemplate) and update all internal
references/imports/exports to use the new symbol; ensure the exported
CommandTemplate object returned (name: 'OpenSpec: Bulk Archive') stays unchanged
and run tests/TS build to catch any missed usages of
getOpsxBulkArchiveCommandTemplate.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 08281812-3933-4fe6-a383-9cda6f3b0c1b
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (62)
README.mddocs/cli.mddocs/commands.mddocs/concepts.mddocs/getting-started.mddocs/migration-guide.mddocs/opsx.mddocs/supported-tools.mddocs/workflows.mdsrc/core/command-generation/adapters/amazon-q.tssrc/core/command-generation/adapters/antigravity.tssrc/core/command-generation/adapters/auggie.tssrc/core/command-generation/adapters/claude.tssrc/core/command-generation/adapters/cline.tssrc/core/command-generation/adapters/codebuddy.tssrc/core/command-generation/adapters/codex.tssrc/core/command-generation/adapters/continue.tssrc/core/command-generation/adapters/costrict.tssrc/core/command-generation/adapters/crush.tssrc/core/command-generation/adapters/cursor.tssrc/core/command-generation/adapters/factory.tssrc/core/command-generation/adapters/gemini.tssrc/core/command-generation/adapters/github-copilot.tssrc/core/command-generation/adapters/iflow.tssrc/core/command-generation/adapters/kilocode.tssrc/core/command-generation/adapters/kiro.tssrc/core/command-generation/adapters/opencode.tssrc/core/command-generation/adapters/pi.tssrc/core/command-generation/adapters/qoder.tssrc/core/command-generation/adapters/qwen.tssrc/core/command-generation/adapters/roocode.tssrc/core/command-generation/adapters/windsurf.tssrc/core/command-generation/types.tssrc/core/init.tssrc/core/legacy-cleanup.tssrc/core/migration.tssrc/core/templates/workflows/apply-change.tssrc/core/templates/workflows/archive-change.tssrc/core/templates/workflows/bulk-archive-change.tssrc/core/templates/workflows/continue-change.tssrc/core/templates/workflows/explore.tssrc/core/templates/workflows/ff-change.tssrc/core/templates/workflows/new-change.tssrc/core/templates/workflows/onboard.tssrc/core/templates/workflows/propose.tssrc/core/templates/workflows/sync-specs.tssrc/core/templates/workflows/verify-change.tssrc/core/update.tssrc/ui/welcome-screen.tssrc/utils/command-references.tstest/commands/artifact-workflow.test.tstest/commands/config-profile.test.tstest/core/command-generation/adapters.test.tstest/core/command-generation/generator.test.tstest/core/command-generation/types.test.tstest/core/init.test.tstest/core/legacy-cleanup.test.tstest/core/migration.test.tstest/core/shared/skill-generation.test.tstest/core/templates/skill-templates-parity.test.tstest/core/update.test.tstest/utils/command-references.test.ts
| ``` | ||
| /opsx:continue | ||
| /openspec:continue | ||
| ``` |
There was a problem hiding this comment.
Add language tags on these fenced command snippets.
These touched blocks use bare fences and can trigger markdown lint (MD040).
Suggested markdownlint fix
-```
+```text
/openspec:continue@@
- +text
/openspec:explore
Also applies to: 325-327
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/migration-guide.md` around lines 319 - 321, The fenced command snippets
containing the literal lines "/openspec:continue" and "/openspec:explore" use
bare ``` fences and should include a language/info tag to satisfy markdownlint
MD040; update the fences around the blocks that wrap the "/openspec:continue"
and "/openspec:explore" snippets (e.g., the fences shown in the diff) to use
```text instead of ``` so the blocks become ```text ... ``` and avoid the lint
warning.
| ``` | ||
| /opsx:explore | ||
| /openspec:explore | ||
| ``` |
There was a problem hiding this comment.
Add fence language tags for short command examples.
Several changed command blocks still use bare triple backticks, which triggers markdown lint (MD040).
Suggested markdownlint fix
-```
+```text
/openspec:explore@@
- +text
/openspec:propose
@@
-```
+```text
/openspec:continue
@@
- +text
/openspec:ff add-dark-mode
@@
-```
+```text
/openspec:apply
@@
- +text
/openspec:archive # Move to archive when done (prompts to sync specs if needed)
Also applies to: 182-184, 195-197, 200-202, 207-209, 213-214
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/opsx.md` around lines 175 - 177, The markdown uses bare triple backticks
for short command examples (e.g. the blocks containing "/openspec:explore",
"/openspec:propose", "/openspec:continue", "/openspec:ff add-dark-mode",
"/openspec:apply", and "/openspec:archive"), which triggers MD040; update each
of those fenced code blocks to include a language tag such as "text" (i.e.,
replace ``` with ```text) for all occurrences noted (around the command lines
and the other ranges: 182-184, 195-197, 200-202, 207-209, 213-214) so the
examples are properly fenced.
| | Claude Code (`claude`) | `.claude/skills/openspec-*/SKILL.md` | `.claude/commands/opsx/<id>.md` | | ||
| | Cline (`cline`) | `.cline/skills/openspec-*/SKILL.md` | `.clinerules/workflows/opsx-<id>.md` | | ||
| | Cline (`cline`) | `.cline/skills/openspec-*/SKILL.md` | `.clinerules/workflows/openspec-<id>.md` | | ||
| | CodeBuddy (`codebuddy`) | `.codebuddy/skills/openspec-*/SKILL.md` | `.codebuddy/commands/opsx/<id>.md` | | ||
| | Codex (`codex`) | `.codex/skills/openspec-*/SKILL.md` | `$CODEX_HOME/prompts/opsx-<id>.md`\* | | ||
| | Continue (`continue`) | `.continue/skills/openspec-*/SKILL.md` | `.continue/prompts/opsx-<id>.prompt` | | ||
| | CoStrict (`costrict`) | `.cospec/skills/openspec-*/SKILL.md` | `.cospec/openspec/commands/opsx-<id>.md` | | ||
| | Codex (`codex`) | `.codex/skills/openspec-*/SKILL.md` | `$CODEX_HOME/prompts/openspec-<id>.md`\* | | ||
| | Continue (`continue`) | `.continue/skills/openspec-*/SKILL.md` | `.continue/prompts/openspec-<id>.prompt` | | ||
| | CoStrict (`costrict`) | `.cospec/skills/openspec-*/SKILL.md` | `.cospec/openspec/commands/openspec-<id>.md` | | ||
| | Crush (`crush`) | `.crush/skills/openspec-*/SKILL.md` | `.crush/commands/opsx/<id>.md` | | ||
| | Cursor (`cursor`) | `.cursor/skills/openspec-*/SKILL.md` | `.cursor/commands/opsx-<id>.md` | | ||
| | Factory Droid (`factory`) | `.factory/skills/openspec-*/SKILL.md` | `.factory/commands/opsx-<id>.md` | | ||
| | Cursor (`cursor`) | `.cursor/skills/openspec-*/SKILL.md` | `.cursor/commands/openspec-<id>.md` | | ||
| | Factory Droid (`factory`) | `.factory/skills/openspec-*/SKILL.md` | `.factory/commands/openspec-<id>.md` | | ||
| | Gemini CLI (`gemini`) | `.gemini/skills/openspec-*/SKILL.md` | `.gemini/commands/opsx/<id>.toml` | | ||
| | GitHub Copilot (`github-copilot`) | `.github/skills/openspec-*/SKILL.md` | `.github/prompts/opsx-<id>.prompt.md`\*\* | | ||
| | iFlow (`iflow`) | `.iflow/skills/openspec-*/SKILL.md` | `.iflow/commands/opsx-<id>.md` | | ||
| | Kilo Code (`kilocode`) | `.kilocode/skills/openspec-*/SKILL.md` | `.kilocode/workflows/opsx-<id>.md` | | ||
| | Kiro (`kiro`) | `.kiro/skills/openspec-*/SKILL.md` | `.kiro/prompts/opsx-<id>.prompt.md` | | ||
| | OpenCode (`opencode`) | `.opencode/skills/openspec-*/SKILL.md` | `.opencode/commands/opsx-<id>.md` | | ||
| | Pi (`pi`) | `.pi/skills/openspec-*/SKILL.md` | `.pi/prompts/opsx-<id>.md` | | ||
| | GitHub Copilot (`github-copilot`) | `.github/skills/openspec-*/SKILL.md` | `.github/prompts/openspec-<id>.prompt.md`\*\* | | ||
| | iFlow (`iflow`) | `.iflow/skills/openspec-*/SKILL.md` | `.iflow/commands/openspec-<id>.md` | | ||
| | Kilo Code (`kilocode`) | `.kilocode/skills/openspec-*/SKILL.md` | `.kilocode/workflows/openspec-<id>.md` | | ||
| | Kiro (`kiro`) | `.kiro/skills/openspec-*/SKILL.md` | `.kiro/prompts/openspec-<id>.prompt.md` | | ||
| | OpenCode (`opencode`) | `.opencode/skills/openspec-*/SKILL.md` | `.opencode/commands/openspec-<id>.md` | | ||
| | Pi (`pi`) | `.pi/skills/openspec-*/SKILL.md` | `.pi/prompts/openspec-<id>.md` | | ||
| | Qoder (`qoder`) | `.qoder/skills/openspec-*/SKILL.md` | `.qoder/commands/opsx/<id>.md` | |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Verify the actual command path patterns in adapter implementations
# Check Claude adapter path
rg -n "commands.*opsx|commands.*openspec" --type=ts src/core/command-generation/adapters/
# Check all adapter getFilePath implementations
ast-grep --pattern $'getFilePath($_) {
$$$
}'Repository: Fission-AI/OpenSpec
Length of output: 2985
Update command paths for Claude Code, CodeBuddy, Crush, Gemini CLI, and Qoder to match actual implementation.
The documented command paths for these five tools use opsx/ but the actual adapter implementations use nested openspec/ directories:
- Claude Code: Change
.claude/commands/opsx/<id>.md→.claude/commands/openspec/<id>.md - CodeBuddy: Change
.codebuddy/commands/opsx/<id>.md→.codebuddy/commands/openspec/<id>.md - Crush: Change
.crush/commands/opsx/<id>.md→.crush/commands/openspec/<id>.md - Gemini CLI: Change
.gemini/commands/opsx/<id>.toml→.gemini/commands/openspec/<id>.toml - Qoder: Change
.qoder/commands/opsx/<id>.md→.qoder/commands/openspec/<id>.md
🧰 Tools
🪛 LanguageTool
[uncategorized] ~37-~37: The official name of this software platform is spelled with a capital “H”.
Context: ...| | GitHub Copilot (github-copilot) | .github/skills/openspec-*/SKILL.md | `.github/...
(GITHUB)
[uncategorized] ~37-~37: The official name of this software platform is spelled with a capital “H”.
Context: ... .github/skills/openspec-*/SKILL.md | .github/prompts/openspec-<id>.prompt.md** | ...
(GITHUB)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@docs/supported-tools.md` around lines 27 - 43, The table entries for Claude
Code, CodeBuddy, Crush, Gemini CLI, and Qoder use the wrong command path segment
"opsx"; update the right-hand column for the rows with symbols "Claude Code
(`claude`)", "CodeBuddy (`codebuddy`)", "Crush (`crush`)", "Gemini CLI
(`gemini`)", and "Qoder (`qoder`)" to use "openspec" instead of "opsx" (i.e.,
replace `.claude/commands/opsx/<id>.md` → `.claude/commands/openspec/<id>.md`,
`.codebuddy/commands/opsx/<id>.md` → `.codebuddy/commands/openspec/<id>.md`,
`.crush/commands/opsx/<id>.md` → `.crush/commands/openspec/<id>.md`,
`.gemini/commands/opsx/<id>.toml` → `.gemini/commands/openspec/<id>.toml`, and
`.qoder/commands/opsx/<id>.md` → `.qoder/commands/openspec/<id>.md`).
|
|
||
| getFilePath(commandId: string): string { | ||
| return path.join('.codebuddy', 'commands', 'opsx', `${commandId}.md`); | ||
| return path.join('.codebuddy', 'commands', 'openspec', `${commandId}.md`); |
There was a problem hiding this comment.
Add CodeBuddy to legacy opsx cleanup patterns to prevent stale command files.
Line 19 now writes to .codebuddy/commands/openspec/..., but src/core/legacy-cleanup.ts currently lists old opsx directories for other tools and appears to omit .codebuddy/commands/opsx. That can leave stale slash-command files after migration.
Suggested follow-up patch in src/core/legacy-cleanup.ts
// Directory-based: .tooldir/commands/opsx/ or .tooldir/commands/opsx/*.md
'claude': { type: 'directory', path: '.claude/commands/opsx' },
+ 'codebuddy': { type: 'directory', path: '.codebuddy/commands/opsx' },
'n': { type: 'directory', path: '.n/commands/opsx' },
'qoder': { type: 'directory', path: '.qoder/commands/opsx' },
'crush': { type: 'directory', path: '.crush/commands/opsx' },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/core/command-generation/adapters/codebuddy.ts` at line 19, The legacy
cleanup patterns are missing CodeBuddy's command dirs, so add entries for
CodeBuddy (at minimum ".codebuddy/commands/opsx") to the list in
src/core/legacy-cleanup.ts (e.g., the array or constant that contains cleanup
patterns such as LEGACY_DIRS or LEGACY_CLEANUP_PATTERNS); also consider adding
".codebuddy/commands/openspec" to cover the new path produced by the return in
the codebuddy adapter (the line returning
path.join('.codebuddy','commands','openspec',`${commandId}.md`)), ensuring stale
slash-command files are removed during cleanup.
|
|
||
| getFilePath(commandId: string): string { | ||
| return path.join('.factory', 'commands', `opsx-${commandId}.md`); | ||
| return path.join('.factory', 'commands', `openspec-${commandId}.md`); |
There was a problem hiding this comment.
Update legacy cleanup patterns for new Factory filenames.
Line 19 now generates .factory/commands/openspec-*.md, but src/core/legacy-cleanup.ts still matches only .factory/commands/opsx-*.md for factory. This leaves newly generated openspec-* artifacts outside cleanup coverage.
Suggested fix
- 'factory': { type: 'files', pattern: '.factory/commands/opsx-*.md' },
+ 'factory': { type: 'files', pattern: ['.factory/commands/opsx-*.md', '.factory/commands/openspec-*.md'] },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/core/command-generation/adapters/factory.ts` at line 19, The factory
filename pattern changed to generate .factory/commands/openspec-*.md, so update
the cleanup rules in legacy-cleanup.ts (the cleanup patterns map/constant for
"factory") to also match openspec-*.md (either add a second glob for
.factory/commands/openspec-*.md or change the existing opsx-*.md glob/regex to
include both opsx and openspec, e.g., opsx-*.md|openspec-*.md or use a combined
pattern like {opsx,openspec}-*.md) so newly generated openspec artifacts are
removed by the legacy cleanup.
|
|
||
| getFilePath(commandId: string): string { | ||
| return path.join('.opencode', 'commands', `opsx-${commandId}.md`); | ||
| return path.join('.opencode', 'commands', `openspec-${commandId}.md`); |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== OpenCode path usage in source and tests =="
rg -n --type=ts --type=md '\.opencode/(command|commands)/|openspec-.*\.md|opsx-.*\.md|toolId:\s*["'\'']opencode["'\'']' src test
echo
echo "== Legacy cleanup patterns for opencode =="
rg -n "opencode|\\.opencode/" src/core/legacy-cleanup.ts test/core/legacy-cleanup.test.tsRepository: Fission-AI/OpenSpec
Length of output: 27888
Fix OpenCode path mismatch between generator and cleanup: commands vs command.
opencode.ts line 20 writes to .opencode/commands/openspec-<id>.md, but legacy-cleanup.ts line 52 searches .opencode/command/... (singular). This prevents cleanup from finding and deleting generated OpenCode artifacts, leaving stale files orphaned.
Choose one canonical path form across the adapter, cleanup patterns, and all tests:
- Either
.opencode/command/(to match current cleanup expectations and tests) - Or
.opencode/commands/(to match current generator)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/core/command-generation/adapters/opencode.ts` at line 20, The generator
path in src/core/command-generation/adapters/opencode.ts uses
'.opencode/commands/openspec-<id>.md' but legacy-cleanup expects
'.opencode/command/...', causing orphaned files; update the path segment in the
return expression (the path.join call that currently uses 'commands') to use the
singular 'command' so the generated files match legacy-cleanup and existing
tests, or alternatively change legacy-cleanup and tests to the plural — pick one
canonical form and make the corresponding change in opencode.ts (or
legacy-cleanup.ts/tests) so both generator (the path.join in opencode.ts) and
cleanup use the exact same directory name.
Summary by CodeRabbit
Release Notes
New Features
/openspec:prefix (e.g.,/openspec:propose,/openspec:apply,/openspec:archive,/openspec:new,/openspec:continue,/openspec:verify).openspec-prefix for generated artifacts across all supported tools.Documentation
/openspec:*command namespace.