{"record":{"id":"bee1134969b7df6d","repo":"github/spec-kit","slug":"error-number-requires-a-value","errorCode":null,"errorMessage":"Error: --number requires a value","messagePattern":"Error: --number requires a value","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"extensions/git/scripts/python/create_new_feature_branch.py","lineNumber":110,"sourceCode":"    i = 0\n    while i < len(argv):\n        arg = argv[i]\n        if arg == \"--json\":\n            args.json_mode = True\n        elif arg == \"--dry-run\":\n            args.dry_run = True\n        elif arg == \"--allow-existing-branch\":\n            args.allow_existing = True\n        elif arg == \"--short-name\":\n            if i + 1 >= len(argv) or argv[i + 1].startswith(\"--\"):\n                _err(\"Error: --short-name requires a value\")\n                raise SystemExit(1)\n            i += 1\n            args.short_name = argv[i]\n        elif arg == \"--number\":\n            if i + 1 >= len(argv) or argv[i + 1].startswith(\"--\"):\n                _err(\"Error: --number requires a value\")\n                raise SystemExit(1)\n            i += 1\n            args.branch_number = argv[i]\n            if not re.fullmatch(r\"[0-9]+\", args.branch_number):\n                _err(\"Error: --number must be a non-negative integer\")\n                raise SystemExit(1)\n        elif arg == \"--timestamp\":\n            args.use_timestamp = True\n        elif arg in (\"--help\", \"-h\"):\n            print(HELP_TEXT)\n            raise SystemExit(0)\n        else:\n            args.description_parts.append(arg)\n        i += 1\n    return args\n\n\n# ── Core helpers loading ─────────────────────────────────────────────────────\n","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/extensions/git/scripts/python/create_new_feature_branch.py#L92-L128","documentation":"While walking/creating the shared-infrastructure directory, _ensure_safe_shared_directory() found an existing path component that is a regular file (or other non-directory), so it cannot create or descend into it. The context string names the kind of directory being prepared (default 'shared infrastructure directory').","triggerScenarios":"A file exists where a directory is expected: e.g. a file named 'shared' at .specify/shared while the CLI tries to use .specify/shared/scripts; or .specify itself is a regular file (e.g. created by 'touch .specify' or a bad tool writing a marker file).","commonSituations":"A previous tool or script wrote a file with the same name as the directory; typo'd commands like touch .specify; editor plugins saving a buffer named after the directory; partial checkouts where a directory became a file.","solutions":["Identify the offending file from the label in the error and inspect it (cat .specify/shared) — if it is junk, delete it","If it holds real content, rename it (mv .specify/shared .specify/shared.bak) and rerun so the directory can be created","Check for scripts/plugins that create marker files with directory names and disable that behavior","In automation, pre-flight: if path.exists() and not path.is_dir(): remove or relocate before running the CLI"],"exampleFix":"# before\n$ ls .specify\nshared   # regular file, not directory\n\n# after\n$ mv .specify/shared .specify/shared.file.bak\n$ specify <command>  # directory recreated cleanly","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef no_file_dir_collision(project: Path, rel_dir: Path) -> bool:\n    cur = project\n    for part in rel_dir.parts:\n        cur = cur / part\n        if cur.exists() and not cur.is_dir():\n            return False\n    return True\n\nassert no_file_dir_collision(project_path, rel_dir)","typeGuard":null,"tryCatchPattern":"try:\n    _ensure_safe_shared_directory(project_path, directory)\nexcept ValueError as e:\n    if 'is not a directory' in str(e):\n        # path from the label is a file; move it aside and retry\n        raise SystemExit(f'file blocking directory: {e}') from e\n    raise","preventionTips":["Never create marker/buffer files whose names collide with .specify subdirectories","Pre-flight check exists()/is_dir() for the whole parent chain in orchestration scripts","Recreate a clean .specify tree after partial failures instead of mixing layouts"],"tags":["filesystem","directory","validation"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}