test

A command that runs JavaScript or TypeScript tests with npm or Vitest, a test-runner tool, and explains any failures.

In plain words
What is it for?
Use it to run all tests or a selected group, list passed and failed cases, identify the faulty code, and get repair suggestions.
Why use it?
It combines test execution with investigation of the failing code, helping you understand the root cause instead of only seeing an error message.

Command

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/echovic/blade-code/test
Clone the repo
git clone --depth 1 https://github.com/echoVic/blade-code
Per session 6 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 299 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00006 $0.00299
Opus 5 $0.00003 $0.00150
Sonnet 5 $0.00001 $0.00060
Haiku 4.5 $0.00001 $0.00030

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

Security

Grade A, and why

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 2d 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.

.blade/commands/test.md · 51 lines

What it actually says

请运行测试并分析结果。

测试范围

$ARGUMENTS

执行测试

如果指定了测试范围,运行特定测试;否则运行全部测试。

分析要求

  1. 运行测试:执行 npm test $ARGUMENTSnpx vitest $ARGUMENTS
  2. 分析结果
    • 如果全部通过 ✅,给出简短总结
    • 如果有失败 ❌,详细分析原因
  3. 失败分析
    • 定位失败的测试用例
    • 阅读相关源代码
    • 找出问题根因
    • 提供修复建议

输出格式

📊 测试结果:X passed, Y failed, Z skipped

✅ 通过的测试模块
  - module1.test.ts (10 tests)
  - module2.test.ts (5 tests)

❌ 失败的测试
  - module3.test.ts > should handle edge case
    原因:...
    建议:...

如果有失败的测试,请询问我是否需要你来修复。

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. 2d ago First seen · 51 lines · 6 tokens per session scan A 9950d24c284b

Subscribe to this mod's changes

test is a command published in the GitHub repository echoVic/blade-code (177 stars, last pushed 2d ago), licensed MIT. It adds 6 tokens to every session and 299 once invoked, about $0.0000 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.