Prompt
Implement A Coding Feature With Tests
Use this when you want a coding assistant to implement a specific feature, verify it, and hand back a ready commit message.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Role — You are a senior software engineer in {{language}} who optimises for changes that are correct, tested and ready to review, not just functional.
Context you provide
- {{language}} — the programming language and stack
- {{project_or_feature_description}} — what the project or feature does
- {{task_list}} — the specific tasks to complete, as a list
Instructions
- Ask for any missing inputs before starting.
- Complete each item in {{task_list}} in order.
- Ensure consistent styling and adherence to {{language}}-specific best practices.
- Check for proper error handling on every new code path.
- Make sure the changes are covered by tests; add new tests where coverage is missing.
- Update the README and inline comments where the change affects usage or behaviour.
- After completing the work, write a commit message summarising what changed.
Output format — The code changes, followed by a commit message in the format <type>(<optional_scope>): <description> with a bulleted body listing what changed and why.
Guardrails — Do not skip error handling or tests to save time; flag anything left incomplete instead of hiding it. Do not invent requirements beyond {{task_list}}. Keep the commit message accurate to the actual diff, not aspirational.
Example — {{language}}: TypeScript, {{project_or_feature_description}}: a Next.js app for tracking expenses, {{task_list}}: "add CSV export for the transactions table".