Skip to content
Skills Library
Programming · Learning & explanation

delphi

/delphi

Expert Delphi / Object Pascal assistance covering VCL, FireMonkey, RTL, and enterprise desktop software. Use when maintaining or modernizing Windows desktop and cross-platform native applications.

Licence
MIT
Last repository change
01.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 01.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Expert Delphi / Object Pascal assistance covering VCL, FireMonkey, RTL, and enterprise desktop software. Use when maintaining or modernizing Windows desktop and cross-platform native applications.

Original author description

Expert Delphi / Object Pascal assistance covering VCL, FireMonkey, RTL, and enterprise desktop software. Use when maintaining or modernizing Windows desktop and cross-platform native applications.

How it works

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Original SKILL.md headings · 141 lines, 536 words
SKILL.md preview
---
name: delphi
description: Expert Delphi / Object Pascal assistance covering VCL, FireMonkey, RTL, and enterprise desktop software. Use when maintaining or modernizing Windows desktop and cross-platform native applications.
---

# Delphi / Object Pascal

Delphi (RAD Studio) and Free Pascal (Lazarus) keep Object Pascal alive. It is famous for **Single EXE** deployment and instant compilation.

## When to Use

- **Rapid Application Development (RAD) for Windows Desktop**: Building native Windows desktop applications with rich VCL graphical controls.
- **Legacy Enterprise Maintenance**: Modernizing and maintaining established corporate desktop software suites.
- **Single-Binary Zero-Dependency Native Compilation**: Producing fast, standalone native binaries that run without external runtime frameworks.
- **High-Performance Database Clients**: Interfacing with enterprise SQL databases via native FireDAC data access components.

## Quick Start

```pascal
program HelloWorld;
{$APPTYPE CONSOLE}
uses
  System.SysUtils;

begin
  try
    Writeln('Hello from Delphi Object Pascal!');
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.
```

## Core Concepts

### Object Pascal Strong Typing & Class Architecture

Clean, readable object-oriented architecture with explicit interfaces:

```pascal
unit OrderProcessor;

interface

type
  IOrderService = interface
    ['{8F3D1E1C-3A62-47CF-A98B-7D12A9E32049}']
    function ProcessOrder(const OrderId: Integer; const Amount: Double): Boolean;
  end;

  TOrderService = class(TInterfacedObject, IOrderService)
  public
    function ProcessOrder(const OrderId: Integer; const Amount: Double): Boolean;
  end;

implementation

function TOrderService.ProcessOrder(const OrderId: Integer; const Amount: Double): Boolean;
begin
  // Business logic execution
  Result := Amount > 0.0;
end;

end.
```

### Visual Component Library (VCL) & FireMonkey (FMX)

- **VCL**: Native Windows-only components wrapping direct Win32/Win64 APIs.
- **FireMonkey (FMX)**: Cross-platform GPU-accelerated UI framework targeting Windows, macOS, iOS, and Android.

### FireDAC Unified Database Connectivity

High-performance data access layer:

```pascal
var
  Query: TFDQuery;
begin
  Query := TFDQuery.Create(nil);
  try
    Query.Connection := FDConnection1;
    Query.SQL.Text := 'SELECT * FROM Customers WHERE Balance > :MinBalance';
    Query.ParamByName('MinBalance').AsCurrency := 1000.0;
    Query.Open;
    // Process records
  finally
    Query.Free;
  end;
end;
```

## Common Patterns

### Safe Memory Management with Try..Finally

**Problem**: Object memory leaks in non-ARC desktop platforms when exceptions occur.

**Solution**:
Use explicit `try..finally` destruction blocks:

```pascal
procedure ProcessCustomerList;
var
  List: TStringList;
begin
  List := TStringList.Create;
  try
    List.Add('Customer 1');
    List.Add('Customer 2');
    List.SaveToFile('customers.txt');
  finally
    List.Free;
  end;
end;
```

## Best Practices

**Do**:

- Always Wrap Object Allocations in `try...finally`: Guarantee that `.Free` executes to prevent memory leaks in non-ARC Windows runtimes.
- Use FireDAC for All Database Operations: Standardize on FireDAC; deprecate legacy BDE and dbExpress components.
- Target 64-Bit Windows (Win64): Ensure new applications compile for 64-bit to utilize modern memory spaces and system libraries.
- Use Parameterized Queries: Always use `ParamByName()` to prevent SQL injection vulnerabilities.

**Don't**:

- Ignore compiler hints and warnings: Treat Delphi compiler warnings with priority; they frequently identify uninitialized variables.
- Use global variables in units: Keep state encapsulated inside classes and records.
- Block the UI thread with long database queries: Execute heavy queries asynchronously using `TTask.Run` from the Parallel Programming Library.

## Troubleshooting

| Error                                                 | Cause                                                           | Solution                                                                        |
| :---------------------------------------------------- | :-------------------------------------------------------------- | :------------------------------------------------------------------------------ |
| `Access Violation at address ... (EAccessViolation)`  | Attempting to access an uninstantiated or freed object pointer. | Verify object was created with `.Create` before calling methods.                |
| `[dcc32 Fatal Error] F2084 Internal Error`            | Compiler cache corruption or circular unit dependency.          | Clean build directory and resolve circular references in `uses` clauses.        |
| `Memory Leak Detected in ReportMemoryLeaksOnShutdown` | Object created without matching `.Free` call.                   | Ensure every object creation is guarded with a `try..finally Free; end;` block. |

## References

- [Free Pascal](https://www.freepascal.org/)

Versions

RepositoryScoreLicence
This page · G1Joshi/Agent-Skills100MIT
dkbnull/hello-skill90MIT

Database snapshot: 13.11.2026 · package version 6a56481e5802 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 3 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 98delphi-xe7
    Use when writing, reviewing or fixing Delphi / Object Pascal code that must compile with Delphi XE7 (CompilerVersion 28.0) — any .pas, .dpr or .dfm in a VCL desktop application. Covers what XE7 can and cannot compile, memory and lifetime, strings and binary data, exceptions,…
  • 100xmake-pascal
    Use when building Pascal projects with xmake — `.pas`/`.pp`/`.lpr` sources, FreePascal (`fpc`) / Delphi toolchain, binary and shared-library targets.
  • 98vcl-ui-testing
    Use when a change to a Delphi VCL application has to be checked in the running UI — clicking through a form, verifying that a dialog opens, that a value appears, that a flow completes — or when writing automated UI smoke tests for it. Drives the real application through Windows…
  • 100devexpress-vcl-reports
    Build DevExpress VCL Reports (ExpressReports) apps in Delphi or C++Builder with TdxReport, TdxReportControl, and TdxBackendDataConnectionManager. Use when someone mentions "ExpressReports", "VCL Reports", "TdxReport", "TdxReportControl", "dxReport", "Report Viewer", "Report…
  • 98fmxer-development
    Develop Delphi FireMonkey (FMX) apps with FMXER (Andrea Magni's declarative, Flutter-inspired framework built on TFrameStand/TFormStand) - screens built in code as trees of frame/form "elements", named routes with TNavigator (DefineRoute, RouteTo, CloseRoute, StackPop, transient…
  • 100electron-desktop
    Desktop application development with Electron for Windows, macOS, and Linux. Use when building cross-platform desktop apps, implementing native OS features, or packaging web apps for desktop.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.