assets/skills/pr-review/SKILL.md
Thorough pull request review workflow with architecture compliance checks. Use when reviewing pull requests, checking code changes, or when user says "review pr", "check pr", "review code", "pr review", "review pull request".
npx skillsauth add phuthuycoding/moicle pr-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Comprehensive workflow for reviewing pull requests with architecture compliance and quality gates.
Before reviewing any code, you MUST read the appropriate architecture reference:
~/.claude/architecture/
├── clean-architecture.md # Core principles for all projects
├── flutter-mobile.md # Flutter + Riverpod
├── react-frontend.md # React + Vite + TypeScript
├── go-backend.md # Go + Gin
├── laravel-backend.md # Laravel + PHP
├── remix-fullstack.md # Remix fullstack
└── monorepo.md # Monorepo structure
.claude/architecture/ # Project overrides
Review must verify compliance with architecture patterns defined in these files.
| Phase | Agent | Purpose |
|-------|-------|---------|
| ANALYZE | @clean-architect | Architecture compliance check |
| REVIEW | @code-reviewer | Code quality and best practices |
| REVIEW | @security-audit | Security vulnerabilities scan |
| REVIEW | @perf-optimizer | Performance analysis |
| REVIEW | @test-writer | Test coverage and quality |
┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐
│ 1. FETCH │──▶│2. ANALYZE│──▶│ 3. REVIEW│──▶│4. FEEDBACK
└──────────┘ └──────────┘ └──────────┘ └──────────┘
│
▼
┌───────────────────────┐
│ Quality Gates Check │
│ ✓ Architecture │
│ ✓ Security │
│ ✓ Performance │
│ ✓ Tests │
└───────────────────────┘
Goal: Gather all PR information and context
Fetch PR details:
gh pr view [PR_NUMBER] --json number,title,body,author,state,commits,reviews,files
Get the diff:
gh pr diff [PR_NUMBER]
List all commits:
gh pr view [PR_NUMBER] --json commits --jq '.commits[] | "\(.oid[:7]) \(.messageHeadline)"'
Check CI/CD status:
gh pr checks [PR_NUMBER]
Identify project stack from PR files and read architecture doc
## PR #[NUMBER]: [TITLE]
### Metadata
- **Author**: [author]
- **State**: [open/merged/closed]
- **Stack**: [Flutter/React/Go/Laravel/Remix]
- **Architecture Doc**: [path to doc]
- **Files Changed**: [count]
- **Additions**: +[count] / **Deletions**: -[count]
### Commits
1. [commit 1]
2. [commit 2]
### Description
[PR body]
### CI/CD Status
[pass/fail status]
Goal: Understand the changes and identify affected areas
Read the architecture doc for this stack
Analyze what changed:
Identify impact areas based on architecture:
Check for red flags:
## Change Analysis
### Architecture Reference
- Doc: [path to architecture doc]
- Pattern: [pattern from doc]
### Scope
- Type: [Feature/Fix/Refactor/Docs/Chore]
- Breaking Changes: [Yes/No]
### Layers Affected (from architecture doc)
- Layer 1: [files]
- Layer 2: [files]
- Layer 3: [files]
### Impact Areas
- [Module 1]: [description]
- [Module 2]: [description]
### Red Flags
- [ ] Issue 1
- [ ] Issue 2
Goal: Thorough code review against multiple quality dimensions
Read architecture doc and verify:
Template:
### Architecture Compliance: [✅ PASS / ❌ FAIL]
Reference: [architecture doc path]
**Layer Boundaries**: [Pass/Fail]
- [Finding 1]
- [Finding 2]
**Structure**: [Pass/Fail]
- [Finding 1]
**Patterns**: [Pass/Fail]
- [Finding 1]
**Violations** (if any):
- [ ] Critical: [description]
- [ ] Major: [description]
- [ ] Minor: [description]
Template:
### Code Quality: [Good/Needs Work/Poor]
**Strengths**:
- [strength 1]
- [strength 2]
**Issues**:
- [ ] [file:line] - [issue description]
- [ ] [file:line] - [issue description]
Template:
### Security: [✅ SECURE / ⚠️ ISSUES / 🚨 CRITICAL]
**Vulnerabilities**:
- [ ] 🚨 Critical: [description + location]
- [ ] ⚠️ High: [description + location]
- [ ] ℹ️ Low: [description + location]
**Recommendations**:
- [recommendation 1]
- [recommendation 2]
Template:
### Performance: [✅ OPTIMIZED / ⚠️ CONCERNS / 🐌 ISSUES]
**Concerns**:
- [ ] [file:line] - [performance issue]
- [ ] [file:line] - [performance issue]
**Suggestions**:
- [optimization 1]
- [optimization 2]
Template:
### Testing: [✅ WELL TESTED / ⚠️ GAPS / ❌ MISSING]
**Coverage**:
- Unit Tests: [Good/Partial/Missing]
- Integration Tests: [Good/Partial/Missing]
- E2E Tests: [Good/Partial/Missing]
**Gaps**:
- [ ] Missing test for [scenario]
- [ ] Missing test for [edge case]
**Test Quality** (per architecture doc): [Pass/Fail]
- [finding]
Use this for every PR:
## Review Checklist
### Architecture (from [doc])
- [ ] Layer boundaries respected
- [ ] Structure follows doc
- [ ] Patterns used correctly
- [ ] Dependencies flow correctly
### Code Quality
- [ ] Readable and maintainable
- [ ] Follows naming conventions
- [ ] No unnecessary complexity
- [ ] Proper error handling
### Security
- [ ] No security vulnerabilities
- [ ] Input validation present
- [ ] No secrets in code
- [ ] Auth/authz correct
### Performance
- [ ] No obvious bottlenecks
- [ ] Queries optimized
- [ ] Caching appropriate
- [ ] Efficient algorithms
### Testing
- [ ] Tests present
- [ ] Tests follow doc patterns
- [ ] Good coverage
- [ ] Edge cases covered
### Documentation
- [ ] PR description clear
- [ ] Complex code commented
- [ ] README updated (if needed)
- [ ] API docs updated (if needed)
Goal: Provide clear, actionable feedback
Use when:
## Review: ✅ APPROVED
### Summary
[Brief summary of changes]
### Architecture Compliance
✅ Follows [architecture doc name] patterns correctly
### Strengths
- [strength 1]
- [strength 2]
- [strength 3]
### Minor Suggestions (Optional)
- [ ] [suggestion 1]
- [ ] [suggestion 2]
### Recommendation
**APPROVE** - Ready to merge
Use when:
## Review: ⚠️ CHANGES REQUESTED
### Summary
[Brief summary of changes]
### Critical Issues (Must Fix)
1. **[Category]** - [file:line]
- Issue: [description]
- Fix: [how to fix]
- Reference: [architecture doc section if applicable]
2. **[Category]** - [file:line]
- Issue: [description]
- Fix: [how to fix]
### Non-Critical Issues (Should Fix)
- [ ] [file:line] - [description]
- [ ] [file:line] - [description]
### Suggestions (Optional)
- [suggestion 1]
- [suggestion 2]
### Recommendation
**REQUEST CHANGES** - Please address critical issues
Use when:
## Review: 💬 COMMENTS
### Questions
1. [Question about approach/design]
2. [Question about implementation]
### Discussion Points
- [Point 1]
- [Point 2]
### Recommendation
**COMMENT** - Let's discuss before proceeding
Post review on GitHub:
# Approve
gh pr review [PR_NUMBER] --approve --body "[feedback]"
# Request changes
gh pr review [PR_NUMBER] --request-changes --body "[feedback]"
# Comment
gh pr review [PR_NUMBER] --comment --body "[feedback]"
Add inline comments for specific issues:
gh pr comment [PR_NUMBER] --body "[comment]"
Update PR status if needed:
# Add labels
gh pr edit [PR_NUMBER] --add-label "needs-changes"
gh pr edit [PR_NUMBER] --add-label "security-review"
gh pr edit [PR_NUMBER] --add-label "architecture-review"
**[file.ts:123]** - Architecture Violation
Issue: Business logic in presentation layer
Reference: `react-frontend.md` - Section 3.2
This violates the architecture pattern. Business logic should be in:
- `src/domain/usecases/`
Suggested fix:
1. Create `src/domain/usecases/calculateTotal.ts`
2. Move logic there
3. Call from component
Example:
\`\`\`typescript
// Component
const total = await calculateTotalUseCase.execute(items);
// Usecase
export class CalculateTotalUseCase {
execute(items: Item[]): number {
// logic here
}
}
\`\`\`
| Stack | Doc |
|-------|-----|
| All | clean-architecture.md |
| Flutter | flutter-mobile.md |
| React | react-frontend.md |
| Go | go-backend.md |
| Laravel | laravel-backend.md |
| Remix | remix-fullstack.md |
| Monorepo | monorepo.md |
| Dimension | Focus | |-----------|-------| | Architecture | Layer boundaries, patterns, structure per doc | | Code Quality | Readability, naming, complexity, DRY | | Security | Validation, auth, secrets, vulnerabilities | | Performance | Queries, caching, algorithms, memory | | Testing | Coverage, quality, edge cases per doc |
| Level | Action | Examples | |-------|--------|----------| | 🚨 Critical | Must fix before merge | Security holes, architecture violations, data loss bugs | | ⚠️ High | Should fix before merge | Missing tests, poor error handling, performance issues | | ℹ️ Medium | Can fix after merge | Code smells, minor refactoring, missing comments | | 💡 Low | Optional | Style suggestions, micro-optimizations |
Architecture (check against doc):
Security:
Performance:
Testing:
# Fetch PR
gh pr view [NUMBER]
gh pr diff [NUMBER]
gh pr checks [NUMBER]
# Review
gh pr review [NUMBER] --approve
gh pr review [NUMBER] --request-changes
gh pr review [NUMBER] --comment
# Comment
gh pr comment [NUMBER] --body "comment"
# Labels
gh pr edit [NUMBER] --add-label "label"
PR review is complete when:
development
Test-Driven Development workflow. Use when doing TDD, writing tests first, or when user says "tdd", "test first", "test driven", "red green refactor".
development
Thorough pull request review workflow with architecture compliance checks. Use when reviewing pull requests, checking code changes, or when user says "review pr", "check pr", "review code", "pr review", "review pull request".
development
Review local branch changes for architecture compliance, conventions, and code quality before pushing/PR. Stack-aware — detects the project stack and applies the matching rules. Use when user says "review changes", "review branch", "check branch", "check changes", "review my code", "review before pr".
testing
DDD architecture compliance review with automated checks and review loop. Use when user says "architect-review", "architecture review", "review architecture", "check architecture", "review ddd", "ddd review".