测试基础设施

测试基础设施 is a skill for Claude Code, Codex from jianchen08/Agent-os-open. It costs 35 tokens per session (641 once invoked), scanned A, original, Apache-2.0.

A set of scripts that supports end-to-end testing, which checks a complete workflow across its connected parts. The scripts capture selected log messages, compare database snapshots, and record and verify notifications or other side effects.

In plain words
What is it for?
Use it to filter runtime logs, compare database state before and after an operation, mock notification or messaging services, and check recorded actions against expected JSON.
Why use it?
It helps confirm what happened during a test and detect unexpected database changes or external actions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to filter runtime logs, compare database state before and after an operation, mock notification or messaging services, and check recorded actions against expected JSON.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jianchen08/agent-os-open/skill-test-infra
Install

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.

Any agent
npx skills add jianchen08/Agent-os-open --skill skill-test-infra
Clone the repo
git clone --depth 1 https://github.com/jianchen08/Agent-os-open

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for 测试基础设施

README.md
[![agentmods](https://agentmods.dev/badge/skills/jianchen08/agent-os-open/skill-test-infra/github.svg)](https://agentmods.dev/skills/jianchen08/agent-os-open/skill-test-infra)
Your own site
<a href="https://agentmods.dev/skills/jianchen08/agent-os-open/skill-test-infra"><img src="https://agentmods.dev/badge/skills/jianchen08/agent-os-open/skill-test-infra/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for 测试基础设施

Your own site · 80×15
<a href="https://agentmods.dev/skills/jianchen08/agent-os-open/skill-test-infra"><img src="https://agentmods.dev/badge/skills/jianchen08/agent-os-open/skill-test-infra.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 641 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What 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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00035 $0.00641
Opus 5 $0.00017 $0.00320
Sonnet 5 $0.00007 $0.00128
Haiku 4.5 $0.00003 $0.00064

Measured 4d ago against content hash ac0a1642a845, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

测试基础设施 scanned grade A with 0 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 4d ago.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/db_snapshot.py, scripts/log_interceptor.py, scripts/side_effect_mock.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/skill-test-infra/SKILL.md · 73 lines

What it actually says

测试基础设施

本技能是流程指引,不是逐条打勾清单:按场景判断使用,遇不适用情况保持裁量,不机械执行。

描述

提供端到端测试所需的基础能力脚本,供 container_verification_agent 编排下的 L3 执行者调用。

脚本

log_interceptor.py

日志拦截 + 按规则提取匹配。

调用方式

# 拦截运行时日志并按规则提取
python scripts/log_interceptor.py --log-file <日志文件路径> --rules <规则JSON文件> [--output <输出路径>]

# 实时拦截(启动后在后台监听,捕获指定进程的输出)
python scripts/log_interceptor.py --follow --log-file <日志文件路径> --rules <规则JSON文件> [--output <输出路径>]

规则文件格式(JSON):

{
  "rules": [
    {"name": "api_error", "pattern": "ERROR.*api.*\\d{3}", "level": "ERROR"},
    {"name": "task_complete", "pattern": "task.*completed.*id=([\\w]+)", "extract_groups": true}
  ]
}

db_snapshot.py

数据库快照对比(操作前后 diff)。

调用方式

# 创建快照
python scripts/db_snapshot.py create --tables <表名,逗号分隔> --output <快照输出路径>

# 对比两个快照
python scripts/db_snapshot.py diff --before <快照1路径> --after <快照2路径> [--output <对比结果输出路径>]

side_effect_mock.py

通知/消息等副作用 mock 和验证。

调用方式

# 启动 mock 服务,记录所有副作用
python scripts/side_effect_mock.py serve --port <端口> [--output <记录输出路径>]

# 验证已记录的副作用是否符合预期
python scripts/side_effect_mock.py verify --record <记录文件路径> --expect <预期JSON文件> [--output <验证报告路径>]

使用场景

  • 端到端测试中拦截日志,验证关键事件是否触发
  • 数据库操作前后快照对比,验证数据变更是否符合预期
  • Mock 外部通知服务,验证副作用(消息推送、邮件发送等)是否正确触发

依赖

  • Python 3.10+
  • 标准库(json, re, sqlite3, argparse, http.server 等)
  • 无额外第三方依赖
Files

What ships with it

3 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.

Changes

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.

  1. 4d ago Changed · +2 lines ac0a1642a845
  2. 9d ago First seen · 71 lines · 35 tokens per session scan A b904ae8e0500

Subscribe to this mod's changes

测试基础设施 is a skill published in the GitHub repository jianchen08/Agent-os-open (5 stars, last pushed 5d ago), licensed Apache-2.0. It adds 35 tokens to every session and 641 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.