-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add /opsx:ff command for fast-forward artifact creation #448
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
Adds a new fast-forward command that creates all artifacts needed for implementation in one go, instead of stepping through them individually. Changes: - Add `applyRequires` field to status JSON output (shows which artifacts are required before the apply phase can begin) - Add skill template for openspec-ff-change - Add command template for /opsx:ff slash command - Register templates in artifact-workflow setup command The fast-forward command uses the schema's `apply.requires` configuration to determine when to stop creating artifacts, making it schema-agnostic.
📝 WalkthroughWalkthroughThe PR introduces fast-forward (ff) artifact support by adding new template functions for ff skills and commands, integrating them into the experimental artifact workflow, and extending the ChangeStatus interface with an Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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 |
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/core/artifact-graph/instruction-loader.ts (1)
257-259: Consider caching the schema in ChangeContext to avoid redundant resolution.
resolveSchemais called here, butloadChangeContextalready calls it internally (line 168). The schema isn't exposed inChangeContext, forcing this duplicate resolution. While likely low-cost for an in-memory lookup, you could consider extendingChangeContextto include the resolved schema if this pattern repeats elsewhere.The fallback logic (
schema.apply?.requires ?? schema.artifacts.map(a => a.id)) is correct—defaulting to all artifact IDs when no explicitapply.requiresis configured.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
src/commands/artifact-workflow.tssrc/core/artifact-graph/instruction-loader.tssrc/core/templates/skill-templates.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-25T01:08:19.004Z
Learnt from: CR
Repo: Fission-AI/OpenSpec PR: 0
File: openspec/AGENTS.md:0-0
Timestamp: 2025-11-25T01:08:19.004Z
Learning: Applies to openspec/changes/**/*.md : Scaffold proposal using `proposal.md`, `tasks.md`, optional `design.md`, and delta specs under `openspec/changes/<id>/`
Applied to files:
src/core/templates/skill-templates.ts
🧬 Code graph analysis (2)
src/core/artifact-graph/instruction-loader.ts (1)
src/core/artifact-graph/index.ts (1)
resolveSchema(22-22)
src/commands/artifact-workflow.ts (1)
src/core/templates/skill-templates.ts (3)
getFfChangeSkillTemplate(367-456)getOpsxNewCommandTemplate(473-542)getOpsxFfCommandTemplate(822-913)
🔇 Additional comments (7)
src/core/artifact-graph/instruction-loader.ts (1)
102-103: LGTM! Well-documented interface extension.The
applyRequiresfield is clearly documented and provides the necessary data for the fast-forward workflow to determine when to stop creating artifacts.src/core/templates/skill-templates.ts (2)
363-456: FF skill skips schema selection—verify this is intentional.The
/opsx:newcommand (line 506-508) prompts the user to select a schema and passes--schematoopenspec new change. However,getFfChangeSkillTemplate(line 388) usesopenspec new change "<name>"without--schema, defaulting tospec-driven.If this is intentional for speed (fast-forward should minimize prompts), consider documenting this behavior in the template description. Otherwise, you may want to add schema selection or accept a schema parameter:
2. **Create the change directory** \`\`\`bash - openspec new change "<name>" + openspec new change "<name>" --schema "spec-driven" \`\`\` - This creates a scaffolded change at \`openspec/changes/<name>/\`. + This creates a scaffolded change at \`openspec/changes/<name>/\` using the default spec-driven schema.
819-912: LGTM! Slash command template is consistent with the skill template.The
/opsx:ffcommand template mirrors the skill template logic and provides clear instructions for the fast-forward workflow. The guardrails and artifact creation guidelines are well-defined.One minor note: line 910 says "ask if user wants to continue it or create a new one" while the skill template (line 453) says "suggest continuing that change instead"—the command version is slightly more interactive, which is appropriate for a slash command.
src/commands/artifact-workflow.ts (4)
31-31: LGTM! Import statement properly extended.The new template functions are correctly imported alongside the existing ones.
799-812: LGTM! FF skill and command properly integrated.The fast-forward skill and command templates are correctly instantiated and added to their respective arrays, following the established patterns for
newChangeSkill,continueChangeSkill, andapplyChangeSkill.
836-840: LGTM! Command file naming is consistent.The
ff.mdfilename follows the pattern of other commands (new.md,continue.md,apply.md).
896-896: LGTM! Help text properly documents the new command.The
/opsx:ffcommand is added to the usage instructions with a clear description matching the PR objectives.
Review CompleteYour review story is ready! Comment !reviewfast on this PR to re-generate the story. |
Summary
/opsx:ffcommand that creates all artifacts needed for implementation in one goapplyRequiresinopenspec status --jsonoutput so agents know when to stopapply.requiresconfigurationChanges
instruction-loader.ts: AddapplyRequiresfield toChangeStatusinterface andformatChangeStatus()skill-templates.ts: Add templates for ff skill and commandartifact-workflow.ts: Register the new templates in setup commandTest plan
openspec artifact-experimental-setupand verify/opsx:ffappears in outputopenspec status --change <name> --jsonand verifyapplyRequiresfield exists/opsx:ffcommand creates artifacts until apply-ready state🤖 Generated with Claude Code
Summary by CodeRabbit
/opsx:ffslash command for expedited artifact operations.✏️ Tip: You can customize this high-level summary in your review settings.