project-init
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProject Init Wizard
项目初始化向导
Run on setup requests and context-recovery requests such as "Setup project", "Initialize context", "Generate CONTEXT.md", or "CONTEXT.md was deleted".
当用户发送“设置项目”“初始化上下文”“生成CONTEXT.md”或“CONTEXT.md已删除”等设置请求或上下文恢复请求时运行。
Core Rules
核心规则
- Do not run blindly. Trigger only for setup intent or missing/incomplete context recovery intent.
- Ask one question at a time.
- Analyze local files before asking setup questions.
- Do not re-ask values that are already inferred with high confidence.
- If first user message is non-English, ask one language confirmation question before any other setup question.
- If has checklist and
.agents/CONTEXT.mdis checked, skip analysis and only confirm whether updates are needed.CONTEXT_READY
- 不要盲目运行。仅在检测到设置意图或缺失/不完整的上下文恢复意图时触发。
- 一次只提一个问题。
- 在询问设置问题前先分析本地文件。
- 不要重复询问已高置信度推断出的值。
- 如果用户的第一条消息是非英文,在其他设置问题前先询问一个语言确认问题。
- 如果.agents/CONTEXT.md包含检查清单且已勾选,则跳过分析,仅确认是否需要更新。
CONTEXT_READY
Hard Trigger Policy
强制触发策略
Trigger with high priority when one of these is true:
project-init- User explicitly asks setup/init/context generation.
- User says is missing, deleted, empty, outdated, or needs regeneration.
.agents/CONTEXT.md - User asks to remap skills from scratch for the project.
Do not stay only in when the request matches this policy.
global-config当满足以下任一条件时,优先触发:
project-init- 用户明确要求设置/初始化/生成上下文。
- 用户表示.agents/CONTEXT.md缺失、已删除、为空、过时或需要重新生成。
- 用户要求从头开始为项目重新映射技能。
当请求符合此策略时,不要仅停留在中。
global-configWorkflow
工作流程
Step 0: Conversation Language
步骤0:对话语言
Ask this only if first user message is non-English. This must be the first setup prompt.
text
O'zbekcha davom etamizmi?
1) Ha
2) Yo'q (English)
3) Boshqa tilFallback template for other non-English languages:
text
Use {detected_language} for this setup conversation?
1) Yes
2) No (English)
3) Other languageIf answer is , ask: (or if user replies in English).
3Qaysi tilda davom etamiz?Which language?仅当用户的第一条消息是非英文时才询问此问题,且这必须是第一个设置提示。
text
O'zbekcha davom etamizmi?
1) Ha
2) Yo'q (English)
3) Boshqa til其他非英文语言的备用模板:
text
Use {detected_language} for this setup conversation?
1) Yes
2) No (English)
3) Other language如果答案是,询问:(如果用户用英文回复则改为)。
3Qaysi tilda davom etamiz?Which language?Step A: Quick Analysis and Confirmation
步骤A:快速分析与确认
Scan and summarize:
.agents/CONTEXT.mdpackage.jsontsconfig.jsonvite.config.*next.config.*nest-cli.json
Ask:
text
Here is the quick analysis summary. Continue with this direction or adjust it?
1) Continue
2) I want changesIf , apply user corrections first. If , continue.
21扫描并总结以下文件:
.agents/CONTEXT.mdpackage.jsontsconfig.jsonvite.config.*next.config.*nest-cli.json
询问:
text
以下是快速分析总结。是否按此方向继续或进行调整?
1) 继续
2) 我需要修改如果选择,先应用用户的修改;如果选择,继续下一步。
21Step B: Ask Only Missing Inputs
步骤B:仅询问缺失的信息
Collect only unresolved fields from this question bank:
| Field | Options |
|---|---|
| Project Name | text |
| Project Type | SaaS, E-commerce, Admin Dashboard, Landing Page, API Backend, Mobile App, Portfolio/Blog, Other |
| Frontend Framework | Next.js, Vite + React, Remix, None |
| TypeScript | Yes, No |
| UI Library | Tailwind, shadcn + Tailwind, MUI, Ant Design, None |
| State Management | TanStack Query, Zustand, Redux Toolkit, TanStack + Zustand, None |
| Backend | NestJS, Express, Next.js API Routes, Hono, None |
| Database | PostgreSQL, MySQL, MongoDB, SQLite, Supabase, None |
| ORM | Prisma, Drizzle, TypeORM, None |
| Package Manager | pnpm, npm, yarn, bun |
仅从以下问题库中收集未确定的字段:
| 字段 | 选项 |
|---|---|
| 项目名称 | 文本 |
| 项目类型 | SaaS, E-commerce, Admin Dashboard, Landing Page, API Backend, Mobile App, Portfolio/Blog, Other |
| 前端框架 | Next.js, Vite + React, Remix, None |
| TypeScript | Yes, No |
| UI库 | Tailwind, shadcn + Tailwind, MUI, Ant Design, None |
| 状态管理 | TanStack Query, Zustand, Redux Toolkit, TanStack + Zustand, None |
| 后端 | NestJS, Express, Next.js API Routes, Hono, None |
| 数据库 | PostgreSQL, MySQL, MongoDB, SQLite, Supabase, None |
| ORM | Prisma, Drizzle, TypeORM, None |
| 包管理器 | pnpm, npm, yarn, bun |
Output Contract
输出约定
Generate with this structure:
.agents/CONTEXT.mdmarkdown
undefined生成具有以下结构的.agents/CONTEXT.md文件:
markdown
undefined{PROJECT_NAME} - Project Context
{PROJECT_NAME} - 项目上下文
Auto-generated by project-init wizard
由project-init向导自动生成
Context Checklist (for agents)
上下文检查清单(供Agent使用)
- CONTEXT_READY
- STACK_CONFIRMED
- STRUCTURE_CONFIRMED
- COMMANDS_CONFIRMED
- SKILLS_MAPPED
- NOTES_CONFIRMED
- LOCAL_SKILLS_SYNCED
- CONTEXT_READY
- STACK_CONFIRMED
- STRUCTURE_CONFIRMED
- COMMANDS_CONFIRMED
- SKILLS_MAPPED
- NOTES_CONFIRMED
- LOCAL_SKILLS_SYNCED
Tech Stack
技术栈
| Category | Technology |
|---|---|
| Framework | {FRAMEWORK} |
| Language | {LANGUAGE} |
| Styling | {UI_LIBRARY} |
| State | {STATE_MANAGEMENT} |
| Backend | {BACKEND} |
| Database | {DATABASE} |
| ORM | {ORM} |
| Package Manager | {PACKAGE_MANAGER} |
| 分类 | 技术 |
|---|---|
| 框架 | {FRAMEWORK} |
| 语言 | {LANGUAGE} |
| 样式 | {UI_LIBRARY} |
| 状态管理 | {STATE_MANAGEMENT} |
| 后端 | {BACKEND} |
| 数据库 | {DATABASE} |
| ORM | {ORM} |
| 包管理器 | {PACKAGE_MANAGER} |
Skills
技能
- Core: ,
global-config,errors,gitsolid - Frontend: {FRONTEND_SKILLS}
- Backend: {BACKEND_SKILLS}
- Data: {DATA_SKILLS}
- State: {STATE_SKILLS}
- UI: {UI_SKILLS}
- Testing: {TESTING_SKILLS}
- 核心:,
global-config,errors,gitsolid - 前端:{FRONTEND_SKILLS}
- 后端:{BACKEND_SKILLS}
- 数据:{DATA_SKILLS}
- 状态:{STATE_SKILLS}
- UI:{UI_SKILLS}
- 测试:{TESTING_SKILLS}
Project Structure
项目结构
{PROJECT_STRUCTURE}
{PROJECT_STRUCTURE}
Coding Rules
编码规则
- Components: Keep focused and small
- TypeScript: Strict mode, avoid
any - Commits: Conventional Commit format
- Naming: PascalCase components, camelCase utilities
- 组件:保持聚焦且体积小巧
- TypeScript:严格模式,避免使用
any - 提交:遵循Conventional Commit格式
- 命名:组件使用PascalCase,工具函数使用camelCase
Commands
命令
pnpm
pnpm
pnpm dev
pnpm build
pnpm lint
pnpm test
pnpm dev
pnpm build
pnpm lint
pnpm test
npm
npm
npm run dev
npm run build
npm run lint
npm run test
npm run dev
npm run build
npm run lint
npm run test
yarn
yarn
yarn dev
yarn build
yarn lint
yarn test
yarn dev
yarn build
yarn lint
yarn test
bun
bun
bun run dev
bun run build
bun run lint
bun run test
undefinedbun run dev
bun run build
bun run lint
bun run test
undefinedSkill Mapping Rules
技能映射规则
- Frontend:
- ->
nextjs,react-corereact-nextjs - ->
vite,react-corereact-vite - ->
remixreact-core - TypeScript:
- ->
yestypescript - UI:
- ->
tailwindtailwind - ->
shadcn,shadcntailwind - or
mui->ant-designdesign - State:
- ->
tanstacktanstack-query - ->
zustandzustand - ->
reduxredux - Backend:
- ->
nestjs,nestjs,api-patternssecurity - or
expressornext-api->hono,api-patternssecurity - Forms:
- if required ->
forms - Testing:
- if planned ->
testing - Any project:
- always include ,
git,solid,errorsglobal-config
- 前端:
- ->
nextjs,react-corereact-nextjs - ->
vite,react-corereact-vite - ->
remixreact-core - TypeScript:
- ->
yestypescript - UI:
- ->
tailwindtailwind - ->
shadcn,shadcntailwind - 或
mui->ant-designdesign - 状态管理:
- ->
tanstacktanstack-query - ->
zustandzustand - ->
reduxredux - 后端:
- ->
nestjs,nestjs,api-patternssecurity - 、
express或next-api->hono,api-patternssecurity - 表单:
- 如果需要 ->
forms - 测试:
- 如果有测试计划 ->
testing - 所有项目:
- 始终包含 ,
git,solid,errorsglobal-config
References
参考资料
- For complete legacy question flow and examples:
references/guide.md
- 完整的历史问题流程及示例:
references/guide.md