You are running in a Next.js + TypeScript project.
Goal
Get the repo into a clean state by:
1) ensuring Prisma types are generated,
2) fixing lint issues automatically where possible,
3) passing typecheck,
4) 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.
1) 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.
2) Lint
- Run
npm run lint. - If it fails due to auto-fixable issues, run
npm run lint:fixand then re-runnpm run lint. - If non-auto-fixable issues remain, make small edits to resolve them (naming, imports, formatting, obvious dead code). Keep changes tightly scoped.
3) Typecheck
- Run
npm run typecheck(equivalent totsc --noEmit). - Resolve clear, local TS errors (missing/incorrect types, unused vars, obvious nullability). Avoid broad
anyunless strictly necessary and documented.
4) 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 runscripts 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:generatenpx prisma generate
- Lint:
npm run lintnpm run lint:fix
- Types:
npm run typecheck
- Tests:
npm test