review
slash command
claude_code
Original Content
---
allowed-tools: Bash(git:*), FileSystem, Bash(npm:*), Bash(yarn:*), Bash(lint:*), Bash(test:*), Bash(build:*)
description: Comprehensive code review with quality checks and documentation validation
---
Review the code changes and documentation updates for a task for a comprehensive
PR review.
## Arguments
- Directory Name: This is the name of the directory or task where
`taskFindings.md` file is located. This is used to understand the context of
the task and where to write the findings.
- Commit Hash: The commit hash of the code changes to review. This is used to
understand the context of the code changes and where to write the findings.
- To and From Branch: The branch names to compare the code changes against. This
is used to understand the context of the code changes and where to write the
findings.
These arguments are mutually exclusive, user should provide only one of them.
Present the error if more than one is provided.
## Context
- Files changed: !`git diff --name-only HEAD~1`
- Diff summary: !`git diff --stat HEAD~1`
- Test files: !`find . -name "*.test.*" -o -name "*.spec.*" | head -10`
- Lint status: !`npm run lint --silent 2>&1 || echo "No lint script"`
- Build status: !`npm run build --silent 2>&1 || echo "No build script"`
- Task findings: @taskNotes/{ArgumentDirectoryName}/taskFindings.md
- Current commit: @taskNotes/{ArgumentDirectoryName}/currentCommitHash
## Process
- If the directory name is provided, read the Task Findings file to understand
the context of the task and the code changes made.
- If the directory name is provided, read the Current commit file to understand
the current commit hash of the code changes. That becomes the commit hash as
starting point for the review.
- If commit hash is provided, that becomes the starting point for the review.
- For the `to` and `from` branch names, from branch is the starting point and to
branch is the ending point for the review.
- For the directory name, and commit has, ending point is the latest commit in
the branch.
- Create the diff of the code changes between the starting and ending points.
### Criteria for Review
- Review the code changes for correctness, readability, maintainability, and
performance.
- Check for adherence to coding standards and best practices.
- Ensure that the code changes are well-documented and the documentation is
updated accordingly.
- Verify that the code changes do not introduce any new bugs or regressions.
- Check for proper test coverage and ensure that the tests are passing. (You do
not have to run the tests, just check the test files and their coverage,
ignore if tests are not present)
- Ensure that the code changes are properly formatted and follow the project's
coding style. (Run linters if available, fix the formatting issues from lint
if possible)
- Check for any potential security vulnerabilities in the code changes.
- If taskFindings.md file is present, check if the code changes are aligned with
the findings and recommendations in the file.
- Consider yourself as a primary reviewer, if you pass the review, then human
reviewer can review the code changes. If you find any issues, then write the
findings in the `taskNotes/{ArgumentDirectoryName}/reviewFindings.md` file.
And then ask the user to fix the issues and re-review the code changes.
Convert to Different Formats
Actions
(Clears cached conversions and forces re-processing)