ios-networking-advanced/SKILL.md
Production-grade iOS networking — URLSession async/await with typed errors, interceptor/middleware pattern (auth token injection + 401 refresh), exponential backoff retry, request deduplication, background URLSession for large downloads/uploads...
npx skillsauth add peterbamuhigire/skills-web-dev ios-networking-advancedInstall 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.
ios-networking-advanced or would be better handled by a more specific companion skill.references only as needed.SKILL.md first, then load only the referenced deep-dive files that are necessary for the task.references/ directory for deep detail after reading the core workflow below.| Topic | Section | |---|---| | Typed errors + async/await foundation | Section 1 | | Type-safe endpoint building | Section 2 | | Auth token refresh interceptor (401) | Section 3 | | Exponential backoff retry | Section 4 | | Background URLSession (downloads/uploads) | Section 5 | | Certificate pinning | Section 6 | | Multipart form data upload | Section 7 | | Network reachability + offline queue | Section 8 (→ references) | | Request deduplication | Section 9 | | Combine + URLSession (legacy) | Section 10 (→ references) | | Structured concurrency (async-let, Task groups) | Section 11 | | Production anti-patterns | Section 12 |
enum NetworkError: Error, LocalizedError {
case invalidURL
case noData
case decodingFailed(Error)
case httpError(statusCode: Int, data: Data?)
case unauthorized // 401 — triggers token refresh
case forbidden // 403 — no point retrying
case serverError(Int) // 5xx — retry eligible
case cancelled
case noInternetConnection
var errorDescription: String? {
switch self {
case .unauthorized: return "Session expired. Please log in again."
case .noInternetConnection: return "No internet connection."
case .httpError(let code, _): return "Request failed with status \(code)"
default: return "Something went wrong. Please try again."
}
}
}
actor NetworkClient {
private let session: URLSession
private let decoder: JSONDecoder
private(set) var authToken: String?
init(session: URLSession = .shared) {
self.session = session
self.decoder = JSONDecoder()
self.decoder.keyDecodingStrategy = .convertFromSnakeCase
self.decoder.dateDecodingStrategy = .iso8601
}
func setToken(_ token: String) { authToken = token }
func request<T: Decodable>(_ endpoint: Endpoint) async throws -> T {
let urlRequest = try endpoint.urlRequest(token: authToken)
let (data, response) = try await session.data(for: urlRequest)
guard let http = response as? HTTPURLResponse else { throw NetworkError.noData }
switch http.statusCode {
case 200...299:
do { return try decoder.decode(T.self, from: data) }
catch { throw NetworkError.decodingFailed(error) }
case 401: throw NetworkError.unauthorized
case 403: throw NetworkError.forbidden
case 500...599: throw NetworkError.serverError(http.statusCode)
default: throw NetworkError.httpError(statusCode: http.statusCode, data: data)
}
}
}
Extended guidance for ios-networking-advanced was moved to references/skill-deep-dive.md to keep this entrypoint compact and fast to load.
Use that deep dive for:
Section 2: Type-Safe Endpoint PatternSection 3: Auth Token Refresh Interceptor (401 Auto-Retry)Section 4: Exponential Backoff RetrySection 5: Background URLSession (Large Downloads/Uploads)Section 6: Certificate PinningSection 7: Multipart Form Data UploadSection 8: Network Reachability + Offline QueueSection 9: Request DeduplicationSection 10: Combine + URLSession (Legacy)Section 11: Structured ConcurrencySection 12: Production Anti-PatternsREST Client Assembly Checklistdata-ai
Use when adding AI-powered analytics to a SaaS platform — semantic search over business data, natural language queries, trend detection, anomaly alerts, and AI-generated insights for dashboards. Covers embeddings, NL2SQL, and per-tenant analytics...
data-ai
Design AI-powered analytics dashboards — what metrics to show, how to display AI predictions and confidence, drill-down patterns, KPI cards, trend visualisation, AI Insights panels, export design, and role-based dashboard variants. Invoke when...
development
Use when designing, building, reviewing, or upgrading production software systems that must be secure, performant, maintainable, scalable, and user-centered. Apply before writing specs, code, architecture, APIs, databases, mobile apps, SaaS platforms, or ERP systems.
development
Professional web app UI using commercial templates (Tabler/Bootstrap 5) with strong frontend design direction when needed. Use for CRUD interfaces, dashboards, admin panels with SweetAlert2, DataTables, Flatpickr. Clone seeder-page.php, use...