agentleFS
apexbymanishapexbymanish/claude-ai-agents-ios/.claude/skills/ios-api-availability/SKILL.md

ios-api-availability

Skill0 starsChanged 3 months agoMITView on GitHub

Procedure for determining whether code actually works at a project's stated minimum iOS version — deployment target vs. API introduction version vs. guard correctness. Use when asked "does this work on iOS 14", "is this compatible", about deprecated APIs, or @available/if #available guards.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If ios-agent MCP is configured, mcp__ios-agent__check_availability_guards alongside the manual check — STATIC_ANALYSIS tier, same as …

    line 25
  2. Distinctive:

    Read the project's actual minimum deployment target — don't assume a common default.

    line 77
  3. Distinctive:

    Look up the API's actual introduction version.

    line 79
  4. Distinctive:

    If a guard exists, check its stated version against the API's real introduction version — flag both "missing" and "over-restrictive" …

    line 83
  5. Distinctive:

    Never say "compatible with iOS 14" without having actually compared the API's introduction version against 14, not just noticing *a* guard …

    line 122
  6. Distinctive:

    Never say a deprecation is "safe to ignore" without reading what the deprecation message actually says changed.

    line 125
  7. Distinctive:

    Never assume the project's deployment target — state where you read it from.

    line 127

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

iOS API Availability

Purpose

Answer "does this work on iOS X" with an actual comparison of four specific facts, not an impression. Never claim compatibility without having checked all four.

When to Use

Any question about minimum deployment target compatibility, a specific API's availability, deprecated-API usage, or @available/ if #available/#if guard correctness.

Inputs

  • The project's actual stated minimum deployment target — read it from the project settings/Package.swift/CLAUDE.md, never assume it.
  • The specific API(s) in question.
  • If ios-agent MCP is configured, mcp__ios-agent__check_availability_guards alongside the manual check — STATIC_ANALYSIS tier, same as reading the code, never higher. It specifically catches the over-restrictive-guard case below, which is easy to miss by eye.

Core Knowledge

  • #if os(iOS) and @available/if #available are different mechanisms. The former is a compile-time platform-family check (does this even compile for this OS family); the latter is a run-time OS-version check. Confusing them is a real, common mistake — a #if guard does nothing to protect a version-specific API from crashing at runtime on an older OS in the same family.
  • A missing guard is the obvious failure mode; an over-restrictive guard is the sneaky one. @available(iOS 16, *) on an API that actually only needs iOS 15 doesn't crash anything — it silently drops support for every iOS 15 device for no reason, and nobody notices because nothing breaks, it just quietly works for fewer users than it could.
  • Framework availability and symbol availability aren't the same check. A framework can exist in the SDK you compile against while a specific symbol inside it was only introduced later — check the specific API's own @available annotation in its documentation/ header, not just "is the framework importable."
  • Deprecation isn't removal. A deprecated API usually still works; the question is whether it still behaves the same way, and whether there's a replacement worth adopting given the project's actual minimum target (see Common Mistakes).

Detection Patterns

PatternRiskDetect by
API call with no availability guard, API's introduction version above the project's minimum deployment targetCrashes or is unavailable on real devices still on the minimum targetFor each API in question, compare its documented introduction version against the project's actual minimum target
@available/if #available guard set higher than the API actually requiresSilently drops support for real devices between the true minimum and the guard's version — no crash, no signal, just fewer supported usersCompare the guard's stated version against the API's actual documented introduction version, not just "a guard exists"
#if os(iOS) used where a version check was actually neededCompiles fine, still crashes at runtime on an older iOS version in the same familyCheck whether the guarded API is version-specific, not just platform-specific
@available guard present but the guarded call happens outside the guarded scope (e.g. inside an escaping closure captured before the check)The guard doesn't actually protect the call it looks like it protectsTrace execution: does the flagged API call actually execute inside the if #available branch, or just textually near it
Deprecated API used with no note of a replacement or reason to keep itMissed opportunity, or a behavior change already shipped in the OS that the deprecation warning is flaggingCheck the deprecation message for why — some deprecations mean "still works, better option exists," others mean "behavior changed"

Procedure

For every API call in question, establish these four facts and report all four together — not a conclusion without showing the comparison:

Current deployment target: [read from project settings, cited]
API introduced version: [from Apple's documentation, cited]
Required guard: [what guard, if any, is actually needed]
Actual project compatibility: [does the code as written handle this correctly]
  1. Read the project's actual minimum deployment target — don't assume a common default.
  2. Look up the API's actual introduction version.
  3. Compare: if introduction version > deployment target, a guard is required; if introduction version ≤ deployment target, no guard is needed and one present anyway isn't wrong, just unnecessary.
  4. If a guard exists, check its stated version against the API's real introduction version — flag both "missing" and "over-restrictive" mismatches.
  5. Report the four facts above for every API checked, not just the ones that turned out to be a problem — a clean check is still evidence.

Common Mistakes

  • Assuming the newest guard/API pattern is automatically the right answer without checking this project's actual minimum target first (see ios-api-availability's companion project-constraints discipline in CLAUDE.md.template).
  • Treating "compiles without a warning" as proof of runtime compatibility — the compiler only catches API availability, not necessarily every version-specific behavior difference.
  • Reporting only the APIs that had a problem, making it impossible to tell later which ones were actually checked vs. never examined.

Verification

  • The four-fact comparison above, from documentation and source reading, is STATIC_ANALYSIS.
  • Confirming the app actually builds against the stated minimum target (a real Xcode build with that deployment target set, not just a read) is BUILD_VERIFIED.
  • Confirming behavior on an actual device/simulator running the minimum OS version is RUNTIME_VERIFIED.

Evidence Requirements

"Works on iOS 14" requires the full four-fact comparison at minimum (STATIC_ANALYSIS); a stronger claim requires actually building and, ideally, running against that minimum version (BUILD_VERIFIED/ RUNTIME_VERIFIED). Never report compatibility from having checked only the API's existence without checking the guard's correctness.

Claim Restrictions

  • Never say "compatible with iOS 14" without having actually compared the API's introduction version against 14, not just noticing a guard is present.
  • Never say a deprecation is "safe to ignore" without reading what the deprecation message actually says changed.
  • Never assume the project's deployment target — state where you read it from.

Output Format

The four-fact table (deployment target / API version / required guard / actual compatibility) per API checked, findings for any mismatch with file:line and the concrete fix, and the ios-evidence-reporting status block.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.