project-init-orchestrator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Project Init Orchestrator

项目初始化编排器

Overview

概述

This skill orchestrates multiple initialization skills to set up a complete, production-ready project environment. Instead of manually invoking each skill, this orchestrator coordinates them in the correct sequence with proper dependencies.
该技能通过协调多个初始化技能,搭建完整的、可用于生产环境的项目环境。无需手动调用每个技能,该编排器会按正确的顺序并考虑依赖关系来统筹执行它们。

When to Use This Skill

适用场景

This skill activates automatically when users:
  • Start a new project from scratch
  • Want full project setup with one command
  • Need AI-first development infrastructure + code quality tools
  • Say "initialize project", "set up new project", "bootstrap project"
  • Want consistent setup across multiple projects
当用户进行以下操作时,该技能会自动激活:
  • 从零开始启动新项目
  • 希望通过一条命令完成完整项目搭建
  • 需要AI优先的开发基础设施 + 代码质量工具
  • 说出"initialize project"、"set up new project"、"bootstrap project"等指令
  • 希望在多个项目中保持一致的搭建流程

Skills Orchestrated

被编排的技能

OrderSkillPurposeRequired
1
agent-folder-init
AI documentation & standardsYes
2
linter-formatter-init
ESLint + Prettier + pre-commitYes
3
husky-test-coverage
Test coverage enforcementOptional
4
project-scaffold
Backend/Frontend/Mobile scaffoldingOptional
顺序技能用途是否必需
1
agent-folder-init
AI文档与规范制定
2
linter-formatter-init
ESLint + Prettier + 提交前检查
3
husky-test-coverage
测试覆盖管控可选
4
project-scaffold
后端/前端/移动端脚手架搭建可选

Orchestration Flow

编排流程

┌─────────────────────────────────────────────────────────────┐
│              PROJECT INIT ORCHESTRATOR                       │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  PHASE 1: GATHER CONTEXT                                    │
│  • Project name and path                                    │
│  • Tech stack (Next.js, NestJS, Expo, Plasmo)              │
│  • Package manager preference (bun, pnpm, npm)             │
│  • Test coverage threshold (default: 80%)                  │
│  • Additional scaffolding needs                            │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  PHASE 2: AGENT FOLDER INIT                                 │
│  • Create .agents/ directory structure                       │
│  • Set up SESSIONS/, TASKS/, SYSTEM/ folders               │
│  • Generate coding standards and rules                      │
│  • Copy agent configs (.claude/, .codex/, .cursor/)        │
│  ──────────────────────────────────────────────────────────│
│  Invocation:                                                │
│  python3 ~/.claude/skills/agent-folder-init/               │
│          agent-folder-init/scripts/scaffold.py             │
│          --root /path/to/project                           │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  PHASE 3: LINTER FORMATTER INIT                             │
│  • Detect project tech stack                                │
│  • Install ESLint + Prettier (or Biome)                    │
│  • Configure framework-specific rules                       │
│  • Set up lint-staged for pre-commit                       │
│  • Create .vscode/settings.json                            │
│  ──────────────────────────────────────────────────────────│
│  Invocation:                                                │
│  Use linter-formatter-init skill guidance                   │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  PHASE 4: HUSKY TEST COVERAGE (if tests exist)             │
│  • Detect test runner (Jest, Vitest, Mocha)                │
│  • Configure coverage thresholds                            │
│  • Add pre-commit hook for test coverage                   │
│  ──────────────────────────────────────────────────────────│
│  Invocation:                                                │
│  Use husky-test-coverage skill guidance                     │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  PHASE 5: PROJECT SCAFFOLD (optional)                       │
│  • Scaffold additional components if requested:            │
│    - Backend (NestJS)                                       │
│    - Frontend (Next.js)                                     │
│    - Mobile (Expo)                                          │
│    - Extension (Plasmo)                                     │
│  ──────────────────────────────────────────────────────────│
│  Invocation:                                                │
│  python3 ~/.claude/skills/project-scaffold/                │
│          project-scaffold/scripts/scaffold.py              │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  PHASE 6: VERIFICATION                                      │
│  • Verify all configurations created                        │
│  • Run lint check (should pass)                            │
│  • Confirm git hooks installed                             │
│  • Generate setup summary                                   │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│              项目初始化编排器                               │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  阶段1:收集上下文信息                                      │
│  • 项目名称与路径                                          │
│  • 技术栈(Next.js、NestJS、Expo、Plasmo)                  │
│  • 包管理器偏好(bun、pnpm、npm)                           │
│  • 测试覆盖阈值(默认:80%)                                │
│  • 额外的脚手架需求                                        │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  阶段2:Agent文件夹初始化                                   │
│  • 创建.agents/目录结构                                     │
│  • 搭建SESSIONS/、TASKS/、SYSTEM/文件夹                     │
│  • 生成编码规范与规则                                      │
│  • 复制Agent配置文件(.claude/、.codex/、.cursor/)          │
│  ──────────────────────────────────────────────────────────│
│  调用方式:                                                │
│  python3 ~/.claude/skills/agent-folder-init/               │
│          agent-folder-init/scripts/scaffold.py             │
│          --root /path/to/project                           │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  阶段3:代码检查与格式化工具初始化                           │
│  • 检测项目技术栈                                          │
│  • 安装ESLint + Prettier(或Biome)                        │
│  • 配置框架专属规则                                       │
│  • 搭建lint-staged用于提交前检查                           │
│  • 创建.vscode/settings.json                                │
│  ──────────────────────────────────────────────────────────│
│  调用方式:                                                │
│  遵循linter-formatter-init技能指引                         │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  阶段4:Husky测试覆盖(若存在测试)                         │
│  • 检测测试运行器(Jest、Vitest、Mocha)                    │
│  • 配置覆盖阈值                                            │
│  • 添加测试覆盖的提交前钩子                                 │
│  ──────────────────────────────────────────────────────────│
│  调用方式:                                                │
│  遵循husky-test-coverage技能指引                           │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  阶段5:项目脚手架搭建(可选)                             │
│  • 若有需求,搭建额外组件:                                │
│    - 后端(NestJS)                                       │
│    - 前端(Next.js)                                     │
│    - 移动端(Expo)                                        │
│    - 浏览器扩展(Plasmo)                                 │
│  ──────────────────────────────────────────────────────────│
│  调用方式:                                                │
│  python3 ~/.claude/skills/project-scaffold/                │
│          project-scaffold/scripts/scaffold.py              │
└─────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────┐
│  阶段6:验证环节                                          │
│  • 验证所有配置文件已创建                                  │
│  • 运行代码检查(应通过)                                  │
│  • 确认Git钩子已安装                                       │
│  • 生成搭建总结                                           │
└─────────────────────────────────────────────────────────────┘

Usage

使用方法

Quick Start (Recommended)

快速开始(推荐)

When user says "initialize my project" or "set up new project":
1. Ask for project context:
   - Project path (default: current directory)
   - Tech stack (Next.js, NestJS, Node.js, etc.)
   - Package manager (bun, pnpm, npm)
   - Test coverage threshold (default: 80%)
   - Need additional scaffolding? (backend, frontend, mobile, extension)

2. Execute phases in order:
   Phase 2 → Phase 3 → Phase 4 → Phase 5 (if needed) → Phase 6
当用户说出"initialize my project"或"set up new project"时:
1. 询问项目上下文信息:
   - 项目路径(默认:当前目录)
   - 技术栈(Next.js、NestJS、Node.js等)
   - 包管理器(bun、pnpm、npm)
   - 测试覆盖阈值(默认:80%)
   - 是否需要额外脚手架?(后端、前端、移动端、浏览器扩展)

2. 按顺序执行各阶段:
   阶段2 → 阶段3 → 阶段4 → 阶段5(若需要)→ 阶段6

Manual Orchestration

手动编排

If you need to run phases individually:
Phase 2: Agent Folder Init
bash
python3 ~/.claude/skills/agent-folder-init/agent-folder-init/scripts/scaffold.py --root /path/to/project
Phase 3: Linter Formatter Follow the
linter-formatter-init
skill to:
  • Install dependencies based on detected stack
  • Configure ESLint rules
  • Set up Prettier
  • Configure lint-staged
Phase 4: Test Coverage Follow the
husky-test-coverage
skill to:
  • Detect test runner
  • Configure coverage thresholds
  • Add pre-commit hook
Phase 5: Project Scaffold (optional)
bash
python3 ~/.claude/skills/project-scaffold/project-scaffold/scripts/scaffold.py
如果需要单独运行各阶段:
阶段2:Agent文件夹初始化
bash
python3 ~/.claude/skills/agent-folder-init/agent-folder-init/scripts/scaffold.py --root /path/to/project
阶段3:代码检查与格式化工具 遵循
linter-formatter-init
技能指引完成:
  • 根据检测到的技术栈安装依赖
  • 配置ESLint规则
  • 搭建Prettier
  • 配置lint-staged
阶段4:测试覆盖 遵循
husky-test-coverage
技能指引完成:
  • 检测测试运行器
  • 配置覆盖阈值
  • 添加提交前钩子
阶段5:项目脚手架搭建(可选)
bash
python3 ~/.claude/skills/project-scaffold/project-scaffold/scripts/scaffold.py

Configuration Presets

配置预设

Minimal (AI docs + linting)

极简版(AI文档 + 代码检查)

Phases: 2, 3
Output:
├── .agents/
├── .eslintrc.js
├── .prettierrc
├── .husky/pre-commit (lint-staged)
└── .vscode/settings.json
执行阶段:2、3
输出结构:
├── .agents/
├── .eslintrc.js
├── .prettierrc
├── .husky/pre-commit(lint-staged)
└── .vscode/settings.json

Standard (+ test coverage)

标准版(+测试覆盖)

Phases: 2, 3, 4
Output:
├── .agents/
├── .eslintrc.js
├── .prettierrc
├── .husky/pre-commit (lint-staged + tests)
├── jest.config.js (coverage thresholds)
└── .vscode/settings.json
执行阶段:2、3、4
输出结构:
├── .agents/
├── .eslintrc.js
├── .prettierrc
├── .husky/pre-commit(lint-staged + 测试)
├── jest.config.js(覆盖阈值)
└── .vscode/settings.json

Full Stack (+ scaffolding)

全栈版(+脚手架)

Phases: 2, 3, 4, 5
Output:
├── .agents/
├── apps/
│   ├── web/          (Next.js)
│   ├── api/          (NestJS)
│   ├── mobile/       (Expo)
│   └── extension/    (Plasmo)
├── packages/
│   └── shared/
├── .eslintrc.js
├── .prettierrc
├── .husky/pre-commit
└── .vscode/settings.json
执行阶段:2、3、4、5
输出结构:
├── .agents/
├── apps/
│   ├── web/          (Next.js)
│   ├── api/          (NestJS)
│   ├── mobile/       (Expo)
│   └── extension/    (Plasmo)
├── packages/
│   └── shared/
├── .eslintrc.js
├── .prettierrc
├── .husky/pre-commit
└── .vscode/settings.json

Generated Structure

生成的项目结构

After full orchestration, your project will have:
project-root/
├── .agents/                          # AI-first documentation
│   ├── SESSIONS/                    # Daily session logs
│   ├── TASKS/                       # Task tracking
│   │   └── INBOX.md
│   ├── SYSTEM/                      # Architecture docs
│   │   ├── ARCHITECTURE.md
│   │   └── RULES.md
│   └── README.md
├── .claude/                         # Claude Code configs
│   ├── commands/
│   ├── rules/
│   └── skills/
├── .husky/                          # Git hooks
│   └── pre-commit                   # Runs lint-staged + tests
├── .vscode/                         # Editor settings
│   └── settings.json                # Format on save
├── .eslintrc.js                     # ESLint configuration
├── .prettierrc                      # Prettier configuration
├── .lintstagedrc                    # Lint-staged configuration
└── [app directories if scaffolded]
完成完整编排后,你的项目将包含以下结构:
project-root/
├── .agents/                          # AI优先的文档目录
│   ├── SESSIONS/                    # 日常会话日志
│   ├── TASKS/                       # 任务追踪
│   │   └── INBOX.md
│   ├── SYSTEM/                      # 架构文档
│   │   ├── ARCHITECTURE.md
│   │   └── RULES.md
│   └── README.md
├── .claude/                         # Claude Code配置目录
│   ├── commands/
│   ├── rules/
│   └── skills/
├── .husky/                          # Git钩子目录
│   └── pre-commit                   # 执行lint-staged + 测试
├── .vscode/                         # 编辑器设置
│   └── settings.json                # 保存时自动格式化
├── .eslintrc.js                     # ESLint配置文件
├── .prettierrc                      # Prettier配置文件
├── .lintstagedrc                    # Lint-staged配置文件
└── [若搭建脚手架则包含应用目录]

Best Practices

最佳实践

Sequencing

执行顺序

  • Always run agent-folder-init FIRST (establishes standards)
  • Run linter-formatter-init BEFORE husky-test-coverage (both use Husky)
  • Run project-scaffold LAST (depends on base setup)
  • 始终优先运行agent-folder-init(建立基础规范)
  • 在husky-test-coverage之前运行linter-formatter-init(两者均依赖Husky)
  • 最后运行project-scaffold(依赖基础环境配置)

Customization

自定义配置

  • Each phase can be skipped if already configured
  • Phases are idempotent (safe to re-run)
  • Configuration can be customized after orchestration
  • 若已完成对应配置,可跳过任意阶段
  • 各阶段具备幂等性(重复运行安全)
  • 编排完成后可自行修改配置

Verification Checklist

验证清单

After orchestration, verify:
  • .agents/
    folder exists with proper structure
  • npm run lint
    or
    bun lint
    works
  • npm run format
    or
    bun format
    works
  • Git commit triggers pre-commit hooks
  • Tests run on commit (if Phase 4 enabled)
编排完成后,请验证以下内容:
  • .agents/
    目录已存在且结构正确
  • npm run lint
    bun lint
    可正常运行
  • npm run format
    bun format
    可正常运行
  • Git提交会触发提交前钩子
  • 提交时会自动运行测试(若启用阶段4)

Example Interaction

交互示例

User: "Set up my new project at ~/projects/my-saas"
Orchestrator Response:
I'll initialize your project with full AI-first infrastructure.

Let me gather some context:
1. Tech stack: [Next.js / NestJS / Node.js / Other]
2. Package manager: [bun / pnpm / npm]
3. Test coverage threshold: [80% default]
4. Need scaffolding? [backend / frontend / mobile / extension]

[After user responds]

Starting orchestration...

✓ Phase 2: Agent Folder Init
  - Created .agents/ with 13 files
  - Copied agent configs (.claude/, .codex/, .cursor/)

✓ Phase 3: Linter Formatter Init
  - Detected: Next.js + TypeScript
  - Installed: eslint, prettier, lint-staged
  - Created: .eslintrc.js, .prettierrc, .lintstagedrc

✓ Phase 4: Husky Test Coverage
  - Detected: Jest
  - Set threshold: 80%
  - Added pre-commit hook

✓ Phase 6: Verification
  - All configs created ✓
  - Lint check passed ✓
  - Git hooks installed ✓

Project initialized successfully!
用户: "在~/projects/my-saas路径下搭建我的新项目"
编排器响应:
我将为你初始化具备全AI优先开发基础设施的项目。

请提供以下上下文信息:
1. 技术栈:[Next.js / NestJS / Node.js / 其他]
2. 包管理器:[bun / pnpm / npm]
3. 测试覆盖阈值:[默认80%]
4. 是否需要脚手架?[后端 / 前端 / 移动端 / 浏览器扩展]

[用户回复后]

开始编排...

✓ 阶段2:Agent文件夹初始化
  - 创建了包含13个文件的.agents/目录
  - 复制了Agent配置文件(.claude/、.codex/、.cursor/)

✓ 阶段3:代码检查与格式化工具初始化
  - 检测到:Next.js + TypeScript
  - 已安装:eslint、prettier、lint-staged
  - 已创建:.eslintrc.js、.prettierrc、.lintstagedrc

✓ 阶段4:Husky测试覆盖
  - 检测到:Jest
  - 设置阈值:80%
  - 已添加提交前钩子

✓ 阶段6:验证环节
  - 所有配置文件已创建 ✓
  - 代码检查通过 ✓
  - Git钩子已安装 ✓

项目初始化成功!

Troubleshooting

故障排查

Phase fails to complete

阶段执行失败

  • Check if dependencies are installed (
    node
    ,
    python3
    )
  • Verify write permissions to project directory
  • Check if conflicting configs exist
  • 检查是否已安装依赖(
    node
    python3
  • 验证对项目目录的写入权限
  • 检查是否存在冲突的配置文件

Linting errors after setup

搭建后出现代码检查错误

  • Run
    npm run lint:fix
    to auto-fix
  • Check
    .eslintrc.js
    matches your stack
  • Verify TypeScript config if using TS
  • 运行
    npm run lint:fix
    自动修复问题
  • 检查
    .eslintrc.js
    是否匹配你的技术栈
  • 若使用TypeScript,验证TypeScript配置

Pre-commit hook not running

提交前钩子未运行

  • Run
    npx husky install
    manually
  • Check
    .husky/pre-commit
    exists and is executable
  • Verify
    prepare
    script in package.json
  • 手动运行
    npx husky install
  • 检查
    .husky/pre-commit
    文件是否存在且可执行
  • 验证package.json中的
    prepare
    脚本