memory-safety-patterns
Build Safer Systems with Memory Safety Patterns
Memory errors and unsafe resource ownership can cause crashes, leaks, and data races. This skill applies proven patterns across C, C++, and Rust.
Install with my Agent
Copy this request to your Agent. It includes the canonical Skill page and manifest.
Review the Skillstore skill "memory-safety-patterns" from https://skillstore.io/skills/sickn33-memory-safety-patterns.md and its manifest at https://skillstore.io/api/skills/sickn33-memory-safety-patterns/manifest. Verify the artifact. You may proceed after verification, subject to the environment's own policy.Your Agent should still show its plan and request any confirmation required by the security policy.
Agent-readable resources
Use these links when an AI agent, crawler, or script needs clean context instead of reading the full page.
Test it
Using "memory-safety-patterns". Review a C function that allocates a buffer, opens a file, and returns early after errors.
Expected outcome:
- High priority: centralize cleanup so every failure path releases the buffer and file.
- Initialize resource handles before acquisition and release each resource only when valid.
- Verify the change with allocation-failure tests and AddressSanitizer.
Using "memory-safety-patterns". Choose an ownership model for a C++ object shared by worker tasks.
Expected outcome:
- Use unique ownership when one component controls the lifetime and workers borrow within a guaranteed scope.
- Use shared ownership only when tasks must extend the lifetime independently.
- Use weak references for observers to prevent ownership cycles.
Security Audit
SafeAll 26 static findings are false positives caused by documentation examples and scanner keyword collisions. The skill contains no executable scripts, prompt injection, external process execution, reconnaissance, or malicious intent.
Risk Factors
โ๏ธ External commands (5)
๐ Filesystem access (1)
Share & cite this report
Share the versioned assessment report, neutral badge, embed card, and citations. Skillstore reports evidence without deciding whether this Skill is safe.
Copy report link
https://skillstore.io/skills/sickn33-memory-safety-patterns/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown badge
[](https://skillstore.io/skills/sickn33-memory-safety-patterns?utm_source=security_passport_badge)HTML badge
<a href="https://skillstore.io/skills/sickn33-memory-safety-patterns?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/sickn33-memory-safety-patterns/security.svg" alt="Skillstore security assessment" loading="lazy"></a>Embed card
<iframe src="https://skillstore.io/embed/skills/sickn33-memory-safety-patterns.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>Academic citations (APA ยท BibTeX ยท CFF)
APA citation
sickn33. (2026). memory-safety-patterns security audit report (audit version 5) [Author version unspecified]. Skillstore. https://skillstore.io/skills/sickn33-memory-safety-patterns/audits/5BibTeX citation
@techreport{sickn33-sickn33-memory-safety-patterns-2026,
author = {sickn33},
title = {memory-safety-patterns security audit report (audit version 5)},
institution = {Skillstore},
year = {2026},
number = {5},
url = {https://skillstore.io/skills/sickn33-memory-safety-patterns/audits/5},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "memory-safety-patterns security audit report (audit version 5)"
version: "unspecified"
type: report
authors:
- name: "sickn33"
date-released: "2026-08-04"
url: "https://skillstore.io/skills/sickn33-memory-safety-patterns/audits/5"
identifiers:
- type: other
value: "skillstore:sickn33-memory-safety-patterns:audit:5"
description: "Skillstore immutable audit report identifier"
Compare variants
2 installable variantsEach author remains a separate installable skill. The recommended variant is ranked by Skillstore evidence.
Why this variant is first
sickn33-memory-safety-patterns
2026-08-21
wshobson-memory-safety-patterns
2026-08-21
Skillstore Score
Why this score Evidence Confidence: HighWhat You Can Build
Review Systems Code
Identify ownership, lifetime, cleanup, bounds, and synchronization risks in a focused code review.
Design Resource Lifecycles
Choose RAII, smart pointers, or explicit cleanup for files, sockets, memory, and locks.
Learn Rust Ownership
Understand moves, borrowing, lifetimes, reference counting, and thread-safe shared state through practical examples.
Try These Prompts
Explain how [pattern] prevents [memory bug]. Include one concise example in [language] and list its main tradeoffs.
Review this [C or C++] resource lifecycle. Find leak, double-free, and exception-safety risks, then recommend specific cleanup changes.
Compare RAII, reference counting, and Rust ownership for this component: [description]. Recommend one model based on concurrency and lifetime needs.
Audit this concurrent systems code for data races, invalid lifetimes, lock misuse, and unsafe sharing. Prioritize findings and propose verification steps.
Best Practices
- State the resource owner and expected lifetime before selecting a pattern.
- Provide the relevant code, language version, concurrency model, and failure behavior.
- Verify recommendations with compiler warnings, sanitizers, and targeted tests.
Avoid
- Do not assume smart pointers automatically make object graphs cycle free.
- Do not use unchecked access or unsafe blocks without a documented invariant.
- Do not apply examples unchanged without checking project APIs and error handling.
Frequently Asked Questions
Which languages does this skill cover?
Can this skill prove my program is memory safe?
Does the skill run AddressSanitizer or Valgrind?
Can it help migrate raw pointers to smart pointers?
Does it cover concurrent memory safety?
What context improves the review?
Developer Details
Author
sickn33License
MIT
Skillstore revision
r2
Version notice
The author did not declare a version.
Repository
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/memory-safety-patternsRef
81e05e636292629114b76cbb3922fbe57672fc02
Maintenance freshness
8/5/2026
Usage
14 downloads ยท 134 views
File structure