christopherkarani/agent-skills/swift-systems-safety
Claude Code and agent skill by christopherkarani/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
Use when Swift touches POSIX, file descriptors, sockets, pointers, buffers, C ABI, mmap, unsafe code, or manual cleanup. Do not invoke for ordinary safe collection code.
Install
npx vskill@latest install christopherkarani/agent-skills/swift-systems-safetySKILL.md
Swift systems safety
Make every unsafe boundary small, typed, bounded, and lifetime-proven. Unsafe APIs are escape hatches from static guarantees, not implementation style.
Procedure
- State the external contract: ownership, validity, alignment, initialization, length, errno behavior, blocking/cancellation, and cleanup.
- Wrap raw handles in a narrow type. Use
~Copyablewhen duplicate close/use-after-close is invalid; keep borrowed operations non-consuming. - Bound all lengths and arithmetic before allocation, pointer formation, or indexing. Reject malformed input before touching memory.
- Bind and access memory only for the documented lifetime and alignment. Do not assume a byte buffer is bound to an arbitrary typed value; do not escape pointers from their closure/lifetime.
- Translate C/POSIX results immediately into typed Swift outcomes. Preserve errno at the call site, retry only interruptible operations where the contract allows, and distinguish EOF, would-block, timeout, and failure.
- Test empty, maximum, truncated, misaligned, interrupted, closed, and allocation-failure paths. Run sanitizers or platform diagnostics when available.
Read references/systems-boundary-guide.md before changing pointer or descriptor code.
Guardrails
- Never use
@unchecked Sendableto paper over a raw pointer or handle whose synchronization/lifetime is unknown. - Never assume
defermakes an aliased descriptor safe; prove single ownership. - Never use
memcpy/rebinding as a substitute for a typed lifetime argument. - Keep system calls and unsafe blocks close to their checked wrapper; do not spread raw integers through the domain.
Completion contract
Report the safety invariant, bounds and lifetime proof, cleanup ownership, error mapping, and the strongest platform-specific verification performed.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingswift-6.3/swift-systems-safety/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/christopherkarani/agent-skills/swift-systems-safety)