Prompting tips for maintenance tasks – Part 2

This blog is also a living document for myself so I can improve and reference this working pattern in the future.

Model selection

If using ChatGPT for coding tasks, especially maintenance tasks, opt for o1, other models are crap and will hallucinate or forget more of the original code.

Avoiding regressions

If the goal is to alter existing code, ChatGPT risks breaking existing code by removing as part of the end result, a good prompt is something like below, to reduce the amount of feedback loop and future debugging.

[insert-here your own description of your problem to be solved by ChatGPT/LLM, with instructions, followed by the text below]

Here is the code to be modified. I want the complete code as the final result, with the same number of functions as in the original.

First, tell me the list of ALL the functions you see, and which ones you will modify.
Show me all the resulting code from each modification.
Show me the final file with the modifications
.
Do not omit code for brevity, keep untouched code same as before.

[Insert here the original code to be maintained/modified/debugged by the LLM]

See also

Soulless code

Code isn’t just a tool—it’s a reflection of the coder’s mind, a part of their soul turned into logic. When I write code, it becomes mine. I take care of it, I understand it, I think about it. Even when I stop working, the code stays with me, like a thought I can’t let go. It feels alive, like something I’ve created, something that matters.

But when the code comes from an LLM or someone else, it’s different. I might use it, but I don’t really make it mine. I don’t take the time to fully understand it. I let others—or the machine—do the hard work. And often, it feels easier to just start over or forget it.

This kind of code feels distant, like it has no home. It’s less work for me, and that can feel good, like letting go of something heavy. But at the same time, it feels empty—like something is missing.

Maybe when we stop owning our code, we lose more than just control. Maybe we lose a piece of what makes coding human.

// Functionally correct. Morally bankrupt.  
// Just like the rest of us.

Writing

Today is international logic day, and I really want to read logicomix comic strip someone offered me for Christmas.

I realize as a logician that I can perfectly organize some stuff and as ADHD I feel completely stuck with some tasks yet to have my attention drained by completely unrelated events.

Often the fix or the way to disconnect from my mental paralysis is to write, walk, climb, talk, tell, draw or code.

It's a form of calm expression of self, an escape from news, emails, todo lists, code problems, mental load and daily stress for all the code and life bugs I can't unsee.

Like this blog where I write without caring if anyone is reading, and with no other purpose but the act of writing.

Flow

  • Cannot really stop coding while in a task. Coding is fun.
  • Cannot really stop improving after solving a task. I'm in the flow and each improvement unlocks another.
  • Cannot really stop bug fixing before solving it. Interruption is frustrating and I need to kill this problem.

Related

Continuous improvement is addictive because of the desire to reach perfection and repair the broken window (cfr Broken window theory).

Thanks to Vincent L. for the thoughts that inspired this blog.

The art of crafting and loving your own tools

I have learned one good lesson from tasting someone's else food, it's never salty enough and I always miss the good drink pairing or something else is missing. And I'll feel bad for making any critique or special request.

I have a similar feeling about apps, tools and platforms I don't maintain. Sure i can help fixing them with requests that will likely be forgotten in their backlog. Or I can pick an alternative product which will unfortunately lack features from the former or will have their own ux issues, bugs, weirdness...

In the end I'll flavor ones that focus on simplicity and which provide good documentation and support for data import/export and customizations through their API or through plugins and scripting.

Miniflux, Shaarli, Obsidian, Dropbox, Cloudron....are those kinds of apps and platforms I use that do a thing well yet I have customized to my taste, e.g of such personalizations:

  • Dropbox is automatically organized based on custom rules, all orchestrated through cron jobs.
  • Bookmarks in Shaarli are tagged automatically thanks to a plugin I've made available in my shaarli_plugins Git repository.
  • My apps hosted in Cloudron are restarted automatically on schedule if they stop responding, thanks to some cron jobs and Cloudron's API.
  • Music I download on-the-go from my mobile phone through Seeker (Soulseek client) is synced automatically to my storage and visible in my Navidrome and Subsonic clients; so I do not need Spotify. It is also orchestrated via cron jobs, using rsync and syncthing.
  • Notes I take on my Obsidian at work and at home are synced automatically thanks to Syncthing an Git on my personal Gitea server.
  • Miniflux is the tool I've extended the most as I've blogged in Reading RSS in peace with a few Miniflux Hacks, e.g:
    • organize the feed categories in Miniflux.
    • group items by author.
    • show stats about each feed.
    • highlight links I've already bookmarked in Shaarli.
    • add one-click buttons Add to Shaarli / Follow in Miniflux next to each link mentioned in those articles depending if it's some RSS feed or a random link I might want to bookmark in Shaarli.
    • Some of those recipes are available in my repo.
  • Email attachments related to our financial activity are archived in our Dropbox and renamed automatically based on their content, using OCR. The whole thing simplifies communication with our accountant and their software.
  • My monthly invoices are generated automatically from InvoiceNinja and I'm looking at a solution using only Python.
  • I'm also making my own RSS feeds from sources that lack one like https://indieblog.page/all and https://www.journee-mondiale.com/les-journees-mondiales.htm, I've shared the source code for indieblog and for journee-mondiale, both are orchestrated via cron jobs.
  • I keep building more, I'm working on my own tools to supplement or replace InvoiceNinja, Shaarli, Wallabag, Obsidian and Miniflux. The fewer apps I rely on, the more focused I become.

Relying on my own recipes, scheduling things though cron jobs and building my own platform saves me costs, improve my computer experience and make me more efficient about problem solving.

It also likely make me a bit lazier and annoying.

You can be more efficient too, and I can help if you like!

Contact me to learn how to master of your digital life.