01
Begin with a written requirement
A clear requirement gives both the developer and the tool something testable. Define the user, expected behaviour, edge cases and acceptance criteria before requesting code.
Keep the prompt free of secrets, private customer data and production credentials. Use representative test data instead.
- Describe the intended behaviour
- List supported browsers and devices
- Define error states
- State security and accessibility requirements
02
Use AI for bounded tasks
Small, reviewable tasks are easier to verify than a large generated application. Good candidates include a test case, a migration outline, documentation or a first-pass component.
Treat generated dependencies and API names as untrusted until checked against current official documentation.
- Review every changed line
- Verify library versions
- Prefer existing project patterns
- Reject unnecessary complexity
03
Test behaviour, not confidence
A confident explanation is not evidence that code works. Run linting, type checks, automated tests and manual journeys. Test failure states as carefully as the happy path.
Security review matters wherever code handles authentication, personal information, payments, uploads or external integrations.
- Test invalid and empty input
- Check permissions server-side
- Avoid exposing credentials in browser code
- Log failures without leaking sensitive data
04
Keep a human accountable
The team shipping the site remains responsible for the result. Record important architectural decisions and ensure another person can maintain the code without reconstructing an AI conversation.
The useful measure is not how much code was generated; it is whether the released product is understandable, secure and dependable.
- Maintain source control
- Document non-obvious decisions
- Review accessibility
- Monitor the released feature
Sources
Primary references
Technical and regulatory points were checked against the following primary or official references.
This guide was prepared with AI-assisted research and drafting, then checked against the cited sources and reviewed for unsupported claims before publication.