test

test is a command for coding agents from dhslegen/digital-delivery-team. It costs 20 tokens per session (1,550 once invoked), scanned B, original, MIT.

A testing command that creates and runs regression tests from the project’s acceptance criteria, then produces a coverage report.

In plain words
What is it for?
Use it in projects with a product requirements document and API contract to test the web, server, and test code, including unit and contract checks.
Why use it?
It catches broken behavior and checks how much of the code is exercised by tests before review or delivery.

Command

Part of the digital-delivery-team plugin — 13 skills, 21 commands, 9 agents, 8 hooks shipped together

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.

agentmods
npx agentmods add commands/dhslegen/digital-delivery-team/test
Clone the repo
git clone --depth 1 https://github.com/dhslegen/digital-delivery-team

Or install digital-delivery-team, the plugin that ships this one along with the rest of its 13 skills, 21 commands, 9 agents, 8 hooks.

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 test

README.md
[![agentmods](https://agentmods.dev/badge/commands/dhslegen/digital-delivery-team/test.svg)](https://agentmods.dev/commands/dhslegen/digital-delivery-team/test)
Your own site
<a href="https://agentmods.dev/commands/dhslegen/digital-delivery-team/test"><img src="https://agentmods.dev/badge/commands/dhslegen/digital-delivery-team/test.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,550 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. Scan, not verified.
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 $0.00020 $0.01550
Opus 5 $0.00010 $0.00775
Sonnet 5 $0.00004 $0.00310
Haiku 4.5 $0.00002 $0.00155

Measured 3d ago against content hash b0130da7f03f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

test scanned grade B 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

[ -f "$DDT_PLUGIN_ROOT/bin/aggregate.mjs" ] || DDT_PLUGIN_ROOT=$(cat "${HOME}/.claude/delivery-metrics/.ddt-plugin-root" 2>/dev/null)
commands/test.md · 156 lines

How it starts

The opening of the file, as written. The whole thing — 156 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/test

输入:$ARGUMENTS


Phase 1 — 前置校验

[ -f "$DDT_PLUGIN_ROOT/bin/aggregate.mjs" ] || DDT_PLUGIN_ROOT=$(cat "${HOME}/.claude/delivery-metrics/.ddt-plugin-root" 2>/dev/null)
[ -f "$DDT_PLUGIN_ROOT/bin/aggregate.mjs" ] || DDT_PLUGIN_ROOT="${HOME}/.claude/plugins/marketplaces/digital-delivery-team"
[ -f "$DDT_PLUGIN_ROOT/bin/aggregate.mjs" ] || { echo "❌ DDT plugin root 未解析。可能原因:(1) 插件未安装;(2) shell 中 DDT_PLUGIN_ROOT 指向无效路径,请 unset DDT_PLUGIN_ROOT 后重启会话;(3) 运行 /digital-delivery-team:doctor 自检"; exit 1; }
export DDT_PLUGIN_ROOT

if printf '%s' "$ARGUMENTS" | grep -q -- '--dry-run'; then
  node "$DDT_PLUGIN_ROOT/bin/print-dry-run.mjs" --phase test --inputs "docs/prd.md,docs/api-contract.yaml,web/,server/,tests/" --outputs "tests/test-report.md" --next "/review"
  exit 0
fi
node "$DDT_PLUGIN_ROOT/bin/emit-phase.mjs" --phase test --action start
test -f docs/prd.md || { echo "❌ docs/prd.md 不存在,请先运行 /prd"; exit 1; }
test -f docs/api-contract.yaml || { echo "❌ docs/api-contract.yaml 不存在,请先运行 /design"; exit 1; }

# 检查上游阶段是否留下未解决 blockers
if [ -f docs/blockers.md ]; then
  unresolved=$(awk '/^- \*\*resolved_at\*\*: null$/' docs/blockers.md | wc -l)
  if [ "$unresolved" -gt 0 ]; then
    echo "❌ docs/blockers.md 中存在 $unresolved 条未解决阻塞,请先处理。"
    echo "   未解决项来自:"
    awk '/^## /{h=$0} /^- \*\*resolved_at\*\*: null$/{print "   - "h}' docs/blockers.md
    exit 2
  fi
fi

Phase 2 — 派发 test-agent

使用 Task 工具派发 test-agent,传入:

  • docs/prd.md(验收标准来源)
  • docs/api-contract.yaml(接口契约)
  • $DDT_PLUGIN_ROOT/templates/test-plan.template.md(测试计划模板,插件根——v0.9.3 D19)
  • $ARGUMENTS(如 --regression-only

test-agent 职责:

  1. 解析 PRD 中的验收标准,生成对应测试用例
  2. 执行全量测试 + 计算覆盖率
  3. 产出 tests/test-report.md

Phase 3 — 覆盖率守门

test-agent 完成后检查覆盖率。若覆盖率 < 70%:

覆盖率 < 70%,禁止推进到 /review,请补充测试

Phase 4 — 汇总输出

/test 完成

验收标准覆盖: <covered> / <total> 条
覆盖率:      <coverage>%
缺陷统计:
  critical: <n> 条
  major:    <n> 条
  minor:    <n> 条

报告: tests/test-report.md

若缺陷 ≤ minor 级别:

Read the full file on GitHub · 156 lines

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. 3d ago First seen · 156 lines · 20 tokens per session scan B b0130da7f03f

Subscribe to this mod's changes

test is a command published in the GitHub repository dhslegen/digital-delivery-team (1 stars, last pushed 3mo ago), licensed MIT. It adds 20 tokens to every session and 1,550 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.