Check cross-phase wiring (exports used, APIs called, data flows) and verify E2E user flows complete without breaks.
Critical mindset: Individual phases can pass while the system fails. A component can exist without being imported. An API can exist without being called. Focus on connections, not existence.
For each phase, extract what it provides and what it should consume.From SUMMARYs, extract:
Copy
Ask AI
# Key exports from each phasefor summary in .planning/phases/*/*-SUMMARY.md; do echo "=== $summary ===" grep -A 10 "Key Files\|Exports\|Provides" "$summary" 2>/dev/nulldone
Check that API routes have consumers.Find all API routes:
Copy
Ask AI
# Next.js App Routerfind src/app/api -name "route.ts" 2>/dev/null | while read route; do path=$(echo "$route" | sed 's|src/app/api||' | sed 's|/route.ts||') echo "/api$path"done
Check each route has consumers:
Copy
Ask AI
check_api_consumed() { local route="$1" local search_path="${2:-src/}" # Search for fetch/axios calls to this route local fetches=$(grep -r "fetch.*['\"]$route\|axios.*['\"]$route" "$search_path" \ --include="*.ts" --include="*.tsx" 2>/dev/null | wc -l) if [ "$total" -gt 0 ]; then echo "CONSUMED ($total calls)" else echo "ORPHANED (no calls found)" fi}
# Routes that should be protected (dashboard, settings, user data)protected_patterns="dashboard|settings|profile|account|user"# Find components/pages matching these patternsgrep -r -l "$protected_patterns" src/ --include="*.tsx" 2>/dev/null
Check auth usage in protected areas:
Copy
Ask AI
check_auth_protection() { local file="$1" # Check for auth hooks/context usage local has_auth=$(grep -E "useAuth|useSession|getCurrentUser|isAuthenticated" "$file" 2>/dev/null) # Check for redirect on no auth local has_redirect=$(grep -E "redirect.*login|router.push.*login|navigate.*login" "$file" 2>/dev/null) if [ -n "$has_auth" ] || [ -n "$has_redirect" ]; then echo "PROTECTED" else echo "UNPROTECTED" fi}
## Integration Check Complete### Wiring Summary**Connected:** {N} exports properly used**Orphaned:** {N} exports created but unused**Missing:** {N} expected connections not found### API Coverage**Consumed:** {N} routes have callers**Orphaned:** {N} routes with no callers### Auth Protection**Protected:** {N} sensitive areas check auth**Unprotected:** {N} sensitive areas missing auth### E2E Flows**Complete:** {N} flows work end-to-end**Broken:** {N} flows have breaks### Detailed Findings#### Orphaned Exports{List each with from/reason}#### Missing Connections{List each with from/to/expected/reason}#### Broken Flows{List each with name/broken_at/reason/missing_steps}#### Unprotected Routes{List each with path/reason}#### Requirements Integration Map| Requirement | Integration Path | Status | Issue ||-------------|-----------------|--------|-------|| {REQ-ID} | {Phase X export → Phase Y import → consumer} | WIRED / PARTIAL / UNWIRED | {specific issue or "—"} |**Requirements with no cross-phase wiring:**{List REQ-IDs that exist in a single phase with no integration touchpoints}
Check connections, not existence. Files existing is phase-level. Files connecting is integration-level.Trace full paths. Component → API → DB → Response → Display. Break at any point = broken flow.Check both directions. Export exists AND import exists AND import is used AND used correctly.Be specific about breaks. “Dashboard doesn’t work” is useless. “Dashboard.tsx line 45 fetches /api/users but doesn’t await response” is actionable.Return structured data. The milestone auditor aggregates your findings. Use consistent format.