askill
urlsession-code-review

urlsession-code-reviewSafety 95Repository

Reviews URLSession networking code for iOS/macOS. Covers async/await patterns, request building, error handling, caching, and background sessions.

22 stars
1.2k downloads
Updated 2/13/2026

Package Files

Loading files...
SKILL.md

URLSession Code Review

Quick Reference

TopicReference
Async/Awaitasync-networking.md
Requestsrequest-building.md
Errorserror-handling.md
Cachingcaching.md

Review Checklist

Response Validation

  • HTTP status codes validated - URLSession does NOT throw on 404/500
  • Response cast to HTTPURLResponse before checking status
  • Both transport errors (URLError) and HTTP errors handled

Memory & Resources

  • Downloaded files moved/deleted (async API doesn't auto-delete)
  • Sessions with delegates call finishTasksAndInvalidate()
  • Long-running tasks use [weak self]
  • Stored Task references cancelled when appropriate

Configuration

  • timeoutIntervalForResource set (default is 7 days!)
  • URLCache sized adequately (default 512KB too small)
  • Sessions reused for connection pooling

Background Sessions

  • Unique identifier (especially with app extensions)
  • File-based uploads (not data-based)
  • Delegate methods used (not completion handlers)

Security

  • No hardcoded secrets (use Keychain)
  • Header values sanitized for CRLF injection
  • Query params via URLComponents (not string concat)

Output Format

### Critical
1. [FILE:LINE] Missing HTTP status validation
   - Issue: 404/500 responses not treated as errors
   - Fix: Check `httpResponse.statusCode` is 200-299

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

68/100Analyzed 2/20/2026

A solid reference-style skill for reviewing URLSession networking code in iOS/macOS apps. Provides a comprehensive checklist covering response validation, memory management, configuration, background sessions, and security. Uses clear formatting with tables and checklists. However, it references external files (async-networking.md, request-building.md, etc.) that aren't included, reducing immediate actionability. The skill is well-structured and tagged but would benefit from inlined reference content. Located in a plugin-specific directory suggesting some internal tailoring, but the skill content itself is broadly applicable to iOS/macOS development.

95
70
75
60
55

Metadata

Licenseunknown
Version-
Updated2/13/2026
Publisherexistential-birds

Tags

apisecurity