test-driven-development

A test-first development workflow for changes that can be checked with automated tests. TDD, or test-driven development, means writing a small test that fails, implementing the change, and then confirming the test passes.

In plain words
What is it for?
Use it for features, bug fixes, refactors, APIs, state changes, permissions, data mappings, and other behavior changes covered by tests.
Why use it?
It gives each feature or fix a clear behavioral target and helps catch regressions before changes are considered complete.

Skill for Claude CodeCodex

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 skills/taichuy/1flowbase/test-driven-development
Any agent
npx skills add taichuy/1flowbase --skill test-driven-development
Clone the repo
git clone --depth 1 https://github.com/taichuy/1flowbase

Made for: Claude Code, Codex.

Per session 80 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,188 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.00080 $0.02188
Opus 5 $0.00040 $0.01094
Sonnet 5 $0.00016 $0.00438
Haiku 4.5 $0.00008 $0.00219

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

Security

Grade A, and why

test-driven-development 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.

.agents/skills/test-driven-development/SKILL.md · 108 lines

How it starts

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

Test Driven Development

Goal

在开发前用最小测试或有限验收矩阵锁定目标行为。Single Issue 先红后绿;Issue Tree 先定义 fixture,完成 Root 全部开发后集中验证,避免事后补“证明型测试”。

When to Use

  • 新功能、缺陷修复、重构和行为变化
  • API、状态流转、UI 交互、数据映射或权限规则变化
  • 修复回归时,先写能复现问题的测试

可跳过但必须说明原因

  • 纯配置、文案、样式 token 或脚手架调整
  • 一次性原型、生成代码或测试基础设施暂时无法覆盖
  • 用户明确要求跳过 TDD

Preflight Gate

开始 TDD 前先确认实现入口:

  • 1flowbase 功能、缺陷、重构或行为变化:必须已有用户确认的 Single Issue,或已批准 Issue Tree Root 下的 Delivery Issue。
  • 可接受替代证据:用户在当前任务中明确说跳过 issue、直接实现或无需确认。
  • 没有 issue 或跳过证据时,停止;回到 problem-framing 创建 / 更新 issue 并等待用户确认。
  • 后端 API / 状态入口测试必须承接已确认的验收预期;缺少预期时回到 problem-framing,不要在 TDD 阶段重定需求。
  • 已确认 issue / handoff 有 AC-001 这类验收点时,测试或 fixture 必须声明覆盖哪个验收点;Single Issue 在实现前确认红灯,Issue Tree 按 Batch Acceptance Cycle 集中执行。缺少可测试验收点时先回 problem-framing 补齐口径。
  • 改产品代码前检查 ../_shared/design-rules.md;命中规则时停止,回到 problem-framing 给更小 redesign。

Cycle Selection

  • Single Issue 或一个连贯实现任务使用常规 red → green。
  • Issue Tree 长计划读取 problem-framing/references/long-running-work.md,使用 Batch Acceptance Cycle:先固定有限完整的验收矩阵,再完成 Root 下全部开发 Work Packet,最后集中执行 authenticity / green / regression;不为每个 Packet 重启测试与 QA。

Single-Task Red-Green

  1. 写一个最小失败测试,表达目标行为或复现缺陷,并在测试名、注释或交付说明中映射到对应验收点。
  2. 运行定向测试,确认失败原因符合预期。
  3. 写最小实现让测试通过。
  4. 绿灯后再重构,重构后保持绿灯。
  5. 把同一行为族或有限字段矩阵作为一个 red → green 批次;先固定 inventory 和判定函数,再批量实现,不按单个字段进行 patch → test 微循环。
  6. 只有覆盖代码、fixture、expectation 或环境发生相关变化后才重跑同一命令。candidate 前第三次运行同一套件是 churn 信号:先批量收敛剩余变化或回到 problem-framing,不靠继续重跑寻找完成感。
  7. 按变更风险补必要回归:定向测试优先,只补当前任务结果和直接风险所需的类型、lint、build 或 smoke。
  8. workspace 级 cargo / pnpm build、clippy、full test、服务重启、api-debug,或超过 3 条重验证命令的收益和成本,必须在 problem-framing / 已确认计划 / handoff 阶段前置说明。实现期发现未预期重验证需求时,默认不打断开发,交付说明标为 beta / CI / 全局门禁未验证;只有缺少该证据会让继续实现不安全或无法判断当前任务是否完成时,才暂停并说明原因。
  9. 同一 worktree 同时只运行一条 Cargo 命令;单条命令内部默认使用机器全部逻辑 CPU 编译和测试,不写死 CARGO_BUILD_JOBS=1/4--test-threads=1。仓库包装命令会自动读取;直接运行定向 Cargo 时使用 CARGO_BUILD_JOBS="$(node scripts/node/testing/verify-runtime.js cargo-jobs)" cargo ...。只有开发者主动复现资源问题并显式配置时才降低。

Batch Acceptance Cycle

Read the full file on GitHub · 108 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. 2d ago First seen · 108 lines · 80 tokens per session scan A 07bec20dac38

Subscribe to this mod's changes

test-driven-development is a skill published in the GitHub repository taichuy/1flowbase (259 stars, last pushed 2d ago), licensed Apache-2.0. It adds 80 tokens to every session and 2,188 once invoked, about $0.0004 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.

Related

Other skills, from other repositories

sync-cliproxy-core

Use when asked to 同步、更新、升级或审计 CLIProxyAPI、cliproxy、translator core、provider adapters、Antigravity 请求/响应转换、internal/protocol/cliproxy 转换快照,刷新上游 commit,或审查一次核心与渠道适配器的原子同步结果。.

caidaoli/ccLoad · 75 tokens

ccload-release

用于发布 ccLoad 新版本,自动提交未提交改动并推送本地领先的 master,按固定版本通道计算并发布 Tag,等待 GitHub Actions,以及验证 GitHub Release 和对应通道的容器镜像。Beta 固定沿用最近稳定版的主版本和次版本;只有显式 stable 发布才允许修改次版本。.

caidaoli/ccLoad · 82 tokens

10router

Entry point for 10Router — local/remote AI gateway with OpenAI-compatible REST for chat, image, TTS, embeddings, web search, web fetch. Use when the user mentions 10Router, TENROUTERURL, or wants AI without writing provider boilerplate. This skill covers setup + indexes capability skills; fetch the relevant capability…

techysy/10router · 83 tokens

10router-chat

Chat / code generation via 10Router using OpenAI /v1/chat/completions or Anthropic /v1/messages format with streaming + auto-fallback combos. Use when the user wants to ask an LLM, generate code, summarize text, or run prompts through 10Router.

techysy/10router · 63 tokens

unified-ai-gateway

Operate and evaluate Unified AI System through twelve governed MCP tools, including provider-free prompt enhancement, while preserving fake-provider, authorization, and evidence boundaries.

happy520ai/unified-ai-system · 35 tokens

10router-image

Generate images via 10Router /v1/images/generations using OpenAI / Gemini Imagen / DALL-E / FLUX / MiniMax / SDWebUI / ComfyUI / Codex models. Use when the user wants to create, generate, draw, or render an image, picture, or text-to-image (txt2img).

techysy/10router · 74 tokens