An opinionated ecosystem of rules, skills and steerings to elevate Delphi development to state-of-the-art with Artificial Intelligence.
FAQ
delphi-spec-kit is a Claude Code plugin with 18 hand-picked skills for development work, indexed on Flowy. Install it with the command on its page. It includes acbr-components, clean-code, code-review. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
$ npx -y skills add delphicleancode/delphi-spec-kit --agent claude-code
Repo: delphicleancode/delphi-spec-kit
An opinionated ecosystem of rules, skills and steerings to elevate Delphi development to state-of-the-art with Artificial Intelligence.
Delphi/Lazarus components <www.inovefast.com.br>
Integrations with payment platforms and services (Asaas, MercadoPago, Cielo, PagSeguro, D4sign, Webstore, MelhorEnvio, Groq)
i9DBTools <www.inovefast.com.br/i9dbTools/> Manage MySQL, PostgreSQL, Firebird and SQLite in one place, with AI to generate and explain SQL in natural language, optimize queries and create Brazilian fake data in seconds.
The Delphi AI Spec-Kit is not a code framework β it's a set of behavior guidelines for your favorite AI. It "teaches" the wizard to write Delphi code:
OnClicktry..finally and (ARC) interfacesSay goodbye to AI that mixes database access with the presentation layer, forgets
try..finallyor ignores Dependency Injection.
| Without Spec-Kit | With the Spec-Kit |
|---|---|
AI generates code with logic in OnClick | AI isolates layers correctly |
TStringList.Create without try..finally | Memory gold standard always applied |
| Tests coupled to the real bank | Fakes via interface, quick and isolated tests |
| Inconsistent naming | A-params, F-fields, T-types, verbs in methods |
with statement and global variables | Code smells blocked proactively |
| Tool | Configuration File | How It Works |
|---|---|---|
| GitHub Copilot | .github/copilot-instructions.md | Pre-prompt injected into Workspace/Chat |
| Cursor | .cursor/rules/*.md | Rules loaded by context |
| Claude Code | .claude/ | Rules by context and skills in the terminal |
| Google Gemini / Antigravity | .gemini/skills/*/SKILL.md | Modular skills by domain |
| Kiro AI | .kiro/steering/*.md | Stack and architectural constraints |
| Any AI | AGENTS.md | Universal rules (project root) |
The AI ββenforces the pattern: every .Create without Owner requires try..finally on the immediately subsequent line. Also teaches the use of Interfaces (ARC) for native Garbage Collection β without Free manual.
//β
Gold Standard β ALWAYS generated by AI with Spec-Kit
var LList: TStringList;
begin
LList := TStringList.Create;
try
LList.Add('item');
finally
LList.Free;
end;
end;
Red-Green-Refactor flow with Fakes isolated per interface. No coupling to the database in tests.
[Test]
procedure ProcessOrder_WithoutStock_RaisesException;
begin
Assert.WillRaise(
procedure begin FSut.Process(FEmptyOrder); end,
EInvalidOrderException
);
end;
TCustomerValidator does not save to the bank.//β
DIP in practice
constructor TOrderService.Create(
ARepo: IOrderRepository;
ANotifier: INotificationService);
begin
FRepo := ARepo;
FNotifier := ANotifier;
end;
Consistent and mandatory nomenclatures:
| Category | Convention | Example |
|---|---|---|
| Parameters | Prefix A | ACustomerName |
| Private fields | Prefix F | FCustomerName |
| Local variables | Prefix L | LCustomer |
| Classes | Prefix T | TCustomerService |
| Interfaces | Prefix I | ICustomerRepository |
| Exceptions | Prefix E | ECustomerNotFound |
| Framework | Domain | Rules Included |
|---|---|---|
| Horse | Minimalist REST APIs | Controller/Service/Repository structure, middleware |
| Dext Framework | .NET-style APIs, ORM, DI, Async | Minimal APIs, Entity ORM, TAsyncTask.Run |
| DelphiMVC (DMVC) | REST APIs with Attributes | [MVCPath], Active Record, JWT, RQL |
| ACBR | Commercial Automation (NFe, CF-e, Boleto) | Tax isolation, without crossing with UI |
| Intraweb | Stateful WebApps in Delphi | UserSession, no global session variables |
| DevExpress | Advanced Enterprise UI | TcxGrid, TdxLayoutControl, skins and export |
| Firebird Database | Corporate Database | FireDAC Connection, PSQL, generators, transactions, migrations |
| PostgreSQL Database | Modern Database | FireDAC Connection, UPSERT, JSONB, Full-Text Search, PL/pgSQL |
| MySQL / MariaDB | Popular Database | FireDAC Connection, AUTO_INCREMENT, UPSERT, JSON, FULLTEXT |
| DUnitX | Unit Tests | Red-Green-Refactor, Fakes via interface |
| Design Patterns GoF | Design Patterns | Creational, Structural and Behavioral with interfaces and ARC |
| Threading | Multi-Threading | TThread, TTask, Synchronize/Queue, TCriticalSection, PPL |
| Code Refactoring | Code Smells and Techniques | Extract Method/Class, Guard Clauses, Strategy, Parameter Object |
delphi-spec-kit/
β
βββ AGENTS.md # π Universal rules (Copilot, Kiro, Antigravity, Gemini)
β
βββ .claude/
β βββ CLAUDE.md # π§ Master system prompt for Claude
β βββ settings.json # Permission settings
β βββ commands/
β β βββ review.md # Slash-command: /project:review
β βββ rules/ # Context-specific rules (auto-loaded by glob)
β β βββ delphi-conventions.md # Naming conventions and code style
β β βββ memory-exceptions.md # Memory management and exception patterns
β β βββ tdd-patterns.md # TDD and DUnitX
β β βββ solid-patterns.md # SOLID and DDD
β β βββ design-patterns.md # Design Patterns GoF (Creational, Structural, Behavioral)
β β βββ refactoring.md # Code refactoring (Extract Method, Guard Clauses, Strategy)
β β βββ horse-patterns.md # Horse REST Framework
β β βββ dmvc-patterns.md # DelphiMVC Framework
β β βββ dext-patterns.md # Dext Framework
β β βββ acbr-patterns.md # Commercial Automation (ACBr)
β β βββ intraweb-patterns.md # Intraweb WebApps
β β βββ firebird-patterns.md # Firebird Database (connection, PSQL, transactions)
β β βββ postgresql-patterns.md # PostgreSQL Database (UPSERT, JSONB, FTS)
β β βββ mysql-patterns.md # MySQL/MariaDB (AUTO_INCREMENT, JSON, UPSERT)
β β βββ threading-patterns.md # Threading (TThread, TTask, Synchronize/Queue)
β βββ skills/ # On-demand skills (SKILL.md per folder β Claude docs standard)
β βββ clean-code/ # Clean Code and Pascal Guide
β βββ delphi-memory-exceptions/# Memory management and try..finally
β βββ delphi-patterns/ # Repository, Service, Factory
β βββ design-patterns/ # Design Patterns GoF (23 patterns)
β βββ refactoring/ # Refactoring (10 techniques, before/after)
β βββ tdd-dunitx/ # TDD with DUnitX
β βββ horse-framework/ # Horse REST API
β βββ dmvc-framework/ # DelphiMVC Framework
β βββ dext-framework/ # Dext Framework
β βββ acbr-components/ # ACBr components
β βββ intraweb-framework/ # Intraweb WebApps
β βββ devexpress-components/ # DevExpress UI
β βββ dunitx-testing/ # Unit testing
β βββ firebird-database/ # Firebird Database (connection, PSQL, generators)
β βββ postgresql-database/ # PostgreSQL Database (UPSERT, JSONB, FTS, PL/pgSQL)
β βββ mysql-database/ # MySQL/MariaDB (AUTO_INCREMENT, JSON, FULLTEXT)
β βββ threading/ # Threading (TThread, TTask, PPL, thread-safety)
β βββ code-review/ # Code review
β
βββ .github/
β βββ copilot-instructions.md # π€ Pre-prompt for GitHub Copilot
β
βββ .cursor/
β βββ rules/ # Same rule files as .claude/rules/ (Cursor format)
β
βββ .gemini/
β βββ skills/ # Same skill folders as .claude/skills/ (Gemini format)
β
βββ .kiro/
β βββ steering/
β βββ product.md # Product vision
β βββ tech.md # Technology stack
β βββ structure.md # Layer architecture
β βββ frameworks.md # Framework guides
β
βββ .specify/ # AI-assisted spec templates
β βββ constitution.md # Project constitution and constraints
β βββ plan-template.md # Implementation plan template
β βββ spec-template.md # Feature specification template
β βββ tasks-template.md # Task breakdown template
β
βββ tools/ # Utility scripts
β βββ neural_translate_en.py # Neural translation helper
β βββ translate_comment_markers_en.py # Comment marker translation
β βββ translate_to_en_us.ps1 # PowerShell translation script
β
βββ examples/
βββ clean-unit-example.pas # Well-organized unit (Golden Path)
βββ memory-exception-example.pas # Correct memory and exception patterns
βββ repository-pattern.pas # Complete Repository Pattern
βββ service-pattern.pas # Complete Service Pattern
βββ design-patterns-example.pas # Design Patterns GoF in practice
βββ refactoring-example.pas # Refactoring before/after (6 techniques)
βββ tdd-dunitx-example.pas # TDD and DUnitX in practice
βββ horse-api-example.pas # REST API with Horse
βββ dmvc-controller-example.pas # DMVC Controller with Attributes
βββ dext-api-example.pas # Minimal API with Dext
βββ acbr-service-example.pas # NF-e issuance with ACBr
βββ intraweb-form-example.pas # Intraweb Form with UserSession
βββ firebird-repository-example.pas # Repository with FireDAC + Firebird
βββ postgresql-repository-example.pas # Repository with FireDAC + PostgreSQL
βββ mysql-repository-example.pas # Repository with FireDAC + MySQL
βββ threading-example.pas # Threading patterns (TTask, BackgroundWorker, Producer-Consumer)
βββ file-copy-app/ # π¦ Complete app example: file copy with service layer
βββ i18n-app/ # π¦ Complete app example: internationalization (i18n)
git clone https://github.com/delphicleancode/delphi-spec-kit.git
YourProject/
βββ MyApp.dpr
βββ AGENTS.md β copy from the root
βββ .claude/ β copy the folder
βββ .github/ β copy the folder
βββ .cursor/ β copy the folder
βββ .gemini/ β copy the folder
βββ .kiro/ β copy the folder
βββ .specify/ β copy the folder (optional β spec templates)
.claude/CLAUDE.md and uses direct rules/skills in the terminal.cursor/rules/*.md automatically by context.github/copilot-instructions.md in workspace.gemini/skills/ are activated on demand.kiro/steering/*.md as fixed product contextNo additional configuration required. Open the project, use your preferred AI and notice the difference.
src/
βββ Domain/ β Entities, Value Objects, Repository Interfaces
βββ Application/ β Services, Use Cases, DTOs
βββ Infrastructure/ β FireDAC Repositories, external APIs
βββ Presentation/ β VCL/FMX Forms, ViewModels
tests/
βββ Unit/ β DUnitX projects with isolated Fakes
Dependency rule:
Presentation β Application β Domain β InfrastructureDomain never depends on other layers.
procedure ProcessOrder(AOrder: TOrder);
begin
if not Assigned(AOrder) then
raise EArgumentNilException.Create('AOrder cannot be nil');
if AOrder.Items.Count = 0 then
raise EBusinessRuleException.Create('Order must have at least one item');
if not AOrder.IsValid then
raise EValidationException.Create('Order validation failed');
//real logic here, no nesting
FRepository.Save(AOrder);
FNotifier.Send(AOrder.Customer.Email);
end;
type
TFakeOrderRepository = class(TInterfacedObject, IOrderRepository)
private
FOrders: TObjectList<TOrder>;
public
constructor Create;
destructor Destroy; override;
procedure Save(AOrder: TOrder);
function FindById(AId: Integer): TOrder;
end;
[TestFixture]
TOrderServiceTest = class
private
FSut: TOrderService;
FRepo: IOrderRepository;
public
[Setup]
procedure SetUp;
[Test]
procedure PlaceOrder_ValidOrder_SavesToRepository;
[Test]
procedure PlaceOrder_EmptyItems_RaisesException;
end;
This project enforces a multi-layer strategy to control what AI agents index and use as context. Before submitting a PR:
.gitignore.cursorignore includes any new heavy or binary pathsAGENTS.md, rules, skills, examples) are NOT excluded.vscode/settings.json excludes are up to date for new artifact types*.key, *.pfx, .env) are committed or referencedSee docs/ai-ignore-strategy.md for the full rationale and maintenance guide.
Pull Requests are welcome! If your favorite Delphi framework or library needs a guide for AI, add:
.claude/rules/your-framework.md.claude/skills/your-framework/SKILL.md.cursor/rules/your-framework.md.gemini/skills/your-framework/SKILL.mdAGENTS.md# Fork and clone
git fork https://github.com/delphicleancode/delphi-spec-kit
git clone https://github.com/YOUR-FORK/delphi-spec-kit
# Create a descriptive branch
git checkout -b feat/add-remobjects-patterns
# Commit and Pull Request
git commit -m "feat: add RemObjects SDK patterns"
git push origin feat/add-remobjects-patterns
Buy the author a coffee via Pix: pix@inovefast.com.br β
Made with β€οΈ for the Delphi community.
If this kit helped you, leave a β in the repository!
.claude/
CLAUDE.md
commands/
review.md
rules/
acbr-patterns.md
delphi-conventions.md
design-patterns.md
dext-patterns.md
dmvc-patterns.md
firebird-patterns.md
horse-patterns.md
intraweb-patterns.md
memory-exceptions.md
mysql-patterns.md
postgresql-patterns.md
refactoring.md
solid-patterns.md
tdd-patterns.md
threading-patterns.md
settings.json
skills/
acbr-components/
SKILL.md
clean-code/
SKILL.md
code-review/
SKILL.md
delphi-memory-exceptions/
SKILL.md
delphi-patterns/
SKILL.md
design-patterns/
SKILL.md
devexpress-components/
SKILL.md
dext-framework/
SKILL.md
dmvc-framework/
SKILL.md
dunitx-testing/
SKILL.md
firebird-database/
SKILL.md
horse-framework/
SKILL.md
intraweb-framework/
SKILL.md
mysql-database/
SKILL.md
postgresql-database/
SKILL.md
refactoring/
SKILL.md
tdd-dunitx/
SKILL.md
threading/
SKILL.md
.cursor/
rules/
acbr-patterns.md
delphi-conventions.md
design-patterns.md
dext-patterns.md
dmvc-patterns.md
firebird-patterns.md
horse-patterns.md
intraweb-patterns.md
memory-exceptions.md
mysql-patterns.md
postgresql-patterns.md
refactoring.md
solid-patterns.md
tdd-patterns.md
threading-patterns.md
.cursorignore
.gemini/
rules/
delphi-rules.md
skills/
acbr-components/
SKILL.md
clean-code/
SKILL.md
code-review/
SKILL.md
delphi-memory-exceptions/
SKILL.md
delphi-patterns/
SKILL.md
design-patterns/
SKILL.md
devexpress-components/
SKILL.md
dext-framework/
SKILL.md
dmvc-framework/
SKILL.md
dunitx-testing/
SKILL.md
firebird-database/
SKILL.md
horse-framework/
SKILL.md
intraweb-framework/
SKILL.md
mysql-database/
SKILL.md
postgresql-database/
SKILL.md
refactoring/
SKILL.md
tdd-dunitx/
SKILL.md
threading/
SKILL.md
.github/
copilot-instructions.md
.gitignore
.kiro/
steering/
frameworks.md
product.md
structure.md
tech.md
.specify/
constitution.md
plan-template.md
spec-template.md
tasks-template.md
.vscode/
settings.json
AGENTS.md
docs/
ai-ignore-strategy.md
examples/
acbr-service-example.pas
clean-unit-example.pas
design-patterns-example.pas
dext-api-example.pas
dmvc-controller-example.pas
file-copy-app/
FileCopy.dpr
FileCopy.Main.View.dfm
FileCopy.Main.View.pas
FileCopy.Service.Copier.pas
FileCopy.Service.Copier.Tests.pas
FileCopyTests.dpr
implementation_plan.md
walkthrough_file-copy-app.md
firebird-repository-example.pas
horse-api-example.pas
i18n-app/
database.sqlite
i18n-code-review.md
i18n-prd.md
I18nApp.dpr
I18nApp.dproj
I18nApp.dproj.local
I18nApp.identcache
I18nApp.res
resources/
en-US.json
pt-BR.json
scripts/
database.sql
src/
Core/
I18nApp.Core.LanguageManager.pas
I18nApp.Core.Resources.pas
Model/
I18nApp.Model.Connection.dfm
I18nApp.Model.Connection.pas
View/
I18nApp.View.Cliente.dfm
I18nApp.View.Cliente.pas
I18nApp.View.Main.dfm
I18nApp.View.Main.pas
I18nApp.View.Produto.dfm
I18nApp.View.Produto.pas
I18nApp.View.Venda.dfm
I18nApp.View.Venda.pas
tests/
I18nAppTests.dpr
Test.I18nApp.Core.LanguageManager.pas
Test.I18nApp.Core.Resources.pas
intraweb-form-example.pas
memory-exception-example.pas
mysql-repository-example.pas
postgresql-repository-example.pas
refactoring-example.pas
repository-pattern.pas
service-pattern.pas
tdd-dunitx-example.pas
threading-example.pas
LICENSE
README.mdΒ© 2026 Flowy Β· Free and open source
Built for Claude Code Β· Not affiliated with Anthropic