home-mcp: Command for Claude Code

.claude/commands/fix-test-case.md

fix-test-case is a command for Claude Code from shenjingnan/home-mcp. It costs 7 tokens per session (357 once invoked), scanned A, original, MIT.

A command for investigating and repairing failed unit tests. Unit tests are small automated checks that verify individual parts of a program.

In plain words
What is it for?
Use it to run a failed test file, diagnose each failure, update the test or source code, run the full test suite, and check formatting and types with the specified pnpm commands.
Why use it?
It helps distinguish failures caused by the test, its mock data, or the application code, then verifies that fixes do not create new failures.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

This is shenjingnan/home-mcp's own configuration. It tells Claude Code how to work on home-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything home-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to shenjingnan/home-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/shenjingnan/home-mcp/main/.claude/commands/fix-test-case.md
Clone the repo
git clone --depth 1 https://github.com/shenjingnan/home-mcp

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 fix-test-case

README.md
[![agentmods](https://agentmods.dev/badge/commands/shenjingnan/home-mcp/fix-test-case/github.svg)](https://agentmods.dev/commands/shenjingnan/home-mcp/fix-test-case)
Your own site
<a href="https://agentmods.dev/commands/shenjingnan/home-mcp/fix-test-case"><img src="https://agentmods.dev/badge/commands/shenjingnan/home-mcp/fix-test-case/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 fix-test-case

Your own site · 80×15
<a href="https://agentmods.dev/commands/shenjingnan/home-mcp/fix-test-case"><img src="https://agentmods.dev/badge/commands/shenjingnan/home-mcp/fix-test-case.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 357 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.00007 $0.00357
Opus 5 $0.00003 $0.00179
Sonnet 5 $0.00001 $0.00071
Haiku 4.5 $0.00001 $0.00036

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

Security

Grade A, and why

fix-test-case 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 9d 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.

.claude/commands/fix-test-case.md · 33 lines

What it actually says

$1

我在执行单元测试时,发现测试文件 <failed-test-file> 中有失败的测试用例。请帮我完成以下任务:

  1. 执行测试并分析失败原因

    • 运行指定的测试文件,获取详细的错误信息和堆栈跟踪
    • 分析每个失败测试用例的具体失败原因(断言失败、Mock配置问题、测试数据问题等)
    • 检查相关源代码是否有变更导致测试逻辑不再适用
  2. 制定修复方案

    • 根据失败原因确定是需要修复测试代码还是源代码
    • 如果是测试代码问题,更新测试逻辑、断言或Mock配置
    • 如果是源代码问题,修复源代码逻辑错误
    • 确保修复不会影响其他测试用例
  3. 实施修复并验证

    • 按照修复方案逐一实施修复
    • 每次修复后立即运行测试验证效果
    • 确保所有原失败的测试用例现在都能通过
    • 运行完整测试套件确保没有引入新的失败
  4. 代码质量检查

    • 执行 pnpm check:fix 进行代码规范检查
    • 执行 pnpm type:check 进行类型检查
    • 修复任何代码规范或类型问题

请提供详细的失败原因分析和修复过程说明。

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. 9d ago First seen · 33 lines · 7 tokens per session scan A 2ecb68361be4

Subscribe to this mod's changes

fix-test-case is a command published in the GitHub repository shenjingnan/home-mcp (21 stars, last pushed 7mo ago), licensed MIT. It adds 7 tokens to every session and 357 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.