Skip to content

Commit 97df98b

Browse files
committed
Update logic for arguments
1 parent 36383b4 commit 97df98b

3 files changed

Lines changed: 50 additions & 29 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "specify-cli"
3-
version = "0.0.19"
3+
version = "0.0.20"
44
description = "Specify CLI, part of GitHub Spec Kit. A tool to bootstrap your projects for Spec-Driven Development (SDD)."
55
requires-python = ">=3.11"
66
dependencies = [

scripts/powershell/create-new-feature.ps1

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@
44
param(
55
[switch]$Json,
66
[string]$ShortName,
7+
[switch]$Help,
78
[Parameter(ValueFromRemainingArguments = $true)]
89
[string[]]$FeatureDescription
910
)
1011
$ErrorActionPreference = 'Stop'
1112

12-
# Show help if requested or no description provided
13-
if (($FeatureDescription -contains '--help') -or ($FeatureDescription -contains '-h') -or
14-
(-not $FeatureDescription) -or ($FeatureDescription.Count -eq 0)) {
15-
16-
if (($FeatureDescription -contains '--help') -or ($FeatureDescription -contains '-h')) {
17-
Write-Host "Usage: ./create-new-feature.ps1 [-Json] [-ShortName <name>] <feature description>"
18-
Write-Host ""
19-
Write-Host "Options:"
20-
Write-Host " -Json Output in JSON format"
21-
Write-Host " -ShortName <name> Provide a custom short name (2-4 words) for the branch"
22-
Write-Host " -h, --help Show this help message"
23-
Write-Host ""
24-
Write-Host "Examples:"
25-
Write-Host " ./create-new-feature.ps1 'Add user authentication system' -ShortName 'user-auth'"
26-
Write-Host " ./create-new-feature.ps1 'Implement OAuth2 integration for API'"
27-
exit 0
28-
} else {
29-
Write-Error "Usage: ./create-new-feature.ps1 [-Json] [-ShortName <name>] <feature description>"
30-
exit 1
31-
}
13+
# Show help if requested
14+
if ($Help) {
15+
Write-Host "Usage: ./create-new-feature.ps1 [-Json] [-ShortName <name>] <feature description>"
16+
Write-Host ""
17+
Write-Host "Options:"
18+
Write-Host " -Json Output in JSON format"
19+
Write-Host " -ShortName <name> Provide a custom short name (2-4 words) for the branch"
20+
Write-Host " -Help Show this help message"
21+
Write-Host ""
22+
Write-Host "Examples:"
23+
Write-Host " ./create-new-feature.ps1 'Add user authentication system' -ShortName 'user-auth'"
24+
Write-Host " ./create-new-feature.ps1 'Implement OAuth2 integration for API'"
25+
exit 0
26+
}
27+
28+
# Check if feature description provided
29+
if (-not $FeatureDescription -or $FeatureDescription.Count -eq 0) {
30+
Write-Error "Usage: ./create-new-feature.ps1 [-Json] [-ShortName <name>] <feature description>"
31+
exit 1
3232
}
3333

3434
$featureDesc = ($FeatureDescription -join ' ').Trim()
3535

3636
# Resolve repository root. Prefer git information when available, but fall back
3737
# to searching for repository markers so the workflow still functions in repositories that
38-
# were initialised with --no-git.
38+
# were initialized with --no-git.
3939
function Find-RepositoryRoot {
4040
param(
4141
[string]$StartDir,

templates/commands/specify.md

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,32 @@ The text the user typed after `/speckit.specify` in the triggering message **is*
1919

2020
Given that feature description, do this:
2121

22-
1. Run the script `{SCRIPT}` from repo root and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute.
23-
**IMPORTANT** You must only ever run this script once. The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
24-
2. Load `templates/spec-template.md` to understand required sections.
22+
1. **Generate a concise short name** (2-4 words) for the branch:
23+
- Analyze the feature description and extract the most meaningful keywords
24+
- Create a 2-4 word short name that captures the essence of the feature
25+
- Use action-noun format when possible (e.g., "add-user-auth", "fix-payment-bug")
26+
- Preserve technical terms and acronyms (OAuth2, API, JWT, etc.)
27+
- Keep it concise but descriptive enough to understand the feature at a glance
28+
- Examples:
29+
- "I want to add user authentication" → "user-auth"
30+
- "Implement OAuth2 integration for the API" → "oauth2-api-integration"
31+
- "Create a dashboard for analytics" → "analytics-dashboard"
32+
- "Fix payment processing timeout bug" → "fix-payment-timeout"
2533

26-
3. Follow this execution flow:
34+
2. Run the script `{SCRIPT}` from repo root **with the short-name argument** and parse its JSON output for BRANCH_NAME and SPEC_FILE. All file paths must be absolute.
35+
36+
**IMPORTANT**:
37+
38+
- Append the short-name argument to the `{SCRIPT}` command with the 2-4 word short name you created in step 1
39+
- Bash: `--short-name "your-generated-short-name"`
40+
- PowerShell: `-ShortName "your-generated-short-name"`
41+
- For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot")
42+
- You must only ever run this script once
43+
- The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for
44+
45+
3. Load `templates/spec-template.md` to understand required sections.
46+
47+
4. Follow this execution flow:
2748

2849
1. Parse user description from Input
2950
If empty: ERROR "No feature description provided"
@@ -49,9 +70,9 @@ Given that feature description, do this:
4970
7. Identify Key Entities (if data involved)
5071
8. Return: SUCCESS (spec ready for planning)
5172

52-
4. 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.
73+
5. 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.
5374

54-
5. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
75+
6. **Specification Quality Validation**: After writing the initial spec, validate it against quality criteria:
5576

5677
a. **Create Spec Quality Checklist**: Generate a checklist file at `FEATURE_DIR/checklists/requirements.md` using the checklist template structure with these validation items:
5778

@@ -143,7 +164,7 @@ Given that feature description, do this:
143164

144165
d. **Update Checklist**: After each validation iteration, update the checklist file with current pass/fail status
145166

146-
6. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`/speckit.clarify` or `/speckit.plan`).
167+
7. Report completion with branch name, spec file path, checklist results, and readiness for the next phase (`/speckit.clarify` or `/speckit.plan`).
147168

148169
**NOTE:** The script creates and checks out the new branch and initializes the spec file before writing.
149170

0 commit comments

Comments
 (0)