Skip to content

fix: warn when feature names have an empty suffix - #4575

Open
xianjianlf2 wants to merge 1 commit into
github:mainfrom
xianjianlf2:fix/4574-empty-feature-name-warning
Open

xianjianlf2 wants to merge 1 commit into
github:mainfrom
xianjianlf2:fix/4574-empty-feature-name-warning

Conversation

@xianjianlf2

@xianjianlf2 xianjianlf2 commented Sep 14, 2026

Copy link
Copy Markdown

Description

When a feature description or explicit short name has no usable ASCII characters, the three core create-new-feature helpers silently produce names such as 001-. This adds a stderr warning pointing to --short-name / -ShortName with an ASCII name, including in dry-run mode.

Related to #4574; implements its suggested warning-only option. It does not change the existing naming policy, JSON stdout, exit status, or feature creation. Unicode ref support or a generated fallback name would require a separate policy decision.

The Bash, PowerShell, and Python variants are updated together. Documentation shows how to keep a non-Latin description and provide a readable short name.

Testing

  • Tested locally with uv run specify --help.
  • Ran the existing feature-creation parity and timestamp suites, including PowerShell 7.6.6 on macOS: 180 passed, 4 skipped.
  • Tested with a sample project created by the local specify init.
  • New regression matrix: 24 missing-warning failures and 12 passing controls on unchanged production code. Covers Chinese/Cyrillic/punctuation-only descriptions, invalid explicit short names, valid ASCII overrides, and ordinary names, across all three backends in dry-run and write mode.
  • git diff --check and error-severity ShellCheck pass. Local markdownlint reports two pre-existing MD028 findings at lines 59/61 of docs/reference/core.md; the unchanged baseline produces the same findings, and none is in the added section.

Test selection reasoning

Changed files Affects Test Why
Three core create-new-feature helpers Direct helper invocation T1: three-backend parity and timestamp tests Check stderr, JSON, exit status, dry runs and created files
Core reference documentation Direct helper usage example T2: local CLI initialization and documented helper command Verify the bundled script emits the warning and an ASCII override creates specs/001-user-auth/spec.md

Current core command templates do not invoke these helpers; the git extension uses different create-new-feature-branch scripts, which this PR does not change. No slash-command behavior change is claimed.

Manual test results

Agent: OpenAI Codex, acting autonomously for @xianjianlf2. OS/shell: macOS / zsh (Bash helper).

Command tested Notes
specify init ... --integration claude --ignore-agent-tools --script sh Local checkout successfully scaffolded a sample project.
create-new-feature.sh --json --dry-run "添加用户" Exit 0, parseable JSON, actionable warning on stderr.
create-new-feature.sh --json --short-name user-auth "添加用户" Exit 0, readable feature name and spec file created; no empty-name warning.

AI Disclosure

  • I did not use AI assistance.
  • I did use AI assistance.

OpenAI Codex (model: GPT-6 Astra / gpt-6-astra, autonomous mode) performed repository research, reproduction, code and test generation, validation, and PR drafting on behalf of @xianjianlf2. The same tool and model were used to update this disclosure in response to review feedback. The patch has not received a human line-by-line review before submission.

Assisted-by: OpenAI Codex (autonomous)
@xianjianlf2
xianjianlf2 requested a review from mnriem as a code owner September 14, 2026 03:40
@mnriem mnriem added the triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review label Sep 14, 2026
@mnriem

mnriem commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

The warning-only scope is appropriate for the option the reporter proposed. No need to expand this into Unicode naming, generated fallback names, or changes to the separate Git extension scripts.

Please add the model(s) used to the AI disclosure. The tool, autonomous mode, extent of assistance, and review status are already clearly stated.

The current CI runs require maintainer approval before final review.

Drafted for @mnriem with assistance from GitHub Copilot (model: GPT-6 Astra; interactive comment drafting).

@mnriem
mnriem requested a balanced review from Copilot September 15, 2026 17:55
@mnriem mnriem added author-needs-disclosure AI use, or the agent/model/settings behind it, not disclosed per CONTRIBUTING author-awaiting Waiting on author response labels Sep 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused change is consistent across all three implementations and has comprehensive regression coverage.

Pull request overview

Adds actionable warnings when feature names lack usable ASCII suffixes while preserving existing behavior.

Changes:

  • Adds consistent stderr warnings across Bash, PowerShell, and Python helpers.
  • Adds cross-backend regression coverage.
  • Documents ASCII short-name overrides.
File summaries
File Description
scripts/bash/create-new-feature.sh Adds Bash warning.
scripts/powershell/create-new-feature.ps1 Adds PowerShell warning.
scripts/python/create_new_feature.py Adds Python warning.
tests/test_create_new_feature_python_parity.py Tests warnings and unchanged behavior.
docs/reference/core.md Documents empty suffixes and overrides.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author-awaiting Waiting on author response author-needs-disclosure AI use, or the agent/model/settings behind it, not disclosed per CONTRIBUTING triage-nice-to-have Verdict: evidence-backed fix or greenlit feature — land after review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants