WeReply: Skill for Claude Code

.claude/skills/tdd-workflow/SKILL.md

tdd-workflow is a skill for Claude Code from cacr92/WeReply. It costs 0 tokens per session (2,544 once invoked), scanned A, original, MIT.

A test-first coding workflow based on TDD, or test-driven development. It uses a repeating red-green-refactor cycle: write a failing test, make it pass with the smallest implementation, then improve the code while keeping tests passing.

In plain words
What is it for?
Use it to turn user stories and acceptance criteria into tests, cover normal and edge cases, and guide implementation in Rust or TypeScript projects.
Why use it?
It gives new features, bug fixes, and refactoring a defined way to check behaviour before and after code changes. The instructions require at least 80% test coverage.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is cacr92/WeReply's own configuration. It tells Claude Code how to work on WeReply 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 WeReply configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is vi.mock('../bindings', () => ({.

Reuse

Borrowing it

Nothing to install: this file belongs to cacr92/WeReply. 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/cacr92/WeReply/main/.claude/skills/tdd-workflow/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/cacr92/WeReply

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 tdd-workflow

README.md
[![agentmods](https://agentmods.dev/badge/skills/cacr92/wereply/tdd-workflow/github.svg)](https://agentmods.dev/skills/cacr92/wereply/tdd-workflow)
Your own site
<a href="https://agentmods.dev/skills/cacr92/wereply/tdd-workflow"><img src="https://agentmods.dev/badge/skills/cacr92/wereply/tdd-workflow/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 tdd-workflow

Your own site · 80×15
<a href="https://agentmods.dev/skills/cacr92/wereply/tdd-workflow"><img src="https://agentmods.dev/badge/skills/cacr92/wereply/tdd-workflow.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,544 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.00000 $0.02544
Opus 5 $0.00000 $0.01272
Sonnet 5 $0.00000 $0.00509
Haiku 4.5 $0.00000 $0.00254

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

Security

Grade A, and why

tdd-workflow 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 8d 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/skills/tdd-workflow/SKILL.md · 462 lines

How it starts

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

TDD 工作流 Skill

核心原则

强制要求:所有新功能、Bug 修复、重构必须达到 80% 以上测试覆盖率


RED-GREEN-REFACTOR 循环

1. RED(写测试,测试失败)

先写测试,验证测试会失败(因为功能尚未实现)。

2. GREEN(实现代码,测试通过)

编写最小代码使测试通过。

3. REFACTOR(重构代码,保持测试通过)

优化代码,保持所有测试通过。


工作流程

步骤 1:编写用户故事

描述期望的行为:

作为用户,我希望能够创建新的饲料配方,
以便我可以保存和管理不同的配方方案。

验收标准:
- 配方名称必填,长度 2-50 个字符
- 品种代码必填,必须是有效的品种
- 创建成功后返回配方 ID
- 创建失败时显示错误消息

步骤 2:生成测试用例

覆盖正常路径和边界情况:

Rust 测试用例

#[cfg(test)]
mod tests {
    use super::*;

    #[tokio::test]
    async fn test_create_formula_success() {
        // 正常创建配方
    }

    #[tokio::test]
    async fn test_create_formula_empty_name() {
        // 配方名称为空
    }

    #[tokio::test]
    async fn test_create_formula_name_too_long() {
        // 配方名称过长
    }

    #[tokio::test]
    async fn test_create_formula_invalid_species() {
        // 品种代码无效
    }

    #[tokio::test]
    async fn test_create_formula_database_error() {
        // 数据库连接失败
    }
}

TypeScript 测试用例

describe('FormulaForm', () => {
  it('should create formula successfully', async () => {
    // 正常创建
  });

  it('should show error when name is empty', async () => {
    // 名称为空
  });

  it('should show error when name is too long', async () => {
    // 名称过长
  });

  it('should show error when species is invalid', async () => {
    // 品种无效
  });
});

步骤 3:运行测试(RED)

# Rust
cargo test

# TypeScript
npm test

预期结果:测试失败(因为功能尚未实现)。

步骤 4:实现代码(GREEN)

编写最小代码使测试通过:

Rust 实现

pub async fn create_formula(
    &self,
    dto: CreateFormulaDto,
) -> Result<i64> {
    // 验证输入
    if dto.name.is_empty() {
        return Err(anyhow!("配方名称不能为空"));
    }

    if dto.name.len() > 50 {
        return Err(anyhow!("配方名称过长"));
    }

    // 验证品种代码
    self.validate_species_code(&dto.species_code).await?;

    // 插入数据库
    let formula_id = sqlx::query!(
        "INSERT INTO formulas (name, species_code) VALUES (?, ?)",
        dto.name, dto.species_code
    )
    .execute(&self.pool)
    .await?
    .last_insert_rowid();

    Ok(formula_id)
}

Read the full file on GitHub · 462 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 8d ago First seen · 462 lines · 0 tokens per session scan A da8bfaae84df

Subscribe to this mod's changes

tdd-workflow is a skill published in the GitHub repository cacr92/WeReply (6 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 2,544 tokens. 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.