run-prompt-unit-test

run-prompt-unit-test is a command for Claude Code from 854771076/oh-my-claude-roles. It costs 19 tokens per session (283 once invoked), scanned A, original, MIT.

A command that runs unit tests for a prompt, meaning instructions given to an AI, using Vitest, a JavaScript testing tool, and creates a structured test report.

In plain words
What is it for?
Use it to test a specified prompt file, measure output format and business accuracy, check error handling, and produce a report for release approval.
Why use it?
It checks whether the prompt meets defined acceptance rules across normal, boundary, error, and prompt-injection cases. Failed checks include their causes and suggested fixes.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to test a specified prompt file, measure output format and business accuracy, check error handling, and produce a report for release approval.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/854771076/oh-my-claude-roles/run-prompt-unit-test
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.

Clone the repo
git clone --depth 1 https://github.com/854771076/oh-my-claude-roles

Made for: Claude Code.

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 run-prompt-unit-test

README.md
[![agentmods](https://agentmods.dev/badge/commands/854771076/oh-my-claude-roles/run-prompt-unit-test/github.svg)](https://agentmods.dev/commands/854771076/oh-my-claude-roles/run-prompt-unit-test)
Your own site
<a href="https://agentmods.dev/commands/854771076/oh-my-claude-roles/run-prompt-unit-test"><img src="https://agentmods.dev/badge/commands/854771076/oh-my-claude-roles/run-prompt-unit-test/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 run-prompt-unit-test

Your own site · 80×15
<a href="https://agentmods.dev/commands/854771076/oh-my-claude-roles/run-prompt-unit-test"><img src="https://agentmods.dev/badge/commands/854771076/oh-my-claude-roles/run-prompt-unit-test.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 283 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.00019 $0.00283
Opus 5 $0.00010 $0.00142
Sonnet 5 $0.00004 $0.00057
Haiku 4.5 $0.00002 $0.00028

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

Security

Grade A, and why

run-prompt-unit-test 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 12d 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.

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.

packages/ai/Prompt/v1.0.0/commands/run-prompt-unit-test.md · 30 lines

What it actually says

命令内容

执行指定提示词的单元测试,生成符合企业规范的测试报告。

测试文件:$ARGUMENTS

执行步骤:

  1. 读取测试文件和关联提示词配置
  2. 使用Vitest执行单元测试,覆盖正常场景、边界场景、异常场景、注入攻击场景
  3. 收集测试结果:格式合规率、业务准确率、异常处理覆盖率
  4. 对照企业验收标准,判断测试是否通过
  5. 生成完整测试报告,包含通过率、失败用例详情、修复建议

检查要点:

  • 必须遵循企业测试规范要求,所有测试用例必须全部执行
  • 格式合规率要求100%,异常场景处理覆盖率要求100%
  • 必须明确标注不符合验收标准的测试项
  • 测试报告必须结构化,可归档作为上线审批材料
  • 测试不通过必须给出清晰的失败原因和修复方向

---
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. 12d ago First seen · 30 lines · 19 tokens per session scan A 1f4d7d4dc9cb

Subscribe to this mod's changes

run-prompt-unit-test is a command published in the GitHub repository 854771076/oh-my-claude-roles (22 stars, last pushed 5mo ago), licensed MIT. It adds 19 tokens to every session and 283 once invoked, about $0.0001 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-30.