Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/bifrost-proxy/bifrost/e2e-testnpx skills add bifrost-proxy/bifrost --skill e2e-testgit clone --depth 1 https://github.com/bifrost-proxy/bifrostWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00043 | $0.01722 |
| Opus 5 | $0.00022 | $0.00861 |
| Sonnet 5 | $0.00009 | $0.00344 |
| Haiku 4.5 | $0.00004 | $0.00172 |
Grade C, and why
e2e-test scanned grade C with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Recursive force deletehighDestructive command
rm -rf with a variable or a broad path is one typo away from removing the wrong tree.
trap 'rm -rf "$TEST_DIR"' EXIT Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
- 管理端 API 是否 ready,例如 `curl -sS http://127.0.0.1:8800/_bifrost/api/proxy/address` How it starts
The opening of the file, as written. The whole thing — 100 lines — stays where its author put it; the contents beside it link to each section on GitHub.
E2E 测试创建与执行
该技能用于创建和执行 Bifrost 的端到端测试,优先覆盖本次变更涉及的能力。
何时调用
- 添加新功能后需要验证
- 修复 bug 后需要回归测试
- 需要创建新的测试用例
- 需要运行现有的 E2E 测试
参考文档
在执行任务前,必须先阅读 E2E 测试框架的详细文档:
- e2e-tests README - 测试架构、目录结构、断言库、现有用例
- 测试覆盖率 - 当前覆盖范围与缺口
- 项目规则 - 仓库级开发与验证要求
使用说明
- 启动代理服务时,必须显式设置临时数据目录,避免覆盖本机已有数据;目录前缀统一使用
./.bifrost-e2e - 若需要手动启动服务,优先使用“先编译、再启动”的方式,而不是直接假设
cargo run或旧进程已生效 - 新增或修改“规则行为”相关测试时,规则定义必须存放在
e2e-tests/rules/下,不能散落到根目录、临时文件或其他测试目录 e2e-tests/rules/下的规则文件必须按“模块功能 + 测试目标”组织:- 先按模块功能拆分子目录,例如
forwarding/、request_modify/、response_modify/ - 再按单一测试目标拆分
.txt文件;一个文件只表达一组紧密相关的规则语义,避免把多个无关目标塞进同一个文件
- 先按模块功能拆分子目录,例如
- 规则文件命名要直接表达测试目标,使用小写下划线风格,例如
headers.txt、wildcard_level.txt、tls_intercept_rule.txt - 每个规则文件顶部必须先写清楚测试目标,再写测试规则本体;顶部说明至少应回答“这个文件验证什么语义/行为”
- 与规则文件配套的测试脚本必须存放在
e2e-tests/tests/,不能继续放在scripts/、根目录或其他位置;脚本命名建议与测试目标对应,例如test_header_replace.sh - 如果某个测试需要额外样例数据、模板或 mock 文件,分别放到现有的
e2e-tests/test_data/、e2e-tests/mock_servers/等目录,不要和规则文件混放 - 对涉及前端静态资源或管理端推送逻辑的改动,优先执行:
CARGO_TARGET_DIR=./.bifrost-ui-target cargo build --bin bifrost
BIFROST_DATA_DIR=./.bifrost-e2e-test ./.bifrost-ui-target/debug/bifrost start -p 8800 --unsafe-ssl
- 启动后,必须同时检查:
- 目标端口是否真的由最新
bifrost进程监听,例如lsof -nP -iTCP:8800 -sTCP:LISTEN - 管理端 API 是否 ready,例如
curl -sS http://127.0.0.1:8800/_bifrost/api/proxy/address
- 目标端口是否真的由最新
- 如果启动过程中出现证书安装交互,先显式处理掉,再继续测试,避免把“服务未启动完成”误判为功能问题
- 不同场景的步骤已拆分为独立文档;按需打开对应文件执行即可
- 当 UI 现象和 API 现象不一致时,优先做“进程级 + API + WebSocket frame”三层交叉验证:
- 先确认当前测试页面连到的是哪一个
bifrost进程 - 再确认
/_bifrost/api/traffic、/_bifrost/api/traffic/{id}返回的真实状态 - 最后抓浏览器
/api/push的framesent/framereceived,判断是“服务端没推”还是“页面没订阅/没消费”
- 先确认当前测试页面连到的是哪一个
- 新建规则测试后,顺手检查对应的规则文件与脚本是否一一对应;若无法建立清晰对应关系,应继续拆分目录或文件
- 测试结束后清理临时目录和残留进程
CLI 测试方法
当本次变更涉及 bifrost CLI 子命令(例如 bifrost value ...、bifrost rule ...、bifrost script ...)时,推荐使用“黑盒 + 独立数据目录”的方式编写与执行测试:
- 使用独立
BIFROST_DATA_DIR:用mktemp -d创建测试目录并导出,避免污染本机~/.bifrost - 优先复用已编译二进制:默认使用
target/release/bifrost,不存在时再cargo build --release --bin bifrost - 断言策略:
- 基于 CLI 输出:用
grep/jq(如有)做关键字段断言 - 基于落盘结果:检查
BIFROST_DATA_DIR下对应文件/目录是否按预期创建与更新
- 基于 CLI 输出:用
- 清理策略:用
trap cleanup EXIT确保结束后停止残留进程并删除临时目录
What ships with it
7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 100 lines · 43 tokens per session scan C cd7c6fa00020
e2e-test is a skill published in the GitHub repository bifrost-proxy/bifrost (124 stars, last pushed 4d ago), licensed MIT. It adds 43 tokens to every session and 1,722 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other skills, from other repositories
codex-e2e-test
Run PR-grade real Codex E2E validation through claude-tap, including resume turns, multiple tool calls, optional image input, viewer verification, and screenshot evidence.
js-in-html-testing
Test JS logic embedded in HTML using two-layer strategy - Python unit tests + Playwright browser integration tests.
playwright-screen-recording
Record browser test videos with Playwright for PR review and bug fix verification.
real-e2e-test
Run real E2E tests against Claude CLI in pytest and tmux modes.
e2e-test
Run claude-tap end-to-end tests with pytest.
api-test-suite-builder
Scans API route definitions across frameworks (Next.js App Router, Express, FastAPI, Django REST) and auto-generates comprehensive test suites covering auth, input validation, error codes, pagination, file uploads, and rate limiting. Outputs ready-to-run test files for Vitest+Supertest (Node) or Pytest+httpx (Python).