urlsession-code-review — Claude Code skill: what it does
urlsession-code-review reviews the networking layer of iOS and macOS apps: status codes, caching, timeouts, background sessions. Findings come with file:line.
Apache-2.0 116 installs ★ 89 updated 2026-09-15
npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-codeWhat urlsession-code-review does
The skill inspects how an iOS or macOS app talks to the network. It carries a checklist split into response validation, memory and resources, session configuration, background sessions and security, with reference files such as references/error-handling.md and references/caching.md behind the individual topics.
Work runs in a fixed order. Before reporting anything, the skill confirms the files under review touch URLSession, URLRequest, URLCache or URLError on a networking path; if none do, it stops with “out of scope”. Then it wants file:line for the code receiving the response and states whether the cast to HTTPURLResponse and the statusCode check are present. When the handler is not visible it answers “unknown” and asks for it rather than guessing.
Several checks lean on URLSession defaults. timeoutIntervalForResource defaults to 7 days and URLCache to 512 KB, and the async download API leaves file cleanup to you. Critical items come back with file:line and the checklist section they break.
What it helps with
- Catch 404 and 500 responses slipping through as success
- Spot a missing
timeoutIntervalForResourcebefore release - Confirm downloaded files get moved or deleted
- Audit delegate-based sessions for
finishTasksAndInvalidate() - Find query strings built by concatenation instead of
URLComponents
Example prompts for the agent
- Review
NetworkClient.swiftand tell me whether every response is cast toHTTPURLResponseand checked forstatusCode. - Run the URLSession checklist over
APIClient.swift, caching and timeouts first. - Audit the background uploads in
UploadManager.swiftand report critical findings withfile:line.
How to install urlsession-code-review
1Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-code2Manually: put the files in place
~/.claude/skills/urlsession-code-review/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/urlsession-code-review/
1Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a codex2Manually: put the files in place
.agents/skills/urlsession-code-review/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a cursor2Manually: put the files in place
.cursor/skills/urlsession-code-review/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install existential-birds/beagle plugins/beagle-ios/skills/urlsession-code-review2Manually: put the files in place
.github/skills/urlsession-code-review/SKILL.md1Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a gemini-cli2Platform CLI
gemini skills install https://github.com/existential-birds/beagle --path plugins/beagle-ios/skills/urlsession-code-reviewManually: put the files in place
.devin/skills/urlsession-code-review/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about urlsession-code-review
How do I install urlsession-code-review in Claude Code?
Run npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-code. The skill file lands at ~/.claude/skills/urlsession-code-review/SKILL.md.
What does urlsession-code-review do?
It checks URLSession code in iOS and macOS projects against a review checklist and returns findings tied to file:line and the rule that was broken.
Why does the skill ask me to show the response handler?
It will not judge statusCode handling until it sees the code that receives response. Without that, the finding is marked “unknown”.
Source text
SKILL.md · Apache-2.0
--- name: urlsession-code-review description: Reviews URLSession networking code for iOS/macOS. Covers async/await patterns, request building, error handling, caching, and background sessions. Use when reviewing code that uses URLSession, URLRequest, URLCache, or URLError, or any iOS networking path. --- # URLSession Code Review ## Quick Reference | Topic | Reference | |-------|-----------| | Async/Await | [async-networking.md](references/async-networking.md) | | Requests | [request-building.md](references/request-building.md) | | Errors | [error-handling.md](references/error-handling.md) | | Caching | [caching.md](references/caching.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) ## Hard gates (before reporting findings) Complete in order. Do not advance while a prior gate is open. 1. **Scope** — **Pass:** You name at least one file under review where `URLSession`, `URLRequest`, `HTTPURLResponse` / `URLResponse`, `URLCache`, or `URLError` appears on a networking path. If none apply, stop with “out of scope.” 2. **HTTP vs transport** — **Pass:** Before claiming missing HTTP status handling or “404 treated as success,” you cite `file:line` for the completion/async/`for await` path that receives `response` and state whether `HTTPURLResponse` is cast and `statusCode` is checked (or cite the helper that does). If you cannot see the handler, say **unknown** and ask for it—do not assume. 3. **Session lifecycle** — **Pass:** For a custom `URLSession` with a delegate, you cite `finishTasksAndInvalidate()` or the documented long-lived/singleton pattern you rely on; for `.shared`, say so if the finding depends on configuration. Skip if only ad hoc `URLSession.shared` one-shots with no delegate issues. 4. **Background or file transfer (if applicable)** — **Pass:** If `URLSessionConfiguration.background`, `downloadTask`, or app-extension–scoped sessions appear, findings cite identifier uniqueness, delegate vs completion-handler usage, or file URLs as required. If none of those APIs appear, mark **N/A** and continue. 5. **Severity and checklist** — **Pass:** Every **Critical** item includes `file:line` and names which **Review Checklist** subsection it violates (e.g. Response Validation, Background Sessions). Lower-severity items still name the file(s) they are drawn from. ## Output Format ```markdown ### Critical 1. [FILE:LINE] Missing HTTP status validation - Issue: 404/500 responses not treated as errors - Fix: Check `httpResponse.statusCode` is 200-299 ```
© existential-birds · Apache-2.0 · existential-birds/beagle