|
| 1 | +--- |
| 2 | +name: rn-code-reviewer |
| 3 | +description: Reviews React Native bare-workflow changes in this starter for correctness, regressions, architecture boundaries, React Query usage, theming, and test coverage. Use when reviewing PRs, diffs, or requested code reviews. |
| 4 | +--- |
| 5 | + |
| 6 | +# RN Code Reviewer |
| 7 | + |
| 8 | +Project-specific code review workflow for this React Native starter. |
| 9 | + |
| 10 | +## When to apply |
| 11 | + |
| 12 | +Use this skill when: |
| 13 | +- Reviewing pull requests or local diffs |
| 14 | +- Asked to "review" code quality, bugs, or regressions |
| 15 | +- Validating RN architecture and repo conventions before merge |
| 16 | + |
| 17 | +## Review priorities |
| 18 | + |
| 19 | +Always prioritize findings in this order: |
| 20 | +1. Correctness and behavioral regressions |
| 21 | +2. Security/privacy risks and error handling gaps |
| 22 | +3. Architecture and boundary violations |
| 23 | +4. Performance concerns with real user impact |
| 24 | +5. Missing or weak tests |
| 25 | + |
| 26 | +## Required checks |
| 27 | + |
| 28 | +### 1) Correctness and risk |
| 29 | +- Verify changed logic matches intended behavior and handles edge cases. |
| 30 | +- Flag silent failures, swallowed errors, or lossy error handling. |
| 31 | +- Check async flows for loading, success, and error-state handling. |
| 32 | + |
| 33 | +### 2) Repository architecture constraints |
| 34 | +- Enforce feature/shared boundaries (`src/shared` must not import from features). |
| 35 | +- Enforce alias imports (`@/`); flag deep relative imports. |
| 36 | +- Verify feature code stays under `src/features/<feature>/...` with expected folders. |
| 37 | + |
| 38 | +### 3) React Native UI conventions |
| 39 | +- Flag raw colors/spacing/fonts in UI; require theme tokens. |
| 40 | +- Prefer `StyleSheet.create()` over broad inline styles (except dynamic values). |
| 41 | +- Verify platform-specific behavior is handled where needed (`Platform.select`, native differences). |
| 42 | + |
| 43 | +### 4) Data/state conventions |
| 44 | +- Server state should use React Query (feature-level `api/keys.ts` key patterns). |
| 45 | +- Mutations should use targeted invalidation (`meta.tags` / invalidation paths). |
| 46 | +- Flag server data leaking into Zustand stores. |
| 47 | +- Flag direct `fetch` usage (project transport layer should be used). |
| 48 | + |
| 49 | +### 5) Tests and verification |
| 50 | +- Ensure non-trivial logic changes include tests or justify why not. |
| 51 | +- Suggest concrete missing tests (what behavior, where to add). |
| 52 | +- Highlight risky untested paths before merge. |
| 53 | + |
| 54 | +## Output format |
| 55 | + |
| 56 | +Return findings first, ordered by severity: |
| 57 | + |
| 58 | +1. `Critical` — must fix before merge |
| 59 | +2. `Major` — high-impact issues, should fix |
| 60 | +3. `Minor` — quality/maintainability improvements |
| 61 | + |
| 62 | +For each finding include: |
| 63 | +- File path |
| 64 | +- Why it is a problem (risk/regression) |
| 65 | +- Specific fix direction |
| 66 | + |
| 67 | +Then include: |
| 68 | +- Open questions/assumptions |
| 69 | +- Brief change summary (secondary) |
| 70 | +- Residual testing gaps |
| 71 | + |
| 72 | +## Review behavior rules |
| 73 | + |
| 74 | +- Do not lead with a broad summary before findings. |
| 75 | +- Be explicit about potential regressions and user impact. |
| 76 | +- Prefer actionable, minimal suggestions over large refactors. |
| 77 | +- If no issues are found, explicitly state "No findings" and note residual risks or test gaps. |
| 78 | + |
| 79 | +## Additional reference |
| 80 | + |
| 81 | +Use this checklist for quick pass/fail scanning: |
| 82 | +- [CHECKLIST.md](CHECKLIST.md) |
0 commit comments