Use this guide when you want to add a real feature, such as user sign-up, search or a report, to an existing project with an AI assistant's help. Have your project under version control, your tests running and a clear description of what the feature should do.
Step by step
Write a short feature description
Describe what the feature does, who uses it and how you will know it works, in a few sentences. Include examples of expected inputs and outputs. This description becomes the context you give the AI in each prompt.
Split the feature into increments
Break the feature into three to six small steps, each of which leaves the app working, such as data model, back-end logic, user interface and error handling. Order them so each builds on the last. Create a new branch for the feature before you start.
Prompt for one increment at a time
Give the assistant the feature description, the relevant existing code and the single increment you want now. Ask it to explain its plan briefly before writing code and to include tests. Correct any misunderstanding before it writes more.
Review and run the tests
Read the suggested code line by line and check any unfamiliar functions against official documentation. Run the full test suite, not just the new tests. If something fails, give the assistant the exact error and the input that caused it.
Commit each working increment
When an increment works and you understand it, commit it with a clear message describing what changed. This gives you a safe point to return to if the next step goes wrong. Check the diff before committing to catch unexpected changes to other files.
Finish with a full review
When all increments are done, review the complete set of changes on the branch, test the feature manually from a user's point of view and try edge cases. Update any documentation. Merge the branch only when everything passes.
Ready-to-use checklist
- Project under version control
- Feature description written
- Feature branch created
- Increments listed in order
- Tests requested with each increment
- Every line reviewed and understood
- Full test suite passing
- Manual test of the whole feature
Practical tips
- Start a fresh conversation with the assistant for each feature so old context does not confuse it.
- Keep a running notes file of decisions made during the feature, which you can paste into future prompts.
- If an increment takes more than two attempts, make it smaller.
Common problems
The AI rewrote parts of the app I did not ask about.
Discard the unwanted changes using version control and repeat the request, stating exactly which files and functions it may change. Reviewing the diff before each commit catches this early.
Each increment works alone but they do not fit together.
Paste your feature description and the current code into the prompt each time so the assistant sees the whole picture. Consider adding an integration test that checks the increments together.
The tests pass but the feature does not behave as expected.
The tests may be checking the wrong thing. Write down the expected behaviour as an example, add a test for it and fix the code until it passes.