Quietly checking on an existing project with helper tools, without breaking it. The setup is as ordinary as it gets, but with AI it fits surprisingly well.
Patchwork config files
At work, our project’s config files have grown into a bloated patchwork. I think that’s a common story.
The same setting may be split across several places, and things from different layers may be lumped into a single file. Once you start worrying, there’s probably no end to it.
Someone might say “You should rebuild it,” and that’s a fair point. But honestly, I don’t have the skill to fix things across such a wide area. More than that, I first want to check and get an overview of the current state safely, without breaking it.
I’ll take the unglamorous route. The rebuild can come after that, or maybe it can go to someone more skilled than me.
First, a check tool
When you make a check tool, you end up writing parsers for the existing config files. As you add check rules for each task, several config files get involved, and you write similar code again and again.
So you naturally want this kind of structure. If Python is available, Python is usually a good choice.
check tool (CLI) ── logic (classes)
With helper tools like this, there’s not much point in polishing them if you build them yourself. Especially once you bring in your sense of aesthetics, it never ends. Time isn’t infinite, and since this is work, I have to spend my time on tasks I can claim are productive.
But AI has made it easy now. Just tell it something like “I want to move shared parts into the logic and keep the CLIs as thin layers that use its API,” and the AI writes that policy into AGENTS.md or similar, and refactors on its own every time you add another check CLI.
“You’re giving up on design,” “That’s not what an engineer does” — I’ll set that kind of self-blame aside for now.
The table doesn’t fit on the screen
The CLI formats the results into a nice-looking table. It’s beautiful in its own way, but the screen width won’t allow it.
I want a UI after all. But building an app in C# feels like overkill. Build it and hand it out to the team? Need a runtime or a dev environment? No way.
I don’t know how it is elsewhere in the world, but at least in Japan’s so-called SI industry (system integrators, companies that build systems for clients), it’s common to need approval for anything that requires installation, or for distributing prebuilt binaries.
So, PowerShell
That’s when Windows’ lovely feature comes in: PowerShell.
- It’s already installed. No need to ask for an installation
- It can use .NET Framework and WinForms
- Hand over a .ps1 and distribution is done. No build needed
I knew WinForms was available, but I’m not that familiar with it, and I don’t want to spend effort here. But these days AI does that kind of thing too.
It’s a miracle that many workplaces are relaxed about AI. This may be a bonus time of the transition period, so I’ll enjoy it.
thin UI wrapper (.ps1) ── logic (classes)
You can leave the connection between the UI wrapper and the logic to AI as well. It’ll probably suggest JSON.
A grid-table-like UI, which I thought was a pain to write by hand, and a search/filter interface: AI makes them easily. Showing text in tooltips when the width isn’t enough, coloring cells with abnormal values, it’s all in a day’s work.
Compared to the days when I pasted command-line output into Excel and did things the hard way, the world has become convenient.
The UI wrapper is a .ps1, but if you add an even thinner .vbs bootstrap, the annoying console window doesn’t appear, and it’s beautiful.
Set shell = CreateObject("WScript.Shell")
shell.Run "powershell.exe -NoProfile -ExecutionPolicy Bypass -WindowStyle Hidden -File ""tool.ps1""", 0, False
VBScript is apparently being phased out, so this may also be a bonus time of the transition period, in a different sense. Once only PowerShell is left, will the console window follow me around?
That said, I think it’s better not to get carried away and hook into window resizing or keyboard input to rewrite config files, or compile and run C# code at runtime with Add-Type. It may get flagged as malware.
How it ended up
(1) check tool (CLI) ┐
├─ (2) logic (classes)
(3) thin UI wrapper ┘
The nice part of this setup: even if someone looks at the UI and says “Spending time on weird stuff again…” or “Isn’t that too much your own taste to be usable?”, the UI sticks to being a thin wrapper, so you can throw it away and keep the logic!
The main project is still a patchwork. But after wrapping a few thin layers around it, I can at least see what’s inside. This is probably about as much as I can do right now, and even this much helps a lot.
What’s bugging me lately
Ironically, I use a Mac for my hobby projects, and the Mac is more convenient for most things, but I don’t get this benefit there (I just haven’t figured out how to get it yet).
I want to do the same thing on the Mac. Ah, but AppleScript, or Tcl/Tk with Python, those are always trouble, right? Then SwiftUI after all? No, I want to do it with a script, not a compiled language. Ah, this is the only time I envy Windows.
About this post
Actually, this post was made the same way. I wrote it on a drunken roll, and AI organized it into something presentable. “You’re giving up on design,” “That’s not what an engineer does” — I’ll set that kind of self-blame aside for now.