Anti-pattern prompting asks an AI system to identify harmful or ineffective implementation approaches and explain how to avoid them. Use it to turn vague concerns about generated code into explicit review criteria, boundary conditions, or design constraints. section 9.6.1
Apply the technique by asking the system to:
- Review code for security vulnerabilities, performance bottlenecks, error handling, duplication, and SOLID-principle violations. section 9.6.1
- Check generated tests against edge cases such as negative values, zero, fractional values, maximum integers, and null or undefined inputs. section 9.6.1
- Examine architectural choices before implementation, such as JWT versus session-based authentication in a microservices architecture. section 9.6.1
A practical review prompt
Review this implementation for security vulnerabilities, performance bottlenecks, missing error handling, code duplication, and SOLID-principle violations. For each issue, explain the risk and suggest a safer alternative. Treat generated suggestions as candidates for developer validation, not as trusted fixes. section 9.6.1
