networking-layer

networking-layer is a skill for Claude Code from rshankras/claude-code-apple-skills. It costs 39 tokens per session (1,085 once invoked), scanned A, original, MIT.

A reusable Swift networking layer for making HTTP requests to APIs. It uses async/await, handles errors, and separates the interface from its implementation so it can be tested or replaced.

In plain words
What is it for?
Use it to add an API client, REST or HTTP requests, URLSession integration, authentication, environment-specific base URLs, and swappable test implementations.
Why use it?
It removes repeated networking code and gives API calls a consistent structure. Separating the interface also makes the code easier to test without using a real server.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: names the AskUserQuestion tool.

Part of the apple-skills plugin — 147 skills shipped together , and of apple-skills

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/rshankras/claude-code-apple-skills/networking-layer
Any agent
npx skills add rshankras/claude-code-apple-skills --skill networking-layer
Clone the repo
git clone --depth 1 https://github.com/rshankras/claude-code-apple-skills

Made for: Claude Code.

Or install apple-skills, the plugin that ships this one along with the rest of its 147 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for networking-layer

README.md
[![agentmods](https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/networking-layer.svg)](https://agentmods.dev/skills/rshankras/claude-code-apple-skills/networking-layer)
Your own site
<a href="https://agentmods.dev/skills/rshankras/claude-code-apple-skills/networking-layer"><img src="https://agentmods.dev/badge/skills/rshankras/claude-code-apple-skills/networking-layer.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,085 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00039 $0.01085
Opus 5 $0.00019 $0.00543
Sonnet 5 $0.00008 $0.00217
Haiku 4.5 $0.00004 $0.00109

Measured 3d ago against content hash daa95e08874a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

networking-layer scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

items = try await apiClient.fetch(ItemsEndpoint())
skills/generators/networking-layer/SKILL.md · 178 lines

How it starts

The opening of the file, as written. The whole thing — 178 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Networking Layer Generator

Generate a modern, protocol-based networking layer using Swift's async/await concurrency, with proper error handling and easy testability.

When This Skill Activates

Use this skill when the user:

  • Asks to "add networking" or "create API client"
  • Mentions "HTTP layer" or "REST API"
  • Wants to "fetch data from API"
  • Asks about "URLSession wrapper" or "network requests"

Pre-Generation Checks

1. Project Context Detection

  • Check Swift version (async/await requires Swift 5.5+)
  • Check deployment target (async/await requires iOS 15+ / macOS 12+)
  • Search for existing networking implementations
  • Identify source file locations

2. Conflict Detection

Search for existing networking:

Glob: **/*API*.swift, **/*Network*.swift, **/*Client*.swift
Grep: "URLSession" or "HTTPURLResponse"

If found, ask user:

  • Replace existing implementation?
  • Extend with new endpoints?

Configuration Questions

Ask user via AskUserQuestion:

  1. Authentication type?

    • Bearer token
    • API key (header or query param)
    • None
    • Custom
  2. Base URL configuration?

    • Single environment
    • Multiple environments (dev/staging/prod)
  3. Additional features?

    • Retry logic with exponential backoff
    • Request/response logging
    • Caching

Generation Process

Step 1: Create Core Files

Generate these files:

  1. APIClient.swift - Protocol and implementation
  2. APIEndpoint.swift - Endpoint definition protocol
  3. NetworkError.swift - Typed errors
  4. APIConfiguration.swift - Base URL and auth config

Step 2: Optional Files

Based on configuration:

  • RetryPolicy.swift - If retry logic selected
  • NetworkLogger.swift - If logging selected

Step 3: Determine File Location

Check project structure:

  • If Sources/ exists → Sources/Networking/
  • If App/ exists → App/Networking/
  • Otherwise → Networking/

Swift 6.2 Concurrency Notes

Reference: Apple's Swift Concurrency Updates

Read the full file on GitHub · 178 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 178 lines · 39 tokens per session scan A daa95e08874a

Subscribe to this mod's changes

networking-layer is a skill published in the GitHub repository rshankras/claude-code-apple-skills (701 stars, last pushed 1mo ago), licensed MIT. It adds 39 tokens to every session and 1,085 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

swift-codable

Implement Swift Codable models for JSON and property-list encoding and decoding with JSONDecoder, JSONEncoder, CodingKeys, and custom init(from:) or encode(to:). Use when parsing API responses, remapping keys, flattening nested JSON, handling date or data decoding strategies, decoding heterogeneous arrays, or…

JordanCoin/ios-skills-collection · 76 tokens

android-development

Android development with Kotlin, Jetpack Compose, and modern Android architecture. Use when building Android apps, implementing Material Design, or following Android best practices.

travisjneuman/.claude · 33 tokens

ios-development

Comprehensive guide for building native Apple platform applications.

travisjneuman/.claude · 43 tokens

kotlin-multiplatform

KMP/CMP shared business logic, Compose Multiplatform, expect/actual, Ktor, SQLDelight, and platform-specific implementations. Use when building cross-platform Kotlin applications for Android, iOS, desktop, or web.

travisjneuman/.claude · 54 tokens

swift-expert

Expert-level Swift development for iOS, macOS with SwiftUI, Combine, and modern Swift 5.9+. Use when the user mentions iOS, macOS, SwiftUI, Combine, async await, or Apple platforms, or when the task involves Modern Swift Features, Basics and Optionals, Functions and Closures, or Structs and Classes.

personamanagmentlayer/pcl · 76 tokens

ios-expert

Expert in iOS development with SwiftUI, UIKit, Combine, and Apple ecosystem integration. Use when the user mentions mobile, Swift, SwiftUI, UIKit, Apple platforms, or Xcode, or when the task involves iOS App Architecture, SwiftUI Fundamentals, UIKit Essentials, or Combine Framework.

personamanagmentlayer/pcl · 64 tokens