verify · anthropics/defending-code-reference-harness — скилл для Claude Code: тест без Docker и как установить
Скилл verify для Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI и OpenCode, который тестирует изменения в harness end-to-end без Docker.
Apache-2.0 257 установок ★ 7 771 обновлён 2026-08-06
npx skills add anthropics/defending-code-reference-harness --skill verify -a claude-codeЧто делает verify
Внутри — рецепт из пяти шагов: скачать закреплённую версию CLI из npm install @anthropic-ai/claude-code@<pin>, поднять stub-сервер, который записывает заголовки запросов в JSONL и возвращает 400, собрать окружение агента точно как в pipeline через resolve_auth_env(), удалить переменные вроде ANTHROPIC_CUSTOM_HEADERS из сессии (их нет в контейнере), запустить CLI с timeout и прочитать лог.
Команда вызывает CLI с аргументами --model, --max-turns и prompt. Без Docker проверить ногу -e в docker run не получится — механизм тот же, что и для ANTHROPIC_API_KEY в продакшене. Для интерактивных скиллов скопируй .claude/settings.json в чистую директорию и запусти хостовый claude оттуда, убрав ANTHROPIC_CUSTOM_HEADERS из окружения. Тесты test_patch.py и test_patch_grade.py требуют Docker и падают на хостах без него — это не связано с твоими правками.
Какие задачи решает
- протестировать изменения в harness без запуска Docker
- перехватить исходящие заголовки запросов CLI агента
- воспроизвести окружение контейнера на голом хосте
- отловить разницу между переменными сессии и контейнера
- проверить интерактивные скиллы с чистым
settings.json
Примеры запросов агенту
- Запусти тест harness без Docker по рецепту из
verify. - Собери env для CLI через
resolve_auth_env()и запиши в файл экспорта. - Подними stub-сервер, который записывает заголовки в JSONL, и прогони CLI через него.
Как установить verify
1Через Skills CLI (Vercel)
npx skills add anthropics/defending-code-reference-harness --skill verify -a claude-code2Вручную: положить файлы
~/.claude/skills/verify/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/verify/
1Через Skills CLI (Vercel)
npx skills add anthropics/defending-code-reference-harness --skill verify -a codex2Вручную: положить файлы
.agents/skills/verify/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add anthropics/defending-code-reference-harness --skill verify -a cursor2Вручную: положить файлы
.cursor/skills/verify/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install anthropics/defending-code-reference-harness .claude/skills/verify2Вручную: положить файлы
.github/skills/verify/SKILL.md1Через Skills CLI (Vercel)
npx skills add anthropics/defending-code-reference-harness --skill verify -a gemini-cli2Командой платформы
gemini skills install https://github.com/anthropics/defending-code-reference-harness --path .claude/skills/verifyВручную: положить файлы
.devin/skills/verify/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add anthropics/defending-code-reference-harness --skill verify -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о verify
Как установить verify в Claude Code?
Выполни npx skills add anthropics/defending-code-reference-harness --skill verify -a claude-code, затем открой ~/.claude/skills/verify/SKILL.md.
Что делает скилл verify?
Прогоняет закреплённый бинарник Claude CLI против stub-сервера с окружением, которое resolve_auth_env() создаёт для контейнера. Позволяет проверить изменения в harness на хосте без Docker.
Почему тесты test_patch.py падают без Docker?
Они требуют Docker и не работают на голых хостах — это не связано с твоими правками в harness, проблема существует до них.
Исходный текст
SKILL.md · Apache-2.0
--- name: verify description: Verify harness changes end-to-end without docker — drive the real pinned CLI against a header-capturing stub server with the exact env resolve_auth_env() produces. --- # Verifying harness changes on a docker-less host The pipeline's real surface is the in-container `claude -p` process and its outbound API requests. Without docker, drive the same pinned CLI binary directly with the env dict the harness would inject via `docker -e`. ## Recipe 1. **Get the pinned CLI** (version from `harness/agent_image.py:CLAUDE_CODE_VERSION`): `npm install --no-save @anthropic-ai/claude-code@<pin>` in a temp dir → binary at `node_modules/@anthropic-ai/claude-code/bin/claude.exe` (the `.exe` name is the real native-binary entry on Linux too, filled in by the package's postinstall — not a Windows leftover). 2. **Stub API server**: a tiny HTTP server that appends each request's headers to a JSONL file and returns a 400 `invalid_request_error` (non-retryable, so the CLI exits fast; exit=1 is expected). 3. **Build the agent env exactly as the pipeline does**: `python3 -c "from harness.auth import resolve_auth_env; ..."` and dump to an `export`-lines file with `shlex.quote` (values contain newlines — NEVER pass via `env $(...)`, word-splitting mangles them; `source` the file). 4. **Emulate the container env**: `unset ANTHROPIC_CUSTOM_HEADERS` (and any other ambient var not in the resolved dict) before sourcing — a Claude Code session in this repo injects `.claude/settings.json` env into shells, which containers never see. 5. **Run**: `ANTHROPIC_BASE_URL=http://127.0.0.1:<port> CLAUDECODE= IS_SANDBOX=1 timeout 30 <cli> -p hi --model claude-sonnet-4-5 --max-turns 1`, then read the captured JSONL. ## Gotchas - Unit tests in `tests/test_patch.py` / `tests/test_patch_grade.py` need docker and fail on docker-less hosts — pre-existing, not your change. - The docker `-e` injection leg itself can't be exercised without docker; it's the same mechanism that carries `ANTHROPIC_API_KEY` in production. - For the interactive-skills surface, copy `.claude/settings.json` into a fresh temp dir and run the host `claude` from there (with ambient `ANTHROPIC_CUSTOM_HEADERS` unset so settings.json is the only source).
© anthropics · Apache-2.0 · anthropics/defending-code-reference-harness
Похожие скиллы
Все скиллы по теме «Тесты и QA» →Сначала — verify от других авторов.