| name | cli:code-check |
| description | Review code changes in current branch for adherence to team guidelines and conventions |
| disable-model-invocation | false |
| allowed-tools | Bash(git:*), Read, Grep, Glob |
| argument-hint | [base-branch] |
Code Style & Guidelines Checker
Review all code changes in the current branch to ensure they follow the team's coding standards, conventions, and organizational guidelines.
Scope: This skill focuses on architectural patterns, code organization, and conventions that require human judgment. Basic formatting (quotes, indentation, line length, trailing commas) should be checked with yarn lint:local and yarn prettier:write.
Task
When this skill is invoked:
1. Run automated checks first
- Run
yarn lint:local to catch formatting and linting issues
- Include these results in the review report to avoid duplicate concerns
- If linter fails, include the errors in the "Critical Issues" section
2. Identify changes to review
- Get the base branch to compare against (default:
main)
- If an argument is provided (e.g.,
/code-style-check develop), use that branch as the base
- Use
git diff --name-only <base-branch>...HEAD to get list of changed files
- Use
git diff <base-branch>...HEAD to see the actual changes
- Only analyze the specific lines that changed - don't review entire files
- Ignore files in
node_modules/, dist/, and other non-source directories
3. Review code against style guidelines
Check each modified file for compliance with these guidelines:
Note: This skill focuses on architectural patterns and conventions that require human judgment. Run yarn lint:local and yarn prettier:write for automated style checks (quotes, indentation, line length, etc.).
Code Quality & Patterns
TypeScript Organization
Project Organization
Logger and i18n
Command Structure
Testing
Unit/Integration Tests (__tests__ directories):
Acceptance Tests (/acceptance-tests directory):
General Testing Rules:
Dependencies and Breaking Changes
Pull Request Size
Git Practices
4. Generate the review report
Provide a structured report with these sections:
# Code Style Review for Branch: <branch-name>
**Base:** <base-branch>
**Files Changed:** <count>
## Summary
_Brief overview of changes and overall code quality assessment (2-3 sentences)_
## Linter Results
**Status:** ✓ Passed / ✗ Failed
_If failed, include the relevant linter errors in the Critical Issues section below_
## Issues Found
### Critical Issues
_Issues that MUST be fixed before merging:_
- Linter/build failures
- Missing `trackCommandUsage()` call in command handler
- User-facing strings hardcoded instead of using `lang/en.ts`
- Using `process.exit`
- Using `exit()` outside of command handler function
- Test file that doesn't build
- Committing directly to `main` branch
- [ ] **<file-path>:<line>** - <description>
- [ ] **<file-path>:<line>** - <description>
### Pattern Violations
_Issues that violate codebase conventions and should be fixed before merging:_
- Type definitions in wrong place (not in `/types` directory)
- Not using `uiLogger` (using `console.log()` instead)
- Wrong directory structure (command file in wrong location)
- Missing tests for new functionality
- Try/catch in tests (should use `expect().toThrow()`)
- [ ] **<file-path>:<line>** - <description>
- [ ] **<file-path>:<line>** - <description>
### Suggestions
_Optional improvements that would enhance code quality:_
- Variable naming could be more descriptive (but not critically vague)
- Early return opportunities (when nesting is manageable)
- Refactoring opportunities for readability
- **<file-path>:<line>** - <description>
## Guideline Adherence
- [x] All user-facing strings in en.ts
- [x] Uses uiLogger for logging
- [x] Types defined in /types directory
- [x] Commands call trackCommandUsage()
- [x] Descriptive variable names
- [x] Proper file organization
- ...
## Files Reviewed
- `<file-path>` - <brief assessment>
- `<file-path>` - <brief assessment>
## Next Steps
**Before merging:**
1. Fix all Critical Issues (blocking)
2. Fix all Pattern Violations (maintain codebase standards)
3. Consider addressing Suggestions for code quality
_Additional specific recommendations based on the issues found_
5. Important constraints
- Linter results are included - since
yarn lint:local runs first, include those results to avoid duplicate concerns
- Focus on architectural patterns and conventions that require human judgment
- Only analyze the specific lines that changed (from git diff), not entire files
- Be specific with file paths and line numbers for all issues
- Provide examples of correct patterns when flagging issues
- If no issues found, say so clearly and congratulate the team
- Don't flag auto-generated files (dist/, node_modules/)
- Be constructive and educational in tone
- Both Critical Issues and Pattern Violations should be fixed before merging
- Suggestions are optional improvements
6. Completion Format
CRITICAL: You MUST end your response with one of these exact status lines:
STATUS: PASSED - No issues found
or
STATUS: FAILED - [brief summary of critical issues]
This status line is used by automated workflows. Do not modify this format.
Determining Status:
- PASSED: No Critical Issues AND no Pattern Violations found (Suggestions only are still PASSED)
- FAILED: Any Critical Issues OR Pattern Violations found
7. Offer to fix issues
After presenting the review report and status line, if any issues were found, ask the user:
"Would you like me to fix any of these issues? If so, please tell me which specific items you'd like me to address."
Wait for the user to specify which issues to fix before making any changes. The user may:
- Ask you to fix all Critical Issues
- Ask you to fix specific items by file path or description
- Ask you to fix everything
- Decline and fix manually
Only make changes after receiving explicit consent and direction from the user.