Agent skill

Memory Safety

by academiadocodigo in academiadocodigo/Router4Delphi

Delphi memory and resource management patterns. An agent skill from academiadocodigo/Router4Delphi.

MITAuto-check passed

Install Memory Safety

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

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

GitHub CLI
$ gh skill install academiadocodigo/Router4Delphi 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/Router4Delphi.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
120
Token cost
~405 tokens
SKILL.md length
179 words
Files
1
Skills in repo
3
Repo updated
First seen
Licence
MIT

At a glance

Delphi memory and resource management patterns. An agent skill from academiadocodigo/Router4Delphi.

  • SKILL.md covers Interface Reference Counting, Object Ownership, try/finally Pattern and Cache Management, 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/Router4Delphi. Delphi memory and resource management patterns

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

The repository describes itself as: Framework para Criação de Rotas de Telas para FMX e VCL. The licence is MIT.

Example prompts

  • “/memory-safety”

What it can do on your machine

Read from SKILL.md and the folder at commit bcac41c. 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 405 tokens when it runs. Until then it costs about 15 tokens; SKILL.md has 179 words of instructions outside code blocks.

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

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/Router4Delphi at commit bcac41c, republished under its MIT licence (© academiadocodigo). 179 words, ~405 tokens.

Download SKILL.mdSave it as .claude/skills/memory-safety/SKILL.md (or your agent's skills folder).
name
memory-safety
description
Delphi memory and resource management patterns

Memory and Resource Management

Interface Reference Counting

TInterfacedObject provides automatic reference counting. When the last interface reference goes out of scope, the object is freed automatically. Always assign to interface-typed variables to activate reference counting.

Object Ownership

If you call Create, you must call Free (unless the object is managed via interfaces). No exceptions.

try/finally Pattern

All resource allocations must be wrapped in try/finally:

pascal
LStream := TFileStream.Create(APath, fmOpenRead);
try
  // use LStream
finally
  LStream.Free;
end;

Cache Management

Router4D uses MAX_FRAME_COUNT = 25 to limit the number of cached frames. When the cache exceeds this limit, the oldest entries are removed to prevent unbounded memory growth.

Common Pitfalls

  • Mixing interface and object references: Holding both an interface reference and an object reference to the same TInterfacedObject instance causes premature or double frees. Pick one.
  • Forgetting to nil references: After freeing an object, set the variable to nil to avoid dangling pointer access.
  • Circular interface references: Two objects holding interface references to each other will never be freed. Break cycles by using weak references or explicit cleanup.

FreeAndNil in Destructors

Use FreeAndNil for owned objects in destructors to safely release and nil fields:

pascal
destructor TRouter4DHistory.Destroy;
begin
  FreeAndNil(FList);
  inherited;
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/Router4Delphi.

Open the folder on GitHubat commit bcac41c

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/Router4Delphi120—~405Automated safety check: PassMIT
Python Type Safetywshobson/agents40k—~1.4kAutomated safety check: PassMIT
Agent Resource Allocatorruvnet/ruflo74k2 repos~4.9kAutomated safety check: PassMIT
Resourceswindmill-labs/windmill18k—~1.7kAutomated safety check: PassCustom licence
Resource Hintsthedaviddias/Front-End-Checklist74k—~430Automated safety check: PassMIT
Safety Guardaffaan-m/ECC276k2 repos~554Automated safety check: NotesMIT

Similar skills

  • Python Type Safety

    wshobson/agents

    Python type safety with type hints, generics, protocols, and strict type checking.

    40k GitHub stars~1.4k tokensUpdated 4 days ago
    DevelopmentAuto-check passed
  • Agent skill for resource-allocator - invoke with $agent-resource-allocator

    74k GitHub starsUsed in 2 repos~4.9k tokens
    Auto-check passed
  • Resources

    windmill-labs/windmill

    MUST use when managing resources.

    18k GitHub stars~1.7k tokensUpdated today
    Backend & APIsAuto-check passed
  • Resource Hints

    thedaviddias/Front-End-Checklist

    A skill your agent uses when auditing slow page loads, heavy assets, or rendering delays related to Use resource hints for faster loading.

    74k GitHub stars~430 tokensUpdated 3 days ago
    Frontend & DesignAuto-check passed
  • Safety Guard

    affaan-m/ECC

    Guard against destructive operations with three modes: Careful intercepts dangerous commands (rm -rf, git push --force, DROP TABLE) for confirmation, Freeze locks writes to one directory, and Guard…

    276k GitHub starsUsed in 2 repos~554 tokens
    DevelopmentAuto-check: notes
  • Safety Guard

    affaan-m/ECC

    本番システムでの作業時や、エージェントを自律的に実行する際に破壊的な操作を防ぐためにこのスキルを使用してください. An agent skill from affaan-m/ECC.

    276k GitHub stars~323 tokensUpdated 4 days ago
    Auto-check: notes

More from academiadocodigo/Router4Delphi

  • Coding Patterns

    academiadocodigo/Router4Delphi

    Router4D coding patterns and conventions. An agent skill from academiadocodigo/Router4Delphi.

    120 GitHub stars~529 tokensUpdated 7 mo ago
    Auto-check passed
  • Changelog Format

    academiadocodigo/Router4Delphi

    CHANGELOG format reference

    120 GitHub stars~190 tokensUpdated 7 mo ago
    Auto-check passed

Questions about Memory Safety

What does Memory Safety do?

Delphi memory and resource management patterns. An agent skill from academiadocodigo/Router4Delphi. Memory Safety is an agent skill from academiadocodigo/Router4Delphi.

How do I install Memory Safety in Claude Code?

Run `npx skills add academiadocodigo/Router4Delphi --skill memory-safety -a claude-code`. Or copy the skill folder (.claude/skills/memory-safety in academiadocodigo/Router4Delphi) 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/Router4Delphi --skill memory-safety -a codex`. Or copy the skill folder (.claude/skills/memory-safety in academiadocodigo/Router4Delphi) 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/Router4Delphi --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 405 tokens (SKILL.md is roughly 1.6k 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: Python Type Safety (wshobson/agents, 40k stars), Agent Resource Allocator (ruvnet/ruflo, 74k stars), Resources (windmill-labs/windmill, 18k stars) and Resource Hints (thedaviddias/Front-End-Checklist, 74k 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/Router4Delphi, which has 120 GitHub stars. The repository holds 3 skills in this directory. The repository was last updated on March 8, 2026.

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