Loading...
Loading...
Compare original and translation side by side
.ai-reviewer/rules/.ai-reviewer/rules/mkdir -p .ai-reviewer/{rules,hooks}
cp <skill-path>/assets/config.yaml .ai-reviewer/
cp <skill-path>/assets/rules/*.md .ai-reviewer/rules/
cp <skill-path>/assets/hooks/*.template .ai-reviewer/hooks/python3 <skill-path>/scripts/install_hook.py install --hook-type pre-commit.ai-reviewer/config.yamlai_backend: claude-apiclaude_api_keyai_backend: claude-cli# Stage some changes
git add .
# Run review manually to test
python3 <skill-path>/scripts/run_review.py --project-root .
# If review passes, commit will proceed normally
git commit -m "test commit"git commit --no-verify -m "message"mkdir -p .ai-reviewer/{rules,hooks}
cp <skill-path>/assets/config.yaml .ai-reviewer/
cp <skill-path>/assets/rules/*.md .ai-reviewer/rules/
cp <skill-path>/assets/hooks/*.template .ai-reviewer/hooks/python3 <skill-path>/scripts/install_hook.py install --hook-type pre-commit.ai-reviewer/config.yamlai_backend: claude-apiclaude_api_keyai_backend: claude-cli# 暂存一些变更
git add .
# 手动运行审查进行测试
python3 <skill-path>/scripts/run_review.py --project-root .
# 若审查通过,提交将正常进行
git commit -m "test commit"git commit --no-verify -m "message"User wants to:
│
├─ "Set up AI code review"
│ └─ Go to Initial Setup
│
├─ "Add review rules"
│ └─ Go to Creating Rules
│
├─ "Configure review behavior"
│ └─ Go to Configuration
│
├─ "Install/uninstall hooks"
│ └─ Go to Managing Git Hooks
│
├─ "Debug review issues"
│ └─ Go to Troubleshooting
│
└─ "Review staged changes manually"
└─ Run: python3 <skill-path>/scripts/run_review.py --project-root .用户需求:
│
├─ "设置AI代码审查"
│ └─ 进入初始设置
│
├─ "添加审查规则"
│ └─ 进入规则创建
│
├─ "配置审查行为"
│ └─ 进入配置环节
│
├─ "安装/卸载钩子"
│ └─ 进入Git钩子管理
│
├─ "调试审查问题"
│ └─ 进入故障排查
│
└─ "手动审查暂存变更"
└─ 执行:python3 <skill-path>/scripts/run_review.py --project-root .project-root/
└── .ai-reviewer/
├── config.yaml # Configuration
├── rules/ # Review rules
│ ├── rule1.md
│ └── rule2.md
└── hooks/ # Git hook templates
├── pre-commit.template
└── pre-push.templateundefinedproject-root/
└── .ai-reviewer/
├── config.yaml # 配置文件
├── rules/ # 审查规则
│ ├── rule1.md
│ └── rule2.md
└── hooks/ # Git钩子模板
├── pre-commit.template
└── pre-push.templateundefinedundefinedundefined.ai-reviewer/config.yamlreview_mode: block
ai_backend: claude-api
claude_api_key: "sk-ant-api03-..." # Or use ANTHROPIC_API_KEY env var
model: claude-sonnet-4-5-20250929review_mode: block
ai_backend: claude-cli.ai-reviewer/config.yamlreview_mode: block
ai_backend: claude-api
claude_api_key: "sk-ant-api03-..." # 或使用ANTHROPIC_API_KEY环境变量
model: claude-sonnet-4-5-20250929review_mode: block
ai_backend: claude-clipython3 <skill-path>/scripts/install_hook.py install --hook-type pre-commitpython3 <skill-path>/scripts/install_hook.py install --hook-type pre-pushpython3 <skill-path>/scripts/install_hook.py install --hook-type pre-commitpython3 <skill-path>/scripts/install_hook.py install --hook-type pre-pushundefinedundefinedundefinedundefinedreferences/rule_format.md---
id: unique-rule-id
keywords: ["keyword1", "keyword2"]
file_patterns: ["*.py", "src/**/*.js"]
priority: high | medium | low
description: Brief one-line description
---references/rule_format.md---
id: unique-rule-id
keywords: ["keyword1", "keyword2"]
file_patterns: ["*.py", "src/**/*.js"]
priority: high | medium | low
description: 简短的单行描述
---undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefinedfile_patternsfile_patterns.ai-reviewer/rules/your-rule.mdidkeywordsfile_patternsprioritydescriptionSpecificationChecklistPositive ExamplesNegative Examples---
id: no-todo-comments
keywords: ["TODO", "FIXME", "HACK"]
file_patterns: ["*.py", "*.js", "*.ts"]
priority: medium
description: No TODO comments in production code
---.ai-reviewer/rules/your-rule.mdidkeywordsfile_patternsprioritydescription规范说明检查清单正面示例反面示例---
id: no-todo-comments
keywords: ["TODO", "FIXME", "HACK"]
file_patterns: ["*.py", "*.js", "*.ts"]
priority: medium
description: 生产代码中不允许出现TODO注释
---undefinedundefinedundefinedundefinedreview_mode: block--no-verifyreview_mode: warnreview_mode: advisoryreview_mode: block--no-verifyreview_mode: warnreview_mode: advisoryai_backend: claude-api
claude_api_key: "sk-ant-api03-..."
model: claude-sonnet-4-5-20250929
max_tokens: 4096ANTHROPIC_API_KEYai_backend: claude-clinpm install -g @anthropic-ai/claude-cliai_backend: claude-api
claude_api_key: "sk-ant-api03-..."
model: claude-sonnet-4-5-20250929
max_tokens: 4096ANTHROPIC_API_KEYai_backend: claude-clinpm install -g @anthropic-ai/claude-cliskip_patterns:
- "*.min.js"
- "vendor/**"
- "node_modules/**"
- "*.pb.go"references/config_format.mdskip_patterns:
- "*.min.js"
- "vendor/**"
- "node_modules/**"
- "*.pb.go"references/config_format.mdpython3 <skill-path>/scripts/install_hook.py install --hook-type pre-commitpython3 <skill-path>/scripts/install_hook.py install --hook-type pre-commitpython3 <skill-path>/scripts/install_hook.py uninstall --hook-type pre-commitpython3 <skill-path>/scripts/install_hook.py uninstall --hook-type pre-commitls -la .git/hooks/ls -la .git/hooks/.git/hooks/pre-commit.git/hooks/pre-push.ai-reviewer.git/hooks/pre-commit.git/hooks/pre-push.ai-reviewerpython3 <skill-path>/scripts/run_review.py --project-root .python3 <skill-path>/scripts/run_review.py --project-root .python3 <skill-path>/scripts/load_rules.py .ai-reviewer/rulespython3 <skill-path>/scripts/load_rules.py .ai-reviewer/rulesls -la .git/hooks/pre-commitchmod +x .git/hooks/pre-commitls -la .ai-reviewer/ls -la .git/hooks/pre-commitchmod +x .git/hooks/pre-commit.ai-reviewerls -la .ai-reviewer/export ANTHROPIC_API_KEY=sk-ant-api03-...config.yamlai_backend: claude-cliexport ANTHROPIC_API_KEY=sk-ant-api03-...config.yamlai_backend: claude-clipython3 <skill-path>/scripts/load_rules.py .ai-reviewer/rules*.pysrc/**/*.jspython3 <skill-path>/scripts/load_rules.py .ai-reviewer/rules*.pysrc/**/*.jsmax_diff_sizemax_diff_size: 50000max_diff_sizemax_diff_size: 50000log_level: debug
log_file: .ai-reviewer/review.loglog_level: debug
log_file: .ai-reviewer/review.logidkeywordsfile_patternsprioritydescriptionload_rules.pyRuleMetadataidkeywordsfile_patternsprioritydescriptionRuleMetadataload_rules.pypython3 scripts/install_hook.py install --hook-type pre-commitpython3 scripts/run_review.py --project-root .from load_rules import RuleLoader, RuleMetadata, FullRulepython3 scripts/install_hook.py install --hook-type pre-commitpython3 scripts/run_review.py --project-root .from load_rules import RuleLoader, RuleMetadata, FullRuleerror-handling.mdnaming-convention.mdpre-commit.templatepre-push.templateerror-handling.mdnaming-convention.mdpre-commit.templatepre-push.templatereview_mode: blockpriority: highmax_tokensreview_mode: blockpriority: highmax_tokensid: security-001
id: style-001
id: performance-001id: security-001
id: style-001
id: performance-001undefinedundefinedundefinedundefinedfile_patterns: ["*.py"] # Python only
file_patterns: ["*.js", "*.ts"] # JavaScript/TypeScript
file_patterns: ["*"] # All filesfile_patterns: ["*.py"] # 仅Python
file_patterns: ["*.js", "*.ts"] # JavaScript/TypeScript
file_patterns: ["*"] # 所有文件- name: AI Code Review
run: python3 scripts/run_review.py --project-root .- name: AI Code Review
run: python3 scripts/run_review.py --project-root .