Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

recursive-tdd递归 TDD

Agent Skill

recursive-tdd 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

706

周安装

30

GitHub Stars

60

下载量

247
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:recursive-tdd(递归 TDD)
来源仓库:https://github.com/try-works/recursive-mode
仓库路径:skills/recursive-tdd
安装命令:
npx skills add https://github.com/try-works/recursive-mode --skill recursive-tdd
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/try-works/recursive-mode --skill recursive-tdd

简介

recursive-tdd 用于查找、检索和筛选相关信息,支持基于关键词或场景定位内容。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中需要快速获取候选结果时使用。
  • 通过 GitHub 安装,结合来源仓库和 README 可进一步核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

recursive-tdd

Overview

Test-Driven Development is mandatory for all recursive-mode implementation work. This skill ensures test-first discipline is followed rigorously and recorded in a way recursive-mode tooling can verify.

Core Principle: If you didn't watch the test fail, you don't know if it tests the right thing.

The Iron Law for recursive-mode:

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST

Trigger examples

  • Implement Phase 3 for run '<run-id>'
  • Add a failing regression test first, then fix the bug
  • I already wrote the code; now add tests (should trigger TDD reset guidance)
  • Follow RED-GREEN-REFACTOR for this change

When to Use

Always in Phase 3 (Implementation):

  • New features
  • Bug fixes
  • Refactoring
  • Behavior changes

Default rule:

  • Not for "simple" changes
  • Not when "under pressure"
  • Not because "tests after achieve same goals"

Explicit exception path only:

  • If strict RED-first flow is genuinely infeasible, declare TDD Mode: pragmatic in the Phase 3 artifact
  • Record a concrete exception reason
  • Record compensating validation evidence under /.recursive/run/<run-id>/evidence/
  • Treat this as an explicit deviation, not a silent shortcut

RED-GREEN-REFACTOR Cycle

digraph tdd_cycle {
    rankdir=LR;
    red [label="RED\nWrite failing test", shape=box, style=filled, fillcolor="#ffcccc"];
    verify_red [label="Verify fails\ncorrectly", shape=diamond];
    green [label="GREEN\nMinimal code", shape=box, style=filled, fillcolor="#ccffcc"];
    verify_green [label="Verify passes\nAll green", shape=diamond];
    refactor [label="REFACTOR\nClean up", shape=box, style=filled, fillcolor="#ccccff"];
    record [label="Record in\nPhase 3 artifact", shape=box];

    red -> verify_red;
    verify_red -> green [label="yes"];
    verify_red -> red [label="wrong\nfailure"];
    green -> verify_green;
    verify_green -> refactor [label="yes"];
    verify_green -> green [label="no"];
    refactor -> verify_green [label="stay\ngreen"];
    verify_green -> record;
}

RED - Write Failing Test

Write one minimal test showing what should happen.

Requirements:

  • One behavior per test
  • Clear, descriptive name
  • Test real code (no mocks unless unavoidable)
  • Clear assertion showing expected outcome

Verify RED - Watch It Fail

MANDATORY. Never skip.

npm test path/to/test.test.ts

Confirm:

  • Test fails (not errors)
  • Failure message is expected
  • Fails because feature missing (not typos)

Record in Phase 3 artifact:

### TDD Cycle for R3 (Email Validation)

TDD Mode: strict

RED Evidence:
- `/.recursive/run/<run-id>/evidence/logs/red/<file>.log`

GREEN Evidence:
- `/.recursive/run/<run-id>/evidence/logs/green/<file>.log`

**RED Phase:**
- Test: `rejects empty email with clear error message`
- Command: `npm test src/forms/email.test.ts`
- Expected failure: "Email is required" not found
- Actual failure: [paste output]
- RED verified: PASS

GREEN - Minimal Code

Write simplest code to pass the test.

Rules:

  • Just enough to pass
  • No additional features
  • No "while I'm here" improvements
  • No refactoring yet

Record in Phase 3 artifact:

**GREEN Phase:**
- Implementation: Added null check for email field
- Command: `npm test src/forms/email.test.ts`
- Result: PASS
- GREEN verified: PASS

REFACTOR - Clean Up

After green only:

  • Remove duplication
  • Improve names
  • Extract helpers
  • Keep tests green

Never add behavior during refactor.

Record in Phase 3 artifact:

**REFACTOR Phase:**
- Extracted `validateRequired(field, name)` helper
- Renamed `submitForm` to `processFormSubmission` for clarity
- All tests still passing: PASS

Common Process Shortcuts (STOP)

ExcuseReality
"This is just a simple fix, no test needed"Simple code breaks. Test takes 30 seconds.
"I'll test after confirming the fix works"Tests passing immediately prove nothing. You never saw it catch the bug.
"Tests after achieve same goals"Tests-after = "what does this do?" Tests-first = "what should this do?"
"I already manually tested it"Ad-hoc!= systematic. No record, can't re-run, no regression protection.
"Deleting working code is wasteful"Sunk cost fallacy. Keeping unverified code is technical debt.
"TDD is dogmatic, I'm being pragmatic"TDD IS pragmatic. Finds bugs before commit, enables refactoring.
"I'll keep the code as reference"You'll adapt it. That's testing after. Delete means delete.
"Test hard = design unclear"Listen to the test. Hard to test = hard to use. Simplify design.
"I need to explore first"Fine. Throw away exploration, start TDD fresh.
"This is different because..."It's not. The rules don't have exceptions.

Red Flags - STOP and Start Over

If you encounter any of these, DELETE CODE and restart with TDD:

  • Code written before test
  • Test passes immediately (not testing what you think)
  • "I'll add tests later"
  • "This is too simple to test"
  • "I know what I'm doing, I don't need the ritual"
  • Can't explain why test failed (or didn't fail)
  • Test testing mock behavior, not real behavior
  • Multiple behaviors in one test ("and" in test name)

Integration with recursive-mode Phase 3

Routing Awareness

If TDD execution uses delegated review, test audit, or bounded routed implementation help, re-read:

  • /.recursive/config/recursive-router.json
  • /.recursive/config/recursive-router-discovered.json

immediately before choosing the delegated CLI/model, and use the routed policy or explicit fallback rather than ad hoc model selection.

Phase 3 Artifact TDD Section

Every Phase 3 artifact must include:

## TODO

- [ ] Replace every placeholder with concrete TDD evidence for the current implementation phase.

## Audit Context

Audit Execution Mode: self-audit / subagent
Subagent Availability: available / unavailable
Subagent Capability Probe: [what proved availability or unavailability]
Delegation Decision Basis: [why self-audit or delegation was chosen]

## TDD Compliance Log

TDD Mode: strict

RED Evidence:
- `/.recursive/run/<run-id>/evidence/logs/red/<file>.log`

GREEN Evidence:
- `/.recursive/run/<run-id>/evidence/logs/green/<file>.log`

### Requirement R1 (Feature X)

**Test:** `test/features/x.test.ts` - "should do Y when Z"
- RED: [timestamp] - Failed as expected: [output]
- GREEN: [timestamp] - Minimal implementation: [description]
- REFACTOR: [timestamp] - Cleanups: [description]
- Final state: PASS - all tests passing

### Requirement R2 (Bug Fix)

**Regression Test:** `test/bugs/issue-123.test.ts` - "reproduces crash on empty input"
- RED: [timestamp] - Confirmed bug: [output]
- GREEN: [timestamp] - Fix applied: [description]
- REFACTOR: [timestamp] - N/A (minimal fix)
- Final state: PASS - test passes, bug fixed

## Requirement Completion Status

- `R1` | `implemented` | Changed Files: `path/to/file`
- `R1` | `verified` | Evidence: `/.recursive/run/<run-id>/evidence/logs/green/<file>.log`

If strict mode cannot be followed, the artifact must include:

## Pragmatic TDD Exception

Exception reason: [specific reason strict RED-first flow was not feasible]
Compensating validation:
- [extra tests, targeted manual verification, diff review, etc.]
- `/.recursive/run/<run-id>/evidence/<supporting-file>`

Phase 3 Coverage Gate Addition

## Coverage Gate

- [ ] Every new function has a corresponding test
- [ ] Every bug fix has a regression test that fails before fix
- [ ] All RED phases documented with failure output
- [ ] All GREEN phases documented with minimal implementation
- [ ] All tests passing (no skipped tests)
- [ ] No production code written before failing test

TDD Compliance: PASS / FAIL

Phase 3 Approval Gate Addition

## Approval Gate

- [ ] TDD Compliance: PASS
- [ ] Implementation matches Phase 3 plan
- [ ] No code without preceding failing test
- [ ] All tests documented in TDD Compliance Log

Approval: PASS / FAIL

Bug Fix TDD Procedure

  1. Add Regression Test First

- Write test that reproduces the bug - Run test, confirm it fails with expected error - Document failure in Phase 3 artifact

  1. Implement Minimal Fix

- Fix only what's needed to make test pass - Run test, confirm it passes - Document fix in Phase 3 artifact

  1. Verify No Regressions

- Run full test suite - Confirm nothing else broke - Document in Phase 3 artifact

  1. Lock Phase 3

- TDD Mode is declared - TDD Compliance: PASS - Approval: PASS - Status: LOCKED

Example: Complete Phase 3 TDD Section

## TDD Compliance Log

### R1: Add email validation

**Test:** `test/forms/validation.test.ts`

RED Phase (2026-02-21T10:15:00Z):

$ npm test test/forms/validation.test.ts FAIL: Expected 'Email is required', got undefined


RED verified: PASS

GREEN Phase (2026-02-21T10:18:00Z):

- Added null check in `submitForm()` function
- Test passes GREEN verified: PASS

REFACTOR Phase (2026-02-21T10:22:00Z):

- Extracted `validateRequired()` helper
- All tests still passing REFACTOR complete: PASS

### R2: Fix crash on empty array

**Regression Test:** `test/utils/array.test.ts`

RED Phase (2026-02-21T10:25:00Z):

$ npm test test/utils/array.test.ts FAIL: TypeError: Cannot read property 'map' of undefined


RED verified: Bug reproduced PASS

GREEN Phase (2026-02-21T10:27:00Z):

- Added guard clause in `processItems()`
- Test passes GREEN verified: PASS

REFACTOR: N/A (minimal 2-line fix)

## Verification

Full suite run: `npm test` Result: 47 passing, 0 failing

References

  • REQUIRED: Follow this skill for all Phase 3 implementation work

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

38.1%
按下载量换算94

Claude

30.88%
按下载量换算76

Cursor

18.74%
按下载量换算46

Gemini CLI

10.12%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills