$npx -y skills add BoltzmannEntropy/OSXSkills --skill osx-blockersUse when conducting deep code review for production blockers including API mismatches, memory leaks, busy wait loops, and UI workflow failures. Apply before release to catch runtime bugs that static analysis misses.
| 1 | # Production Blocker Detection |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Systematic deep code review that identifies runtime bugs and production blockers that cause app crashes, hangs, or degraded user experience. This skill goes beyond static code review by simulating user workflows and verifying API contract compliance between frontend and backend. |
| 6 | |
| 7 | **Core Principle:** Every user-facing workflow must be traced end-to-end from UI action through API call to backend handler and back. |
| 8 | |
| 9 | ## When to Use |
| 10 | |
| 11 | - Before any production release |
| 12 | - After major feature implementation |
| 13 | - When debugging intermittent crashes or hangs |
| 14 | - When users report "app freezes" or "nothing happens" issues |
| 15 | - After backend API changes |
| 16 | - When adding new UI workflows |
| 17 | |
| 18 | ## Review Categories |
| 19 | |
| 20 | ```dot |
| 21 | digraph blocker_flow { |
| 22 | rankdir=TB; |
| 23 | node [shape=box]; |
| 24 | |
| 25 | "Start Review" -> "1. API Contract Compliance"; |
| 26 | "1. API Contract Compliance" -> "2. Memory Management"; |
| 27 | "2. Memory Management" -> "3. Busy Wait/Spin Detection"; |
| 28 | "3. Busy Wait/Spin Detection" -> "4. UI Workflow Simulation"; |
| 29 | "4. UI Workflow Simulation" -> "5. Error Path Coverage"; |
| 30 | "5. Error Path Coverage" -> "6. State Machine Validation"; |
| 31 | "6. State Machine Validation" -> "Generate Blocker Report"; |
| 32 | } |
| 33 | ``` |
| 34 | |
| 35 | ## Severity Classification |
| 36 | |
| 37 | | Severity | Definition | Examples | |
| 38 | |----------|------------|----------| |
| 39 | | **P0 (Blocker)** | Crashes app or makes feature unusable | Null pointer, infinite loop, deadlock | |
| 40 | | **P1 (Critical)** | Severe degradation, data loss risk | Memory leak, race condition | |
| 41 | | **P2 (Major)** | Feature broken under certain conditions | Missing error handling, timeout | |
| 42 | | **P3 (Minor)** | Degraded experience but functional | Slow response, UI flicker | |
| 43 | |
| 44 | ## 1. API Contract Compliance |
| 45 | |
| 46 | Verify every frontend API call matches backend expectations exactly. |
| 47 | |
| 48 | ### Discovery Checklist |
| 49 | |
| 50 | - [ ] List all API endpoints from backend (FastAPI routes, Flask routes, etc.) |
| 51 | - [ ] List all API calls from frontend (ApiService, http calls, fetch requests) |
| 52 | - [ ] Cross-reference: every frontend call has matching backend endpoint |
| 53 | - [ ] Cross-reference: every backend endpoint is called by frontend (or documented as internal) |
| 54 | |
| 55 | ### Contract Verification |
| 56 | |
| 57 | For each API endpoint, verify: |
| 58 | |
| 59 | | Check | Frontend | Backend | Blocker If Mismatch | |
| 60 | |-------|----------|---------|---------------------| |
| 61 | | **HTTP Method** | `POST /api/foo` | `@app.post("/api/foo")` | YES - 405 error | |
| 62 | | **URL Path** | `/api/jobs` | `/api/job` (singular) | YES - 404 error | |
| 63 | | **Query Params** | `?status=active` | `status: str = Query(...)` | YES - validation error | |
| 64 | | **Request Body** | `{"text": "..."}` | `class Request(text: str)` | YES - 422 error | |
| 65 | | **Response Shape** | `data.items[0].id` | `{"items": [...]}` | YES - undefined access | |
| 66 | | **Response Status** | `if (res.ok)` | `return JSONResponse(...)` | P1 - silent failure | |
| 67 | | **Content-Type** | `Accept: application/json` | `media_type="application/json"` | P1 - parse error | |
| 68 | |
| 69 | ### Code Patterns to Search |
| 70 | |
| 71 | **Frontend (Dart/Flutter):** |
| 72 | ```dart |
| 73 | // Search for all API calls |
| 74 | http.get|post|put|delete|patch |
| 75 | dio.get|post|put|delete|patch |
| 76 | ApiService.*\( |
| 77 | fetch\( |
| 78 | ``` |
| 79 | |
| 80 | **Backend (Python/FastAPI):** |
| 81 | ```python |
| 82 | # Search for all route definitions |
| 83 | @app\.(get|post|put|delete|patch) |
| 84 | @router\.(get|post|put|delete|patch) |
| 85 | ``` |
| 86 | |
| 87 | ### Common API Mismatches |
| 88 | |
| 89 | | Issue | Frontend Code | Backend Code | Fix | |
| 90 | |-------|---------------|--------------|-----| |
| 91 | | Path mismatch | `GET /api/models` | `GET /api/model` | Align paths | |
| 92 | | Missing trailing slash | `POST /api/jobs` | `POST /api/jobs/` | Remove backend slash or add redirect | |
| 93 | | Query vs Body | `?text=hello` | `Body(text: str)` | Change to body or query | |
| 94 | | Nested vs flat response | `data.result.items` | `{"items": [...]}` | Fix nesting | |
| 95 | | Wrong field name | `item.modelName` | `{"model_name": ...}` | Match snake_case/camelCase | |
| 96 | |
| 97 | ### Automated Check Pattern |
| 98 | |
| 99 | ```bash |
| 100 | # Extract all backend routes |
| 101 | grep -rn '@app\.\(get\|post\|put\|delete\|patch\)' backend/ | \ |
| 102 | sed 's/.*@app\.\([a-z]*\)("\([^"]*\)".*/\1 \2/' | sort > backend_routes.txt |
| 103 | |
| 104 | # Extract all frontend API calls |
| 105 | grep -rn 'http\.\(get\|post\|put\|delete\|patch\)\|ApiService' lib/ | \ |
| 106 | sed 's/.*\(get\|post\|put\|delete\|patch\)[^"]*"\([^"]*\)".*/\1 \2/' | sort > frontend_calls.txt |
| 107 | |
| 108 | # Compare |
| 109 | diff backend_routes.txt frontend_calls.txt |
| 110 | ``` |
| 111 | |
| 112 | ## 2. Memory Management |
| 113 | |
| 114 | Detect memory leaks, unbounded growth, and resource exhaustion. |
| 115 | |
| 116 | ### Flutter/Dart Memory Checklist |
| 117 | |
| 118 | - [ ] All `StreamSubscription` cancelled in `dispose()` |
| 119 | - [ ] All `Timer` and `Timer.periodic` cancelled in `dispose()` |
| 120 | - [ ] All `AnimationController` disposed |
| 121 | - [ ] All `TextEditingController` disposed |
| 122 | - [ ] All `ScrollController` disposed |
| 123 | - [ ] All `FocusNode` disposed |
| 124 | - [ ] No growing lists withou |