1. State the Goal Clearly
Start with what you want to achieve:
Add user authentication using NextAuth.js with Google OAuth. Users should be redirected to /dashboard after login.
2. Provide Context When Helpful
Give context about your project:
This is a Next.js 14 app using App Router and PostgreSQL with Prisma. Add a /api/users/[id] route that returns user profile data.
3. Specify Acceptance Criteria
Define what "done" looks like:
Implement email validation for the signup form:
- Check format with a regex
- Verify domain has MX records
- Show inline error if invalid
- The existing tests should still pass
4. Request Verification
Ask Claude Code to verify its work:
After making the changes, run the test suite and fix any failures.
5. Constrain the Scope
Prevent over-engineering:
Fix the null pointer error in calculateTotal. Don't refactor other parts of the file.