Blog
All Blog Posts | Next Post | Previous Post
Better Delphi Code from AI Agents with TMS Skills
Monday, March 16, 2026
AI coding agents have become a daily tool for many developers. Tools like Anthropic Claude Code, OpenAI Codex, and Cursor can read your codebase, write new features, fix bugs, and refactor code all from a natural language description of what you want. Delphi developers are using them too, and we at TMS Software see that more and more of our users work with these tools every day.
But there's a recurring problem when you use these agents with specialized libraries. General-purpose AI models are trained on the broad universe of open-source code. They know Java, C#, Python, and JavaScript well. For Delphi, they manage. For TMS-specific APIs Aurelius entity attributes, XData service definitions, Sparkle middleware they often guess. And when an AI guesses at a rich, opinionated API, the results are plausible-looking but wrong.
This is why we are releasing an official, curated collection of agent skills for TMS products: the TMS Software Agent Skills repository.
What Are Agent Skills?
An agent skill is a focused instruction package that an AI coding agent loads dynamically when it encounters a task it recognizes. Think of it as giving your agent a reference manual that it reads before writing code except it only reads the relevant manual for the specific task at hand.
Skills follow the open Agent Skills specification, which means they work across multiple agents: Claude Code, Cursor, Cline, OpenCode, Continue, and others. You install them once and they activate automatically no prompting, no configuration.
Each skill is a folder with two parts:
SKILL.md describes when to activate and what rules to apply beyond what the reference material coversreferences/ detailed API documentation: attribute signatures, option tables, code examples, and common patterns
When the agent detects that you're working on something the skill covers say, mapping a Delphi class to a database it reads the relevant reference material and applies those rules as it generates code.
The TMS Skills Repository
The TMS Software Agent Skills repository currently ships two skills, both focused on TMS Aurelius, our ORM framework for Delphi.
| Skill | What it covers |
|---|---|
aurelius-mapping |
Mapping Delphi classes to a relational database using Aurelius attributes ([Entity], [Table], [Column], associations, inheritance, nullable fields, blobs, and more) |
aurelius-objects |
Saving, loading, updating, deleting, and navigating entity objects using TObjectManager including transactions, change tracking, lazy loading, and concurrency control |
The reference documentation behind these skills is thorough: over 800 lines covering 25+ mapping scenarios for aurelius-mapping, and 640+ lines covering 15+ operational patterns for aurelius-objects. These are the same concepts our documentation covers distilled into a format that agents can read and apply directly.
Installing TMS Skills
Using the skills CLI (recommended)
The skills CLI auto-detects which agents you have installed and places files in the right location. It requires Node.js to be installed once you have it, npx is available and no separate installation is needed.
# Install all TMS skills at once
npx skills add tmssoftware/skills
# Install a single skill
npx skills add https://github.com/tmssoftware/skills/tree/main/skills/aurelius-mapping
Manual installation
Clone or download the repository, then copy the skill folder into the directory your agent watches:
| Agent | Project-level path | Global path |
|---|---|---|
| Claude Code | .claude\skills\ | %USERPROFILE%\.claude\skills\ |
| Cursor | .agents\skills\ | %USERPROFILE%\.cursor\skills\ |
| Cline | .cline\skills\ | %USERPROFILE%\.cline\skills\ |
| OpenCode | .agents\skills\ | %APPDATA%\opencode\skills\ |
| Continue | .continue\skills\ | %USERPROFILE%\.continue\skills\ |
For example, to install the aurelius-mapping skill for Claude Code in your project (from the cloned repository root):
xcopy /E /I skills\aurelius-mapping your-project\.claude\skills\aurelius-mapping
Skills placed in a project-level folder activate for that project only. Skills placed in the global folder activate for all your projects.
Skills in Action
Here's what the difference looks like in practice.
Entity Mapping
Suppose you ask your agent: "Create an Aurelius entity for a Customer that belongs to a Country."
Without a skill, a capable model will often produce plausible-looking but incorrect code wrong attribute names, wrong association syntax, and missing the RegisterEntity call that Aurelius requires at runtime:
// What an agent might generate WITHOUT the aurelius-mapping skill:
[Table('customers')] // missing [Entity] Aurelius ignores this class entirely
TCustomer = class
public
[PrimaryKey] // wrong no such attribute; should be [Id(...)]
Id: Integer;
[Column('name')]
Name: string;
CountryId: Integer; // wrong associations must be expressed as object references,
// not raw foreign key fields
end;
// Missing initialization section entirely RegisterEntity never called
With the aurelius-mapping skill loaded, the agent knows the correct attribute names, where to place them, how to express the association, and the initialization section that anchors the class in the Delphi linker:
uses
Aurelius.Mapping.Attributes;
type
[Entity]
[Automapping]
TCountry = class
private
FId: Integer;
FName: string;
public
property Id: Integer read FId;
property Name: string read FName write FName;
end;
[Entity]
[Automapping]
TCustomer = class
private
FId: Integer;
FName: string;
[Association([], CascadeTypeAllButRemove)]
[JoinColumn('COUNTRY_ID', [])]
FCountry: TCountry;
public
property Id: Integer read FId;
property Name: string read FName write FName;
property Country: TCountry read FCountry write FCountry;
end;
initialization
RegisterEntity(TCountry);
RegisterEntity(TCustomer);
The [Automapping] attribute lets Aurelius infer the table name (CUSTOMER), column names (ID, NAME), and the identifier from the FId field no extra attributes needed for straightforward mappings. The RegisterEntity call in the initialization section prevents the Delphi linker from removing the class in server applications where it may not be directly referenced in code a silent failure that is very easy to miss.
Saving and Loading Objects
Now suppose you ask: "Save a new Customer and then load it back by ID."
Without the aurelius-objects skill, the agent is likely to miss the AddOwnership call that transfers memory ownership to the manager before the risky Save call. It may also incorrectly set a raw foreign key field instead of assigning the associated object:
// What an agent might generate WITHOUT the aurelius-objects skill:
var
Customer: TCustomer;
begin
Customer := TCustomer.Create;
Customer.Name := 'Acme Corp';
Customer.CountryId := 42; // wrong set the object reference, not a raw FK value
Manager.Save(Customer);
// If Save raises an exception, Customer leaks AddOwnership was never called
end;
With the aurelius-objects skill, the agent generates correct, safe code:
var
Customer: TCustomer;
Found: TCustomer;
begin
Customer := TCustomer.Create;
Manager.AddOwnership(Customer); // manager will destroy it even if Save raises
Customer.Name := 'Acme Corp';
Customer.Country := Manager.Find<TCountry>(CountryId); // assign the object, not an ID
Manager.Save(Customer); // executes the INSERT immediately
// Find uses the identity map: same instance returned if already cached
Found := Manager.Find<TCustomer>(Customer.Id);
WriteLn(Found.Name); // 'Acme Corp'
// Do not free Customer or Found the manager owns them
end;
The skill teaches the agent that AddOwnership should come before Save so the manager assumes ownership regardless of outcome; that Save itself executes the INSERT immediately (no Flush needed for new objects); and that associations must be expressed as object references never as raw foreign key values, which would bypass the ORM entirely.
What's Next
Our skills repository is designed to grow. We plan to add skills for more TMS products XData service definitions, Sparkle middleware, Sphinx authentication flows as we expand coverage across our library suite.
The skills follow an open specification, and contributions are welcome. If you've worked extensively with a TMS library and want to help encode that knowledge for AI agents, open a pull request on the GitHub repository.
To get started, install the skills for whichever agent you use, and try asking it to create or work with Aurelius entities. The improvement in code quality should be immediate and noticeable.
Wagner Landgraf
This blog post has received 3 comments.
2. Wednesday, March 18, 2026 at 10:53:21 AM
Thank you for the feedback! It is definitely a direction we want to keep exploring in and providing broader Skill coverage for our other products as well. Please do let us know what you learn in your trials!
Dennis Röhner
3. Wednesday, April 1, 2026 at 4:14:55 PM
Hi, It is MOST welcome! Delphi developers are the stepchild of AI coding revolution. The models are dumb the hallucinate a whole API and generally does not have a clue about Delphi Object Pascal and 3rdParty libraries. The LSP support thanks to silly Embarcadero near not existent. I struggling with building and AI consumable library reference for TMS (mostly UI Pack) but it is far from a skill like you did. It would be helpful if the source would have an xlm doc remarks or other API documentation than PDF only.
I am looking forward to see more skills like this (UI, WEB, FNC)
Sandor DObi
All Blog Posts | Next Post | Previous Post
tecun jose