{"record":{"id":"ced55aa59976e0a9","repo":"github/spec-kit","slug":"error-template-requires-a-template-name","errorCode":null,"errorMessage":"ERROR: --template requires a template name","messagePattern":"ERROR: --template requires a template name","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"scripts/python/check_prerequisites.py","lineNumber":93,"sourceCode":"    index = 0\n    while index < len(argv):\n        arg = argv[index]\n        if arg == \"--json\":\n            json_mode = True\n        elif arg == \"--require-tasks\":\n            require_tasks = True\n        elif arg == \"--include-tasks\":\n            include_tasks = True\n        elif arg == \"--paths-only\":\n            paths_only = True\n        elif arg == \"--template\":\n            index += 1\n            if index >= len(argv):\n                print(\n                    \"ERROR: --template requires a template name\",\n                    file=sys.stderr,\n                )\n                raise SystemExit(1)\n            template_name = argv[index]\n        elif arg in {\"--help\", \"-h\"}:\n            sys.stdout.write(HELP_TEXT)\n            raise SystemExit(0)\n        else:\n            print(\n                f\"ERROR: Unknown option '{arg}'. Use --help for usage information.\",\n                file=sys.stderr,\n            )\n            raise SystemExit(1)\n        index += 1\n\n    return Args(\n        json_mode=json_mode,\n        require_tasks=require_tasks,\n        include_tasks=include_tasks,\n        paths_only=paths_only,\n        template_name=template_name,","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/github/spec-kit/blob/bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c/scripts/python/check_prerequisites.py#L75-L111","documentation":"_validate_safe_shared_directory() is the lenient validator that allows missing directories but still refuses symlinked components: any existing component on the path to the shared-infra directory that is a symlink raises SymlinkedSharedPathError. It is used by _ensure_safe_shared_destination(parent_must_exist=False) before writing files whose parents may not exist yet.","triggerScenarios":"Writing a shared-infra file with parent_must_exist=False while any existing parent component (e.g. .specify or .specify/shared) is a symlink — e.g. a developer symlinking .specify to share configuration between clones.","commonSituations":"Dotfiles-style setups symlinking .specify; shared monorepo infra via symlinks; workspace tools (VS Code multi-root, devcontainers) that link config directories; restoring trees with backup tools that link instead of copy.","solutions":["Replace the symlink with a real directory (cp -aL to dereference, or rm the link and copy contents)","Use the CLI's supported sharing mechanisms (presets, packages) instead of symlinking inside the tree","Pre-check with p.is_symlink() down the parent chain before invoking the write","Document to team members that .specify must be a real directory in this repo"],"exampleFix":"# before\n$ ln -s ~/dotfiles/specify .specify && specify <cmd>  # raises\n\n# after\n$ rm .specify && cp -a ~/dotfiles/specify .specify && specify <cmd>","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef tree_free_of_symlinks(project: Path, rel_dir: Path) -> bool:\n    cur = project\n    for part in rel_dir.parts:\n        cur = cur / part\n        if cur.is_symlink():\n            return False\n    return True\n\nassert tree_free_of_symlinks(project_path, rel_dir)","typeGuard":null,"tryCatchPattern":"from specify_cli.shared_infra import SymlinkedSharedPathError\n\ntry:\n    _validate_safe_shared_directory(project_path, directory)\nexcept SymlinkedSharedPathError as e:\n    raise SystemExit(f'replace symlink with a real directory: {e}') from e","preventionTips":["Never symlink .specify or its children; copy instead (cp -aL)","Add CI lint: test -z \"$(find .specify -type l 2>/dev/null)\"","Document repo policy that shared infra must live in-tree"],"tags":["filesystem","symlink","security"],"backgroundTag":null,"analyzedSha":"bf88c9f9a82fa370c7a7257aa2b3cf10b457b65c","analyzedAt":"2026-08-14T19:43:37.150Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}