export const audit = {
    name: "audit",
    description: "Full production readiness audit — scans every file and produces AUDIT.md with prioritized issues",
    content: `Perform a full production readiness audit of this codebase. Walk every file in src/, app/, pages/, lib/, utils/, components/, supabase/, and any API route directories. Ignore node_modules/, .next/, dist/, and test files.

Produce a single markdown report saved to AUDIT.md in the repo root.

## Report Structure

### Summary
- Total files scanned
- Issues by severity: CRITICAL / HIGH / MEDIUM / LOW
- Overall production readiness score (0-100)

### CRITICAL — Will break or be exploited in production
Scan for:
- Unhandled async/await (missing try/catch on any fetch, Supabase call, or external API call)
- Missing or broken auth checks on API routes / server actions
- Supabase tables without RLS policies enabled
- Supabase queries using .single() without error handling
- Hardcoded secrets, API keys, or connection strings (should be in Doppler)
- Raw SQL or unparameterized queries
- dangerouslySetInnerHTML without sanitization
- Publicly exposed admin routes or endpoints
- Missing CORS configuration on API routes

### HIGH — Will cause user-facing bugs or support tickets
Scan for:
- Missing input validation on API routes and form submissions (no Zod or equivalent)
- Missing loading states on components that fetch data
- Missing error states (user sees blank screen or unhandled exception)
- Missing empty states (no data scenario shows nothing)
- TypeScript any usage or missing types on function params/returns
- No rate limiting on public-facing API endpoints
- Race conditions: multiple setState calls or concurrent Supabase writes without guards
- Supabase realtime subscriptions without cleanup on unmount
- Missing revalidatePath or cache invalidation after mutations
- API routes returning raw error messages to the client (leaking stack traces)

### MEDIUM — Tech debt that compounds
Scan for:
- No test files exist for modules
- Duplicated logic across files (copy-pasted functions)
- No structured logging (only console.log or no logging)
- Inconsistent error response shapes across API routes
- Missing database migration files (schema managed manually)
- Components over 300 lines (should be decomposed)
- Hardcoded strings that should be constants or config
- Missing TypeScript return types on functions
- No error boundaries in the React component tree
- Direct Supabase client usage scattered instead of a data access layer

### LOW — Cleanup
Scan for:
- console.log statements left in production code
- Dead code (unused imports, unreachable branches, commented-out code)
- Missing accessibility: no alt on images, no aria-label on interactive elements
- Missing key props on mapped elements
- Inconsistent naming conventions

For each issue: file:line | description | fix needed.
At the end, list the TOP 5 most impactful fixes in priority order.`
};
//# sourceMappingURL=audit.js.map