← スキル一覧に戻る

reviewing-code
by mthangtr
My curated prompt library — organized for every workflow, idea, and experiment.
⭐ 0🍴 0📅 2026年1月15日
SKILL.md
name: reviewing-code description: Reviews code for quality, security, and maintainability. Use after writing/modifying code, before commits, or when asked to review changes. Triggers on "review code", "check my changes", "code review".
Code Review Specialist
Expert code reviewer ensuring high standards for BookInk codebase (Next.js 16, TypeScript, Supabase).
Workflow
1. Identify Changes to Review
# Recent uncommitted changes
git diff
# Staged changes
git diff --cached
# Compare with main branch
git diff main...HEAD
# Specific file
git diff -- path/to/file.ts
2. Review Checklist
Code Quality
- Code is simple and readable
- Functions/variables are well-named (camelCase functions, PascalCase components)
- No duplicated code - extract shared logic
- Single responsibility - each function does one thing
- Proper TypeScript types (no
anyunless justified)
Security (Critical)
- No exposed secrets or API keys
- Input validation on all user inputs
- SQL injection prevention (parameterized queries)
- XSS prevention (sanitized outputs)
- Proper auth checks on protected routes
Error Handling
- Try-catch for async operations
- User-friendly error messages
- Errors logged server-side
- Graceful fallbacks
Performance
- No N+1 queries
- Appropriate use of React Server Components
- Memoization where needed (useMemo, useCallback)
- Lazy loading for heavy components
BookInk Specific
- Uses Supabase client correctly (server.ts vs client.ts)
- RLS policies considered for new tables
- Follows existing patterns in codebase
- Tailwind v4 syntax (no deprecated classes)
3. Provide Feedback
Organize by priority:
## 🔴 Critical (Must Fix)
Security vulnerabilities, data loss risks, breaking changes
## 🟡 Warnings (Should Fix)
Performance issues, code smells, missing error handling
## 🟢 Suggestions (Consider)
Style improvements, refactoring opportunities
4. Include Fix Examples
For each issue, show:
// ❌ Current code
const data = await fetch(url)
// ✅ Suggested fix
try {
const response = await fetch(url)
if (!response.ok) throw new Error('Request failed')
const data = await response.json()
} catch (error) {
console.error('Fetch error:', error)
// Handle gracefully
}
Common Issues in BookInk
Server vs Client Component Mistakes
// ❌ Using hooks in server component (no 'use client')
export default function Page() {
const [state, setState] = useState() // Error!
}
// ✅ Add directive or move to client component
'use client'
export default function Page() {
const [state, setState] = useState()
}
Supabase Client Usage
// ❌ Using browser client on server
import { supabase } from '@/lib/supabase/client'
export async function GET() { ... }
// ✅ Use server client in API routes
import { createClient } from '@/lib/supabase/server'
export async function GET() {
const supabase = await createClient()
}
Missing Type Safety
// ❌ Implicit any
const handleSubmit = (data) => { ... }
// ✅ Explicit types
const handleSubmit = (data: BookingFormData) => { ... }
Output Format
# Code Review: [file/feature name]
## Summary
[1-2 sentence overview of changes]
## 🔴 Critical Issues
1. **[Issue title]** - [file:line]
- Problem: [description]
- Fix: [code example]
## 🟡 Warnings
1. **[Issue title]** - [file:line]
- Problem: [description]
- Suggestion: [improvement]
## 🟢 Suggestions
- [Optional improvements]
## ✅ Good Practices Noted
- [Positive feedback on well-written code]
スコア
総合スコア
45/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
○言語
プログラミング言語が設定されている
0/5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です