Skip to content

πŸ’« Toolkit to help you get started with SDD or any other process!

fix: accept 4+ digit spec numbers in tests and docs (#2094)

alex-zwinglif92e7e80961b
diff --git a/README.md b/README.md
index fec35f564..e8121564e 100644
--- a/README.md
+++ b/README.md
@@ -337,7 +337,7 @@ The `specify` command supports the following options:
| `--debug` | Flag | Enable detailed debug output for troubleshooting |
| `--github-token` | Option | GitHub token for API requests (or set GH_TOKEN/GITHUB_TOKEN env variable) |
| `--ai-skills` | Flag | Install Prompt.MD templates as agent skills in agent-specific `skills/` directory (requires `--ai`). Extension commands are also auto-registered as skills when extensions are added later. |
-| `--branch-numbering` | Option | Branch numbering strategy: `sequential` (default β€” `001`, `002`, `003`) or `timestamp` (`YYYYMMDD-HHMMSS`). Timestamp mode is useful for distributed teams to avoid numbering conflicts |
+| `--branch-numbering` | Option | Branch numbering strategy: `sequential` (default β€” `001`, `002`, `003`, …, `1000`, … β€” expands beyond 3 digits automatically) or `timestamp` (`YYYYMMDD-HHMMSS`). Timestamp mode is useful for distributed teams to avoid numbering conflicts |
### Examples
diff --git a/spec-driven.md b/spec-driven.md
index 70b978970..090071a3c 100644
--- a/spec-driven.md
+++ b/spec-driven.md
@@ -78,7 +78,7 @@ The SDD methodology is significantly enhanced through three powerful commands th
This command transforms a simple feature description (the user-prompt) into a complete, structured specification with automatic repository management:
-1. **Automatic Feature Numbering**: Scans existing specs to determine the next feature number (e.g., 001, 002, 003)
+1. **Automatic Feature Numbering**: Scans existing specs to determine the next feature number (e.g., 001, 002, 003, …, 1000 β€” expands beyond 3 digits automatically)
2. **Branch Creation**: Generates a semantic branch name from your description and creates it automatically
3. **Template-Based Generation**: Copies and customizes the feature specification template with your requirements
4. **Directory Structure**: Creates the proper `specs/[branch-name]/` structure for all related documents
diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py
index 455beea38..1c62a4a3b 100644
--- a/src/specify_cli/__init__.py
+++ b/src/specify_cli/__init__.py
@@ -840,7 +840,7 @@ def init(
ai_skills: bool = typer.Option(False, "--ai-skills", help="Install Prompt.MD templates as agent skills (requires --ai)"),
offline: bool = typer.Option(False, "--offline", help="Deprecated (no-op). All scaffolding now uses bundled assets.", hidden=True),
preset: str = typer.Option(None, "--preset", help="Install a preset during initialization (by preset ID)"),
- branch_numbering: str = typer.Option(None, "--branch-numbering", help="Branch numbering strategy: 'sequential' (001, 002, ...) or 'timestamp' (YYYYMMDD-HHMMSS)"),
+ branch_numbering: str = typer.Option(None, "--branch-numbering", help="Branch numbering strategy: 'sequential' (001, 002, …, 1000, … β€” expands past 999 automatically) or 'timestamp' (YYYYMMDD-HHMMSS)"),
integration: str = typer.Option(None, "--integration", help="Use the new integration system (e.g. --integration copilot). Mutually exclusive with --ai."),
integration_options: str = typer.Option(None, "--integration-options", help='Options for the integration (e.g. --integration-options="--commands-dir .myagent/cmds")'),
):
diff --git a/tests/test_timestamp_branches.py b/tests/test_timestamp_branches.py
index edc93fb39..2c1385311 100644
--- a/tests/test_timestamp_branches.py
+++ b/tests/test_timestamp_branches.py
@@ -134,7 +134,7 @@ class TestSequentialBranch:
if line.startswith("BRANCH_NAME:"):
branch = line.split(":", 1)[1].strip()
assert branch is not None
- assert re.match(r"^\d{3}-new-feat$", branch), f"unexpected branch: {branch}"
+ assert re.match(r"^\d{3,}-new-feat$", branch), f"unexpected branch: {branch}"
def test_sequential_ignores_timestamp_dirs(self, git_repo: Path):
"""Sequential numbering skips timestamp dirs when computing next number."""
@@ -289,7 +289,7 @@ class TestE2EFlow:
capture_output=True,
text=True,
).stdout.strip()
- assert re.match(r"^\d{3}-seq-feat$", branch), f"branch: {branch}"
+ assert re.match(r"^\d{3,}-seq-feat$", branch), f"branch: {branch}"
assert (git_repo / "specs" / branch).is_dir()
val = source_and_call(f'check_feature_branch "{branch}" "true"')
assert val.returncode == 0