skills/generators/http-cache/SKILL.md
Generates an HTTP caching layer with Cache-Control parsing, ETag/conditional requests, and offline fallback. Use when user wants to add response caching, offline support, or reduce API calls.
npx skillsauth add rshankras/claude-code-apple-skills http-cacheInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate a production HTTP caching layer that integrates with your existing networking code. Supports Cache-Control directives, ETag/Last-Modified conditional requests, stale-while-revalidate, and offline fallback.
Use this skill when the user:
Search for existing networking code:
Glob: **/*API*.swift, **/*Client*.swift, **/*Network*.swift
Grep: "APIClient" or "URLSession" or "HTTPURLResponse"
If networking-layer generator was used, detect the APIClient protocol and generate a decorator that wraps it.
Search for existing caching:
Glob: **/*Cache*.swift
Grep: "URLCache" or "ResponseCache" or "CachePolicy"
If found, ask user whether to replace or extend.
Ask user via AskUserQuestion:
Cache storage sizes?
Caching strategy?
Offline support?
Integration style?
Read http-cache-patterns.md for architecture guidance.
Read templates.md for production Swift code.
Generate these files:
HTTPCacheConfiguration.swift — Memory/disk sizes, default policyCachePolicy.swift — Per-endpoint enum (default, noCache, forceCache, cacheFirst)CacheControlHeader.swift — Cache-Control header parserConditionalRequestHandler.swift — ETag/Last-Modified/304 handlingHTTPResponseCache.swift — Protocol + disk-backed response storeBased on configuration:
CachingAPIClient.swift — Decorator wrapping existing APIClient (if decorator style)NetworkReachability.swift — NWPathMonitor wrapper (if offline support selected)Check project structure:
Sources/Networking/ exists → Sources/Networking/Cache/App/Networking/ exists → App/Networking/Cache/Networking/ exists → Networking/Cache/Cache/After generation, provide:
Networking/Cache/
├── HTTPCacheConfiguration.swift # Memory/disk sizes, default policy
├── CachePolicy.swift # Per-endpoint caching enum
├── CacheControlHeader.swift # Cache-Control header parser
├── ConditionalRequestHandler.swift # ETag/Last-Modified/304
├── HTTPResponseCache.swift # Protocol + disk implementation
├── CachingAPIClient.swift # Decorator for existing APIClient
└── NetworkReachability.swift # NWPathMonitor (optional)
Wrap your existing client:
let baseClient = URLSessionAPIClient(configuration: .production)
let cachingClient = CachingAPIClient(
wrapping: baseClient,
cache: DiskHTTPResponseCache(),
configuration: .default
)
// Use cachingClient everywhere you used baseClient
let users = try await cachingClient.request(UsersEndpoint())
Per-endpoint cache policy:
struct UsersEndpoint: APIEndpoint, CacheConfigurable {
var cachePolicy: CachePolicy { .cacheFirst(maxAge: 300) }
}
struct OrdersEndpoint: APIEndpoint, CacheConfigurable {
var cachePolicy: CachePolicy { .noCache }
}
With SwiftUI:
struct UsersView: View {
@Environment(\.apiClient) private var apiClient
var body: some View {
List(users) { user in
Text(user.name)
}
.task {
// Automatically uses cache if available
users = try await apiClient.request(UsersEndpoint())
}
}
}
@Test
func cachedResponseReturnedOnSecondRequest() async throws {
let mockClient = MockAPIClient()
let cache = InMemoryHTTPResponseCache()
let cachingClient = CachingAPIClient(wrapping: mockClient, cache: cache)
mockClient.mockResponse(for: UsersEndpoint.self, response: [.mock])
// First request hits network
let first = try await cachingClient.request(UsersEndpoint())
#expect(mockClient.requestCount == 1)
// Second request comes from cache
let second = try await cachingClient.request(UsersEndpoint())
#expect(mockClient.requestCount == 1) // No additional network call
#expect(first == second)
}
generators/networking-layer — Base networking layer this decoratesdevelopment
US web checkout via the StoreKit External Purchase Link entitlement — currently 0% Apple commission (litigation ongoing), how to ship it safely, and how to architect for a commission flip so a future ruling is a config change, not a rewrite. Use when adding external purchase links, weighing web checkout vs IAP, or planning US-storefront pricing strategy.
tools
Revenue beyond the single-app price tag — own-app bundles, Family Sharing as a conversion lever, cross-developer bundles & suites, and institutional licensing via Group Purchases / Apple School & Business Manager. Use when a developer has multiple apps, a subscription worth sharing, complementary indie partners, or school/clinic/business buyers.
testing
Run a structured accessibility audit on an iOS/macOS app — automated XCUITest audits, Accessibility Inspector, manual VoiceOver/Dynamic Type passes, and App Store Accessibility Nutrition Label evaluation. Use before release, when preparing Nutrition Label declarations, or for EU Accessibility Act compliance.
tools
Stage-by-stage audit of an app's App Store growth machinery against a 54-item P0–P9 playbook — every item scored from an App Store Connect MCP call, a codebase check, or an explicit question to the user, then routed to the skill or command that fixes it. Read-only on App Store Connect. Use for a growth audit or scorecard, a pre-launch growth plan, a quarterly re-audit, or "which growth levers am I missing."