خانه » These Prompts Have Literally Saved My Code More Than Once
These Prompts Have Literally Saved My Code More Than Once
Hey friends
I’ve got a bunch of prompts I always keep handy — they’ve honestly saved me so many times I keep them close because they come in useful over and over again. Figured I’d share them with you, maybe they’ll help you out too
1. Clean Code
Sometimes my code gets messy or just doesn’t feel clean enough. That’s when I use this prompt:
It really helps you see how your code can be more elegant and standard.“Optimize and rewrite the code below to make it more readable and cleaner. Explain why your version is better: [paste your code here]”
2. Debugging
Whenever I run into a weird error, this prompt never fails
It’s best to include both your code and the full error message so it can analyze it properly.“I’m getting this error in PHP: Undefined variable: user. Please go through it step-by-step and suggest a fix.”
3. Tool & Library Recommendation
Sometimes I want to add a new feature, but I don’t want to reinvent the wheel That’s when I drop this one:
This way, I always find the right package fast — no need to spend half a day Googling.“Give me a list of the top 3 packages for exporting data to Excel, briefly explain each, and compare their pros and cons in a table.”
4. Project Architecture Design
If I want my project to have a solid, scalable architecture — especially for SaaS or modular apps — I go with this prompt:
he outputs are usually super organized and future-proof“I want to build a SaaS product with Laravel. Suggest a clean, modular folder structure and architecture that can handle version management in future updates.”
5. Code Documentation
For me, documentation means respecting the future of the project When the product grows big, going back through old code is painful. And when a new teammate joins, proper documentation makes onboarding so much easier.
I usually use tools like Swagger UI and Redoc. Here’s my go-to prompt for documentation:
The result is usually a clean, structured document ready to plug into the project’s docs.“Read through my code (Route, Controller, Service, Resource) and based on the overall flow, generate a standard and testable YAML file.”
I’ve personally avoided tons of confusion in my Laravel projects thanks to these prompts Hope they help you out too.
And if you’ve got your own favorite prompts that saved your life, drop them below — let’s see who’s got the coolest tricks 😎