project-init

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Project 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

核心规则

  1. Do not run blindly. Trigger only for setup intent or missing/incomplete context recovery intent.
  2. Ask one question at a time.
  3. Analyze local files before asking setup questions.
  4. Do not re-ask values that are already inferred with high confidence.
  5. If first user message is non-English, ask one language confirmation question before any other setup question.
  6. If
    .agents/CONTEXT.md
    has checklist and
    CONTEXT_READY
    is checked, skip analysis and only confirm whether updates are needed.
  1. 不要盲目运行。仅在检测到设置意图或缺失/不完整的上下文恢复意图时触发。
  2. 一次只提一个问题。
  3. 在询问设置问题前先分析本地文件。
  4. 不要重复询问已高置信度推断出的值。
  5. 如果用户的第一条消息是非英文,在其他设置问题前先询问一个语言确认问题。
  6. 如果.agents/CONTEXT.md包含检查清单且
    CONTEXT_READY
    已勾选,则跳过分析,仅确认是否需要更新。

Hard Trigger Policy

强制触发策略

Trigger
project-init
with high priority when one of these is true:
  1. User explicitly asks setup/init/context generation.
  2. User says
    .agents/CONTEXT.md
    is missing, deleted, empty, outdated, or needs regeneration.
  3. User asks to remap skills from scratch for the project.
Do not stay only in
global-config
when the request matches this policy.
当满足以下任一条件时,优先触发
project-init
  1. 用户明确要求设置/初始化/生成上下文。
  2. 用户表示.agents/CONTEXT.md缺失、已删除、为空、过时或需要重新生成。
  3. 用户要求从头开始为项目重新映射技能。
当请求符合此策略时,不要仅停留在
global-config
中。

Workflow

工作流程

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 til
Fallback template for other non-English languages:
text
Use {detected_language} for this setup conversation?

1) Yes
2) No (English)
3) Other language
If answer is
3
, ask:
Qaysi tilda davom etamiz?
(or
Which language?
if user replies in English).
仅当用户的第一条消息是非英文时才询问此问题,且这必须是第一个设置提示。
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
如果答案是
3
,询问:
Qaysi tilda davom etamiz?
(如果用户用英文回复则改为
Which language?
)。

Step A: Quick Analysis and Confirmation

步骤A:快速分析与确认

Scan and summarize:
  • .agents/CONTEXT.md
  • package.json
  • tsconfig.json
  • vite.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 changes
If
2
, apply user corrections first. If
1
, continue.
扫描并总结以下文件:
  • .agents/CONTEXT.md
  • package.json
  • tsconfig.json
  • vite.config.*
  • next.config.*
  • nest-cli.json
询问:
text
以下是快速分析总结。是否按此方向继续或进行调整?

1) 继续
2) 我需要修改
如果选择
2
,先应用用户的修改;如果选择
1
,继续下一步。

Step B: Ask Only Missing Inputs

步骤B:仅询问缺失的信息

Collect only unresolved fields from this question bank:
FieldOptions
Project Nametext
Project TypeSaaS, E-commerce, Admin Dashboard, Landing Page, API Backend, Mobile App, Portfolio/Blog, Other
Frontend FrameworkNext.js, Vite + React, Remix, None
TypeScriptYes, No
UI LibraryTailwind, shadcn + Tailwind, MUI, Ant Design, None
State ManagementTanStack Query, Zustand, Redux Toolkit, TanStack + Zustand, None
BackendNestJS, Express, Next.js API Routes, Hono, None
DatabasePostgreSQL, MySQL, MongoDB, SQLite, Supabase, None
ORMPrisma, Drizzle, TypeORM, None
Package Managerpnpm, npm, yarn, bun
仅从以下问题库中收集未确定的字段:
字段选项
项目名称文本
项目类型SaaS, E-commerce, Admin Dashboard, Landing Page, API Backend, Mobile App, Portfolio/Blog, Other
前端框架Next.js, Vite + React, Remix, None
TypeScriptYes, 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
ORMPrisma, Drizzle, TypeORM, None
包管理器pnpm, npm, yarn, bun

Output Contract

输出约定

Generate
.agents/CONTEXT.md
with this structure:
markdown
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

技术栈

CategoryTechnology
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
    ,
    git
    ,
    solid
  • Frontend: {FRONTEND_SKILLS}
  • Backend: {BACKEND_SKILLS}
  • Data: {DATA_SKILLS}
  • State: {STATE_SKILLS}
  • UI: {UI_SKILLS}
  • Testing: {TESTING_SKILLS}
  • 核心:
    global-config
    ,
    errors
    ,
    git
    ,
    solid
  • 前端:{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
undefined
bun run dev bun run build bun run lint bun run test
undefined

Skill Mapping Rules

技能映射规则

  • Frontend:
  • nextjs
    ->
    react-core
    ,
    react-nextjs
  • vite
    ->
    react-core
    ,
    react-vite
  • remix
    ->
    react-core
  • TypeScript:
  • yes
    ->
    typescript
  • UI:
  • tailwind
    ->
    tailwind
  • shadcn
    ->
    shadcn
    ,
    tailwind
  • mui
    or
    ant-design
    ->
    design
  • State:
  • tanstack
    ->
    tanstack-query
  • zustand
    ->
    zustand
  • redux
    ->
    redux
  • Backend:
  • nestjs
    ->
    nestjs
    ,
    api-patterns
    ,
    security
  • express
    or
    next-api
    or
    hono
    ->
    api-patterns
    ,
    security
  • Forms:
  • if required ->
    forms
  • Testing:
  • if planned ->
    testing
  • Any project:
  • always include
    git
    ,
    solid
    ,
    errors
    ,
    global-config
  • 前端:
  • nextjs
    ->
    react-core
    ,
    react-nextjs
  • vite
    ->
    react-core
    ,
    react-vite
  • remix
    ->
    react-core
  • TypeScript:
  • yes
    ->
    typescript
  • UI:
  • tailwind
    ->
    tailwind
  • shadcn
    ->
    shadcn
    ,
    tailwind
  • mui
    ant-design
    ->
    design
  • 状态管理:
  • tanstack
    ->
    tanstack-query
  • zustand
    ->
    zustand
  • redux
    ->
    redux
  • 后端:
  • nestjs
    ->
    nestjs
    ,
    api-patterns
    ,
    security
  • express
    next-api
    hono
    ->
    api-patterns
    ,
    security
  • 表单:
  • 如果需要 ->
    forms
  • 测试:
  • 如果有测试计划 ->
    testing
  • 所有项目:
  • 始终包含
    git
    ,
    solid
    ,
    errors
    ,
    global-config

References

参考资料

  • For complete legacy question flow and examples:
    references/guide.md
  • 完整的历史问题流程及示例:
    references/guide.md