feat: add category prefix to change name derivation#945
Conversation
Update workflow templates to derive change names with a category prefix (feat, fix, chore, or docs) prepended with an underscore.
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughUpdated user-facing instruction and guardrail strings in three workflow template files to accept a change name as either plain kebab-case or an optional category-prefixed form ( Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
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: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/core/templates/workflows/ff-change.ts`:
- Line 24: Update the template text so the input contract matches the new
prefixed naming rule: replace occurrences of "(kebab-case)" in the ff-change
template with "<category>_<kebab-case>" and adjust the explanatory/example text
(the line that shows the derivation and the example `feat_add-user-auth`) so it
clearly states the final name format is "<category>_<kebab-case>" (apply this
change to all occurrences of the "(kebab-case)" placeholder found in the
ff-change template).
In `@src/core/templates/workflows/new-change.ts`:
- Line 24: Update the name validation and guardrail checks so they accept the
new "<category>_<kebab-case>" format (e.g., feat_add-user-auth) instead of plain
kebab-case: change the validation regex/patterns and any guardrail logic that
currently enforces only kebab-case to allow a leading category prefix
(feat|fix|chore|docs) followed by an underscore and then the existing kebab-case
pattern, and update the user-facing wording/messages to explicitly describe
"<category>_<kebab-case>" everywhere the template derives or validates the
change name (search for the name derivation and guardrail validation logic in
this template to find the code to update).
In `@src/core/templates/workflows/propose.ts`:
- Line 33: The user-facing instruction text in the propose template is
inconsistent: some places tell users to provide a plain kebab-case name while
the generated change names expect "<category>_<kebab-case>" (the prompt string
starting "From their description, choose which one..." and the earlier input
instructions). Update all prompt/instruction strings in this template so they
consistently instruct users to supply a category-prefixed kebab-case name in the
form "<category>_<kebab-case>" (not plain kebab-case), including the other
occurrences referenced in the file (the earlier instruction and the occurrence
noted as also applies to the later line), so the wording matches the generated
change-name format.
🪄 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: fb40f482-de37-4a5c-b6d4-fee58e2ebe2a
📒 Files selected for processing (3)
src/core/templates/workflows/ff-change.tssrc/core/templates/workflows/new-change.tssrc/core/templates/workflows/propose.ts
…g format Update remaining (kebab-case) references in Input descriptions and guardrail validation text to use <category>_<kebab-case> consistently.
Update all workflow templates so the category prefix (feat_, fix_, chore_, docs_) is recommended but not required. Plain kebab-case names are still accepted.
|
I don't know if this was meant to be on a fork. But tying conventional commit convention to openspec change directory names dosen't make sense. The types of specs you create vs the type of changes you make are not exactly 1:1. For most small fixes or even docs you wouldn't go through OpenSpec. |
Summary
Updates the change name derivation instructions across all workflow templates to prepend a category prefix (feat, fix, chore, or docs) with an underscore to the kebab-case name. In our team, the openspec/changes folder is effectively functioning as a backlog of proposed changes. The category prefix could help in viewing and understanding them at a glance.
Changes
src/core/templates/workflows/propose.ts: Updated name derivation in both skill and command templatessrc/core/templates/workflows/new-change.ts: Updated name derivation in both skill and command templatessrc/core/templates/workflows/ff-change.ts: Updated name derivation in both skill and command templatesDetails
Previously, the AI was instructed to derive a plain kebab-case name (e.g.,
add-user-auth). Now it will choose a category (feat, fix, chore, or docs) and prepend it with an underscore (e.g.,feat_add-user-auth), giving change directories a consistent categorical prefix.After running
openspec init, the updated instructions will appear in both SKILL.md files and command files (e.g.,.claude/commands/opsx/propose.md).Summary by CodeRabbit