dsh-test-first

dsh-test-first is a skill for Claude Code, Codex from hackerFish/awesome-dsh-skills. It costs 28 tokens per session (286 once invoked), scanned A, original, MIT.

A test-first process for fixing bugs or adding features: write a failing test, make the smallest change that passes it, then improve the code.

In plain words
What is it for?
Use it to reproduce bugs in tests, cover empty or invalid input, repeated or concurrent calls, missing files, permission failures, and network errors.
Why use it?
It proves the test detects the intended problem and keeps the implementation tied to expected public behavior, including important boundary and failure cases.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to reproduce bugs in tests, cover empty or invalid input, repeated or concurrent calls, missing files, permission failures, and network errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hackerfish/awesome-dsh-skills/dsh-test-first
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.

Any agent
npx skills add hackerFish/awesome-dsh-skills --skill dsh-test-first
Clone the repo
git clone --depth 1 https://github.com/hackerFish/awesome-dsh-skills

Made for: Claude Code, Codex.

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 dsh-test-first

README.md
[![agentmods](https://agentmods.dev/badge/skills/hackerfish/awesome-dsh-skills/dsh-test-first/github.svg)](https://agentmods.dev/skills/hackerfish/awesome-dsh-skills/dsh-test-first)
Your own site
<a href="https://agentmods.dev/skills/hackerfish/awesome-dsh-skills/dsh-test-first"><img src="https://agentmods.dev/badge/skills/hackerfish/awesome-dsh-skills/dsh-test-first/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 dsh-test-first

Your own site · 80×15
<a href="https://agentmods.dev/skills/hackerfish/awesome-dsh-skills/dsh-test-first"><img src="https://agentmods.dev/badge/skills/hackerfish/awesome-dsh-skills/dsh-test-first.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 286 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.00028 $0.00286
Opus 5 $0.00014 $0.00143
Sonnet 5 $0.00006 $0.00057
Haiku 4.5 $0.00003 $0.00029

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

Security

Grade A, and why

dsh-test-first 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 10d 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.

skills/dsh-test-first/SKILL.md · 31 lines

What it actually says

测试优先(红 → 绿 → 重构)

流程

  1. :先写一个描述期望行为的测试,运行确认它失败(证明测试真的在测)
  2. 绿:写最小实现让测试通过,不做任何多余设计
  3. 重构:在绿灯下改善结构,每步都保持测试通过

边界用例表(写测试时逐项过)

  • 空输入、单元素、满容量
  • 错误类型、缺字段、超长输入
  • 重复调用、并发调用
  • 权限不足、文件不存在、网络失败

运行

  • Node 内置:node --test
  • 项目用 vitest/jest 时跟随项目配置
  • 只测公共行为,不测内部实现细节;覆盖率数字不设硬指标,关键路径必须覆盖

修复 bug 的额外要求

先写一个能复现该 bug 的失败测试,再修复;提交信息里写清复现路径。

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. 10d ago First seen · 31 lines · 28 tokens per session scan A 1156ea2c728c

Subscribe to this mod's changes

dsh-test-first is a skill published in the GitHub repository hackerFish/awesome-dsh-skills (5 stars, last pushed 5d ago), licensed MIT. It adds 28 tokens to every session and 286 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-31.