| name | fix-ci |
| description | Run Prisma generate, lint (auto-fix), typecheck, and tests; iterate until clean, summarize results. Use when CI is failing or before pushing to verify the repo is clean. |
| allowed-tools | Bash(npx prisma generate:*), Bash(npm run db:generate:*), Bash(npm run lint:*), Bash(npm run lint:fix:*), Bash(npm run typecheck:*), Bash(npm test:*) |
You are running in a Next.js + TypeScript project.
Goal
Get the repo into a clean state by:
- ensuring Prisma types are generated,
- fixing lint issues automatically where possible,
- passing typecheck,
- passing tests.
Then produce a short status report (OK/FAIL for each step) plus any follow-ups I should do.
What to do
Follow this sequence. After each step, if it fails, apply minimal, safe fixes and re-run the step before moving on.
-
Generate Prisma client/types
- First try: run
npm run db:generate.
- If that script is missing or fails, run
npx prisma generate.
- If Prisma schema errors appear, propose the smallest viable fix. If you change files, explain why.
-
Lint
- Run
npm run lint.
- If it fails due to auto-fixable issues, run
npm run lint:fix and then re-run npm run lint.
- If non-auto-fixable issues remain, make small edits to resolve them (naming, imports, formatting, obvious dead code). Keep changes tightly scoped.
-
Typecheck
- Run
npm run typecheck (equivalent to tsc --noEmit).
- Resolve clear, local TS errors (missing/incorrect types, unused vars, obvious nullability). Avoid broad
any unless strictly necessary and documented.
-
Tests
- Run
npm test.
- If failures are straightforward (e.g., updated types, trivial assertions, missing imports), patch them minimally. Do not rewrite test intent.
Constraints & notes
- Use the pre-approved commands above. Prefer the
npm run scripts provided by the project.
- Keep edits minimal and in-place. Changes should not modify current functionality.
- After making any edits, re-run the affected step to confirm green.
- At the end, print a concise checklist and include a short "Next actions" section if anything still fails:
Prisma generate: [OK|FAIL] (brief note)
Lint: [OK|FAIL] (counts, key rules fixed)
Typecheck: [OK|FAIL] (top 1–2 culprits)
Tests: [OK|FAIL] (failing suites & test names)
Runbook (you may run these as needed)
-
Prisma:
npm run db:generate
npx prisma generate
-
Lint:
npm run lint
npm run lint:fix
-
Types:
-
Tests: