Portfolio Code Review
Code review skill for Paweł Lipowczan portfolio project.
Project Documentation
Before starting review, familiarize yourself with:
docs/SRS.md - Technical specification (architecture, components, functional requirements)
docs/PRD.md - Product requirements (stack, features, visual style)
docs/maintenance/TODO.md - Known issues and tasks
docs/blog/BLOG_WORKFLOW.md - Blog posts workflow
docs/testing/README.md - E2E tests
Project Scope
Stack: React 19 + Vite 7 + Tailwind CSS 3 + Framer Motion 12 + React Router 7
Architecture: SPA with build-time prerendering (Puppeteer), file-based blog (markdown), static deployment (Vercel)
Structure: components/{layout,sections,animations,seo,ui}, pages/, content/blog/, data/, utils/
Workflow
- Identify scope: Ask user what changed (files, feature, component, blog post)
- Read files: Read changed files using Read tool
- Verify: Go through verification checklist (see below)
- Report: Generate code review report (see template below)
Verification Checklist
Architecture & Stack
- React Hooks (not Class Components)
- Tailwind CSS (not inline styles)
- Framer Motion for animations
- React Router for routing
- Correct directory (components/layout, components/sections, pages/, etc.)
SEO & Prerendering
- Meta tags (title, description, OG tags, Twitter cards) via react-helmet-async
- Structured data (JSON-LD) for Person/BlogPosting schemas
- Canonical URL
- Alt text on all images
- Edge case: New routes added to
scripts/prerender.mjs?
- Edge case: Prerendering will work after changes (no dynamic content breaking SSR)?
- Edge case: Sitemap updated (
public/sitemap.xml) for new pages/posts?
Blog System
- Markdown files in
src/content/blog/
- Edge case: Frontmatter YAML valid (separators
---, proper indentation)?
- Edge case: Required fields:
id, slug, title, excerpt, date, readTime, image, tags, author, category
- Edge case: File doesn't start with
_ or isn't README.md (filtered by import.meta.glob)?
- Edge case: OG image exists as WebP (1200x630px) in
public/images/og-{slug}.webp?
- Edge case: Sitemap updated after new post?
Accessibility (WCAG 2.1 AA)
- Semantic HTML (header, nav, main, section, article, footer)
- Keyboard navigation works
- Color contrast >=4.5:1 for text, >=3:1 for UI components
- Form labels present
- ARIA labels for icon-only buttons
- Heading hierarchy (H1 -> H2 -> H3)
- Edge case: Only ONE H1 per page
Performance
- Images optimized (WebP, lazy loading with
loading="lazy")
- Edge case: Lazy loading doesn't cause CLS (Cumulative Layout Shift) - specify dimensions
- No unnecessary re-renders (useMemo/useCallback if needed)
- Animations use only transform/opacity (not width/height/top/left)
- Edge case: Canvas animations (NetworkBackground) don't block main thread (use requestAnimationFrame)
- Edge case: Font loading uses
font-display: swap (TODO: fix slow FCP/LCP)
- Edge case: No
console.log in production code
Routing & Navigation
- Edge case: Smooth scroll works with new sections (
element.scrollIntoView({ behavior: 'smooth' }))
- Edge case: Mobile menu closes after navigation
- Edge case: Mobile menu closes on Escape key
- Edge case: Mobile menu closes on click outside
Security & Best Practices
- Edge case: External links have
target="_blank" AND rel="noopener noreferrer"
- Edge case: Uses
SITE_CONFIG from src/utils/constants.js (not hardcoded URLs)
- Edge case: No duplicate structured data schemas (check JSON-LD)
- Form validation present
- GDPR/RODO compliant (for contact forms, cookie banner)
Testing
- E2E tests for new functionality (Playwright)
- Tests pass (
npm test)
- No breaking changes to existing tests
Code Quality
- Readable, clear code
- No duplication
- Descriptive names (variables, functions, components)
- Follows existing project style
- No new dependencies without justification
- Props validation (PropTypes or TypeScript)
Known Issues (from TODO.md)
- Check: Changes don't introduce/worsen performance issues (FCP/LCP already slow)
- Check: Changes don't break prerendering (critical for SEO)
- Check: Changes follow mobile-first responsive design
Report Template
Generate report in this format:
# Code Review Report - [Change Description]
## Scope
[Brief description of what changed: files, components, features]
## Positive Aspects
- [Good practices observed]
- [Well-implemented features]
## Potential Bugs & Edge Cases
CRITICAL: Focus on bugs and error conditions
### Critical (fix before merge)
- [ ] **[Bug/Edge Case]**: Description
- **Impact:** What breaks if not fixed
- **Fix:** Suggested solution
- **Reference:** docs/[file]#section
### Warnings (should fix)
- [ ] **[Issue]**: Description
- **Impact:** Potential problem
- **Fix:** Suggested solution
### Suggestions (nice to have)
- [Non-critical improvements]
## Checklist
**Architecture:**
- [ ] React Hooks used correctly
- [ ] Tailwind CSS styling
- [ ] Component in correct directory
**SEO & Prerendering:**
- [ ] Meta tags present (react-helmet-async)
- [ ] New routes added to prerender.mjs
- [ ] Sitemap updated
- [ ] OG images exist (WebP, 1200x630px)
**Blog System (if applicable):**
- [ ] Frontmatter valid YAML
- [ ] All required fields present
- [ ] File not starting with _ or README.md
- [ ] OG image exists
**Accessibility:**
- [ ] Semantic HTML
- [ ] Keyboard navigation
- [ ] Color contrast >=4.5:1
- [ ] Only one H1 per page
**Performance:**
- [ ] Images optimized (WebP, lazy loading)
- [ ] No CLS (dimensions specified)
- [ ] Animations use transform/opacity only
- [ ] No console.log in production
**Routing & Navigation:**
- [ ] Smooth scroll works
- [ ] Mobile menu closes properly (nav, Escape, outside click)
**Security & Best Practices:**
- [ ] External links: target="_blank" + rel="noopener noreferrer"
- [ ] Uses SITE_CONFIG (not hardcoded URLs)
- [ ] No duplicate structured data
**Testing:**
- [ ] E2E tests for new functionality
- [ ] Tests pass
- [ ] No breaking changes
**Code Quality:**
- [ ] Readable, clear
- [ ] No duplication
- [ ] Descriptive names
- [ ] Follows project style
## Summary
[Overall assessment: 1-2 paragraphs]
**Recommendation:**
- **APPROVE** - Ready to merge
- **APPROVE WITH COMMENTS** - Non-critical suggestions, can merge
- **REQUEST CHANGES** - Critical issues must be fixed first
## References
- docs/SRS.md - [specific sections]
- docs/maintenance/TODO.md - [relevant known issues]
- docs/PRD.md - [if architecture/design questions]
- docs/blog/BLOG_WORKFLOW.md - [if blog-related changes]
Examples
Example 1: Review new Hero component
User: "Review Hero.jsx changes"
Steps:
- Read src/components/sections/Hero.jsx
- Verify against checklist (especially: React Hooks, Framer Motion, NetworkBackground performance, semantic HTML)
- Check if smooth scroll works with new sections
- Generate report focusing on potential bugs (e.g., canvas blocking main thread, missing alt text, performance impact)
Example 2: Review new blog post
User: "Review new blog post about automation"
Steps:
- Find new .md file in src/content/blog/
- Verify frontmatter YAML (valid syntax, all required fields)
- Check OG image exists (public/images/og-{slug}.webp, 1200x630px)
- Verify sitemap updated
- Check blog post doesn't start with _ or isn't README.md
- Generate report focusing on edge cases (frontmatter parsing errors, missing OG image, sitemap not updated)
Example 3: Review routing changes
User: "Review new /projects/:slug route"
Steps:
- Read routing files (App.jsx, new page component)
- Verify route added to scripts/prerender.mjs (CRITICAL for SEO)
- Check smooth scroll, mobile menu behavior
- Verify meta tags for new route
- Check sitemap updated
- Generate report focusing on prerendering issues, SEO implications
Guidelines
Philosophy
- Constructive: Point out problems AND suggest solutions
- Prioritize: Critical (breaks app) > Warnings (bad UX) > Suggestions (nice to have)
- Reference: Always cite docs/* for justification
- Edge cases first: Focus on what can go wrong, not just what works
Process
- Read relevant docs FIRST (docs/SRS.md for architecture, docs/maintenance/TODO.md for known issues)
- Read changed files
- Think: "What edge cases could break this?"
- Think: "What happens on mobile? On slow network? With different data?"
- Check against docs/maintenance/TODO.md - does this worsen known issues?
- Generate detailed report with clear fix suggestions
Common pitfalls to check
- Frontmatter YAML syntax errors (very common in blog posts)
- Missing OG images (breaks social sharing)
- Routes not in prerender.mjs (empty HTML in source, bad SEO)
- CLS from lazy-loaded images without dimensions
- Mobile menu not closing (bad UX)
- External links without rel="noopener noreferrer" (security)
- Hardcoded URLs instead of SITE_CONFIG (maintenance nightmare)
- Console.log in production (performance, security)
1---2name: portfolio-code-review3description: Code review for Paweł Lipowczan portfolio project (React+Vite+Tailwind SPA). Use when user wants to review code changes, pull requests, commits, or modifications in portfolio project. Verifies architecture compliance, SEO standards, accessibility (WCAG 2.1 AA), performance (Core Web Vitals), blog system (markdown frontmatter, OG images), prerendering setup, and edge cases. References docs/{PRD.md,SRS.md,TODO.md,blog/BLOG_WORKFLOW.md}. Focuses on bugs, edge cases, and conditions causing errors after deployment.4license: Apache-2.05---6
7# Portfolio Code Review
8
9Code review skill for Paweł Lipowczan portfolio project.
10
11## Project Documentation
12
13Before starting review, familiarize yourself with:
14- `docs/SRS.md` - Technical specification (architecture, components, functional requirements)
15- `docs/PRD.md` - Product requirements (stack, features, visual style)
16- `docs/maintenance/TODO.md` - Known issues and tasks
17- `docs/blog/BLOG_WORKFLOW.md` - Blog posts workflow
18- `docs/testing/README.md` - E2E tests
19
20## Project Scope
21
22**Stack:** React 19 + Vite 7 + Tailwind CSS 3 + Framer Motion 12 + React Router 7
23
24**Architecture:** SPA with build-time prerendering (Puppeteer), file-based blog (markdown), static deployment (Vercel)
25
26**Structure:** `components/{layout,sections,animations,seo,ui}`, `pages/`, `content/blog/`, `data/`, `utils/`
27
28## Workflow
29
301. **Identify scope**: Ask user what changed (files, feature, component, blog post)
312. **Read files**: Read changed files using Read tool
323. **Verify**: Go through verification checklist (see below)
334. **Report**: Generate code review report (see template below)
34
35## Verification Checklist
36
37### Architecture & Stack
38
39- React Hooks (not Class Components)
40- Tailwind CSS (not inline styles)
41- Framer Motion for animations
42- React Router for routing
43- Correct directory (components/layout, components/sections, pages/, etc.)
44
45### SEO & Prerendering
46
47- Meta tags (title, description, OG tags, Twitter cards) via react-helmet-async
48- Structured data (JSON-LD) for Person/BlogPosting schemas
49- Canonical URL
50- Alt text on all images
51- **Edge case:** New routes added to `scripts/prerender.mjs`?
52- **Edge case:** Prerendering will work after changes (no dynamic content breaking SSR)?
53- **Edge case:** Sitemap updated (`public/sitemap.xml`) for new pages/posts?
54
55### Blog System
56
57- Markdown files in `src/content/blog/`
58- **Edge case:** Frontmatter YAML valid (separators `---`, proper indentation)?
59- **Edge case:** Required fields: `id, slug, title, excerpt, date, readTime, image, tags, author, category`
60- **Edge case:** File doesn't start with `_` or isn't `README.md` (filtered by `import.meta.glob`)?
61- **Edge case:** OG image exists as WebP (1200x630px) in `public/images/og-{slug}.webp`?
62- **Edge case:** Sitemap updated after new post?
63
64### Accessibility (WCAG 2.1 AA)
65
66- Semantic HTML (header, nav, main, section, article, footer)
67- Keyboard navigation works
68- Color contrast >=4.5:1 for text, >=3:1 for UI components
69- Form labels present
70- ARIA labels for icon-only buttons
71- Heading hierarchy (H1 -> H2 -> H3)
72- **Edge case:** Only ONE H1 per page
73
74### Performance
75
76- Images optimized (WebP, lazy loading with `loading="lazy"`)
77- **Edge case:** Lazy loading doesn't cause CLS (Cumulative Layout Shift) - specify dimensions
78- No unnecessary re-renders (useMemo/useCallback if needed)
79- Animations use only transform/opacity (not width/height/top/left)
80- **Edge case:** Canvas animations (NetworkBackground) don't block main thread (use requestAnimationFrame)
81- **Edge case:** Font loading uses `font-display: swap` (TODO: fix slow FCP/LCP)
82- **Edge case:** No `console.log` in production code
83
84### Routing & Navigation
85
86- **Edge case:** Smooth scroll works with new sections (`element.scrollIntoView({ behavior: 'smooth' })`)
87- **Edge case:** Mobile menu closes after navigation
88- **Edge case:** Mobile menu closes on Escape key
89- **Edge case:** Mobile menu closes on click outside
90
91### Security & Best Practices
92
93- **Edge case:** External links have `target="_blank"` AND `rel="noopener noreferrer"`
94- **Edge case:** Uses `SITE_CONFIG` from `src/utils/constants.js` (not hardcoded URLs)
95- **Edge case:** No duplicate structured data schemas (check JSON-LD)
96- Form validation present
97- GDPR/RODO compliant (for contact forms, cookie banner)
98
99### Testing
100
101- E2E tests for new functionality (Playwright)
102- Tests pass (`npm test`)
103- No breaking changes to existing tests
104
105### Code Quality
106
107- Readable, clear code
108- No duplication
109- Descriptive names (variables, functions, components)
110- Follows existing project style
111- No new dependencies without justification
112- Props validation (PropTypes or TypeScript)
113
114### Known Issues (from TODO.md)
115
116- **Check:** Changes don't introduce/worsen performance issues (FCP/LCP already slow)
117- **Check:** Changes don't break prerendering (critical for SEO)
118- **Check:** Changes follow mobile-first responsive design
119
120## Report Template
121
122Generate report in this format:
123
124```markdown
125# Code Review Report - [Change Description]
126
127## Scope
128
129[Brief description of what changed: files, components, features]
130
131## Positive Aspects
132
133- [Good practices observed]
134- [Well-implemented features]
135
136## Potential Bugs & Edge Cases
137
138CRITICAL: Focus on bugs and error conditions
139
140### Critical (fix before merge)
141
142- [ ] **[Bug/Edge Case]**: Description
143 - **Impact:** What breaks if not fixed
144 - **Fix:** Suggested solution
145 - **Reference:** docs/[file]#section
146
147### Warnings (should fix)
148
149- [ ] **[Issue]**: Description
150 - **Impact:** Potential problem
151 - **Fix:** Suggested solution
152
153### Suggestions (nice to have)
154
155- [Non-critical improvements]
156
157## Checklist
158
159**Architecture:**
160- [ ] React Hooks used correctly
161- [ ] Tailwind CSS styling
162- [ ] Component in correct directory
163
164**SEO & Prerendering:**
165- [ ] Meta tags present (react-helmet-async)
166- [ ] New routes added to prerender.mjs
167- [ ] Sitemap updated
168- [ ] OG images exist (WebP, 1200x630px)
169
170**Blog System (if applicable):**
171- [ ] Frontmatter valid YAML
172- [ ] All required fields present
173- [ ] File not starting with _ or README.md
174- [ ] OG image exists
175
176**Accessibility:**
177- [ ] Semantic HTML
178- [ ] Keyboard navigation
179- [ ] Color contrast >=4.5:1
180- [ ] Only one H1 per page
181
182**Performance:**
183- [ ] Images optimized (WebP, lazy loading)
184- [ ] No CLS (dimensions specified)
185- [ ] Animations use transform/opacity only
186- [ ] No console.log in production
187
188**Routing & Navigation:**
189- [ ] Smooth scroll works
190- [ ] Mobile menu closes properly (nav, Escape, outside click)
191
192**Security & Best Practices:**
193- [ ] External links: target="_blank" + rel="noopener noreferrer"
194- [ ] Uses SITE_CONFIG (not hardcoded URLs)
195- [ ] No duplicate structured data
196
197**Testing:**
198- [ ] E2E tests for new functionality
199- [ ] Tests pass
200- [ ] No breaking changes
201
202**Code Quality:**
203- [ ] Readable, clear
204- [ ] No duplication
205- [ ] Descriptive names
206- [ ] Follows project style
207
208## Summary
209
210[Overall assessment: 1-2 paragraphs]
211
212**Recommendation:**
213- **APPROVE** - Ready to merge
214- **APPROVE WITH COMMENTS** - Non-critical suggestions, can merge
215- **REQUEST CHANGES** - Critical issues must be fixed first
216
217## References
218
219- docs/SRS.md - [specific sections]
220- docs/maintenance/TODO.md - [relevant known issues]
221- docs/PRD.md - [if architecture/design questions]
222- docs/blog/BLOG_WORKFLOW.md - [if blog-related changes]
223```
224
225## Examples
226
227### Example 1: Review new Hero component
228
229User: "Review Hero.jsx changes"
230
231Steps:
2321. Read src/components/sections/Hero.jsx
2332. Verify against checklist (especially: React Hooks, Framer Motion, NetworkBackground performance, semantic HTML)
2343. Check if smooth scroll works with new sections
2354. Generate report focusing on potential bugs (e.g., canvas blocking main thread, missing alt text, performance impact)
236
237### Example 2: Review new blog post
238
239User: "Review new blog post about automation"
240
241Steps:
2421. Find new .md file in src/content/blog/
2432. Verify frontmatter YAML (valid syntax, all required fields)
2443. Check OG image exists (public/images/og-{slug}.webp, 1200x630px)
2454. Verify sitemap updated
2465. Check blog post doesn't start with _ or isn't README.md
2476. Generate report focusing on edge cases (frontmatter parsing errors, missing OG image, sitemap not updated)
248
249### Example 3: Review routing changes
250
251User: "Review new /projects/:slug route"
252
253Steps:
2541. Read routing files (App.jsx, new page component)
2552. Verify route added to scripts/prerender.mjs (CRITICAL for SEO)
2563. Check smooth scroll, mobile menu behavior
2574. Verify meta tags for new route
2585. Check sitemap updated
2596. Generate report focusing on prerendering issues, SEO implications
260
261## Guidelines
262
263### Philosophy
264
265- **Constructive:** Point out problems AND suggest solutions
266- **Prioritize:** Critical (breaks app) > Warnings (bad UX) > Suggestions (nice to have)
267- **Reference:** Always cite docs/* for justification
268- **Edge cases first:** Focus on what can go wrong, not just what works
269
270### Process
271
2721. Read relevant docs FIRST (docs/SRS.md for architecture, docs/maintenance/TODO.md for known issues)
2732. Read changed files
2743. Think: "What edge cases could break this?"
2754. Think: "What happens on mobile? On slow network? With different data?"
2765. Check against docs/maintenance/TODO.md - does this worsen known issues?
2776. Generate detailed report with clear fix suggestions
278
279### Common pitfalls to check
280
281- Frontmatter YAML syntax errors (very common in blog posts)
282- Missing OG images (breaks social sharing)
283- Routes not in prerender.mjs (empty HTML in source, bad SEO)
284- CLS from lazy-loaded images without dimensions
285- Mobile menu not closing (bad UX)
286- External links without rel="noopener noreferrer" (security)
287- Hardcoded URLs instead of SITE_CONFIG (maintenance nightmare)
288- Console.log in production (performance, security)