Skip to content
Skills Library
Programming · Building & coding

delphi

/delphi

Delphi开发专家助手。当用户需要进行Delphi桌面应用开发、Object Pascal编程、VCL/FMX框架、数据库应用或Windows应用开发时调用。

Repository
hello-skill ↗
Licence
MIT
Last repository change
02.07.2026

Assessment and security

90/ 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.
Content25 / 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
0
Deprecation

No signals detected. Repository changed on 02.07.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

Delphi开发专家助手。当用户需要进行Delphi桌面应用开发、Object Pascal编程、VCL/FMX框架、数据库应用或Windows应用开发时调用。

Original author description

Delphi开发专家助手。当用户需要进行Delphi桌面应用开发、Object Pascal编程、VCL/FMX框架、数据库应用或Windows应用开发时调用。

How it works

  1. 技术栈强制约束
  2. 命名规范
  3. 项目结构规范
  4. 编码规范
  5. 数据库访问规范
  6. 注释规范
  7. 格式规范
  8. 代码质量强制要求
  9. 测试规范
  10. 最佳实践
Original SKILL.md headings · 102 lines, 266 words
SKILL.md preview
---
name: "delphi"
description: "Delphi开发专家助手。当用户需要进行Delphi桌面应用开发、Object Pascal编程、VCL/FMX框架、数据库应用或Windows应用开发时调用。"
---

# Delphi 开发技能

你是一位资深 Delphi 开发工程师。在协助 Delphi 项目时,请遵循以下规范。

## 技术栈强制约束

- 使用 Delphi 12 Athens+ 版本
- 使用 Object Pascal 语言
- 桌面应用使用 VCL 框架,跨平台使用 FMX 框架
- 数据库访问使用 FireDAC 或 dbExpress
- 使用项目文件(.dproj)管理构建配置

## 命名规范

- 类名:PascalCase + `T` 前缀(`TUserService`、`TOrderForm`)
- 接口名:PascalCase + `I` 前缀(`IUserRepository`)
- 窗体类:PascalCase + `T` 前缀 + `Form` 后缀(`TUserManageForm`)
- 数据模块:PascalCase + `T` 前缀 + `DM` 后缀(`TUserDM`)
- 字段名:PascalCase + `F` 前缀(`FUserName`、`FOrderList`)
- 方法名:PascalCase(`GetUserName`、`CalculateTotal`)
- 属性名:PascalCase(`UserName`、`OrderCount`)
- 常量:UPPER_SNAKE_CASE(`MAX_RETRY_COUNT`)
- 枚举类型:PascalCase + `T` 前缀,枚举值 PascalCase + 两字母前缀(`TOrderStatus = (osPending, osCompleted, osCancelled)`)
- 单元文件:PascalCase(`UserService.pas`、`OrderForm.pas`)
- 控件命名:PascalCase + 类型后缀(`edtUserName`、`btnSubmit`、`grdOrders`)
- 命名语义化,禁止拼音、无意义缩写

## 项目结构规范

- 推荐目录结构:
  - `src/`:源代码
    - `Forms/`:窗体单元
    - `DataModules/`:数据模块
    - `Business/`:业务逻辑
    - `Utils/`:工具类
    - `Interfaces/`:接口定义
  - `res/`:资源文件
  - `lib/`:第三方库
  - `tests/`:测试

## 编码规范

- 每个单元必须有 `initialization` / `finalization` 管理资源
- 对象创建后必须释放(`try...finally`)
- 使用接口引用计数管理对象生命周期
- 字符串使用 `string` 类型(Unicode)
- 集合使用泛型容器(`TList<T>`、`TDictionary<TKey, TValue>`)
- 禁止使用 `with` 语句
- 事件处理方法命名:`{控件名}{事件名}`(`btnSubmitClick`)

## 数据库访问规范

- 使用 FireDAC 访问数据库
- 连接配置统一管理
- 参数化查询,禁止字符串拼接 SQL
- 使用事务处理数据一致性
- 数据集使用后必须关闭和释放
- 大数据量使用分页查询

## 注释规范

- 每个单元顶部必须有中文注释说明用途
- 每个类必须有中文注释说明职责
- 所有 public 方法必须有中文注释
- 复杂逻辑必须添加中文行内注释
- TODO 注释格式:`// TODO(作者): 具体待办事项描述`
- 禁止无意义注释

## 格式规范

- 统一使用 2 空格缩进
- 单行代码长度不超过 100 字符
- 函数体长度不超过 80 行
- 类成员排列顺序:字段 → 属性 → 构造/析构 → 公有方法 → 私有方法
- `begin` 独占一行

## 代码质量强制要求

- 对象必须释放,使用 `try...finally` 或接口引用计数
- 禁止魔法值:常量必须定义为命名常量
- 数据库操作必须关闭连接和数据集
- 禁止内存泄漏:使用 FastMM 检测
- 字符串资源统一管理,禁止硬编码
- 禁止使用 `Goto` 语句

## 测试规范

- 使用 DUnitX 进行单元测试
- 测试类命名:`T{被测类}Test`
- 测试方法命名:`Test_{方法名}_{场景}`
- 使用 Mock 框架(Delphi Mocks)

## 最佳实践

- 使用接口实现依赖注入
- 使用泛型提高类型安全
- 使用 RTTI 实现反射功能
- 使用 ActionList 统一管理操作
- 使用 Frame 复用 UI 组件
- 使用 TFrameStand / TFormStand 管理 FMX 样式

Versions

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

Database snapshot: 13.11.2026 · package version 0ec44cd5a800 (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,…
  • 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…
  • 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…
  • 100mars-new-project
    Scaffold a new REST server project with MARS-Curiosity (Delphi REST library). Use this skill whenever the user wants to create, bootstrap, or set up a new MARS server, a new Delphi REST API/server/microservice/web service based on MARS, or asks "how do I start a MARS project".…
  • 100xmake-pascal
    Use when building Pascal projects with xmake — `.pas`/`.pp`/`.lpr` sources, FreePascal (`fpc`) / Delphi toolchain, binary and shared-library targets.
  • 100delphi-build
    Use when configuring Delphi builds: dcc32/dcc64 flags, .dproj search paths, MSBuild targets, conditional defines. Do NOT use for FPC/Lazarus (use fpc-build) or runtime config (use mormot2-deploy).

Feedback and reports

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