From cc-auto-workflow
Review code against project rules and standards. Use when user asks "review code, review-code issue
How this skill is triggered — by the user, by Claude, or both
Slash command
/cc-auto-workflow:review-codeThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Before code review, validate:**
Before code review, validate:
11 or #11)specs/rules/ folderspecs/issues/ folderIf validation fails:
❌ Code review failed — validation error!
Issues:
- Issue #11 not found in specs/issues/
- Branch feature/hung-11-* doesn't exist
- specs/rules/ folder missing
- Rules files incomplete
Solution:
1. Create the feature branch (or provide file paths)
2. Implement the issue
3. Ensure specs/rules/ files exist
4. Then retry /review-code [issue-number]
Đọc code từ branch hoặc files, so sánh với specs/rules/, ghi feedback vào specs/comments/[ISSUE-NUMBER]-code-review.md.
specs/rules/User gọi: review-code 11 → extract number 11
Tìm branch hoặc files:
feature/hung-11-calendar-widgetspecs/rules/coding.md — Naming, folder structure, Riverpod, error handling
specs/rules/flutter.md — Flutter patterns
specs/rules/design.md — Design tokens, colors, typography
specs/rules/clean-code.md — Code quality
Kiểm tra xem đã tuân theo quy tắc chưa ?
🧪 No Warnings
flutter analyze = 0 warnings?---
GitHub Issue: #11
Issue Title: Calendar Widget
Review Date: YYYY-MM-DD
Type: Code Review
Reviewer: Claude Code
---
## **Code Summary**
[Tóm tắt files/components được implement]
## **✅ What's Good**
- Folder structure correct
- Riverpod providers properly structured
- Widget extraction appropriate
- Consistent naming conventions
## **🚨 Critical Issues** (Must fix)
### Issue 1: [Title]
**Location:** `lib/features/calendar/presentation/screens/calendar_screen.dart:42`
**Problem:** Hardcoded color `Color(0xFF4CAF50)` instead of `AppColors.primary`
**Rule:** specs/rules/coding.md — Constants
**Fix:** Replace with `AppColors.primary`
### Issue 2: [Title]
...
## **⚠️ Code Quality Issues** (Nice to have)
### Issue 1: [Title]
**Location:** `lib/features/calendar/providers/calendar_provider.dart:15`
**Problem:** Method `_buildCalendar()` > 50 lines, should extract as widget
**Rule:** specs/rules/coding.md — Widgets
**Suggestion:** Extract to `CalendarGridWidget`
### Issue 2: [Title]
...
## **📊 Code Quality Score**
| Category | Status | Notes |
|----------|--------|-------|
| **Structure** | ✅/❌ | Folder organization |
| **Naming** | ✅/❌ | Conventions followed |
| **Riverpod** | ✅/❌ | Provider pattern |
| **Widgets** | ✅/❌ | Widget extraction |
| **Constants** | ✅/❌ | No hardcoding, colors/spacing via constants |
| **Magic Numbers** | ✅/❌ | ALL numbers extracted to named constants? |
| **Strings** | ✅/❌ | i18n proper, no hardcoded strings |
| **Imports** | ✅/❌ | Order & style |
| **flutter analyze** | ✅/❌ | 0 warnings? |
**Overall: X/10**
## **📋 Rule Compliance**
✅ Follows: `specs/rules/coding.md`
✅ Follows: `specs/rules/flutter.md`
❌ Violates: `specs/rules/clean-code.md` (magic numbers)
## **✍️ Action Items**
- [ ] Fix critical issues (2 items)
- [ ] Address code quality (3 items)
- [ ] Run `flutter analyze` & confirm 0 warnings
- [ ] Run `flutter test` & ensure all pass
## **Status**
- [ ] NEEDS_FIX — Critical issues found
- [ ] READY_TO_MERGE — Code meets standards
✅ Code Review Complete
📄 File: specs/comments/011-code-review.md
📊 Violations:
🚨 Critical: X issues (must fix)
⚠️ Quality: X suggestions
✅ Compliance: X/10
🏷️ Rules Coverage:
✅ coding.md
✅ flutter.md
❌ clean-code.md (3 issues)
⏭️ Next Step:
Fix critical issues, re-review, then merge
| Lỗi | Xử lý |
|---|---|
| Branch/files không tồn tại | Dừng, thông báo không tìm thấy |
flutter analyze có warning | Report all warnings, block merge |
| Tests fail | List failing tests, block merge |
| Hardcoded values | List each location, mark critical |
| Naming violation | Suggest correct name |
flutter analyze warningsSTRICTLY scan all code for EVERY hardcoded number. Check:
if (x > 5), if (x >= 18), if (x < 3) → Extract to constantarray[0], list[7], weekday == 6 || weekday == 7 → Extract to constantList.generate(7, ...), for (int i = 0; i < 10; i++) → Extract to constantx / 7, x * 24, y - 1 → Extract to constant with meaningful namewidth: 28, height: 28, size: 18, padding: 2 → Use AppSpacing/constants'Hôm nay', 'Error' → Use Strings class (NOT critical but flag)for (int i = 0; i < items.length; i++) — i is fine// Return first 3 items with magic 3 — OK if explained// ❌ BAD - flag these
if (items.length > 5) { } // Magic: 5
final rows = (total / 7).ceil(); // Magic: 7
width: 28, height: 28 // Magic: 28 (should be const)
date.weekday == 6 || date.weekday == 7 // Magic: 6, 7
padding: EdgeInsets.all(2) // Magic: 2 (should be AppSpacing.xs)
List.generate(7, ...) // Magic: 7 (should be const _daysPerWeek)
index >= 5 // Magic: 5 (should be const _weekendStartIndex)
// ✅ GOOD - extracted constants
const int maxStatusLength = 5;
const int daysPerWeek = 7;
const double buttonSize = 28;
if (items.length > maxStatusLength) { }
final rows = (total / daysPerWeek).ceil();
width: buttonSize, height: buttonSize
Use Grep to find all numbers in code:
grep -n "[0-9]" file.dart (look for digit patterns)= [0-9], > [0-9], < [0-9], == [0-9]width:, height:, size:, padding:, .generate(, []For each number found, ask:
If any of above = YES → Flag as magic number
STRICT RULE: If you find ANY hardcoded number that could be a constant, FLAG IT.
npx claudepluginhub nxhung2204/cc-auto-workflow-plugin --plugin cc-auto-workflowGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.