agentsclimarketplace

Ios networking

Skill ComeOnOliver/skillshub/skills/HoangNguyen0403/agent-skills-standard/ios-networking

Standards for URLSession, Alamofire, and API communication. Use when implementing URLSession networking, Alamofire, or API clients in iOS. (triggers: **/*Service.swift, **/*API.swift, **/*Client.swift, URLSession, Alamofire, Moya, URLRequest, URLComponents, Codable)From its SKILL.md

Install
npx -y skills add ComeOnOliver/skillshub --skill ios-networking

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

1.9 KB, 375 tokens by cl100k_base, as published. Nobody here has run it

iOS Networking Standards

Priority: P0

Implementation Guidelines

URLSession (Native)

  • Tasks: Use dataTaskPublisher (Combine) or async/await (e.g., let (data, response) = await URLSession.shared.data(...)).
  • Configuration: Use URLSessionConfiguration.default for standard tasks and ephemeral for private browsing/clearing cache.
  • Request Building: Use URLComponents and URLQueryItem to build URLs safely with parameters. Never use string interpolation for URL parameters.

Alamofire (Standard Third-Party)

  • Session: Maintain a singleton or DI-injected Session instance.
  • Request: Use .validate() to automatically check for 200..299 status codes.
  • Encoding: Use JSONParameterEncoder.default for body parameters.
  • Retriers: Handle a 401 token refresh with a RequestInterceptor. Use onRetry to call the refreshToken() API.

Best Practices

  • Codable: Use Codable for all JSON decoding/mapping. Prefer snake_case strategies for API data consistency.
  • Bearer Token Auth: Use RequestInterceptor to add the Bearer header (Authorization: Bearer <token>) to all API requests.
  • SSL Pinning: Implement using ServerTrustManager or TrustKit for production-grade security.

Anti-Patterns

  • No UI updates in background task: Always dispatch to MainActor or main thread.
  • No manual JSONSerialization: Use Codable and JSONDecoder.
  • No indefinite wait: Set a reasonable timeoutInterval (30s default).

References

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.