Token导航 LogoToken导航

Agent Skill · 前端设计

tdd(时差)

tdd 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

tdd 是前端设计类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为调用外部服务;许可证信息还不明确,第三方扫描已通过,按安装量在前端设计类的 10,216 个 Skill 里排第 9,472。

总安装 214周安装 9GitHub Stars 2下载 75核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/tercel/code-forge --skill tdd

这个 Skill 是做什么的

前端设计类 Skill 关注页面结构、视觉规范和组件写法,输出通常是可运行的界面代码。

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合在 Codex、Claude、Cursor、Gemini CLI 中整理仓库状态或协作事项。通过 npx 安装,需结合原始 README 核验具体用法。安装前建议确认权限范围、维护状态及是否触发联网或文件操作。

tdd 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/tdd

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/tercel/code-forge --skill tdd;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要调用外部服务,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tdd 怎么安装?

在终端执行 npx skills add https://github.com/tercel/code-forge --skill tdd。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

tdd 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

tdd 需要什么权限?

权限级别是调用外部服务。该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

tdd 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

tdd 用的人多吗?

公开数据是累计安装 214 次,近一周安装 9 次,下载 75 次,GitHub 2 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

tdd 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理前端设计类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

前端设计类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
frontend-design

前端设计 · Codex、Claude

8,823,360126,072只读MIT通过
vercel-composition-patterns

Vercel 组合模式 · Codex、Claude

3,858,81625,893需要联网MIT通过
vercel-react-native-skills

Vercel React native skills 前端 · Codex、Claude

2,468,66425,878只读MIT通过
adapt

adapt 搜索 · Codex、Claude

2,027,04023,125操作浏览器未明确通过
bolder

bolder 分析 · Codex、Claude

2,004,28823,130只读未明确通过
tdd

时差 · 本页

2142调用外部服务未明确通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

Code Forge — TDD

Test-Driven Development enforcement for any code change, with built-in code analysis.

When to Use

  • Writing code outside of code-forge:impl workflow (ad-hoc changes, quick fixes)
  • Adding tests to existing code that lacks coverage
  • Implementing test cases from a spec-forge:test-cases document
  • Any new feature, bug fix, or behavior change that needs test discipline

Note: code-forge:impl already enforces TDD internally. This skill is for work outside that workflow.

Iron Law

NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST.

No exceptions. Not for "simple" changes. Not for "obvious" fixes. Not when under time pressure.

Step 0: Determine Mode

Examine the arguments to determine the operating mode:

ArgumentModeBehavior
@docs/.../test-cases.mdDriven ModeRead test cases document, implement each case via TDD
@src/services/payment.ts or specific code pathAuto-Analysis ModeAnalyze specified code, design cases, implement via TDD
Feature name or description (e.g., "add validation to user signup")Standalone ModeClassic TDD — write tests for the described change
Empty (no arguments)Auto-Analysis ModeScan project for coverage gaps, design cases, implement

Driven Mode — Implementing from Test Cases Document

When a test-cases.md file is provided (generated by spec-forge:test-cases):

D.1 Read and Parse

  1. Read the test-cases document
  2. Extract all test cases (TC-MODULE-NNN entries)
  3. Identify which are already implemented (check existing test files for matching test names/IDs)
  4. Filter to unimplemented cases
  5. Sort by priority: P0 first, then P1, then P2

D.2 Confirm Scope

Present to user:

  • "{N} test cases found, {X} already implemented, {Y} remaining"
  • "Implement: (A) all remaining, (B) P0 only, (C) P0 + P1, (D) specific modules?"

D.3 Implement Loop

For each test case in scope:

  1. Read the case — extract preconditions, steps, expected result, not-expected, test infra
  2. Set up test infrastructure — if Test Infra is "Real DB", configure TestContainers or test database; if "Mock external", set up mock for the specified third-party service; if "Temp dir", create temp directory; if "N/A", no special setup needed
  3. RED — Write a failing test that matches the case specification

- Test name should include TC ID: test("TC-AUTH-001: create user with valid email returns 201",...) - Preconditions become test setup (seed data, auth context, config) - Steps become test actions - Expected result becomes assertions - "Not Expected" becomes negative assertions where applicable

  1. VERIFY RED — Run the test, confirm it fails correctly
  2. GREEN — Write minimal production code to make it pass (if the code already exists and passes, the case was already covered — note and move on)
  3. VERIFY GREEN — Run all tests, confirm clean pass
  4. REFACTOR — Clean up if needed
  5. Report — "TC-AUTH-001: DONE (test passes, implementation complete)"

D.4 Progress Tracking

After each case, display progress:

TDD Progress: {completed}/{total} ({percentage}%)
  [x] TC-AUTH-001: Create user with valid email (P0) — DONE
  [x] TC-AUTH-010: Create user with duplicate email rejected (P0) — DONE
  [ ] TC-AUTH-011: Create user with invalid email format (P1) — next
  [ ] TC-AUTH-030: Create user should NOT bypass email validation (P1)

Ask: "Continue with next case, skip, or pause?"

D.5 Completion

After all cases are implemented:

  • Run full test suite
  • Report: total cases implemented, all tests passing, coverage change
  • Suggest: "Run /code-forge:verify to confirm completion"

Auto-Analysis Mode — Scan and Test

When the user points to code or says "help me write tests" without a test-cases document.

Iron Rule: Auto-Analysis uses the SAME full analysis as spec-forge:test-cases. The only difference is the output — auto-analysis produces code directly instead of a document. The analysis quality must be identical.

A.0 Full Test Case Analysis (same as spec-forge:test-cases Steps 1-5)

Execute the complete spec-forge:test-cases analysis pipeline. The full workflow is defined in the spec-forge test-cases-generation skill (spec-forge/skills/test-cases-generation/SKILL.md). The essential steps are inlined below — follow them exactly:

Step 1 — Determine Input Mode and Project Profile

  • Determine input mode: Scan / Code / Spec (from user arguments)
  • Detect project profile: Web API / CLI Tool / Frontend App / AI Agent / Data Pipeline / Function Library / SDK
  • Detect: has database? has auth? has external APIs?
  • Output explicit profile with rationale

Step 2 — Deep Scan and Extract (Four Layers)

  • Use the language-specific deep extraction strategy (Python / TypeScript / Go / Rust / Java)
  • Extract ALL testable units across four layers:

- Interface: public API surface, type contracts, trait/interface boundaries - Logic: branch paths, error chains, state transitions, validation rules - Architecture: module structure, layer boundaries, dependency direction - Relationships: call graphs, data flow, event propagation, trait implementations

  • Scan existing tests to determine current coverage
  • Run scan verification (file coverage ≥ 90%, module tree completeness, re-export tracking)
  • Produce structured Functional Inventory with all four layers per unit

Step 3 — Detect Dimensions

  • Apply built-in dimensions: Coverage Depth (L1/L2/L3)
  • Auto-detect project-specific dimensions (Auth Context, Trigger Mode, Input Source, etc.)

Step 4 — Confirm Scope with User

  • Present Profile confirmation: "I detected this as {profile} ({rationale}). Correct?"
  • Present scope: "{N} testable units, {X} have tests, {Y} don't. Cover: all / uncovered / specific modules?"
  • Present detected dimensions for confirmation
  • Ask for business rules the code can't reveal

Step 5 — Design Test Cases

  • Per testable unit, generate at minimum:

- 1 × L1 (Happy Path) - 2 × L2 (Boundary + Error) - 1 × L3 (Negative — what should NOT happen)

  • For interacting units: pairwise combination cases (L1 both succeed + L2 one fails + L3 should not combine)
  • For auto-detected dimensions: cross with coverage depth using risk-based prioritization
  • Apply conditional sections:

- Data Integrity cases (only if project has database) - Security cases (only if project has auth or handles user input) - Performance cases (only if project has latency/throughput requirements)

  • Assign priorities: P0 (critical path) / P1 (important) / P2 (nice-to-have)
  • Build coverage matrix internally: unit × depth, dimension coverage, combination coverage, gap analysis

Result: A complete set of structured test cases in memory — identical quality to what spec-forge:test-cases would produce as a document.

A.1 Optional: Save Test Cases Document

Ask the user: "Save the test cases as docs/{feature}/test-cases.md for future reference? (Y/n)"

  • If yes → write the document following the spec-forge:test-cases template, then continue to A.2
  • If no → keep in memory, continue to A.2

A.2 Implement via TDD

For each test case (sorted by priority: P0 → P1 → P2), follow the same TDD cycle as Driven Mode:

  1. Read the case — extract preconditions, steps, expected result, not-expected, test infra
  2. Set up test infrastructure — if Test Infra is "Real DB", configure TestContainers; if "Mock external", set up mock; if "Temp dir", create temp directory; if "N/A", no setup
  3. RED — Write a failing test matching the case specification

- Test name should include TC ID: test("TC-AUTH-001: create user with valid email returns 201",...) - Preconditions → test setup; Steps → test actions; Expected result → assertions; Not Expected → negative assertions

  1. VERIFY RED — Run the test, confirm it fails correctly
  2. GREEN — Write minimal production code to make it pass
  3. VERIFY GREEN — Run all tests, confirm clean pass
  4. REFACTOR — Clean up if needed
  5. Report — "TC-AUTH-001: DONE"

A.3 Progress Tracking

After each case, display progress (same format as Driven Mode D.4):

TDD Progress: {completed}/{total} ({percentage}%)
  [x] TC-AUTH-001: Create user with valid email (P0) — DONE
  [x] TC-AUTH-010: Duplicate email rejected (P0) — DONE
  [ ] TC-AUTH-011: Invalid email format (P1) — next

Ask: "Continue with next case, skip, or pause?"

A.4 Completion

After all cases are implemented:

  • Run full test suite
  • Report: total cases implemented, all tests passing, coverage statistics
  • If test cases were saved to file (A.1), report the file path
  • Suggest: "Run /code-forge:verify to confirm completion"

Standalone Mode — Classic TDD

For ad-hoc changes where the user describes what to build or fix:

Workflow

RED (write failing test) → VERIFY RED → GREEN (minimal code) → VERIFY GREEN → REFACTOR → REPEAT

The Cycle

Complete each phase fully before moving to the next.

1. RED — Write a Failing Test
  • One minimal test showing the desired behavior
  • Clear, descriptive test name
  • Use real code, not mocks (unless unavoidable: external APIs, time-dependent behavior)
  • One behavior per test
2. VERIFY RED — Watch It Fail (MANDATORY)

Run the test. Confirm:

  • It fails (not errors)
  • The failure message describes the missing behavior
  • It fails because the feature is missing, not because of typos or setup issues

If the test passes: you're testing existing behavior. Rewrite the test. If the test errors: fix the error, re-run until it fails correctly.

3. GREEN — Write Minimal Code
  • Simplest code that makes the test pass
  • No extra features, no "while I'm here" improvements
  • No premature abstractions — three similar lines beats a premature helper
4. VERIFY GREEN — Watch It Pass (MANDATORY)

Run the test. Confirm:

  • The new test passes
  • All other tests still pass
  • Output is clean (no warnings, no errors)

If the new test fails: fix the code, not the test. If other tests fail: fix them now, before proceeding.

5. REFACTOR — Clean Up (After Green Only)
  • Remove duplication, improve names, extract helpers
  • Keep all tests green throughout
  • Do NOT add new behavior during refactor
6. REPEAT

Go back to Step 1 for the next behavior.

Decision Rules

If you're about to...Instead...Why
Write production code without a testSTOP — write the failing test firstTests written after implementation pass immediately and prove nothing
Skip testing because the change is "simple"Write the test — it will be quick if it's truly simpleSimple code has the sneakiest bugs (off-by-one, null edge cases)
Apply a quick fix without a regression testWrite the test, then fixUntested fixes become permanent regressions
Continue with code that wasn't test-drivenConsider rewriting test-firstSunk cost — untested code is a liability regardless of time spent

External Dependency Rules

Principle: test your own dependencies for real; only mock what you don't control.

Your DependencyApproach
Own databaseReal DB (TestContainers, test instance, SQLite in-memory)
Own file systemReal temp directory
Own cache / message queueReal (TestContainers, embedded)
External third-party APIMock / stub acceptable
Non-deterministic input (time, random)Inject controlled values
  • For projects without a database or external I/O: most tests are pure unit tests — no special infra needed
  • For write operations: verify state after the operation (DB query / file check / store assertion)

Example

Task: Add isPalindrome(str) function

1. RED — Write test:
   test("isPalindrome returns true for 'racecar'", () => {
     expect(isPalindrome("racecar")).toBe(true);
   });

2. VERIFY RED — Run: npm test
   ✗ ReferenceError: isPalindrome is not defined    ← fails correctly

3. GREEN — Minimal code:
   function isPalindrome(str) {
     return str === str.split("").reverse().join("");
   }

4. VERIFY GREEN — Run: npm test
   ✓ isPalindrome returns true for 'racecar'        ← passes
   42 passed, 0 failed

5. REFACTOR — (no changes needed)

6. REPEAT — next test: edge case with empty string

Test runner detection: Check package.json scripts, pytest.ini, Cargo.toml, go.mod, or Makefile for the project's test command before starting the cycle. Use the same runner consistently.

Verification Checklist

Before claiming work is complete:

  • Every new function/method has at least one test
  • Watched each test fail before implementing
  • Each test failed for the expected reason (not errors)
  • Wrote minimal code per test (no gold-plating)
  • All tests pass with clean output
  • Edge cases and error paths covered
  • Mocks used only when unavoidable
  • Database-touching tests use real database

When Stuck

  • Test too complicated to write → design is too complicated, simplify first
  • Must mock everything → code is too coupled, extract interfaces
  • Test setup is huge → extract test helpers or fixtures
  • No test-cases document and unsure what to test → run /spec-forge:test-cases first to generate a structured case set

平台分布

Codex

37.25%
按下载量换算28

Claude

28.51%
按下载量换算21

Cursor

16.8%
按下载量换算13

Gemini CLI

9.57%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

调用外部服务

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

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

继续浏览同类 Skills