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/echovic/blade-code/unit-integration-and-shared-test-harnessesnpx skills add echoVic/blade-code --skill unit-integration-and-shared-test-harnessesgit clone --depth 1 https://github.com/echoVic/blade-codeWrote 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.
[](https://agentmods.dev/skills/echovic/blade-code/unit-integration-and-shared-test-harnesses)<a href="https://agentmods.dev/skills/echovic/blade-code/unit-integration-and-shared-test-harnesses"><img src="https://agentmods.dev/badge/skills/echovic/blade-code/unit-integration-and-shared-test-harnesses.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00184 | $0.02459 |
| Opus 5 | $0.00092 | $0.01229 |
| Sonnet 5 | $0.00037 | $0.00492 |
| Haiku 4.5 | $0.00018 | $0.00246 |
Grade A, and why
knowledge-engineering-quality-and-delivery-unit-integration-and-shared-test-harnesses scanned grade A with 1 finding 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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- 普通 setup 会 mock `fs`、`child_process`、`axios`、`ws`、`http` 和 `https`;需要验证真实 I/O 的 integration 测试必须显式 `vi.unmock` 或进入 real-api setup,否则“集成”断言可能只覆盖 mock (`packages/cli/tests/support/setup.ts`, `packages/cli/tests/integrati How it starts
The opening of the file, as written. The whole thing — 87 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Module Structure
测试层由 Vitest project 负责选择文件,由包装脚本负责环境和进程所有权;CLI 与 Web 共用部分 setup,但真实 API 使用单独的无 mock setup。
Directory Layout
packages/cli/tests/unit/— 细粒度状态机、服务、工具、协议与表面投影回归packages/cli/tests/integration/— 跨模块与真实子进程集成;real-api/和cli/被独立 project 接管packages/cli/tests/e2e/— 本地 fixture 与模拟流程测试packages/cli/tests/support/— setup、mock、跨表面 driver、PTY/ACP/Web runner 与清理 helperpackages/cli/tests/fixtures/— 可由测试子进程执行的最小场景packages/cli/web/tests/— Web 组件、Store、服务与 bundle 测试packages/cli/scripts/test*.js— 项目选择、测试子进程、超时、环境隔离和 owner watchdog
Key Entry Points
packages/cli/vitest.config.ts— CLI 测试项目、pool、并发、setup 与超时packages/cli/web/vitest.config.ts— Web 依赖去重、alias 与默认 Node 环境runTest()inpackages/cli/scripts/test.js— 包装 Vitest 并创建进程级临时根runOwnedCommand()inpackages/cli/scripts/test-runner.js— 启动独立进程组并在 timeout/abort 时回收整棵树packages/cli/tests/support/setup.ts— 普通项目的全局 mock 和 test-file 存储根packages/cli/tests/support/setup.real-api.ts— 保留生产文件、子进程与网络实现的真实 API setup
Branching Table
| 维度 | 分支 A | 分支 B |
|---|---|---|
| 执行入口 | test:<type> 经 scripts/test.js 获得 TMPDIR 隔离、总超时和 owner watchdog |
test:all/test:watch 直接调用 Vitest,不经过该进程包装层 |
| 运行环境 | 本地 unit 使用最多 4 个 thread worker 和文件并行 | CI=true 将共享 pool 收窄为单 worker、关闭文件并行 |
| 项目隔离 | unit/CLI/performance/snapshot 使用 threads | integration/E2E/security/real-api 使用 forks,integration 与 real-api 还固定串行 |
| 全局 setup | unit/integration/CLI/E2E/security 等加载 setup.ts 的基础设施 mock |
real-api 只加载 setup.real-api.ts,保持真实文件、进程与网络 |
| 文件归属 | generic integration 显式排除 integration/cli/ 与 integration/real-api/ |
CLI 和 real-api 由各自 project、超时和 setup 独立运行 |
| Web DOM | Web project 默认 environment: node |
需要 DOM 的文件用 @vitest-environment jsdom 局部切换 |
| 存储所有权 | 未设置 BLADE_STORAGE_ROOT 时 setup 创建并注册清理 |
调用方显式设置时保持 caller-owned,setup 不删除 |
Affected Scope
packages/cli/tests/unit/— 受全局 mock、thread pool、15 秒默认 timeout 和文件隔离影响packages/cli/tests/integration/— 受 fork 串行执行、真实子进程显式 unmock 和 30 秒 project timeout 影响packages/cli/tests/e2e/— 叠加普通 setup 与 E2E setup,当前仍包含 mock/占位场景packages/cli/tests/support/— 跨表面 driver、临时根、mock 和进程清理的共享实现packages/cli/web/tests/— 复用 CLI setup,并依赖 React/Zustand 去重与按文件 jsdompackages/cli/scripts/test.js— 为按类型运行建立进程级环境与超时packages/cli/scripts/test-runner.js— 决定 timeout、abort 和父进程硬退出后的进程树回收packages/cli/vitest.config.ts、packages/cli/web/vitest.config.ts— 文件选择、pool、retry、coverage 与 alias 的最终配置
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 · 87 lines · 184 tokens per session scan A dfef87701390
knowledge-engineering-quality-and-delivery-unit-integration-and-shared-test-harnesses is a skill published in the GitHub repository echoVic/blade-code (178 stars, last pushed today), licensed MIT. It adds 184 tokens to every session and 2,459 once invoked, about $0.0009 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
test-writing
Write comprehensive tests for code including unit tests, integration tests, and end-to-end tests. Use this to ensure code quality, catch bugs, and validate functionality.
dogfood
Exploratory QA of web apps: find bugs, evidence, reports.
tdd-workflow
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
langbot-testing
Test LangBot WebUI and core product flows with an automated browser and backend logs. Use when validating the configured LangBot frontend, pipeline Debug Chat, model provider setup and test buttons, bot and knowledge-base UI flows, or troubleshooting failed LangBot end-to-end tests.
golang-testing
Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI…
golang-stretchr-testify
Comprehensive guide to stretchr/testify for Golang testing. Covers assert, require, mock, and suite packages in depth. Use when writing tests with testify, creating mocks, setting up test suites, or choosing between assert and require. Covers testify assertions, mock expectations, argument matchers, call verification…