AI agents are now good at writing SQL and not very good at Anchor Modeling. Left alone, they tend to produce wide tables with a few _history suffixes, or they ask you questions in Anchor jargon you may not want to answer. I’ve written a skill to fix that, and it’s now public:
https://github.com/Roenbaeck/anchor-modeling-skill
What it is
A skill is a folder of instructions and reference files that an agent reads when a task calls for it. This one follows the open Agent Skills format, so it isn’t tied to one product. Copy the skills/anchor-modeling folder into your agent’s skills directory and it picks the skill up whenever you talk about Anchor models. The skill doesn’t name any host’s tools. It says what the agent needs to be able to do (run SQL, run JavaScript) and what to do when it can’t.
What it does
- Reverse-engineers an existing database or a set of files into an Anchor model, testing its guesses against the data.
- Designs a model with you. It asks about your domain in your own words rather than in Anchor terms, and it asks you to confirm sentences and examples, not a diagram of constructs.
- Generates the DDL: knots, anchors, nexuses, attributes, ties, perspectives and triggers, for uni-, bi- and concurrent-reliance-temporal models.
- Loads data incrementally and idempotently, and rolls a batch back.
- Queries a model through its perspectives, extends it without touching existing tables, and explains it.
The generator comes with it
The skill doesn’t ask the agent to improvise DDL. It bundles the code behind the Anchor Modeler’s Generate SQL, built into one self-contained JavaScript file for each database. It has no dependencies and uses no file system, network or browser. It takes your model XML and gives back the script, the same text the modeler gives.
| Database | Temporalizations | Run on a real server |
|---|---|---|
| SQL Server | uni, bi, crt | yes |
| Snowflake | uni, bi, crt | yes |
| PostgreSQL | uni, bi, crt | yes (16) |
| Vertica | bi, crt | not yet |
Each file is checked against the approved output of 141 test models, character for character. The agent finds a way to run it: Node, Deno, Bun, a browser, or any engine that runs ES5. If there is no JavaScript at all, it falls back to writing a uni-temporal model by hand, or to asking you to generate the script in the Anchor Modeler. For BigQuery, Oracle and other databases there is no generator file yet. The skill says so, and says that anything adapted by hand has not been run by anyone.
Early days
This is a first release. The generator is well tested, but I haven’t yet run a broad set of agents through the skill to see how it behaves, so please tell me where it goes wrong: what you asked, what it did, and what you expected. Issues are welcome in the repository.
If you work in Snowflake with Cortex Code, there is also anchor-snowflake-skill, with task-graph loading and a generator that runs inside Snowflake. The new skill is for every other combination.