Prompt file imported from daniel-luan-tran/next-blog (
.github/prompts/specify.prompt.md). Fill in{{arguments}}before use. Copyright stays with the author.
Given the feature description provided as an argument, do this:
-
Branch Check: Run
git rev-parse --abbrev-ref HEADto get the current branch name.- If the branch already matches the feature branch pattern (
NNN-feature-name, e.g.012-aws-hosting), ask the user:Current branch is
<branch_name>, which is already a valid feature branch. Would you like to:- Use the current branch — I'll create/update the spec in the existing feature directory
- Create a new feature branch — a new branch and spec directory will be created
- If the branch does NOT match (e.g.
main,feature/something), proceed to step 2 (create new branch). - If the user chooses to use the current branch, skip step 2 — instead set BRANCH_NAME to the current branch, set SPEC_FILE to
specs/<BRANCH_NAME>/spec.md, create the directory if needed, and continue to step 3. - Wait for the user's answer before proceeding.
- If the branch already matches the feature branch pattern (
-
Generate Branch Name: Before creating the branch:
- Determine the next feature number by scanning existing
specs/directories for the highestNNNprefix. - Generate a concise, meaningful branch name from the feature description (2-5 lowercase kebab-case words that capture the core intent, e.g.
013-aws-dynamodb-migration,014-user-role-permissions). Drop filler words like "with", "the", "and", "for". - Ask the user to confirm or edit the suggested name:
Suggested branch name:
<suggested-name>Press Enter to accept, or type a different name. - Wait for the user's answer before proceeding.
- Run
.specify/scripts/bash/create-new-feature.sh --json --name=<confirmed-name> "{{arguments}}"from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute.
- Determine the next feature number by scanning existing
-
Load
.specify/templates/spec-template.mdto understand required sections. -
Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
-
Report completion with branch name, spec file path, and readiness for the next phase.
Note: Step 2 creates and checks out a new branch using the --name flag. If using an existing branch (step 1), the script is skipped.
