urlsession-code-review — скилл для Claude Code
Скилл urlsession-code-review разбирает сетевой код на URLSession в iOS и macOS: статус-коды, кэш, таймауты и фоновые сессии. Находки идут с привязкой file:line.
Apache-2.0 116 установок ★ 89 обновлён 2026-09-15
npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-codeЧто делает urlsession-code-review
Скилл проверяет сетевой слой приложений на iOS и macOS. Внутри чек-лист по пяти блокам: валидация ответа, память и ресурсы, конфигурация сессии, фоновые сессии, безопасность. Рядом лежат справочники references/async-networking.md, request-building.md, error-handling.md и caching.md, к которым скилл обращается по теме проверки.
Главное — порядок работы. До отчёта скилл проходит жёсткие ворота: сначала убеждается, что в файлах вообще есть URLSession, URLRequest, URLCache или URLError на сетевом пути, иначе останавливается с пометкой «out of scope». Потом требует file:line для кода, который получает ответ, и явно говорит, приведён ли ответ к HTTPURLResponse и проверен ли statusCode. Если обработчика не видно, скилл пишет «unknown» и просит его показать.
Проверки завязаны на умолчания URLSession. timeoutIntervalForResource по умолчанию 7 дней, у URLCache 512 КБ, а асинхронный API не удаляет скачанные файлы за вас. Критичные находки скилл выдаёт с file:line и названием нарушенного пункта чек-листа.
Какие задачи решает
- Найти места, где 404 и 500 уходят в успешный сценарий
- Поймать забытый
timeoutIntervalForResourceдо релиза - Проверить, что скачанный файл перемещают или удаляют
- Разобрать жизненный цикл сессии с делегатом и
finishTasksAndInvalidate() - Отловить сборку query-параметров конкатенацией строк
Примеры запросов агенту
- Проверь
NetworkClient.swift: везде ли ответ приводится кHTTPURLResponseи проверяетсяstatusCode? - Прогони чек-лист по
APIClient.swift, отдельно посмотри кэш и таймауты. - Отревьюй фоновые загрузки в
UploadManager.swiftи покажи критичные находки сfile:line.
Как установить urlsession-code-review
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-code2Вручную: положить файлы
~/.claude/skills/urlsession-code-review/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/urlsession-code-review/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a codex2Вручную: положить файлы
.agents/skills/urlsession-code-review/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a cursor2Вручную: положить файлы
.cursor/skills/urlsession-code-review/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install existential-birds/beagle plugins/beagle-ios/skills/urlsession-code-review2Вручную: положить файлы
.github/skills/urlsession-code-review/SKILL.md1Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a gemini-cli2Командой платформы
gemini skills install https://github.com/existential-birds/beagle --path plugins/beagle-ios/skills/urlsession-code-reviewВручную: положить файлы
.devin/skills/urlsession-code-review/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add existential-birds/beagle --skill urlsession-code-review -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы об urlsession-code-review
Как установить urlsession-code-review в Claude Code?
Выполните npx skills add existential-birds/beagle --skill urlsession-code-review -a claude-code. Файл скилла появится по пути ~/.claude/skills/urlsession-code-review/SKILL.md.
Что делает urlsession-code-review?
Проверяет сетевой код на URLSession в iOS и macOS по чек-листу и выдаёт находки с привязкой к file:line и названием нарушенного пункта.
Почему скилл иногда просит показать обработчик ответа?
Он не делает вывода о проверке statusCode, пока не увидит код, который получает response. Без этого в отчёте будет «unknown».
Исходный текст
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