-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add slash commands to artifact-experimental-setup #442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Extend the `openspec artifact-experimental-setup` command to also generate slash commands alongside Agent Skills. Changes: - Add CommandTemplate interface and template functions for /opsx:new, /opsx:continue, and /opsx:apply commands - Modify artifactExperimentalSetupCommand() to create slash command files at .claude/commands/opsx/ - Update success message to show both skills and slash commands created The setup command now creates: - 3 Agent Skills (.claude/skills/) - 3 Slash Commands (.claude/commands/opsx/)
📝 WalkthroughWalkthroughThe changes introduce slash command template generation for an experimental artifact workflow. A new Changes
Sequence DiagramsequenceDiagram
participant User
participant ArtifactWorkflow as artifact-workflow.ts
participant SkillTemplates as skill-templates.ts
participant FileSystem as File System
User->>ArtifactWorkflow: initiate setup
ArtifactWorkflow->>SkillTemplates: import template functions
ArtifactWorkflow->>SkillTemplates: getOpsxNewCommandTemplate()
SkillTemplates-->>ArtifactWorkflow: CommandTemplate (new)
ArtifactWorkflow->>SkillTemplates: getOpsxContinueCommandTemplate()
SkillTemplates-->>ArtifactWorkflow: CommandTemplate (continue)
ArtifactWorkflow->>SkillTemplates: getOpsxApplyCommandTemplate()
SkillTemplates-->>ArtifactWorkflow: CommandTemplate (apply)
rect rgb(230, 245, 250)
note right of ArtifactWorkflow: Generate and Write Files
ArtifactWorkflow->>FileSystem: write new.md (YAML + content)
ArtifactWorkflow->>FileSystem: write continue.md (YAML + content)
ArtifactWorkflow->>FileSystem: write apply.md (YAML + content)
ArtifactWorkflow->>FileSystem: write SKILL.md
end
ArtifactWorkflow->>User: report "Experimental Artifact Workflow Setup Complete"
ArtifactWorkflow->>User: list created Skills and Slash Commands
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
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 |
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/commands/artifact-workflow.ts (1)
743-751: Consider quoting YAML tag values for robustness.The tags are rendered without quotes:
[workflow, artifacts, experimental]. This works for simple alphanumeric strings, but would break YAML parsing if tags ever contained spaces or special characters (e.g.,'ci/cd').🔎 Proposed fix to quote tag values
- const commandContent = `--- -name: ${template.name} -description: ${template.description} -category: ${template.category} -tags: [${template.tags.join(', ')}] ---- + const commandContent = `--- +name: ${template.name} +description: ${template.description} +category: ${template.category} +tags: [${template.tags.map(t => `'${t}'`).join(', ')}] +---
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/commands/artifact-workflow.tssrc/core/templates/skill-templates.ts
🧰 Additional context used
🧬 Code graph analysis (1)
src/commands/artifact-workflow.ts (2)
src/core/templates/skill-templates.ts (3)
getOpsxNewCommandTemplate(338-394)getOpsxContinueCommandTemplate(399-496)getOpsxApplyCommandTemplate(501-642)src/utils/file-system.ts (1)
FileSystemUtils(44-209)
🔇 Additional comments (8)
src/commands/artifact-workflow.ts (3)
29-29: LGTM!Import statement correctly brings in the three new OPSX command template functions alongside the existing skill templates.
762-793: LGTM!Clear, well-structured success output with separate sections for skills and slash commands. The usage guidance accurately reflects both invocation methods.
685-757: Implementation is clean and idempotent.The setup correctly generates both skill files (in
.claude/skills/) and command files (in.claude/commands/opsx/).FileSystemUtils.writeFilehandles directory creation, and the sequential processing ensures reliable execution. Re-running the command will overwrite existing files, which aligns with the stated idempotency requirement.src/core/templates/skill-templates.ts (5)
322-333: LGTM!The
CommandTemplateinterface is well-designed with appropriate fields for slash command metadata. The distinction betweencontent(for commands) andinstructions(for skills inSkillTemplate) reflects the different output formats each requires.
338-394: LGTM!The
/opsx:newcommand template provides comprehensive instructions for starting a new change, with clear steps and appropriate guardrails to prevent premature artifact creation.
399-496: LGTM!The
/opsx:continuecommand template correctly handles the three possible states (complete, ready, blocked) and provides clear artifact creation guidelines. The instruction to create only ONE artifact per invocation is an important guardrail.
501-642: LGTM!The
/opsx:applycommand template provides thorough implementation guidance with well-defined pause conditions and output formats. The "Fluid Workflow Integration" section correctly documents the non-linear nature of the workflow.
322-326: Good separation of template types.The clear section header and separation between Skill templates (above) and Slash Command templates (lines 322+) improves maintainability. The AI-generated summary mentioned potential duplication, but the code shows a single, clean definition of
CommandTemplateand its associated functions.
Summary
openspec artifact-experimental-setupto also generate slash commands alongside Agent SkillsCommandTemplateinterface and template functions for/opsx:new,/opsx:continue, and/opsx:applyThe setup command now creates:
.claude/skills/).claude/commands/opsx/)Test plan
openspec artifact-experimental-setupand verify all 6 files are created🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.