Add AI-Driven Feature Name Generation to Specification Workflow #579
+122
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Enhanced the
.specify
workflow to support explicit feature names while maintaining backward compatibility with description-based branch naming. This change allows users to provide precise, meaningful branch names when needed while keeping automatic slug generation for simple cases.Note: GitHub Copilot was used to understand the codebase, to get advices to improve the prompt and to write most of this comment.
Fixes #518
Changes Made
1. PowerShell and Bash Scripts Enhancement (
.specify/scripts/powershell/create-new-feature.ps1
,.specify/scripts/bash/create-new-feature.sh
).Note: bash file was generated using Copilot and was tested by myself.
New Parameter:
-FeatureName
parameter to accept explicit feature namesEnhanced Helper Function:
Get-FeatureSlug
with configurableWordLimit
parameter (defaults to 3)WordLimit = 0
, preserves all words from the inputWordLimit > 0
, caps output to specified number of wordsBranch Name Logic:
WordLimit = 0
)WordLimit = 3
)001-
,002-
, etc.)2. Prompt Workflow Updates (
.github/prompts/specify.prompt.md
)Feature Name Detection:
feature-name:
,feature name:
,branch-name:
,branch name:
(case-insensitive)Enhanced Agent Instructions:
-FeatureName
argument to script (either explicit or synthesized)Behavior Examples
Before (Description Only)
After (Explicit Feature Name)
After (Agent Synthesized Name)
User input:
Upload Processing Enhancement
Agent synthesizes: "Upload Processing Enhancement"
Backward Compatibility
Testing Performed
Impact
This enhancement provides greater control over branch naming while maintaining the automatic, sensible defaults that make the workflow easy to use. Users can now specify precise, meaningful branch names when working on complex features while still benefiting from automatic slug generation for routine work.