verify

GitHub

提供在无 Docker 环境下验证 CLI 变更的端到端测试指南,通过模拟容器环境变量和 Stub 服务器捕获请求头。

.claude/skills/verify/SKILL.md anthropics/defending-code-reference-harness

触发场景

验证 harness 变更 本地调试 CLI 环境配置

安装

npx skills add anthropics/defending-code-reference-harness --skill verify -g -y
更多选项

非标准路径

npx skills add https://github.com/anthropics/defending-code-reference-harness/tree/main/.claude/skills/verify -g -y

不安装直接使用

npx skills use anthropics/defending-code-reference-harness@verify

指定 Agent (Claude Code)

npx skills add anthropics/defending-code-reference-harness --skill verify -a claude-code -g -y

安装 repo 全部 skill

npx skills add anthropics/defending-code-reference-harness --all -g -y

预览 repo 内 skill

npx skills add anthropics/defending-code-reference-harness --list

SKILL.md

Frontmatter
{
    "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).

版本历史

  • 6de8141 当前 2026-07-19 22:58

同 Skill 集合

.claude/skills/customize/SKILL.md
.claude/skills/dnr-hunt/SKILL.md
.claude/skills/dnr-respond/SKILL.md
.claude/skills/quickstart/SKILL.md
.claude/skills/triage/SKILL.md
.claude/skills/vuln-scan/SKILL.md
.claude/skills/patch/SKILL.md
.claude/skills/threat-model/SKILL.md

元信息

文件数
0
版本
2eea705
Hash
40bbbc91
收录时间
2026-07-19 22:58

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-05 21:10
浙ICP备14020137号-1 $访客地图$