init-project
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese<objective>
Bootstrap a fully configured project from an empty or existing directory. Detect what already
exists (git, package.json, framework, GSD, skills) and only install what's missing. Ask the
user to configure MCP integrations. End with a clean initial commit and clear next step.
</objective>
<context>
Input: $ARGUMENTS — optional project name or framework override (e.g., "my-app", "vite", "remix")
Defaults: Next.js with TypeScript, Tailwind, App Router, src-dir, bun
Requires: bun installed, git installed
</context>
<process>
<objective>
从空目录或现有目录启动一个完成全配置的项目。检测已存在的内容(git、package.json、框架、GSD、skills),仅安装缺失的部分。引导用户配置MCP集成。最终生成干净的初始提交,并给出清晰的下一步操作指引。
</objective>
<context>
输入:$ARGUMENTS — 可选的项目名称或框架覆盖参数(例如:"my-app"、"vite"、"remix")
默认配置:Next.js + TypeScript、Tailwind、App Router、src-dir、bun
依赖要求:已安装bun、已安装git
</context>
<process>
0. Detect Existing State
0. 检测现有状态
Before installing anything, audit what already exists:
Checks:
[ ] git repo initialized?
[ ] package.json exists?
[ ] Framework detected? (next, vite, remix, nuxt, etc.)
[ ] .gitignore exists?
[ ] GSD installed? (.claude/commands/gsd/ or .planning/)
[ ] Skills installed? (.claude/skills/)
[ ] CLAUDE.md exists?
[ ] .claude/settings.json exists?
[ ] .claude/commands/product/ exists?
[ ] .linear-project exists?Print a brief status:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PRODUCT ► INIT PROJECT
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Detected:
✓ Git repo
✓ package.json (Next.js 15)
○ No GSD framework
○ No skills
○ No CLAUDE.md
○ No project settings
○ No .linear-project
Will install: GSD, skills, CLAUDE.md, settings, commandsIF everything is already set up: "Project is already fully initialized. Run or to get started."
/gsd:new-project/product:sync安装任何内容前,先审计当前已存在的内容:
检查项:
[ ] git仓库已初始化?
[ ] package.json已存在?
[ ] 已检测到框架?(next、vite、remix、nuxt等)
[ ] .gitignore已存在?
[ ] GSD已安装?(.claude/commands/gsd/ 或 .planning/)
[ ] Skills已安装?(.claude/skills/)
[ ] CLAUDE.md已存在?
[ ] .claude/settings.json已存在?
[ ] .claude/commands/product/ 已存在?
[ ] .linear-project已存在?打印简要状态:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
产品 ► 初始化项目
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
检测到:
✓ Git仓库
✓ package.json (Next.js 15)
○ 未安装GSD框架
○ 未安装Skills
○ 无CLAUDE.md
○ 无项目配置
○ 无.linear-project
即将安装:GSD、skills、CLAUDE.md、配置、命令集如果所有配置都已完成:输出「项目已完成全部初始化。运行 或 开始使用。」
/gsd:new-project/product:sync1. Git & Framework
1. Git与框架配置
Git:
- IF no git repo →
git init - IF git repo exists → skip
Framework:
- IF package.json exists → detect framework, skip scaffolding
- IF no package.json AND no argument → scaffold Next.js:
bunx create-next-app@latest . --ts --tailwind --eslint --app --src-dir --import-alias "@/*" --use-bun - IF argument specifies a different framework → use that instead
- Recognized: "vite", "remix", "nuxt", "astro", "svelte"
- For unrecognized: ask "How should I scaffold this? Give me the init command."
.gitignore:
- IF .gitignore missing → create with standard entries: node_modules/, .env, .env.*, !.env.example, .DS_Store, *.log, dist/, build/, .next/, .nuxt/, .output/, .vercel/, coverage/, .planning/quick/
- IF .gitignore exists → check if it covers the essentials, append missing entries
Git:
- 无git仓库 → 执行
git init - 已存在git仓库 → 跳过
框架:
- 已存在package.json → 检测框架,跳过脚手架搭建
- 无package.json且未传入参数 → 搭建Next.js项目:
bunx create-next-app@latest . --ts --tailwind --eslint --app --src-dir --import-alias "@/*" --use-bun - 传入参数指定了其他框架 → 使用指定框架
- 已识别框架:"vite"、"remix"、"nuxt"、"astro"、"svelte"
- 未识别框架:询问用户「该如何搭建项目?请提供初始化命令。」
.gitignore:
- 缺少.gitignore → 创建并添加通用忽略规则: node_modules/, .env, .env.*, !.env.example, .DS_Store, *.log, dist/, build/, .next/, .nuxt/, .output/, .vercel/, coverage/, .planning/quick/
- 已存在.gitignore → 检查是否覆盖核心规则,补充缺失的条目
2. MCP Integrations
2. MCP集成配置
Ask which MCP integrations to enable for this project:
"Which integrations do you need for this project?"
Options (multi-select):
- Linear (issue tracking) — recommended for all projects
- Pencil (design tool for .pen files)
- Slack (team messaging)
- Gmail (email)
- Google Calendar (scheduling)
- Discord Status (presence updates)
- None
Create or update with only the selected MCPs in :
.claude/settings.jsonpermissions.allowjson
{
"permissions": {
"allow": ["mcp__claude_ai_Linear__*"]
}
}IF settings.json already exists → merge into it, don't overwrite other settings.
询问用户需要为项目启用哪些MCP集成:
「您当前项目需要哪些集成?」
选项(可多选):
- Linear(问题跟踪)—— 推荐所有项目使用
- Pencil(.pen文件设计工具)
- Slack(团队通讯)
- Gmail(邮件)
- Google Calendar(日程安排)
- Discord Status(状态同步)
- 不需要
创建或更新,仅将选中的MCP添加到中:
.claude/settings.jsonpermissions.allowjson
{
"permissions": {
"allow": ["mcp__claude_ai_Linear__*"]
}
}如果已存在settings.json → 合并配置,不要覆盖其他设置
3. Link Linear Project
3. 关联Linear项目
- IF exists → skip (show linked project name)
.linear-project - ELSE:
- Read project name from name field or directory name
package.json - Run and fuzzy-match against the project name
linear project list - IF match found → confirm with user: "Link this repo to Linear project '{name}'?"
- Yes →
echo "{name}" > .linear-project - No → show all available projects, let user pick
- Yes →
- IF no match → ask:
"No matching Linear project found. What would you like to do?"
- Select from existing projects ()
linear project list - Create a new project ()
linear project create "{name}" - Skip — don't link a Linear project
- Select from existing projects (
- IF skipped → continue without
.linear-project
- Read project name from
- 已存在→ 跳过(展示已关联的项目名称)
.linear-project - 否则:
- 从的name字段或目录名称读取项目名
package.json - 执行,与项目名进行模糊匹配
linear project list - 匹配到结果 → 询问用户:「将当前仓库关联到Linear项目「{name}」吗?」
- 是 → 执行
echo "{name}" > .linear-project - 否 → 展示所有可用项目,供用户选择
- 是 → 执行
- 未匹配到结果 → 询问:
「未找到匹配的Linear项目,您希望如何操作?」
- 从现有项目中选择(执行)
linear project list - 创建新项目(执行)
linear project create "{name}" - 跳过,不关联Linear项目
- 从现有项目中选择(执行
- 选择跳过 → 不创建,继续后续流程
.linear-project
- 从
4. Install GSD Framework
4. 安装GSD框架
- IF GSD already installed (exists) → skip
.claude/commands/gsd/ - ELSE →
bunx get-shit-done-cc@latest --claude --local
- 已安装GSD(存在) → 跳过
.claude/commands/gsd/ - 否则 → 执行
bunx get-shit-done-cc@latest --claude --local
5. Install Skills
5. 安装Skills
Check each skill individually and only install missing ones:
Skills to check:
web-design-guidelines → ~/.claude/skills/web-design-guidelines or .claude/skills/
agent-browser → same pattern
seo-audit → same pattern
copywriting → same pattern
gsap-react → same pattern
linear-cli → same patternFor each missing skill, run:
bunx skills add $REPO --skill $NAME --localSkip any that are already installed (global or local).
逐个检查每个skill,仅安装缺失的部分:
待检查的Skills:
web-design-guidelines → ~/.claude/skills/web-design-guidelines 或 .claude/skills/
agent-browser → 同上路径规则
seo-audit → 同上路径规则
copywriting → 同上路径规则
gsap-react → 同上路径规则
linear-cli → 同上路径规则每个缺失的skill执行:
bunx skills add $REPO --skill $NAME --local跳过已安装的skill(全局或本地安装都算)
6. Create CLAUDE.md
6. 创建CLAUDE.md
- IF CLAUDE.md exists → ask "CLAUDE.md already exists. Update it with workflow rules, or leave it?"
- IF no CLAUDE.md → create it:
Infer project name from: argument, directory name, or package.json name field.
Structure:
markdown
undefined- 已存在CLAUDE.md → 询问用户「CLAUDE.md已存在,是否要更新工作流规则,还是保留现有内容?」
- 无CLAUDE.md → 创建该文件:
从参数、目录名称或package.json的name字段推断项目名称
文件结构:
markdown
undefined{project-name}
{project-name}
Linear Integration
Linear集成
- Use linear-cli skill for all issue management
- Check Linear before starting tasks, update issues after completing work
- Reference issue IDs in commits:
feat(ENG-123): description
- 所有问题管理使用linear-cli skill
- 开始任务前检查Linear,完成工作后更新issue状态
- 提交信息中关联issue ID:
feat(ENG-123): description
GSD Framework
GSD框架
- Follow workflow: discuss → plan → execute → verify
- Keep .planning/ updated
- Use atomic commits per task
- Run to check state
/gsd:progress
- 遵循工作流:讨论 → 规划 → 执行 → 验证
- 保持.planning/目录内容更新
- 每个任务使用原子提交
- 运行检查当前状态
/gsd:progress
Skills Available
可用Skills
- linear-cli, web-design-guidelines, agent-browser
- seo-audit, copywriting, gsap-react
- linear-cli, web-design-guidelines, agent-browser
- seo-audit, copywriting, gsap-react
Conventions
规范
- Conventional commits: feat, fix, docs, chore, refactor, test
- Always reference Linear issue IDs
- Run after milestones
/product:sync
undefined- 约定式提交:feat、fix、docs、chore、refactor、test
- 始终关联Linear issue ID
- 里程碑完成后运行
/product:sync
undefined7. Copy Slash Commands
7. 复制斜杠命令
- IF .claude/commands/product/ already has files → skip
- ELSE → copy from ~/.claude/commands/product/ into .claude/commands/product/
- .claude/commands/product/ 已存在文件 → 跳过
- 否则 → 从~/.claude/commands/product/ 复制内容到 .claude/commands/product/
8. Initial Commit
8. 初始提交
git add -Agit commit -m "chore: scaffold project with GSD + skills + linear-cli"- IF nothing to commit (all clean) → skip
- 执行
git add -A - 执行
git commit -m "chore: scaffold project with GSD + skills + linear-cli" - 无内容可提交(工作区干净) → 跳过
9. Summary & Next Step
9. 总结与下一步操作
Print what was set up:
Setup complete:
✓ Next.js 15 with TypeScript + Tailwind
✓ GSD framework (v1.22.0)
✓ 6 skills installed
✓ Linear + Slack MCPs enabled
✓ CLAUDE.md with workflow rules
✓ Linked to Linear project: {project-name}
✓ /product: commands available
✓ Initial commit created
Next: run /gsd:new-project to define your roadmap<success_criteria>
- Existing state detected — nothing overwritten or duplicated
- Framework scaffolded (or skipped if exists)
- MCP integrations configured per user choice
- GSD and skills installed (only what's missing)
- CLAUDE.md exists with workflow rules
- .linear-project created (or explicitly skipped)
- Slash commands available as /product:*
- Clean initial commit
- User knows the next step </success_criteria>
打印已完成的配置:
设置完成:
✓ Next.js 15 + TypeScript + Tailwind
✓ GSD框架 (v1.22.0)
✓ 已安装6个Skills
✓ 已启用Linear + Slack MCP
✓ 已生成带工作流规则的CLAUDE.md
✓ 已关联Linear项目:{project-name}
✓ 可用/product: 系列命令
✓ 已生成初始提交
下一步:运行/gsd:new-project定义项目路线图<success_criteria>
- 已检测现有状态 — 无内容被覆盖或重复安装
- 已搭建框架(或已存在则跳过)
- 已按用户选择配置MCP集成
- 已安装GSD和Skills(仅安装缺失部分)
- 已生成带工作流规则的CLAUDE.md
- 已创建.linear-project(或用户明确跳过)
- 可使用/product:* 系列斜杠命令
- 已生成干净的初始提交
- 用户明确知晓下一步操作 </success_criteria>