_templates_suffix: .jinja # 模板文件都在 template/ 子目录;脚手架自身的 README/scripts/.claude/skills 不进生成项目 _subdirectory: template _skip_if_exists: - "backend/src/**" - "agent/src/**" - "frontend/src/**" - "**/.env" # 注:.vscode/* 故意不列入此处。它们是团队级规则(个人偏好在 VSCode 全局配置, # 不受影响),随 scaffold 演进——copier update 会 3-way 合并推送改进, # 仅当用户改了同一行才提示冲突。 _exclude: - copier.yml # ── 服务目录 ────────────────────────────────────────────────────────────── - "{% if not include_backend %}backend{% endif %}" - "{% if not include_agent %}agent{% endif %}" - "{% if not include_frontend %}frontend{% endif %}" # ── Backend 规则(仅 include_backend=true 时复制)────────────────────── - "{% if not include_backend %}.claude/rules/backend.md{% endif %}" - "{% if not include_backend %}.claude/rules/backend-db.md{% endif %}" - "{% if not include_backend %}.claude/rules/backend-concurrency.md{% endif %}" # ── Agent 规则(仅 include_agent=true 时复制)──────────────────────────── - "{% if not include_agent %}.claude/rules/agent.md{% endif %}" - "{% if not include_agent %}.claude/rules/agent-dag.md{% endif %}" - "{% if not include_agent %}.claude/rules/agent-concurrency.md{% endif %}" - "{% if not include_agent %}.claude/rules/agent-extension-points.md{% endif %}" # LLM 驱动层:按 llm_provider 只保留对应变体 - "{% if not include_agent or llm_provider != 'gemini-cli' %}.claude/rules/agent-llm-pty.md{% endif %}" - "{% if not include_agent or llm_provider == 'gemini-cli' %}.claude/rules/agent-llm-api.md{% endif %}" # ── Frontend 规则(仅 include_frontend=true 时复制)────────────────────── - "{% if not include_frontend %}.claude/rules/frontend.md{% endif %}" - "{% if not include_frontend %}.claude/rules/frontend-runtime.md{% endif %}" # ── 跨服务规则 ──────────────────────────────────────────────────────────── # data-lifecycle: agent 产生文件,backend 清理 DB,两者都有才有意义 - "{% if not (include_backend and include_agent) %}.claude/rules/data-lifecycle.md{% endif %}" # communication-catalog: 描述服务间 WS 消息,单服务时无跨层通信 - "{% if not (include_backend or include_agent) or not (include_agent or include_frontend) %}.claude/rules/communication-catalog.md{% endif %}" # ── VSCode 自动 watch(仅 vscode_auto_watch=true 时生成)────────────────── - "{% if not vscode_auto_watch %}.vscode/tasks.json{% endif %}" _tasks: - command: git init - command: git add . - command: "git commit -m 'chore: initialize project from scaffold'" - command: uv sync working_directory: backend when: "{{ include_backend }}" - command: uv sync working_directory: agent when: "{{ include_agent }}" - command: pnpm install working_directory: frontend when: "{{ include_frontend }}" # 未安装 pre-commit 时跳过而非让生成失败(退出码恒 0) - command: >- command -v pre-commit >/dev/null 2>&1 && pre-commit install && pre-commit install --hook-type commit-msg || echo '⚠ 未检测到 pre-commit,已跳过钩子安装;请先安装后手动运行:pre-commit install' # ── 项目基本信息 ──────────────────────────────────────────────────────── project_name: type: str help: 项目显示名称(用于文档、README) default: My Awesome Service project_slug: type: str help: 项目 slug(snake_case,用于包名、目录名) default: "{{ project_name | lower | replace(' ', '_') | replace('-', '_') }}" validator: >- {% if not (project_slug | regex_search('^[a-z][a-z0-9_]*$')) %} project_slug 只能包含小写字母、数字和下划线,且以字母开头 {% endif %} org_name: type: str help: GitHub 组织 / 用户名(用于仓库 URL) default: my-org description: type: str help: 项目一行描述 default: "{{ project_name }}" # ── 服务选择(条件包含) ──────────────────────────────────────────────── include_backend: type: bool help: 包含 Python FastAPI backend 服务? default: true include_agent: type: bool help: 包含 Python LLM Agent 服务? default: false include_frontend: type: bool help: 包含 React + Vite + TypeScript 前端? default: true # ── 端口配置 ──────────────────────────────────────────────────────────── backend_port: type: int help: Backend 服务端口 default: 8000 when: "{{ include_backend }}" agent_port: type: int help: Agent 服务端口 default: 8001 when: "{{ include_agent }}" frontend_port: type: int help: 前端开发服务器 / 容器暴露端口 default: 5173 when: "{{ include_frontend }}" # ── Python 配置 ────────────────────────────────────────────────────────── python_version: type: str help: Python 版本 default: "3.12" choices: - "3.11" - "3.12" - "3.13" database: type: str help: 数据库类型 default: sqlite choices: - sqlite - postgresql when: "{{ include_backend }}" # ── 前端配置 ───────────────────────────────────────────────────────────── node_version: type: str help: Node.js 版本(CI 使用) default: "22" choices: - "20" - "22" when: "{{ include_frontend }}" # ── LLM 配置(Agent 专属) ─────────────────────────────────────────────── llm_provider: type: str help: LLM 提供商 default: gemini-cli choices: - gemini-cli - openai-api - anthropic-api - custom when: "{{ include_agent }}" llm_cmd: type: str help: LLM CLI 命令(留空则按 provider 默认) default: "{% if llm_provider == 'gemini-cli' %}gemini{% elif llm_provider == 'openai-api' %}openai{% else %}llm{% endif %}" when: "{{ include_agent }}" # ── 编辑器(VSCode)───────────────────────────────────────────────────────── vscode_auto_watch: type: bool help: VSCode 打开项目时自动启动 watch 任务(类型/lint 持续后台检查,编码时即时发现问题)? default: false when: "{{ include_backend or include_agent or include_frontend }}"