Claude Skill

adopt-c-bounds-safety

Guide for the C -fbounds-safety language extension. Covers the language model, pointer annotations, adopting bounds-safety in existing C code, compiler build settings and modes, and runtime debugging of bounds violations.

LLM Mart · 0 points · 1 views 0 listing impressions 0 install-command copies
Download artemnovichkov-xcode-skills-skills_adopt-c-bounds-safety-aa5c1cb.zip · 48 KB

Install

skills CLI npx skills add https://github.com/artemnovichkov/xcode-skills/tree/main/skills/adopt-c-bounds-safety
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install artemnovichkov-xcode-skills@llmmart
Git git clone https://github.com/artemnovichkov/xcode-skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole artemnovichkov/xcode-skills collection as a plugin from our marketplace. Git is the plain clone.

Skill manifest

How to Use This Skill

When helping with -fbounds-safety adoption or code changes, ask clarifying questions about the user's codebase and goals before suggesting changes. For complex tasks involving multiple files or non-trivial annotation decisions, use plan mode to propose an approach before implementing.

-fbounds-safety Language Extension

-fbounds-safety is a C language extension that prevents out-of-bounds memory access by enforcing bounds safety at the language level. It inserts automatic bounds checks at runtime, rejects unsafe pointer operations at compile time, and requires programmers to provide bounds annotations so the compiler can guarantee safety. Out-of-bounds accesses become deterministic traps instead of exploitable vulnerabilities.

Detailed Documentation

Required reading before adoption work

You MUST have fully read the following three documents (via the Read tool) at the start of an adoption task, and re-read them via the Read tool before any source-modifying step in the adoption workflow unless their content is verifiably fresh in your active context:

Other references (read on demand)

For compiler flags, Xcode build settings, soft trap mode, and ptrcheck.h configuration, read build-settings.md.

For debugging bounds violations at runtime — trap behavior, LLDB commands, wide pointer inspection, watchpoints, crash log analysis, and soft trap debugging, read runtime-debugging.md.

Files (xcode-skills)
  • references
    • adoption-strategies.md 52.9 KB
      Loading…
    • build-settings.md 2.9 KB
      Loading…
    • common-patterns-and-pitfalls.md 36.3 KB
      Loading…
    • language-overview.md 39.3 KB
      Loading…
    • runtime-debugging.md 8.7 KB
      Loading…
  • SKILL.md 2.9 KB
    ---
    description: |
      Guide for the C -fbounds-safety language extension. Covers the language model, pointer annotations, adopting bounds-safety in existing C code, compiler build settings and modes, and runtime debugging of bounds violations.
    effort: high
    when_to_use: |
      When working with, reading, reviewing, comparing, debugging or analyzing C code that has adopted -fbounds-safety or wants to adopt it.  Key syntax to look for Bounds annotations (__counted_by, __counted_by_or_null, __sized_by, __sized_by_or_null, __ended_by, __single, __indexable, __bidi_indexable, __unsafe_indexable, __null_terminated, __terminated_by), its helper functions (e.g.: __unsafe_forge_bidi_indexable, __unsafe_forge_single,  __null_terminated_to_indexable, __unsafe_null_terminated_to_indexable,  __unsafe_null_terminated_from_indexable) or other macros  (e.g. __ptrcheck_abi_assume_single) or includes of "ptrcheck.h".
    name: adopt-c-bounds-safety
    ---
    ## How to Use This Skill
    
    When helping with `-fbounds-safety` adoption or code changes, ask clarifying questions about the user's codebase and goals before suggesting changes. For complex tasks involving multiple files or non-trivial annotation decisions, use plan mode to propose an approach before implementing.
    
    # `-fbounds-safety` Language Extension
    
    `-fbounds-safety` is a C language extension that prevents out-of-bounds memory access by enforcing bounds safety at the language level. It inserts automatic bounds checks at runtime, rejects unsafe pointer operations at compile time, and requires programmers to provide bounds annotations so the compiler can guarantee safety. Out-of-bounds accesses become deterministic traps instead of exploitable vulnerabilities.
    
    ## Detailed Documentation
    
    ### Required reading before adoption work
    
    You MUST have fully read the following three documents (via the Read tool) at the start of an adoption task, and re-read them via the Read tool before any source-modifying step in the adoption workflow unless their content is verifiably fresh in your active context:
    
    - [adoption-strategies.md](references/adoption-strategies.md) — the workflow for adopting `-fbounds-safety` in an existing C project (full and header-only modes).
    - [language-overview.md](references/language-overview.md) — the language reference for `-fbounds-safety`: pointer kinds, annotations, and the rules that govern them.
    - [common-patterns-and-pitfalls.md](references/common-patterns-and-pitfalls.md) — recipes and anti-patterns encountered during real-world adoption.
    
    ### Other references (read on demand)
    
    For compiler flags, Xcode build settings, soft trap mode, and `ptrcheck.h` configuration, read [build-settings.md](references/build-settings.md).
    
    For debugging bounds violations at runtime — trap behavior, LLDB commands, wide pointer inspection, watchpoints, crash log analysis, and soft trap debugging, read [runtime-debugging.md](references/runtime-debugging.md).

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.