AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Delphi Clean Code

skill-delphicleancode-delphi-spec-kit-clean-code · by delphicleancode

Pragmatic clean code standards for Delphi — concise, direct, no over-engineering

No reviews yet
0 installs
33 views
0.0% view→install

Install

$ agentstack add skill-delphicleancode-delphi-spec-kit-clean-code

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-delphicleancode-delphi-spec-kit-clean-code)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Delphi Clean Code? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Delphi Clean Code — Skill

> CRITICAL SKILL — Be concise, direct and solution-focused.

Fundamental Principles

| Principle | Rule | |-----------|-------| | SRP | A function/class does ONE thing | | DRY | Don't repeat code — extract and reuse | | KISS | Simplest solution that works | | YAGNI | Don't build what wasn't asked for | | Boy Scout | Leave the code better than you found it |

Naming Rules (Pascal Guide)

| Element | Convention | |----------|-----------| | Variables | Reveal intent: LCustomerCount not N | | Methods | Verb + noun: GetCustomerById not Customer | | Booleans | Question form: IsActive, HasPermission, CanEdit | | Constants | SCREAMING_SNAKE: MAX_RETRY_COUNT | | Fields | Prefix F: FCustomerName | | Parameters | Prefix A: ACustomerName | | Var. locations | Prefix L: LCustomer |

> Rule: If you need a comment to explain a name, rename it.

Method Rules

| Rule | Description | |-------|-----------| | Short | Maximum 20 lines, ideal 5-10 | | One Thing | Do one thing and do it well | | One Level | One level of abstraction per method | | Few Args | Maximum 3 arguments, prefer 0-2 | | No Side Effects | Don't mute inputs unexpectedly |

Code Structure

| Standard | Application | |--------|-----------| | Guard Clauses | Early returns for edge cases | | Flat > Nested | Avoid deep nesting (max 2 levels) | | Composition | Small compound methods | | Colocation | Related code together |

Guard Clauses in Delphi

// ❌ RUIM — nesting excessivo
procedure ProcessOrder(AOrder: TOrder);
begin
  if Assigned(AOrder) then
  begin
    if AOrder.Items.Count > 0 then
    begin
      if AOrder.IsValid then
      begin
        // logic real aqui
      end;
    end;
  end;
end;

// ✅ BOM — guard clauses
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 items');
  if not AOrder.IsValid then
    raise EValidationException.Create('Order validation failed');

  // logic real aqui — sem nesting
end;

Anti-Patterns (DO NOT DO)

| ❌ Pattern | ✅ Fix | |-----------|------------| | Comment each line | Delete obvious comments | | Method > 20 lines | Share by responsibility | | Magic numbers | Named constants | | with statement | Explicit local variables | | Global variables | Constructor injection | | Generic Catch | Specific exceptions | | Logic in OnClick | Delegate to Service | | God class / God unity | One class = one responsibility | | Ignore Free | try/finally always |

Memory Management

// ✅ Objetos temporários — sempre try/finally
LList := TStringList.Create;
try
  LList.Add('item');
  // usar LList
finally
  LList.Free;
end;

// ✅ Interfaces — reference counting automático
var LService: IMyService;
LService := TMyService.Create; // liberado automaticamente

// ✅ Owner pattern para componentes visuais
LButton := TButton.Create(Self); // Self libera automaticamente

AI Code Style

| Situation | Action | |----------|------| | User requests feature | Write directly | | User reports bug | Correct, don't explain | | Requirement unclear | Ask, don't assume |

🔴 Before Editing (THINK FIRST!)

| Question | Why | |----------|---------| | Which units use this? | They can break | | What does this unit matter? | Interfaces can change | | What tests cover this? | Tests may fail | | Is it a shared component? | Multiple points affected |

> 🔴 Rule: Edit the file + all dependents in the SAME task.

🔴 Self-Check (MANDATORY)

| Check | Pergunta | |-------|----------| | ✅ Goal achieved? | Did I do exactly what was asked? | | ✅ Edited files? | Have I modified everything necessary? | | ✅ Does the code work? | Have I tested/verified? | | ✅ No errors? | Compiles without warnings? | | ✅ Nothing forgotten? | Edge cases treated? | | ✅ Memory safe? | Objects released correctly? |

> 🔴 Rule: If ANY check fails, correct it before finishing.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.