<coding_guidelines>
Schema-first & Issue-Driven Development
在正式开工前,先分析需求并查阅相关白皮书:
# 生成 RFC 草稿和白皮书推荐
pnpm agent investigate analyze --type <ui|service|page|hybrid> --topic "需求描述"严禁手动创建 Issue/Branch/Worktree,必须使用自动化工作流:
# 自动创建 Issue -> Branch -> Worktree -> Draft PR
pnpm agent task start --type <type> --title "Task Title"进入生成的 Worktree 目录后:
# 同步进度到 Issue
pnpm agent task sync "- [x] Step 1 done"
# 质量检查 (Pre-commit)
pnpm agent review verify# 推送代码并标记 PR 为 Ready
pnpm agent task submit完整指南见 AGENTS.md
必须使用以下命令进行类型检查:
# 正确:通过 turbo 检查所有 packages(注意清除缓存以获取最新结果)
pnpm typecheck
# 正确:直接检查主应用 src/ 目录(无缓存)
pnpm tsc --build --noEmit
# 或者明确指定 tsconfig
pnpm tsc -p tsconfig.app.json --noEmit注意:turbo 缓存可能导致误报,如需确保最新结果:
rm -rf .turbo && pnpm typecheckThese instructions are for AI assistants working in this project.
Always open @/openspec/AGENTS.md when the request:
- Mentions planning or proposals (words like proposal, spec, change, plan)
- Introduces new capabilities, breaking changes, architecture shifts, or big performance/security work
- Sounds ambiguous and you need the authoritative spec before coding
Use @/openspec/AGENTS.md to learn:
- How to create and apply change proposals
- Spec format and conventions
- Project structure and guidelines
Keep this managed block so 'openspec update' can refresh the instructions.
| 文档 | 路径 | 用途 |
|---|---|---|
| 白皮书 | docs/white-book/ |
唯一权威技术文档 (Schema-first) |
| Workflow | scripts/agent-flow/ |
自动化工作流源码 |
- React 19 + Vite 7
- Stackflow (导航) + TanStack (Query + Store + Form)
- shadcn/ui + Tailwind CSS 4.x
- Zod 4.x (Schema-first) + i18next
- Storybook 10.x + Vitest 4.x
- Schema-first: 先定义
types.ts和 Zod Schema,再写实现。 - Issue-Driven: 没有 Issue 就没有代码。
- Worktree-Only: 所有开发必须在
.git-worktree/下进行。 - Test-Driven: 业务逻辑必须有测试,UI 必须有 Storybook。
</coding_guidelines>