name: code-review
description: Review, analyze, and inspect code for Photo Map MVP project following Spring Boot, Angular 18, and shared project conventions. Check security, performance, naming, testing, and MVP scope compliance. Use when reviewing pull requests, conducting code audits, analyzing code quality, inspecting Java or TypeScript files, or ensuring quality before commits. File types: .java, .ts, .html, .xml, .properties, .css, .scss
allowed-tools: Read, Grep, Glob
Code Review - Photo Map MVP
Note: This is a READ-ONLY Skill (allowed-tools: Read, Grep, Glob only).
Review Philosophy
MVP-First Mindset:
- ✅ Simple, working solution over complex, perfect solution
- ✅ Security-first (user scoping, input validation, JWT)
- ✅ Code readability (self-documenting, English names)
- ❌ NO over-engineering
- ❌ NO features beyond MVP requirements
Read-Only Workflow:
Use Read, Grep, Glob to analyze code. Provide findings as comments. Never edit code directly.
When to Review
Decision Tree:
| Scenario |
Action |
| Pre-commit review |
Check Security + Architecture + Tests |
| Pull Request review |
Full review with references/ checklists |
| Bug investigation |
Focus on Security + Performance |
| Refactoring audit |
Check Architecture + Anti-patterns |
Review Workflows
Backend Review (Spring Boot + Java 17)
Priority Check Order:
Security (CRITICAL!) → references/security-patterns.md
- User scoping on ALL photo queries
- JWT validation working
- Input validation present
- No entities exposed to API
Architecture → references/backend-checklist.md
- Controllers → Services → Repositories
- DTOs used for all API responses
@Transactional on service methods
Testing → references/backend-checklist.md
- Service logic tested (>70% coverage)
- Custom queries tested
- Security configuration tested
Quick Scan:
- Grep for
findById\( without userId parameter → Security issue!
- Grep for
return new Photo\( in Controller → Entity exposure!
- Grep for business logic in
@RestController → Architecture violation!
Examples: Check examples/user-scoping.java for bad vs good patterns.
Frontend Review (Angular 18 + TypeScript)
Priority Check Order:
Architecture (CRITICAL!) → references/frontend-checklist.md
- NO
@NgModule anywhere (standalone only!)
inject() function used (not constructor)
- BehaviorSubject kept private
State Management → references/frontend-checklist.md
- Signals for component-local state
- BehaviorSubject for shared state (services)
- Async pipe over manual subscriptions
Testing → references/frontend-checklist.md
- Component logic tested
- Service methods tested (HTTP mocked)
- Guards tested
Quick Scan:
- Grep for
@NgModule → Angular 18 violation!
- Grep for
constructor.*inject\( → Should use inject() function!
- Grep for
public.*BehaviorSubject → Exposed state management!
Examples:
examples/standalone-patterns.ts - NgModule vs Standalone
examples/state-management.ts - BehaviorSubject patterns
Security Review
Critical Checks:
- User Scoping: ALL photo queries include
userId filtering
- JWT Validation: Token signature & expiration checked
- Input Validation:
@Valid on DTOs, file upload validation
- No Data Leaks: Entities never exposed, DTOs only
Detailed Patterns: references/security-patterns.md
Examples: examples/user-scoping.java for complete patterns
Performance Review
Backend Checks:
- Database indexes on
user_id, frequently queried columns
@Transactional(readOnly = true) on queries
FetchType.LAZY for relationships
- ❌ NO premature optimization (Redis, queues)
Frontend Checks:
- Lazy loading images in gallery
- Async pipe (automatic subscription cleanup)
- TrackBy for *ngFor lists
- ❌ NO premature optimization (Virtual Scroll, Service Workers)
Detailed Patterns: references/performance-review.md
Common Anti-Patterns
Quick Scan List:
Backend:
- ❌ Business logic in Controller
- ❌ Exposing entities to API
- ❌ No user scoping on queries
- ❌ No
@Transactional on service methods
Frontend:
- ❌
@NgModule usage (Angular 18!)
- ❌ Constructor injection instead of
inject()
- ❌ Exposed BehaviorSubject (public)
- ❌ Nested subscriptions (use
switchMap)
Complete List: examples/common-anti-patterns.md
Git Commit Review
Check:
- ✅ Conventional Commits format:
type(scope): description
- ✅ Types:
feat, fix, docs, refactor, test, chore
- ✅ NO promotional messages ("Generated with Claude Code")
- ✅ Clear, focused commits (single change)
- ✅ Imperative mood ("add" not "added")
Detailed Standards: references/git-standards.md
Quick Reference
Reference Lookup
| Need |
Check |
| Backend security, architecture, testing |
references/backend-checklist.md |
| Frontend standalone, DI, state, testing |
references/frontend-checklist.md |
| User scoping, JWT, input validation |
references/security-patterns.md |
| Performance checks (backend + frontend) |
references/performance-review.md |
| Conventional Commits, PR review |
references/git-standards.md |
Example Lookup
| Need |
Check |
| User scoping patterns (bad vs good) |
examples/user-scoping.java |
| Standalone components (NgModule vs Standalone) |
examples/standalone-patterns.ts |
| BehaviorSubject patterns (private vs public) |
examples/state-management.ts |
| Common mistakes quick scan |
examples/common-anti-patterns.md |
Review Checklist Summary
Before Approval:
Security:
Architecture:
Testing:
Code Quality:
MVP Scope:
For detailed checklists: Check references/backend-checklist.md and references/frontend-checklist.md
Related Documentation
Project Context:
.ai/prd.md - MVP scope and requirements
.ai/tech-stack.md - Technology specifications
.ai/api-plan.md - Backend API specification
.ai/ui-plan.md - Frontend architecture
Skill Resources:
references/ - Detailed review checklists (loaded on demand)
examples/ - Code examples (bad vs good patterns)
1---2name: code-review-63description: Review, analyze, and inspect code for Photo Map MVP project following Spring Boot, Angular 18, and shared project conventions. Check security, performance, naming, testing, and MVP scope compliance. U4---5
6---
7name: code-review
8description: Review, analyze, and inspect code for Photo Map MVP project following Spring Boot, Angular 18, and shared project conventions. Check security, performance, naming, testing, and MVP scope compliance. Use when reviewing pull requests, conducting code audits, analyzing code quality, inspecting Java or TypeScript files, or ensuring quality before commits. File types: .java, .ts, .html, .xml, .properties, .css, .scss
9allowed-tools: Read, Grep, Glob
10---
11
12# Code Review - Photo Map MVP
13
14**Note:** This is a READ-ONLY Skill (allowed-tools: Read, Grep, Glob only).
15
16## Review Philosophy
17
18**MVP-First Mindset:**
19- ✅ Simple, working solution over complex, perfect solution
20- ✅ Security-first (user scoping, input validation, JWT)
21- ✅ Code readability (self-documenting, English names)
22- ❌ NO over-engineering
23- ❌ NO features beyond MVP requirements
24
25**Read-Only Workflow:**
26Use Read, Grep, Glob to analyze code. Provide findings as comments. Never edit code directly.
27
28---
29
30## When to Review
31
32**Decision Tree:**
33
34| Scenario | Action |
35|----------|--------|
36| Pre-commit review | Check Security + Architecture + Tests |
37| Pull Request review | Full review with `references/` checklists |
38| Bug investigation | Focus on Security + Performance |
39| Refactoring audit | Check Architecture + Anti-patterns |
40
41---
42
43## Review Workflows
44
45### Backend Review (Spring Boot + Java 17)
46
47**Priority Check Order:**
481. **Security (CRITICAL!)** → `references/security-patterns.md`
49 - User scoping on ALL photo queries
50 - JWT validation working
51 - Input validation present
52 - No entities exposed to API
53
542. **Architecture** → `references/backend-checklist.md`
55 - Controllers → Services → Repositories
56 - DTOs used for all API responses
57 - `@Transactional` on service methods
58
593. **Testing** → `references/backend-checklist.md`
60 - Service logic tested (>70% coverage)
61 - Custom queries tested
62 - Security configuration tested
63
64**Quick Scan:**
65- Grep for `findById\(` without `userId` parameter → Security issue!
66- Grep for `return new Photo\(` in Controller → Entity exposure!
67- Grep for business logic in `@RestController` → Architecture violation!
68
69**Examples:** Check `examples/user-scoping.java` for bad vs good patterns.
70
71---
72
73### Frontend Review (Angular 18 + TypeScript)
74
75**Priority Check Order:**
761. **Architecture (CRITICAL!)** → `references/frontend-checklist.md`
77 - NO `@NgModule` anywhere (standalone only!)
78 - `inject()` function used (not constructor)
79 - BehaviorSubject kept private
80
812. **State Management** → `references/frontend-checklist.md`
82 - Signals for component-local state
83 - BehaviorSubject for shared state (services)
84 - Async pipe over manual subscriptions
85
863. **Testing** → `references/frontend-checklist.md`
87 - Component logic tested
88 - Service methods tested (HTTP mocked)
89 - Guards tested
90
91**Quick Scan:**
92- Grep for `@NgModule` → Angular 18 violation!
93- Grep for `constructor.*inject\(` → Should use inject() function!
94- Grep for `public.*BehaviorSubject` → Exposed state management!
95
96**Examples:**
97- `examples/standalone-patterns.ts` - NgModule vs Standalone
98- `examples/state-management.ts` - BehaviorSubject patterns
99
100---
101
102### Security Review
103
104**Critical Checks:**
105- **User Scoping:** ALL photo queries include `userId` filtering
106- **JWT Validation:** Token signature & expiration checked
107- **Input Validation:** `@Valid` on DTOs, file upload validation
108- **No Data Leaks:** Entities never exposed, DTOs only
109
110**Detailed Patterns:** `references/security-patterns.md`
111
112**Examples:** `examples/user-scoping.java` for complete patterns
113
114---
115
116### Performance Review
117
118**Backend Checks:**
119- Database indexes on `user_id`, frequently queried columns
120- `@Transactional(readOnly = true)` on queries
121- `FetchType.LAZY` for relationships
122- ❌ NO premature optimization (Redis, queues)
123
124**Frontend Checks:**
125- Lazy loading images in gallery
126- Async pipe (automatic subscription cleanup)
127- TrackBy for *ngFor lists
128- ❌ NO premature optimization (Virtual Scroll, Service Workers)
129
130**Detailed Patterns:** `references/performance-review.md`
131
132---
133
134## Common Anti-Patterns
135
136**Quick Scan List:**
137
138**Backend:**
139- ❌ Business logic in Controller
140- ❌ Exposing entities to API
141- ❌ No user scoping on queries
142- ❌ No `@Transactional` on service methods
143
144**Frontend:**
145- ❌ `@NgModule` usage (Angular 18!)
146- ❌ Constructor injection instead of `inject()`
147- ❌ Exposed BehaviorSubject (public)
148- ❌ Nested subscriptions (use `switchMap`)
149
150**Complete List:** `examples/common-anti-patterns.md`
151
152---
153
154## Git Commit Review
155
156**Check:**
157- ✅ Conventional Commits format: `type(scope): description`
158- ✅ Types: `feat`, `fix`, `docs`, `refactor`, `test`, `chore`
159- ✅ NO promotional messages ("Generated with Claude Code")
160- ✅ Clear, focused commits (single change)
161- ✅ Imperative mood ("add" not "added")
162
163**Detailed Standards:** `references/git-standards.md`
164
165---
166
167## Quick Reference
168
169### Reference Lookup
170
171| Need | Check |
172|------|-------|
173| Backend security, architecture, testing | `references/backend-checklist.md` |
174| Frontend standalone, DI, state, testing | `references/frontend-checklist.md` |
175| User scoping, JWT, input validation | `references/security-patterns.md` |
176| Performance checks (backend + frontend) | `references/performance-review.md` |
177| Conventional Commits, PR review | `references/git-standards.md` |
178
179### Example Lookup
180
181| Need | Check |
182|------|-------|
183| User scoping patterns (bad vs good) | `examples/user-scoping.java` |
184| Standalone components (NgModule vs Standalone) | `examples/standalone-patterns.ts` |
185| BehaviorSubject patterns (private vs public) | `examples/state-management.ts` |
186| Common mistakes quick scan | `examples/common-anti-patterns.md` |
187
188---
189
190## Review Checklist Summary
191
192**Before Approval:**
193
194**Security:**
195- [ ] User scoping on all photo queries
196- [ ] JWT validation working
197- [ ] Input validation present
198- [ ] No entities exposed to API
199
200**Architecture:**
201- [ ] Backend: Controllers → Services → Repositories
202- [ ] Frontend: Standalone components, inject(), BehaviorSubject pattern
203- [ ] NO NgModules in Angular code
204- [ ] DTOs used for all API responses
205
206**Testing:**
207- [ ] Service logic tested (>70% coverage)
208- [ ] Component logic tested
209- [ ] Custom queries tested
210- [ ] Guards tested
211
212**Code Quality:**
213- [ ] English naming conventions
214- [ ] Self-documenting code
215- [ ] Minimal comments
216- [ ] No over-engineering
217
218**MVP Scope:**
219- [ ] Only features from `.ai/prd.md`
220- [ ] No premature optimization
221- [ ] Simple solutions
222
223**For detailed checklists:** Check `references/backend-checklist.md` and `references/frontend-checklist.md`
224
225---
226
227## Related Documentation
228
229**Project Context:**
230- `.ai/prd.md` - MVP scope and requirements
231- `.ai/tech-stack.md` - Technology specifications
232- `.ai/api-plan.md` - Backend API specification
233- `.ai/ui-plan.md` - Frontend architecture
234
235**Skill Resources:**
236- `references/` - Detailed review checklists (loaded on demand)
237- `examples/` - Code examples (bad vs good patterns)