FreePascal/Lazarus Clean Code

Enforce clean-code rules for FreePascal/Lazarus projects and legacy refactors.

17|7|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/delphicleancode/lazarus-spec-kit --skill freepascal-lazarus-clean-code
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: FreePascal/Lazarus Clean Code
Source: https://github.com/delphicleancode/lazarus-spec-kit/tree/main/.gemini/skills/clean-code
Command: npx skills add https://github.com/delphicleancode/lazarus-spec-kit --skill freepascal-lazarus-clean-code

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Este Skill define padrões pragmáticos de código limpo para FreePascal/Lazarus, promovendo código legível, simples e fácil de manter, evitando a complexidade desnecessária.

Core Features & Use Cases

  • Princípios de design: SRP, DRY, KISS, YAGNI e orientação a responsabilidade.
  • Regras de nomenclatura e estrutura para Pascal/Lazarus: variáveis, métodos, booleanos, constantes, campos e parâmetros.
  • Padrões de estrutura de código e uso de guard clauses para reduzir aninhamento e facilitar manutenção.
  • Gestão de memória e prevenção de anti-patterns comuns, com diretrizes para evitar código de OnClick com lógica de negócio.
  • Casos de uso: refatoração de unidades Lazarus, melhoria de legibilidade, manutenção e adoção de práticas de clean architecture.

Quick Start

Apply these guidelines to your FreePascal/Lazarus codebase by starting with guard clauses, renaming variables for clarity, and eliminating repeated code.

Frequently Asked Questions about FreePascal/Lazarus Clean Code

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor legacy FreePascal code to reduce nesting and improve readability?▼

Manage memory in Lazarus projects by following pragmatic clean-code rules that prevent common anti-patterns. These guidelines enforce proper memory management and prevent memory leaks during legacy refactors.

Can I apply clean architecture principles like SRP and DRY to small Lazarus projects?▼

Yes, you can apply SRP, DRY, KISS, and YAGNI principles to small to mid-sized Lazarus projects. These design principles enforce responsibility orientation and eliminate unnecessary complexity for better maintainability.

Why should I avoid putting business logic inside OnClick event handlers in Pascal?▼

Avoiding business logic in OnClick handlers is a key anti-pattern prevention rule in clean FreePascal code. Separating UI events from business logic enforces the Single Responsibility Principle and improves long-term maintainability.

What are the best naming conventions for variables, methods, and constants in FreePascal?▼

The best naming conventions for FreePascal enforce clear structures for variables, methods, booleans, constants, fields, and parameters. Consistent naming reduces cognitive load and makes legacy refactors significantly easier to maintain.