Skills memory-safety-patterns
๐Ÿ“ฆ

memory-safety-patterns

Content revision r2 Safe โš™๏ธ External commands๐Ÿ“ Filesystem access

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.

Supports: Claude Codex Code(CC)
๐Ÿฅ‰ 78 Bronze

Install with my Agent

Copy this request to your Agent. It includes the canonical Skill page and manifest.

Agent request
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.

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

Safe
v5 โ€ข 8/4/2026 Open versioned report

All 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.

2
Files scanned
646
Lines analyzed
0
Review items
0
False positives ignored
No confirmed security findings were detected by the latest completed static and semantic audit. This does not prove the skill has no side effects.
Audited by: codex View Audit History โ†’
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.

Open versioned report
Security Assessment

Copy report link

https://skillstore.io/skills/sickn33-memory-safety-patterns/audits/5?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_report

Markdown badge

[![Skillstore security assessment](https://skillstore.io/badges/skills/sickn33-memory-safety-patterns/security.svg)](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/5

BibTeX 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 variants

Each author remains a separate installable skill. The recommended variant is ranked by Skillstore evidence.

Why this variant is first

Highest Skillstore Score
sickn33 Recommended Current

sickn33-memory-safety-patterns

Skillstore Score 78
Evidence Confidence High
Skillstore usage 18
Updated

2026-08-21

wshobson-memory-safety-patterns

Skillstore Score 77
Evidence Confidence High
Skillstore usage 17
Updated

2026-08-21

Skillstore Score

Why this score Evidence Confidence: High
55
Architecture
85
Maintainability
87
Content
69
Community
83
Spec Compliance

What 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 a Memory Safety Pattern
Explain how [pattern] prevents [memory bug]. Include one concise example in [language] and list its main tradeoffs.
Review Resource Cleanup
Review this [C or C++] resource lifecycle. Find leak, double-free, and exception-safety risks, then recommend specific cleanup changes.
Compare Ownership Designs
Compare RAII, reference counting, and Rust ownership for this component: [description]. Recommend one model based on concurrency and lifetime needs.
Audit Concurrent Memory Safety
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?
It focuses on C, C++, and Rust, with general guidance that also applies to other systems languages.
Can this skill prove my program is memory safe?
No. It provides patterns and review guidance, but verification still requires testing, analysis tools, and project-specific review.
Does the skill run AddressSanitizer or Valgrind?
No. It can recommend commands and interpret supplied results, but it does not run tools by itself.
Can it help migrate raw pointers to smart pointers?
Yes. It can map ownership roles and recommend unique, shared, or weak pointers based on actual lifetime requirements.
Does it cover concurrent memory safety?
Yes. It explains atomics, mutexes, read-write locks, thread-safe sharing, and Rust data race prevention.
What context improves the review?
Provide the code, language version, ownership expectations, thread model, error paths, and available test or sanitizer results.

Developer Details

Author

sickn33

License

MIT

Skillstore revision

r2

Version notice

The author did not declare a version.

Ref

81e05e636292629114b76cbb3922fbe57672fc02

Maintenance freshness

8/5/2026

Usage

14 downloads ยท 134 views

File structure

๐Ÿ“ resources/

๐Ÿ“„ implementation-playbook.md

๐Ÿ“„ SKILL.md