Agent skill · AI & Agents

memory

Swift 6.2 InlineArray and Span types for zero-overhead memory access, fixed-size collections, and safe pointer alternatives. Use when optimizing performance-critical code paths.

rshankrasgithub.com/rshankrasGitHub ↗
claude-coderead-onlyMIT
Install
npx skills add rshankras/claude-code-apple-skills --skill memory --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 13 KB
Bundled scripts: none
Allowed tools: ReadGlobGrep
Path: skills/swift/memory/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 589
Language: Swift

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# InlineArray and Span Guidance for Swift 6.2's low-level memory types: `InlineArray` for fixed-size inline storage without heap allocation, and `Span` for safe, zero-cost access to contiguous memory. These replace common uses of `UnsafeBufferPointer` and hand-tuned tuple storage with compiler-checked alternatives. ## When This Skill Activates Use this skill when the user: - Asks about **InlineArray**, **fixed-size arrays**, or **stack-allocated collections** - Mentions **Span**, **MutableSpan**, **RawSpan**, or **UTF8Span** - Wants to **eliminate heap allocations** in hot paths - Is replacing **UnsafeBufferPointer** or **UnsafePointer** with safe alternatives - Asks about **value generics** or `let count: Int` generic parameters - Needs **zero-copy** access to collection storage - Mentions **inline storage**, **contiguous memory**, or **memory layout** - Is doing **binary parsing**, **signal processing**, or **embedded Swift** work - Wants to avoid **copy-on-write overhead** for small fixed collections - Asks about **non-escapable types** or **lifetime dependencies** in Swift ## Decision Tree ``` What memory optimization do you need? │ ├─ A fixed-size collection that never grows/s

What's inside
Steps it walks through
  1. When This Skill Activates
  2. Decision Tree
  3. API Availability
  4. Top 5 Mistakes
  5. InlineArray
  6. Declaration
  7. Initialization
  8. Memory Layout
  9. Basic Usage
  10. InlineArray vs Array
  11. Span Family
  12. Span (Read-Only)
  13. MutableSpan
  14. RawSpan
Ships with 1 file
  • swift-performance.md
More from claude-code-apple-skills
All skills →
About this skill
What does the memory skill do?

Swift 6.2 InlineArray and Span types for zero-overhead memory access, fixed-size collections, and safe pointer alternatives. Use when optimizing performance-critical code paths.

How do I install it?

Run `npx skills add rshankras/claude-code-apple-skills --skill memory --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From rshankras/claude-code-apple-skills, a repository with 589 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going