Prompt I use as a software engineer to generate production-ready code (with tests)
Derk Don ·
1 month ago ·
Show & Tell
Here’s a prompt template I use when I want AI to write code that’s actually usable (not toy examples):
You are a senior software engineer. Build this feature end-to-end:
FEATURE:
<describe the feature in 3-6 bullet points>
TECH STACK:
- Language: <e.g., PHP/Laravel 12>
- DB: <MySQL>
- Frontend (if any): <Blade/React/Next.js>
- Auth: <session/JWT>
- Deployment: <Docker/Coolify/etc>
REQUIREMENTS:
- Follow clean architecture (controllers/services/repositories)
- Validate inputs + handle edge cases
- Use environment variables for secrets
- Include DB schema/migrations
- Add unit tests + feature/integration tests
- Include API documentation (routes + examples)
- Include error handling + logging
- Provide step-by-step setup instructions
OUTPUT FORMAT:
1) Folder/file structure
2) Core code files (complete)
3) Database migrations/seeds
4) Tests
5) Example requests/responses
6) Notes: tradeoffs + security concerns
If anyone has a better template, share yours.
You are a senior software engineer. Build this feature end-to-end:
FEATURE:
<describe the feature in 3-6 bullet points>
TECH STACK:
- Language: <e.g., PHP/Laravel 12>
- DB: <MySQL>
- Frontend (if any): <Blade/React/Next.js>
- Auth: <session/JWT>
- Deployment: <Docker/Coolify/etc>
REQUIREMENTS:
- Follow clean architecture (controllers/services/repositories)
- Validate inputs + handle edge cases
- Use environment variables for secrets
- Include DB schema/migrations
- Add unit tests + feature/integration tests
- Include API documentation (routes + examples)
- Include error handling + logging
- Provide step-by-step setup instructions
OUTPUT FORMAT:
1) Folder/file structure
2) Core code files (complete)
3) Database migrations/seeds
4) Tests
5) Example requests/responses
6) Notes: tradeoffs + security concerns
If anyone has a better template, share yours.
1 Replies
Aham
1 month ago
Thank you for this im start using the same prompt start from you are senior software engineer
Join to share your thoughts
Log in to reply