Skip to content

Conversation

@TabishB
Copy link
Contributor

@TabishB TabishB commented Jan 6, 2026

Summary

  • Extends openspec artifact-experimental-setup to also generate slash commands alongside Agent Skills
  • Adds CommandTemplate interface and template functions for /opsx:new, /opsx:continue, and /opsx:apply
  • Updates 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/)

Test plan

  • Build succeeds
  • Run openspec artifact-experimental-setup and verify all 6 files are created
  • Verify slash command files have correct format (YAML frontmatter + content)
  • Verify idempotent execution (running again works without errors)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added three new slash commands for the experimental artifact workflow (new, continue, apply)
    • Enhanced setup process to generate both skills and slash commands with improved reporting

✏️ Tip: You can customize this high-level summary in your review settings.

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/)
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 6, 2026

📝 Walkthrough

Walkthrough

The changes introduce slash command template generation for an experimental artifact workflow. A new CommandTemplate interface and three OPSX command template functions are defined, then integrated into the artifact-workflow setup to generate both Skill and Slash Command files with YAML frontmatter.

Changes

Cohort / File(s) Summary
Slash Command Template Definitions
src/core/templates/skill-templates.ts
Introduces CommandTemplate interface with name, description, category, tags, and content fields. Adds three exported functions—getOpsxNewCommandTemplate(), getOpsxContinueCommandTemplate(), getOpsxApplyCommandTemplate()—that return detailed multi-step instructional templates for OPSX commands. Note: Public API definitions appear duplicated within the same file.
Artifact Workflow Setup Integration
src/commands/artifact-workflow.ts
Extends artifact-experimental-setup flow to import OPSX command templates and generate three command files (new.md, continue.md, apply.md) in .claude/commands/opsx/ directory with YAML frontmatter. Updates user-facing messages and success reporting to consolidate both Skill and Slash Command creation under "Experimental Artifact Workflow Setup Complete" header.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

Poem

🐰 A rabbit hops through templates new,
Slash commands sprout in morning dew,
Skills and workflows intertwine,
With OPSX steps so clear and fine! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: add slash commands to artifact-experimental-setup' clearly and concisely describes the main change: adding slash command generation to the artifact-experimental-setup flow.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@vibe-kanban-cloud
Copy link

Review Complete

Your review story is ready!

View Story

Comment !reviewfast on this PR to re-generate the story.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

📥 Commits

Reviewing files that changed from the base of the PR and between cac5404 and 63f247e.

📒 Files selected for processing (2)
  • src/commands/artifact-workflow.ts
  • src/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.writeFile handles 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 CommandTemplate interface is well-designed with appropriate fields for slash command metadata. The distinction between content (for commands) and instructions (for skills in SkillTemplate) reflects the different output formats each requires.


338-394: LGTM!

The /opsx:new command 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:continue command 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:apply command 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 CommandTemplate and its associated functions.

@TabishB TabishB merged commit 51fb10d into main Jan 6, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants