setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseLanguage 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:
- → pnpm
pnpm-lock.yaml - /
bun.lock→ bunbun.lockb - → yarn
yarn.lock - → npm
package-lock.json - No lockfile → ask the user
Use the detected package manager for all install commands. Replace in rule files with the detected manager.
<pm>按以下顺序检查锁文件:
- → pnpm
pnpm-lock.yaml - /
bun.lock→ bunbun.lockb - → yarn
yarn.lock - → npm
package-lock.json - 无锁文件 → 询问用户
使用检测到的包管理器执行所有安装命令。将规则文件中的 替换为检测到的包管理器。
<pm>2. Detect Existing Tooling
2. 检测已存在的工具
Before installing anything, scan for existing configurations:
- /
biome.json→ Biome already configuredbiome.jsonc - directory → Husky already configured
.husky/ - /
commitlint.config.*→ commitlint already configured.commitlintrc.* - /
.lintstagedrc*key inlint-staged→ lint-staged already configuredpackage.json - in
gitleaks→ GitLeaks already configured.husky/pre-commit - → TypeScript already configured
tsconfig.json - /
.eslintrc*→ ESLint present (suggest migration to Biome)eslint.config.* - /
.prettierrc*→ Prettier present (suggest migration to Biome)prettier.config.*
Skip tools that are already configured. Report what was skipped at the end.
在安装任何工具之前,扫描现有配置:
- /
biome.json→ Biome已配置biome.jsonc - 目录 → Husky已配置
.husky/ - /
commitlint.config.*→ commitlint已配置.commitlintrc.* - /
.lintstagedrc*中的package.json字段 → lint-staged已配置lint-staged - 中包含
.husky/pre-commit→ GitLeaks已配置gitleaks - → TypeScript已配置
tsconfig.json - /
.eslintrc*→ 已存在ESLint(建议迁移至Biome)eslint.config.* - /
.prettierrc*→ 已存在Prettier(建议迁移至Biome)prettier.config.*
跳过已配置的工具,在最后报告跳过的内容。
3. Install Tools
3. 安装工具
Read each rule file for detailed setup instructions and config files.
阅读每个规则文件获取详细的设置说明和配置文件。
Auto-install (always set up when missing)
自动安装(缺失时始终配置)
| Tool | Purpose | Rule |
|---|---|---|
| Biome | Linting + formatting | |
| Husky | Git hooks | |
| commitlint | Conventional commits | |
| lint-staged | Pre-commit linting | |
| GitLeaks | Secrets detection | |
| TypeScript | Type checking | |
| 工具 | 用途 | 规则 |
|---|---|---|
| Biome | 代码检查 + 格式化 | |
| Husky | Git钩子 | |
| commitlint | 约定式提交 | |
| lint-staged | 提交前代码检查 | |
| GitLeaks | 密钥检测 | |
| TypeScript | 类型检查 | |
Opt-in (only when explicitly requested)
可选安装(仅在明确请求时配置)
| Tool | Purpose | Rule |
|---|---|---|
| semantic-release | Automated versioning | |
| 工具 | 用途 | 规则 |
|---|---|---|
| semantic-release | 自动化版本管理 | |
4. Output Summary
4. 输出总结
After all tools are installed, display a summary:
undefined所有工具安装完成后,显示总结信息:
undefinedSetup Complete
配置完成
Installed
已安装
- [list of tools installed]
- [已安装的工具列表]
Skipped (already configured)
已跳过(已配置)
- [list of tools skipped with reason]
- [已跳过的工具及原因列表]
Next Steps
后续步骤
- Run to verify Biome is working
<pm> run check - Make a test commit to verify git hooks
undefined- 运行 验证Biome是否正常工作
<pm> run check - 创建测试提交以验证Git钩子
undefinedAssumptions
假设条件
- Project has a (JS/TS project)
package.json - GitLeaks is installed on the system (or equivalent)
brew install gitleaks - Git is initialised in the project
- 项目已包含 (JS/TS项目)
package.json - 系统已安装GitLeaks(使用 或其他等效方式)
brew install gitleaks - 项目已初始化Git