code-standards
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCode Standards — Universal AI Tool Configuration Generator
代码标准 — 通用AI工具配置生成器
Generate code standards files based on Linus Torvalds' "Good Taste" philosophy. Auto-detects AI tools in your project and creates the appropriate configuration files in the user's language.
基于Linus Torvalds的“良好品味”理念生成代码标准文件。自动检测项目中的AI工具,并以用户使用的语言创建相应的配置文件。
When to Use
使用场景
- User wants to set up coding standards for a project
- User wants to sync code quality rules across AI coding tools
- User mentions "code standards", "init claude md", "code review", or equivalent in any language
- 用户想要为项目设置代码标准
- 用户想要在AI编码工具间同步代码质量规则
- 用户提及“代码标准”、“初始化claude md”、“代码审查”或其他语言中的等效表述
Instructions for Agent
Agent操作说明
Step 1: Detect Language & Read Template
步骤1:检测语言并读取模板
Detect the user's language. Read the matching template from this skill's directory:
references/- Simplified Chinese →
references/code-standards-zh-CN.md - Traditional Chinese →
references/code-standards-zh-TW.md - Japanese →
references/code-standards-ja.md - All other languages →
references/code-standards-en.md
检测用户使用的语言,从本技能的目录中读取匹配的模板:
references/- 简体中文 →
references/code-standards-zh-CN.md - 繁体中文 →
references/code-standards-zh-TW.md - 日语 →
references/code-standards-ja.md - 其他所有语言 →
references/code-standards-en.md
Step 2: Detect AI Tools
步骤2:检测AI工具
bash
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
[ -d "$PROJECT_ROOT/.cursor" ] && echo "CURSOR"
[ -f "$PROJECT_ROOT/AGENTS.md" ] || [ -d "$PROJECT_ROOT/.codex" ] && echo "CODEX"
[ -f "$PROJECT_ROOT/GEMINI.md" ] || [ -d "$PROJECT_ROOT/.gemini" ] && echo "GEMINI"
[ -d "$PROJECT_ROOT/.github" ] && echo "COPILOT"
[ -d "$PROJECT_ROOT/.windsurf" ] || [ -f "$PROJECT_ROOT/.windsurfrules" ] && echo "WINDSURF"
[ -f "$PROJECT_ROOT/.aider.conf.yml" ] && echo "AIDER"
[ -d "$PROJECT_ROOT/.clinerules" ] || [ -d "$PROJECT_ROOT/.roo" ] && echo "CLINE"bash
PROJECT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
[ -d "$PROJECT_ROOT/.cursor" ] && echo "CURSOR"
[ -f "$PROJECT_ROOT/AGENTS.md" ] || [ -d "$PROJECT_ROOT/.codex" ] && echo "CODEX"
[ -f "$PROJECT_ROOT/GEMINI.md" ] || [ -d "$PROJECT_ROOT/.gemini" ] && echo "GEMINI"
[ -d "$PROJECT_ROOT/.github" ] && echo "COPILOT"
[ -d "$PROJECT_ROOT/.windsurf" ] || [ -f "$PROJECT_ROOT/.windsurfrules" ] && echo "WINDSURF"
[ -f "$PROJECT_ROOT/.aider.conf.yml" ] && echo "AIDER"
[ -d "$PROJECT_ROOT/.clinerules" ] || [ -d "$PROJECT_ROOT/.roo" ] && echo "CLINE"Step 3: Generate Files
步骤3:生成文件
Write the template content directly. No confirmation needed — the user invoked this skill, that IS the intent.
Always generate:
CLAUDE.mdFor each detected tool, also generate:
| Tool | File | Notes |
|---|---|---|
| Cursor | | Prepend |
| Codex | | Same content |
| Gemini | | Same content |
| Copilot | | |
| Windsurf | | Same content |
| Aider | | Same content |
| Cline/Roo | | |
直接写入模板内容,无需确认——用户调用本技能即明确表达了此需求。
必须生成:
CLAUDE.md针对每个检测到的工具,额外生成:
| 工具 | 文件 | 说明 |
|---|---|---|
| Cursor | | 开头添加 |
| Codex | | 内容一致 |
| Gemini | | 内容一致 |
| Copilot | | 先执行 |
| Windsurf | | 内容一致 |
| Aider | | 内容一致 |
| Cline/Roo | | 先执行 |
Step 4: Report
步骤4:反馈结果
Report created files in the user's language. Keep it brief.
用用户的语言反馈已创建的文件,保持简洁。
Response Guidelines
响应准则
- Execute immediately — No confirmation, no "shall I proceed?". Just write.
- Unconditionally overwrite existing files — Always overwrite CLAUDE.md and other config files without asking. The invocation is explicit intent to replace.
- Respond in user's language — Match the language they used to invoke.
- No extra commentary — Detect, write, report. Done.
- 立即执行——无需确认,不要问“是否继续?”,直接写入文件。
- 无条件覆盖现有文件——始终覆盖CLAUDE.md及其他配置文件,无需询问。用户调用本技能即明确表示要替换现有文件。
- 使用用户的语言响应——与用户调用技能时使用的语言保持一致。
- 无额外注释——检测、写入、反馈,完成即可。
Error Handling
错误处理
| Situation | Action |
|---|---|
| Not in a git repo | Use current directory as root |
| No tools detected | Only generate |
| Permission denied | Report error with path |
| Template not found | Fall back to English |
| 场景 | 操作 |
|---|---|
| 不在git仓库中 | 将当前目录作为根目录 |
| 未检测到任何工具 | 仅生成 |
| 权限不足 | 反馈包含路径的错误信息 |
| 未找到模板 | 回退到英文模板 |