code_review — Claude Code rule: review and install
The code_review rule for Claude Code sets a review process for changes before merging. It checks branches, files, code, tests, and the PR/MR description.
MIT ★ 674 updated 2026-10-29
/plugin marketplace add evanca/flutter-ai-rules
/plugin install flutter-ai-skills@flutter-ai-rulesWhat code_review does
The rule starts by identifying the working and merge-target branches, then listing files that changed, were added, or were removed. For each change, it calls for checking the commit title and related components before judging the implementation. If the purpose remains unclear after investigation, that should appear in the report.
Review points cover file placement and naming, readable code, logic, error handling, security, performance, documentation, and tests. The rule also checks generated files, project conventions, and whether the PR/MR description matches the changes. When library guidance is uncertain, it calls for consulting online documentation. The response belongs in chat, with findings and recommendations for each file.
What it helps with
- confirm the current branch is not
mainordevelop - list files changed, added, or deleted in a merge request
- spot logic errors, missing edge cases, and weak exception handling
- assess whether tests exercise real behavior or only mocks
- compare the PR/MR description with the actual changes
Example prompts for the agent
- Review this branch and report findings for each file.
- Check these changes before merging into
main, including the tests and PR description. - Inspect this diff and report any change whose purpose remains unclear.
How to install code_review
1Plugin marketplace
/plugin marketplace add evanca/flutter-ai-rules/plugin install flutter-ai-skills@flutter-ai-rules2Manually: put the files in place
.claude/rules/code_review.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/code_review.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/code_review.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/code_review.mdManually: put the files in place
.clinerules/code_review.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about code_review
How do I install code_review in Claude Code?
Run /plugin marketplace add evanca/flutter-ai-rules, followed by /plugin install flutter-ai-skills@flutter-ai-rules. The rule file path is .claude/rules/code_review.md.
What does code_review do?
It guides a pre-merge review of branches, changed files, implementation details, tests, and the PR/MR description. Its expected response gives conclusions and recommendations file by file.
What does code_review inspect in each file?
It checks concerns such as file location and naming, logic, error handling, security, documentation, test coverage, and consistency with project conventions.
Source text
code_review.md · MIT
# Code Review Ruleset for LLMs 1. Check that the current branch is a feature, bugfix, or PR/MR branch and not a main or develop branch. 2. Verify the branch is up-to-date with the target branch (main). 3. Identify the target branch for the merge and list all files that have changed, been added, or deleted. 4. For every change, look up the commit title and review how any connected components are implemented. 5. Do not assume a change or fix is correct without investigating the implementation details. 6. Avoid complimenting or critiquing by default; be as objective and reasonable as possible. Instead of offering automatic praise, take a devil's advocate approach and give honest, thoughtful feedback. 7. If the change or fix remains difficult to understand after several attempts, include this in your report. 8. Fetch online documentation if you're unsure about the best practices for a particular package or library. 9. For each changed file, check that the file is in the correct directory. 10. For each changed file, check that the file name follows naming conventions. 11. For each changed file, verify the file's responsibility is clear and that the reason for its change or addition is understandable. 12. For each changed file, review the code for readability and ensure variable, function, and class names are descriptive and consistent. 13. For each changed file, check the logic and correctness of the code, ensuring there are no logic errors or missing edge cases. 14. For each changed file, check that the code is modular and does not contain unnecessary duplication (maintainability). 15. For each changed file, ensure errors and exceptions are handled appropriately. 16. For each changed file, check for potential security concerns such as input validation and secrets in code. 17. For each changed file, check for obvious performance issues or inefficiencies. 18. For each changed file, verify that public APIs, complex logic, and new modules are documented. 19. For each changed file, ensure there is sufficient test coverage for new or changed logic. 20. For each changed file, ensure the code matches the project's style guide and coding patterns. 21. For generated files, confirm they are up-to-date and not manually edited. 22. Check that the overall change set is focused and scoped to the stated purpose and does not include unrelated or unnecessary changes. 23. Verify that the PR/MR description accurately reflects the changes made. 24. Ensure there are new or updated tests covering new or changed logic. 25. If there's a test, always evaluate whether the test could fail or if it's only checking a mock implementation. 26. Ensure all tests pass in the continuous integration system. 27. Provide clear, constructive feedback for any issues found, including suggestions for improvement and requests for clarification if anything is unclear. 28. The expected output is an answer in the chat, mentioning conclusions and recommendations per file.
© Ivanna Kaceviča · MIT · evanca/flutter-ai-rules