Skip to content

contribute_with_ai_assistant

ispyisail edited this page Oct 31, 2026 · 7 revisions

Fix a bug or add a feature with an AI assistant

A step-by-step guide for someone who has never built QElectroTech (QET) and has never written C++. An AI coding assistant (such as Claude Code) does the typing; you decide what to build and check the result.

It works for any bug fix or feature. For the rules of contributing, see Contributing Code. The assistant builds QET by following Building from Source.

What to expect: the first build takes a while (about 3 minutes on a fast 24-thread machine, much longer on a laptop) and a few GB of disk. A paid plan for the AI assistant is needed.

1. Install the tools

You need Git, Python 3, the GitHub command-line tool (gh) and the assistant. The build itself needs Qt 6; the assistant installs it for you in step 3.

Windows 10/11

  1. In PowerShell as Administrator: wsl --install, then restart.
  2. Open the Ubuntu app. Everything below runs inside it, not in PowerShell. QET runs as a normal Linux program there and its window opens on your desktop (Windows 11, or Windows 10 with a current WSL).
  3. In Ubuntu: sudo apt update && sudo apt install -y git curl python3

Keep your work inside the Ubuntu home folder (~), not under C:\. Files there are much faster.

macOS

  1. In Terminal run git --version. If macOS offers to install developer tools, accept.
  2. Install Homebrew, then brew install python gh.

Linux (Ubuntu/Debian)

sudo apt update && sudo apt install -y git curl python3

Install the assistant and gh

curl -fsSL https://claude.ai/install.sh | bash
claude                             # sign in

Install gh from cli.github.com (macOS: already done above), then run gh auth login. If the install command for the assistant has changed, follow the current instructions on its website.

2. Get your own copy of QET and the checker

On GitHub, click Fork on qelectrotech-source-mirror. Your work goes on a branch of your fork, never straight into the main project.

Then download the checker, a small script that tests your change before you submit it (details: qet_verify):

mkdir -p ~/qet && cd ~/qet
git clone https://github.com/ispyisail/qet-verify

3. Start the assistant and paste the prompt

Run claude inside the ~/qet folder and paste the prompt below. Replace the two lines marked <>.

I am a complete beginner. My system is <Windows with WSL / macOS / Linux>.
I want to <fix this bug / add this feature>: <link to the GitHub issue,
bugtracker entry or discussion>.

Work step by step, explain in plain language, and stop and ask me before you
delete files, install software on my computer, or post anything to GitHub.
Everything you write for GitHub (pull request, comments, replies) must follow
https://github.com/qelectrotech/qelectrotech-source-mirror/wiki/posting_with_ai_assistant
and I read it before it is posted.
The folder qet-verify next to you holds a checker; read its README.

1. Check my tools (git, python3, gh). Fix or tell me what is missing.
2. Clone my fork of qelectrotech-source-mirror into ~/qet and create a
   branch named after the change.
3. Build QET with Qt 6 by following the wiki page
   https://github.com/qelectrotech/qelectrotech-source-mirror/wiki/building
   Then run it so I can see it works.
4. BEFORE writing code, check the change is needed: search the open and
   closed issues and pull requests, and look in the source (the interface
   words differ from the code words, for example wire = conductor,
   page = folio, symbol = element). For a bug, reproduce it on the current
   code first. Tell me what you found. The feature may already exist, or
   the bug may already be fixed.
5. Show me a short plan (files to change, any new setting) and wait for my OK.
6. Implement it. Rules:
   - A change that alters existing behaviour gets an enable/disable setting
     in the settings dialog, off by default, so existing projects look the
     same.
   - New interface text is written in English inside tr().
   - Old project files must still open and look unchanged.
   - Match the style of the surrounding code. Do not reformat other code.
7. Build again and run the project's tests (ninja or
   cmake --build for all targets, then ctest --test-dir build/tests).
   Then run the checker and fix every FAIL it reports:
     ../qet-verify/verify.sh --qet-dir <my QET folder> --binary <my built qelectrotech>
   Run it again after your last commit, so the receipt names that commit.
   Try the change on a real project and show me before and after
   screenshots.
8. If the change can be seen, take a before and an after screenshot (two or
   three at most, cropped to the relevant part, from the same build with
   one thing changed). Follow the "Show what changed" section of
   https://github.com/qelectrotech/qelectrotech-source-mirror/wiki/contribute_with_ai_assistant
   Read each picture and check the caption says only what the picture shows.
   Never use one of my private projects.
9. Commit on my branch and help me open a pull request against
   qelectrotech/qelectrotech-source-mirror. Keep the description short and
   plain: what it does, how I tested it, the screenshots, and the receipt
   block that verify.sh printed (paste it exactly, never write one yourself).

4. What the checker tells you

verify.sh takes about a minute and prints PASS, FAIL or SKIP for each of three checks. It compares your change with a clean copy of the main project, so it fails only on a problem you added.

Check A FAIL means
Project and symbol files Your change added a broken wire, a bad coordinate or another file problem in the example projects or symbols
Interface text is English A new tr() string is not English
Saving a project loses nothing Saving and reloading a project lost or invented an element, wire or terminal

A SKIP is not a pass; it means that check did not run. At the end it prints a receipt: a short block naming the commit it checked, which goes in the pull request description. If the commit in the receipt is not the last commit of the pull request, the checks are out of date. The checker does not decide whether a feature should exist. A maintainer still decides that. More detail is in the qet-verify README.

5. Show what changed

For a change you can see (a dialog, a menu, how a symbol or wire is drawn), a before and an after picture helps the reviewer more than a paragraph. Two or three pictures are enough.

Rules

  • Take both pictures from the same build, with one thing changed, and say which is before and which is after.
  • Crop to the part that matters.
  • Read each caption against its picture. Say what is actually in the picture, nothing more.
  • Use an example project or a made-up one. Never a customer's or your employer's drawing.

Taking the pictures

Your setup How Install
macOS The assistant runs the built-in screencapture nothing
Linux scrot on the real window, or run QET in a virtual display with xvfb so no window opens sudo apt install xvfb xdotool scrot
Windows (WSL) The xvfb route above, or take the picture yourself with the Snipping Tool and give the file to the assistant sudo apt install xvfb xdotool

If the change only affects a drawing, a sheet or an export, no screen is needed: QET writes each sheet to an image from the command line (qelectrotech --export-png project.qet out-folder, see the CLI reference).

Putting them in the pull request

GitHub has no way to upload a picture from the command line, so the assistant links to it instead:

  1. Create an image-only branch in your fork (git checkout --orphan pr-assets) holding just the pictures. Never put pictures on the branch of the change itself.
  2. Link each one as https://raw.githubusercontent.com/<you>/<fork>/pr-assets/<file>.png.
  3. Open each link before posting. It must show the picture, not an error page.

Alternatively, drag the files into the pull request description in your web browser. GitHub hosts them for you.

6. Before you submit

Ask the assistant: "Review my diff like a maintainer would. Is anything unrelated to the change included? Does behaviour stay the same when the new setting is off?" Then read the pull request description the assistant wrote against Posting with an AI assistant: short and plain, with the qet-verify receipt and any screenshots. Open the pull request only when you are happy with it.

If you get stuck

Problem What to do
The build fails Paste the last lines of the error into the assistant. A missing Qt package is the usual cause; the Building page lists them.
Build runs out of disk or memory Free some space, or build with fewer parallel jobs (cmake --build build -j2).
The build seems frozen It is probably compiling. Wait 15 minutes, then ask the assistant to show the last lines of the log.
Windows: files are slow Keep everything inside the Ubuntu home folder (~), not under C:\.
Anything else Paste the exact error into the assistant and ask it to explain and fix it. You can also ask on the issue you are working on.

See also

Getting Started

Home

🌐 Languages β€” English Β· FranΓ§ais Β· Deutsch

Downloads

Windows without admin rights β€” the portable archive, no installer

Quick Start Guide

User Manual

FAQ

Tips & Tricks

Guides

Conductors β€” wire properties, what feeds which export, cables, and hops where wires cross

Wires per terminal β€” limit the wires on a terminal, chain wiring instead of stars

Printing and exporting β€” paper, PDF, images, and what each path does differently

Linking elements β€” master, slave, terminal

PLC modules β€” I/O tables and linking a wire to a specific point

Using the element editor β€” drawing tools, saving, checks

Generic devices β€” a quick box symbol with terminals on any side, made by a wizard

Grid size and element size β€” why symbols aren't all the same scale, and scaling one without leaving the grid

Preferences reference β€” what each settings page does

Saving and loading settings β€” your whole setup in one file, to copy or keep

Keyboard-only control β€” mouseless QET, and what still needs a mouse

Mouse modifiers β€” what Shift, Ctrl and Alt change while you drag

3D mouse β€” SpaceMouse pan, zoom and buttons

Aligning items β€” snap symbols back to the grid, or line them up

Drawing aids β€” dark mode, snap and grid step, crosshair, dimensions, the tape measure

Symbols already on the sheet β€” select the same symbols, replace them, show a T-junction as a dot, update placed copies from the collections

Symbol texts β€” place the texts at nine points, fixed or free size, format painter, title block cells, GOST ESKD, %T

Wiring tools β€” automatic connections, the Connections toolbar, chained folio reports, a cable across wires

Symbols and parts β€” edit several symbols, relay contact display, grouped parts list

Device types β€” what a device is made of: check, place and change its parts, Device Navigator

Project languages and checks β€” languages in a project, cell origin, duplicate labels, the Check panel

Reports and lists β€” project lists to CSV/PDF, tables on a folio, label-printer export, symbol list

Pictures on a sheet β€” labels, crop, transparency, what they cost in the file

Arcs and curved wires β€” the Arc tool, pulling an arc in or out, rounding a corner with a fillet, dashed arcs for lighting layouts

Grouping items β€” select, move and copy several items as one

Finding your place on a sheet β€” go to a cell like B13 or 4-B7, keep the headers in sight, show the cell limits, zoom and pan

Showing and hiding kinds of items β€” hide texts, wire numbers, shapes, pictures, tables or cross-references on every sheet

Drawing faster β€” place without dragging, the S shortcut bar, command search, gestures

Customising QElectroTech β€” keys, toolbar size and contents, the gesture ring

Managing collections β€” folders, writability, building your own shortlist

Templates β€” reusable multi-element blocks, placed by double-click or drag

Search & Replace β€” bulk property changes

Building a nomenclature query β€” the BOM/summary table builder

Formula columns β€” build a calculated column in a parts list without writing SQL

Linking wires across pages β€” sheet reports

Variables & formulas β€” %f, %{label}, sequences

Auto-numbering β€” schemes, sequences, freezing

Terminal strips β€” strips, levels, bridges

Connectors β€” plugs and sockets as terminal strips or head-with-pins devices, device types, pin check, spare-pin plans

Title block templates β€” the .titleblock format

Title block alignment β€” place a title block inside or outside the sheet, left, centred or right

Plants and locations β€” list, rename, copy a plant, suggestions

Designations and structure boxes β€” IEC 81346 names, structure boxes, ==/++ levels, folio groups, company prefixes

Revisions, document kinds and drawing standard β€” revision list and table, IEC 61355 document kind, project standard

Importing EPLAN parts (.edz) β€” EPLAN Data Portal

DXF import & export β€” two unrelated features, one format; command-line export and layers

Project files β€” .qetz (zipped, the default) and .qet, what is inside, opening big projects faster, starting from a template

The one-file project, .qetdb β€” history of saves, repair, --query over many projects

Saving safely β€” previous versions, a project open elsewhere, damaged files, crash recovery

The project database β€” the working SQLite database built when a project opens

File formats
Elements XML
Project XML
Development

Building from Source

Contributing Code

Code style β€” the QET house style for C++, and formatting only the lines you change

Fix or add with an AI assistant β€” beginner build setup and a prompt that does the work

Check your change: qet-verify β€” run it before every pull request

Posting with an AI assistant β€” short, plain pull requests and replies

Translate with an AI assistant β€” draft the interface in your language, check it, send it

Making a how-to video β€” a short feature video from a checked story

Writing wiki pages with an AI assistant β€” the rules, and a checker to run before you push

Automating QET β€” CLI, XML formats, external tools

CLI Reference β€” command line usage

JavaScript Scripting β€” --run, geometry editing, undo

MCP server β€” let an AI assistant read, verify and edit projects

Connecting an AI assistant β€” setup for Claude, Copilot, Gemini, Codex, Cursor, LM Studio

Script buttons β€” stored scripts with an icon, by hand or by an assistant

Live mode β€” an assistant working in the open project while you watch

Macro recorder β€” record a task by hand, for an assistant to script

Development Roadmap

Vision β€” proposal, under discussion

Developer Tools

About

Features

History

Community

License

Contributing to this Wiki

Clone this wiki locally