Token导航 LogoToken导航

Agent Skill · 开发

tdd-workflow(TDD 工作流程)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

tdd-workflow 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 13,743。

总安装 832周安装 35GitHub Stars 37下载 291核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/majesticlabs-dev/majestic-marketplace --skill tdd-workflow

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于辅助测试设计、自动化测试、用例整理和回归验证。适合编写单元测试、端到端测试或根据日志定位问题。使用时需确认测试框架、运行命令和夹具数据,避免误改逻辑。涉及浏览器或服务时,应区分本地模拟与生产环境。建议结合项目实际配置使用,确保测试有效性。

tdd-workflow 属于开发类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/tdd-workflow

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

tdd-workflow 怎么安装?

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

tdd-workflow 支持哪些 AI 工具?

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

tdd-workflow 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

tdd-workflow 是免费的吗?

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

tdd-workflow 用的人多吗?

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

tdd-workflow 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

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

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
tdd-workflow

TDD 工作流程 · 本页

83237操作浏览器未明确通过

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

SKILL.md 原文

TDD Workflow

Core Principle

Never write implementation code before a failing test exists for that behavior.

Execution Flow

1. Setup

LANG = /majestic:config tech_stack "unknown"
If LANG == "unknown": detect from project files (package.json → TypeScript, Gemfile → Ruby, go.mod → Go, pyproject.toml → Python)
If LANG == "unknown": AskUserQuestion("What language/framework?")

RUNNER = lookup LANG in [references/language-configs.md]
If LANG in [ruby]: delegate to `rspec-coder` or `minitest-coder` skill for runner details

INCREMENTS = decompose feature using patterns from [references/increments.md]
  - Read requirements/plan
  - Identify pattern (Data Transformation, CRUD, State Machine, Calculation, Integration)
  - Break into ordered increments: degenerate → happy path → variations → edge cases → errors

For each INCREMENT in INCREMENTS:
  TaskCreate(subject: INCREMENT.name, description: INCREMENT.test_description)

AskUserQuestion("Review increments. Adjust ordering or scope?", options: ["Looks good", "Modify"])

2. TDD Loop (per increment)

For each INCREMENT in INCREMENTS:
  TaskUpdate(INCREMENT.task_id, status: "in_progress")

  # RED
  Write failing test to real file (not code block)
  RUN = Bash(RUNNER.test_command)
  If RUN.status == PASS: STOP — investigate unexpected pass
  If RUN.status == FAIL (wrong reason): fix test, rerun
  PAUSE → show test + failure output, wait for user

  # GREEN
  Write minimal implementation code
  RUN = Bash(RUNNER.full_suite_command)
  If RUN.status == FAIL: show output, PAUSE → ask user to fix or hand off
  If RUN.status == PASS: auto-continue (no pause)

  # REFACTOR
  If improvement opportunities exist:
    Refactor implementation and/or test code
    RUN = Bash(RUNNER.full_suite_command)
    If RUN.status == FAIL: revert refactor, PAUSE → discuss
    If RUN.status == PASS: auto-continue (no pause)

  TaskUpdate(INCREMENT.task_id, status: "completed")
  Brief summary of what was implemented
  → immediately begin next increment (no pause between increments)

3. Wrap-up

RUN = Bash(RUNNER.full_suite_command)
Report: increments completed, total tests, pass/fail status
Suggest: remaining work, missed edge cases, integration tests needed

Pause/Continue Rules

SituationAction
RED: test fails (expected)Pause — show test + failure, wait for user
RED: test passes unexpectedlyStop — investigate, don't proceed
GREEN: all tests passAuto-continue to REFACTOR
GREEN: tests failPause — show output, ask user
REFACTOR: tests passAuto-continue to next increment
REFACTOR: tests failRevert + Pause — discuss approach
Between incrementsAuto-continue — no pause

Task Tracking Integration

TASK_TRACKING = /majestic:config task_tracking.enabled false
WORKFLOW_ID = "tdd-{timestamp}"

If TASK_TRACKING:
  For each TaskCreate: add metadata {workflow: WORKFLOW_ID, phase: "tdd-loop"}
  For each TaskUpdate: wrap with If TASK_TRACKING: TaskUpdate(...)
  On Wrap-up: update ledger if LEDGER_ENABLED
    LEDGER_ENABLED = /majestic:config task_tracking.ledger false
    LEDGER_PATH = /majestic:config task_tracking.ledger_path .agents/workflow-ledger.yml

Red-Green-Refactor Cycle

1. Red Phase: Write a Failing Test

  • Select one small, specific behavior from the increment
  • Write a descriptive test that expresses the expected behavior
  • Run the test to confirm it fails (red)
  • The failure should be for the right reason (not syntax error or missing dependency)

2. Green Phase: Minimal Implementation

  • Implement only the minimal code necessary to pass the failing test
  • Resist adding extra features or handling edge cases not yet covered by tests
  • Run the test to confirm it passes (green)

3. Refactor Phase: Improve Quality

  • Review both implementation and test code for improvements
  • Remove duplication, improve naming, extract methods
  • Apply language-specific idioms and patterns
  • Run tests after each refactoring step to ensure they still pass

Test Sequencing Strategy

Order tests from simple to complex:

  1. Happy path — The core behavior with valid inputs
  2. Validation tests — Required fields, format constraints
  3. Edge cases — Boundary conditions, empty values, unusual inputs
  4. Error handling — Invalid inputs, failure scenarios
  5. Integration points — Interactions with other components

Test Quality Guidelines

Each test should:

  • Cover exactly one behavior
  • Be isolated — no shared state between tests
  • Have a clear, descriptive name
  • Fail for only one reason

Avoid:

  • Testing implementation details instead of behavior
  • Writing tests after the code
  • Sharing test setup that creates hidden dependencies
  • Skipping the refactor phase

Framework-Specific Implementation

For language-specific test runner commands, see references/language-configs.md.

For Ruby projects:

  • RSpec: Apply rspec-coder skill
  • Minitest: Apply minitest-coder skill

A Rails example is available in references/rails-tdd-workflow.md.

Test Generation Patterns

When writing tests outside a TDD loop (e.g., adding coverage to existing code), follow these patterns.

Framework Detection

EvidenceFramework
spec/ + _spec.rb + .rspecRSpec
test/ + _test.rb + test_helper.rbMinitest
*.test.js + jest.config.jsJest
*.spec.ts in tests/ or e2e/Playwright
vitest.config.jsVitest

Test Plan Structure

Before writing tests, create a plan covering:

  1. Scope - What functionality will be tested
  2. Happy path scenarios - Expected successful flows
  3. Sad path scenarios - Error handling, validations, failures
  4. Edge cases - Boundary conditions, null/empty values, unusual inputs
  5. Auth checks - Authorization/authentication (if applicable)
  6. Test data requirements - Fixtures or data needed
  7. Mocking strategy - External services/dependencies to mock

Test Case Matrix

Use for complex scenarios with multiple parameters:

ObjectiveInputsExpected OutputTest Type
Validate creationvalid paramsCreated, 201Happy Path
Reject duplicateexisting dataError, 422Sad Path
Handle emptymissing fieldValidation errorEdge Case

Completion Criteria

Tests are complete when ALL of these are met:

Coverage: All public methods tested, happy/sad/edge paths covered, auth checks included.

Quality: Tests pass (verified by running), isolated (no shared state), follow AAA pattern (Arrange-Act-Assert), descriptive names.

Framework compliance: Proper matchers, appropriate mocking, follows project patterns.

Test Writing Best Practices

  • Test behavior, not implementation details
  • One assertion focus per test
  • Use descriptive test names that document expected behavior
  • Prefer explicit assertions over implicit ones
  • Use test doubles sparingly and purposefully
  • Group related tests with describe/context blocks
  • Test data should be minimal but sufficient
  • For Rails: use transactional fixtures and database cleaner
  • For Playwright: proper waiting strategies, avoid flaky selectors

平台分布

Codex

36.86%
按下载量换算107

Claude

26.87%
按下载量换算78

Cursor

19.5%
按下载量换算57

Gemini CLI

8.67%
按下载量换算25

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

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

继续浏览同类 Skills