Agent skill

Memory Safety

by academiadocodigo in academiadocodigo/SimpleORM

Delphi memory management patterns for SimpleORM - ownership, try/finally, interface refs, and common leak scenarios.

MITAuto-check passedDatabases

Install Memory Safety

skills CLI
$ npx skills add academiadocodigo/SimpleORM --skill memory-safety -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install academiadocodigo/SimpleORM memory-safety --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/academiadocodigo/SimpleORM.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/memory-safety .claude/skills/memory-safety && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
memory-safety
GitHub stars
157
Token cost
~531 tokens
SKILL.md length
70 words
Files
1
Skills in repo
9
Repo updated
First seen
Licence
MIT

At a glance

Delphi memory management patterns for SimpleORM - ownership, try/finally, interface refs, and common leak scenarios.

  • Databases work in your project
  • SKILL.md covers Ownership Patterns, Pattern: Object Created, Used,…, Pattern: Object Created and… and Pattern: List with Error Safety, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Memory Safety is an agent skill from academiadocodigo/SimpleORM. Delphi memory management patterns for SimpleORM - ownership, try/finally, interface refs, and common leak scenarios.

Its SKILL.md is about 530 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases. The repository describes itself as: ORM Simples para Aplicações Delphi. The licence is MIT.

When your agent uses it

  • Databases work in your project

Example prompts

  • “/memory-safety”

What it can do on your machine

Read from SKILL.md and the folder at commit 6227399. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are pascal).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Memory Safety loads about 531 tokens when it runs. Until then it costs about 33 tokens; SKILL.md has 70 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~33
When it runs · the whole SKILL.md, loaded when a task matches
~531

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from academiadocodigo/SimpleORM at commit 6227399, republished under its MIT licence (© academiadocodigo). 70 words, ~531 tokens.

Download SKILL.mdSave it as .claude/skills/memory-safety/SKILL.md (or your agent's skills folder).
name
memory-safety
description
Delphi memory management patterns for SimpleORM - ownership, try/finally, interface refs, and common leak scenarios.
user-invocable
false

Delphi Memory Safety for SimpleORM

Rules are in .claude/rules/security.md — this skill provides patterns and examples.

Ownership Patterns

Interface References (Auto-managed)
pascal
var
  LQuery: iSimpleQuery;  // Reference counted
begin
  LQuery := TSimpleQueryFiredac.New(Conn);
  // Do NOT call LQuery.Free — freed automatically when ref count = 0
end;
Object References (Manual management)
pascal
var
  LList: TObjectList<T>;
begin
  LList := TObjectList<T>.Create;
  try
    // Use LList
  finally
    LList.Free;
  end;
end;

Pattern: Object Created, Used, and Freed

pascal
LEntity := T.Create;
try
  LDAO.Insert(LEntity);
finally
  LEntity.Free;
end;

Pattern: Object Created and Returned

pascal
function CreateEntity: T;
begin
  Result := T.Create;
  try
    // Populate Result
  except
    Result.Free;  // Free on error only
    raise;
  end;
  // Caller owns Result — caller must free it
end;

Pattern: List with Error Safety

pascal
function CreateList: TObjectList<T>;
begin
  Result := TObjectList<T>.Create;
  try
    for I := 0 to N do
      Result.Add(CreateItem);
  except
    Result.Free;  // Frees list AND owned objects
    raise;
  end;
end;

Pattern: Destructor

pascal
destructor TSimpleXxx.Destroy;
begin
  FreeAndNil(FOwnedComponent1);
  FreeAndNil(FOwnedComponent2);
  // Interface fields: do NOT free (auto-managed)
  inherited;
end;

Common Leak Scenarios in SimpleORM

JSON Parsing
pascal
LJSON := TJSONObject.ParseJSONValue(Body) as TJSONObject;
if LJSON = nil then
  raise Exception.Create('Invalid JSON');
try
  // Use LJSON
finally
  LJSON.Free;
end;
TRttiContext

TRttiContext is a RECORD (not class). .Create and .Free are no-ops. Do not treat it as an object.

DataSet Operations
pascal
FQuery.DataSet.DisableControls;
try
  // Process dataset
finally
  FQuery.DataSet.EnableControls;
end;

© academiadocodigo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/memory-safety of academiadocodigo/SimpleORM.

Open the folder on GitHubat commit 6227399

Compare with similar skills

Memory Safety next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Memory Safety compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Memory Safety this skillacademiadocodigo/SimpleORM157—~531Automated safety check: PassMIT
Keeper Stress AnalysisClickHouse/ClickHouse50k—~4.7kAutomated safety check: PassApache-2.0
Perf ComparisonClickHouse/ClickHouse50k—~3.9kAutomated safety check: NotesApache-2.0
Patch Release CheckClickHouse/ClickHouse50k—~4kAutomated safety check: NotesApache-2.0
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0
Hybrid Cloud Outboxesgetsentry/sentry46k—~4.8kAutomated safety check: PassCustom licence

Similar skills

  • Keeper Stress Analysis

    ClickHouse/ClickHouse

    Analyze ClickHouse Keeper stress-test results from play.clickhouse.com / keeperstresstests data warehouse.

    50k GitHub stars~4.7k tokensUpdated today
    DatabasesAuto-check passed
  • Perf Comparison

    ClickHouse/ClickHouse

    Evaluate ClickHouse performance test results from existing CI/dashboard data or local perf.py runs.

    50k GitHub stars~3.9k tokensUpdated today
    DatabasesAuto-check: notes
  • Patch Release Check

    ClickHouse/ClickHouse

    Check whether ClickHouse's supported versions (last 3 majors + latest LTS) have recent stable patch releases, diagnose why the scheduled AutoReleases pipeline failed, and identify which releases…

    50k GitHub stars~4k tokensUpdated today
    DatabasesAuto-check: notes
  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Hybrid Cloud Outboxes

    getsentry/sentry

    Official

    Guide for creating and maintaining outbox-based eventually consistent operations in Sentry.

    46k GitHub stars~4.8k tokensUpdated today
    DatabasesAuto-check passed
  • Adaptive Spin Wait

    microsoft/garnet

    Official

    Selects Garnet spin-wait policies based on the slow-path cost.

    12k GitHub stars~1k tokensUpdated today
    DatabasesAuto-check passed

More from academiadocodigo/SimpleORM

All 9 skills in this repo
  • Delphi Patterns

    academiadocodigo/SimpleORM

    Coding conventions and patterns for the SimpleORM Delphi project.

    157 GitHub stars~560 tokensUpdated 2 mo ago
    Auto-check passed
  • Delphi Project Structure

    academiadocodigo/SimpleORM

    Delphi project file structure reference — .dpr vs .pas, .dproj, .res, .dfm.

    157 GitHub stars~1.2k tokensUpdated 2 mo ago
    Auto-check passed
  • Delphi Validator

    academiadocodigo/SimpleORM

    Validates all SimpleORM Delphi source files for Delphi 10.2 Tokyo+ compatibility.

    157 GitHub stars~828 tokensUpdated 2 mo ago
    Auto-check passed
  • Entity Mapping

    academiadocodigo/SimpleORM

    SimpleORM entity-to-database mapping via RTTI attributes. An agent skill from academiadocodigo/SimpleORM.

    157 GitHub stars~816 tokensUpdated 2 mo ago
    Auto-check passed
  • Horse Integration

    academiadocodigo/SimpleORM

    Horse/ExpxHorse integration patterns for SimpleORM — server auto-routing, client REST driver, serialization examples.

    157 GitHub stars~759 tokensUpdated 2 mo ago
    Auto-check passed
  • Isimplequery Contract

    academiadocodigo/SimpleORM

    The exact iSimpleQuery interface contract that all query drivers must implement.

    157 GitHub stars~670 tokensUpdated 2 mo ago
    Auto-check passed

Categories

Questions about Memory Safety

What does Memory Safety do?

Delphi memory management patterns for SimpleORM - ownership, try/finally, interface refs, and common leak scenarios. Memory Safety is an agent skill from academiadocodigo/SimpleORM. Delphi memory management patterns for SimpleORM - ownership, try/finally, interface refs, and common leak scenarios.

When should I use Memory Safety?

Memory Safety fits situations like: databases work in your project.

How do I install Memory Safety in Claude Code?

Run `npx skills add academiadocodigo/SimpleORM --skill memory-safety -a claude-code`. Or copy the skill folder (.claude/skills/memory-safety in academiadocodigo/SimpleORM) into .claude/skills/memory-safety in your project. Claude Code loads it when a task matches its description.

How do I install Memory Safety in Codex?

Run `npx skills add academiadocodigo/SimpleORM --skill memory-safety -a codex`. Or copy the skill folder (.claude/skills/memory-safety in academiadocodigo/SimpleORM) into .agents/skills/memory-safety in your project. Codex loads it when a task matches its description.

Can I use Memory Safety in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add academiadocodigo/SimpleORM --skill memory-safety -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/memory-safety, .gemini/skills/memory-safety, .github/skills/memory-safety and .opencode/skills/memory-safety in your project.

What does Memory Safety need to run?

SKILL.md names no scripts, command-line tools or credentials: Memory Safety is instructions for the agent only.

Does Memory Safety access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Memory Safety safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Memory Safety use?

Memory Safety is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Memory Safety use?

About 531 tokens (SKILL.md is roughly 2.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Memory Safety?

Skills that share tags, products or a category with Memory Safety: Keeper Stress Analysis (ClickHouse/ClickHouse, 50k stars), Perf Comparison (ClickHouse/ClickHouse, 50k stars), Patch Release Check (ClickHouse/ClickHouse, 50k stars) and Evolving The Data Model (TriliumNext/Trilium, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Memory Safety?

academiadocodigo (a GitHub organization) maintains it in academiadocodigo/SimpleORM, which has 157 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on August 2, 2026.

Source: academiadocodigo/SimpleORM on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.