blog.pierrehenry.be

How to Code Faster Without Tedious Repetitive Tasks

Photo by Bernd 📷 Dittrich How to Code Faster Without Tedious Repetitive Tasks - Photo by Bernd 📷 Dittrich on Unsplash

Alright, let’s get right into it. I want to show you something cool about Cursor, this AI-powered code editor I’ve been using a lot lately. It’s one of those tools that, once you start using it, you realize how much time you’ve been wasting on little tasks that should be automated. Cursor is like having a junior developer sitting next to you, except it never gets tired and it’s always ready to help.

Ask Cursor Anything (Seriously)

So, here’s the thing: with Cursor, you can basically ask it to do anything you want. Need to minify a file? Done. Want to compress something? No problem. Tasks that would usually have you jumping to some random third-party website or service—Cursor can handle them right inside your editor.

For example, if you want to format or minify a CSS or JS file, just ask Cursor. It’ll do it for you. It even listens to the output of commands like yarn, npm, or pnpm. You can literally tell it, “Hey, run this command and watch what happens,” and it’ll keep an eye on the output for you.

Real-Time Error Handling and Auto-Fixing

Let me show you how this plays out. Say you’re running a React dashboard app (or React Native, or whatever you’re working on). You can ask Cursor to run your app with Expo, listen for any errors, and then automatically fix whatever errors it finds. It’s like a feedback loop: Cursor listens, catches the error, tries to fix it, and keeps going.

This is a game changer. You can go make a coffee while Cursor is working through your build errors. Of course, you still need to check what it’s doing. Sometimes it might remove a function or swap out something you didn’t want changed. You can set up rules in the Cursor rules file—like “don’t remove comments” or “don’t touch this function”—but sometimes Cursor (or any AI code editor, really) can be a bit stubborn.

Here’s what my generic Cursor rules file looks like:

Software development How to Code Faster Without Tedious Repetitive Tasks - Photo by Árpád Czapp on Unsplash

1{
2  "noRemoveComments": true,
3  "preserveFunctions": ["myImportantFunction"]
4}

You can add your own rules, and it’s a good idea to do so. But always, always do a code review. Treat Cursor like a good junior engineer: you’re the senior, and you’re reviewing what it did. Be specific about what you want. AI can be smart, but it needs clear instructions. The more context you give, the better the results.

The Magic of Listening to Terminal Output

This is where things get really interesting. When you ask Cursor to listen to the output of a terminal command, it’s like having a little automation loop running in the background. For example, you run yarn submit, and if there’s an error, Cursor sees it, understands it, and tries to fix it automatically. It’s a feedback loop that just keeps going until the job is done.

Here’s a quick example of how you might set this up:

1# In Cursor, you can prompt:
2"Run yarn submit, listen for errors, and fix them automatically."

It’s honestly kind of wild how much time this saves. You can even ask Cursor to fetch data online or compress images using API services. Right now, it can’t compress images from your local computer directly (at least, I haven’t tried that yet), but you can use APIs like ImageOptim or TinyPNG. Just tell Cursor to use the API, and it’ll handle it.

Be Specific, Stay in Control

One thing I’ve learned: you have to be extremely specific with your prompts. Tell Cursor exactly what you want, and give it the context it needs. When you do that, it really does change everything. The more precise you are, the better Cursor performs.

And remember, always review what it does. You’re still the master of your codebase. Cursor is there to help, but you’re in charge.

Photo by Safar Safarov How to Code Faster Without Tedious Repetitive Tasks - Photo by Safar Safarov on Unsplash


Key Takeaways

“Treat AI like a good junior engineer: you’re the senior, and you’re reviewing what it did.”

“The more precise you are, the better Cursor performs.”


Pierre-Henry Soria

GitHub · PierreHenry.Dev · YouTube

<< Previous Post

|

Next Post >>

#Ai-Powered Software #Code Editor #Cursor Ai #Developer Tools #Productivity #Programming Productivity #Tasks #Tech