Steve SpenceKK4HFJ · Advanced Research Systems

Blog

Let your AI build the panel: a PanelWorks prompt you can paste

Steve Spence, KK4HFJ · 3 December 2026

PanelWorks forms are two plain files: a JSON form and a Python file of event procedures. That makes them easy for an AI to write. All it needs is to be told where the rules are and not to make things up. Here's a prompt that does that. Paste it into your AI, change the first paragraph (and the panel's name and place) to whatever you want, and you get back a panel you can run.

The prompt

Build me a PanelWorks control panel called WeatherDash: a weather dashboard for
Nashville, TN (latitude 36.16, longitude -86.78) using Open-Meteo (free, no API
key), in °F and mph. Show the current temperature, wind and humidity, a chart
of the next 24 hours, and an alarm for frost.

PanelWorks is a Visual Basic-style panel builder for Python:
https://github.com/KK4HFJ/panelworks (install with: pip install panelworks).

Rules:
1. Before writing anything, read the README sections "The form file",
   "Event procedures" and "Controls", and the manual in docs/manual/.
   Use only controls, properties and events that are documented there.
   Don't invent any.
2. Start from the closest bundled example (list them with
   python -m panelworks --example). For weather, that's the "weather" example.
3. Give me exactly two complete files, WeatherDash.json (the form) and
   WeatherDash.py (the event procedures), plus the exact commands to run them
   on Windows, one per line:
     mkdir C:\dev
     cd C:\dev
     python -m venv pw
     pw\Scripts\python -m pip install panelworks
     pw\Scripts\python -m panelworks WeatherDash.json --mcp none
4. If you can run code, install PanelWorks yourself, run the panel (with the
   example's --simulator if it has one), check the values it shows, and fix
   every error before you give it to me.
5. If you are running on my Windows PC, also build a program I can run without
   Python: pw\Scripts\python -m panelworks.make_exe WeatherDash.json --name WeatherDash
   It lands in dist\WeatherDash.exe. It's unsigned, so tell me Windows will say
   "Windows protected your PC" and that I click More info, then Run anyway.
6. No hardware and no accounts unless I ask. Explain each event procedure in
   one line, in plain words.

What you get back depends on your AI

  • A chat-only AI (no tools) writes the two files and the commands. Save the files in C:\dev, run the commands, and the panel opens. If something errors, paste the error back to it.
  • An AI that can run code (a code sandbox that can install packages) installs PanelWorks there, runs the panel against the bundled weather simulator, and fixes its own mistakes before you see the files.
  • An AI working on your Windows PC (Claude Code, Codex, Cursor and the like) can do all of that and also hand you dist\WeatherDash.exe: one program that runs on any Windows PC without Python. It isn't code-signed, so Windows will warn you the first time: click More info, then Run anyway.

I tested this prompt on a fresh AI that had never seen PanelWorks. It read the README and manual, started from the weather example, and built the dashboard: current conditions on an LCD readout and gauges, a 24-hour forecast chart with a frost line, and two frost alarms (freezing now, and frost in the next 24 hours). Then it ran the panel against a pretend weather service and checked every reading before handing it over. It didn't invent a single property.

Even shorter, with a coding agent

If your AI works inside the PanelWorks repository (Claude Code, Codex, Cursor, Copilot and others), it reads the repo's AGENTS.md by itself, and that file carries the same rules. Clone the repo, open it in your agent, and just ask: "build me a weather dashboard for Nashville with a frost alarm".

Why the rules matter

Rule 1 is the important one. Asked cold, an AI will happily invent a property that sounds right, and the panel won't load. Pointing it at the README and manual, and telling it not to guess, fixes most of that. Rule 2 gives it a working, tested panel to adapt instead of a blank page: PanelWorks ships examples for weather, solar, UPSes, Modbus meters and more, and most come with a pretend device. Rule 4 makes it test its own work.

Make it yours

Change the first paragraph. Some ideas:

  • "a panel that shows my ESP32's temperature over MQTT, with a lamp that goes red above 30 °C"
  • "a UPS status panel using the NUT example's simulator"
  • "a garden watering panel with four zone buttons and a run timer"

New to PanelWorks? The five-minute first panel shows the bare minimum by hand. For the whole story, from your first panel to Arduino, ESP32, MQTT, Modbus and SNMP, there's my book, Draw It, Wire It, Run It, the official guide to building control panels in Python with PanelWorks: paperback or Kindle (affiliate links). The book's page has the free code and errata.

As an Amazon Associate I earn from qualifying purchases.

73, Steve, KK4HFJ

PanelWorksPythonAITutorial

Reply to this post

A question, a correction, or your own results? Send it here. Replies come to me by email and aren't published. Your address is only used to answer you.

Ask AI answers only from these posts, with numbered links to where it found it. It's a small model: check the post it links.

← All posts