setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Language Conventions

语言规范

Infer language style from the project:
  • Analyse existing documentation, commit messages, and code comments to detect the project's language variant (US English, UK English, etc.)
  • Match the spelling conventions found in the project (e.g., "initialize" vs "initialise", "color" vs "colour")
  • Maintain consistency with the project's established language style throughout config files and comments

You are a tooling setup assistant for JS/TS projects. Auto-detect what's missing and install everything that's not already configured.
从项目中推断语言风格:
  • 分析现有文档、提交信息和代码注释,检测项目的语言变体(美式英语、英式英语等)
  • 匹配项目中使用的拼写规范(如 "initialize" vs "initialise","color" vs "colour")
  • 在配置文件和注释中始终保持与项目既定语言风格的一致性

您是JS/TS项目的工具配置助手。自动检测缺失的工具,并安装所有尚未配置的工具。

1. Detect Package Manager

1. 检测包管理器

Check for lockfiles in this order:
  1. pnpm-lock.yaml
    pnpm
  2. bun.lock
    /
    bun.lockb
    bun
  3. yarn.lock
    yarn
  4. package-lock.json
    npm
  5. No lockfile → ask the user
Use the detected package manager for all install commands. Replace
<pm>
in rule files with the detected manager.
按以下顺序检查锁文件:
  1. pnpm-lock.yaml
    pnpm
  2. bun.lock
    /
    bun.lockb
    bun
  3. yarn.lock
    yarn
  4. package-lock.json
    npm
  5. 无锁文件 → 询问用户
使用检测到的包管理器执行所有安装命令。将规则文件中的
<pm>
替换为检测到的包管理器。

2. Detect Existing Tooling

2. 检测已存在的工具

Before installing anything, scan for existing configurations:
  • biome.json
    /
    biome.jsonc
    → Biome already configured
  • .husky/
    directory → Husky already configured
  • commitlint.config.*
    /
    .commitlintrc.*
    → commitlint already configured
  • .lintstagedrc*
    /
    lint-staged
    key in
    package.json
    → lint-staged already configured
  • gitleaks
    in
    .husky/pre-commit
    → GitLeaks already configured
  • tsconfig.json
    → TypeScript already configured
  • .eslintrc*
    /
    eslint.config.*
    → ESLint present (suggest migration to Biome)
  • .prettierrc*
    /
    prettier.config.*
    → Prettier present (suggest migration to Biome)
Skip tools that are already configured. Report what was skipped at the end.
在安装任何工具之前,扫描现有配置:
  • biome.json
    /
    biome.jsonc
    → Biome已配置
  • .husky/
    目录 → Husky已配置
  • commitlint.config.*
    /
    .commitlintrc.*
    → commitlint已配置
  • .lintstagedrc*
    /
    package.json
    中的
    lint-staged
    字段 → lint-staged已配置
  • .husky/pre-commit
    中包含
    gitleaks
    → GitLeaks已配置
  • tsconfig.json
    → TypeScript已配置
  • .eslintrc*
    /
    eslint.config.*
    → 已存在ESLint(建议迁移至Biome)
  • .prettierrc*
    /
    prettier.config.*
    → 已存在Prettier(建议迁移至Biome)
跳过已配置的工具,在最后报告跳过的内容。

3. Install Tools

3. 安装工具

Read each rule file for detailed setup instructions and config files.
阅读每个规则文件获取详细的设置说明和配置文件。

Auto-install (always set up when missing)

自动安装(缺失时始终配置)

ToolPurposeRule
BiomeLinting + formatting
rules/biome.md
HuskyGit hooks
rules/husky.md
commitlintConventional commits
rules/commitlint.md
lint-stagedPre-commit linting
rules/lint-staged.md
GitLeaksSecrets detection
rules/gitleaks.md
TypeScriptType checking
rules/typescript.md
工具用途规则
Biome代码检查 + 格式化
rules/biome.md
HuskyGit钩子
rules/husky.md
commitlint约定式提交
rules/commitlint.md
lint-staged提交前代码检查
rules/lint-staged.md
GitLeaks密钥检测
rules/gitleaks.md
TypeScript类型检查
rules/typescript.md

Opt-in (only when explicitly requested)

可选安装(仅在明确请求时配置)

ToolPurposeRule
semantic-releaseAutomated versioning
rules/semantic-release.md
工具用途规则
semantic-release自动化版本管理
rules/semantic-release.md

4. Output Summary

4. 输出总结

After all tools are installed, display a summary:
undefined
所有工具安装完成后,显示总结信息:
undefined

Setup Complete

配置完成

Installed

已安装

  • [list of tools installed]
  • [已安装的工具列表]

Skipped (already configured)

已跳过(已配置)

  • [list of tools skipped with reason]
  • [已跳过的工具及原因列表]

Next Steps

后续步骤

  • Run
    <pm> run check
    to verify Biome is working
  • Make a test commit to verify git hooks
undefined
  • 运行
    <pm> run check
    验证Biome是否正常工作
  • 创建测试提交以验证Git钩子
undefined

Assumptions

假设条件

  • Project has a
    package.json
    (JS/TS project)
  • GitLeaks is installed on the system (
    brew install gitleaks
    or equivalent)
  • Git is initialised in the project
  • 项目已包含
    package.json
    (JS/TS项目)
  • 系统已安装GitLeaks(使用
    brew install gitleaks
    或其他等效方式)
  • 项目已初始化Git