← BACK TO NOTES
2026-10-29 |
HDK HOUDINI

Having AI Write the HDK, and Keeping It Stable

Most of the 230 nodes in this series were written with AI.
This is the story of how I got it to write HDK code at all, and how I got it to stop breaking things.

The short version: I never made the AI smarter. I only built what surrounds it.

It barely knows the HDK

Ask an AI for a Houdini node in Python and it does fine.
Ask for one in C++ with the HDK and it makes things up: functions that do not exist, headers in the wrong place. There are very few examples online, so it has little to learn from.

So I gave it the documentation.
I turned the official HDK docs into Markdown files in the repository, so the AI can read them offline. That is tens of thousands of files, far too many to index, so I excluded them from the editor's index and made a short "read these chapters first" list. Everything else it opens by file name, when it needs it.

It stopped guessing and started reading. That was the first big change.

One rule per mistake

The first commit named rules is from February 12, a few weeks after I started.
Every time the AI made a mistake, I wrote one line that forbids it. Now there are 22 rule files, and they read like this:

Inherit HDK_SOP_Base. Override cookMySopSafe, not cookMySop.
Always PRIME_, never Prime_.
PRM templates end with an empty PRM_Template().

Some rules are about the build, such as which Visual Studio generator to use, and never overwriting a DLL that Houdini has loaded.
Some come straight from a bad day. One says every numeric parameter needs a range, because a slider once allowed a million rows. Another says never to use setParmTemplateGroup and updateFromNode on a live asset, because it crashes. These are the same traps as in article 19, written so the AI reads them before it writes anything.

A rule is a mistake I do not have to explain twice.

"Done" is not proof

The next problem was quieter. The AI would say it was finished, and it was not.

At first I let it look at Houdini directly through an MCP connection and take screenshots. It took many round trips, and a picture of a viewport does not tell you much anyway.
So I changed the rule. The AI writes a small script, runs it with hython (Houdini without the screen), and has to show numbers: the bounding box, the point count, and whether the node reports errors.

The rules now forbid the multi-turn MCP loops and the screenshots outright.
Performance work follows the same idea: same shape, same attributes, same features, split into times you can compare, and a missed target is not a success.

A number cannot be argued with, and the AI cannot say "it looks fine" about one.

Short rules, only the ones that matter

Rules grow, and then they stop working.
In March I deleted two old ones. Later I cut the "run it with hython" rule from about twenty lines to about fifteen. Only five of the 22 are always-on (build, coding, architecture, UI language, and the hython rule); the rest are for one project or one kind of task.

I also keep one short file at the top that points to the rest, so more than one AI tool can find the same rules.

What made it stable

Looking back, three things did all the work:

  • What it reads: the HDK docs, on disk, with a short list of where to start.
  • What it must follow: a rules folder that grows from mistakes and is trimmed regularly.
  • What it must prove: numbers from hython, not pictures.

The AI is the same as on day one.
It is the repository around it that got better, over 540 commits in nine months.

The next article is about a tool where I use the same three things from the start.

Related articles

2026-10-29

Pausing HDK Development

Since January 2026 I have written 230 nodes with the HDK. Setting the good things beside the limits, here is why I decided to stop writing new HDK nodes for now.

2026-10-23

HDK Limit 2: Hard to Fix, and Houdini's Rules

The other price of the HDK is how hard it is to fix things, and having to follow Houdini's rules. Static parameters, traps that break silently, operations that crash, and thread rules, with real examples.

2026-10-19

HDK Limit 1: Waiting for Compiles

The biggest price of the HDK is the wait for compiles. The time after each edit, the weight of 230-plus DLLs, the limits of incremental builds, and the procedure when Houdini is holding a DLL, with real numbers.

Comments