跳到正文
TakoAPI
返回技能列表

agents-skill-tdd-helper

由 cerbug45 提供

CLI Utilities
570下载量由 clawskills.sh 提供
1浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Lightweight helper to enforce TDD-style loops for non-deterministic agents.

描述

该技能的功能

tdd-helper wraps task execution to enforce test-first discipline. It refuses to run production code if tests are absent or failing, and can optionally treat lint warnings as errors. Configuration is via environment variables or a JSON file.

Unlike invoking pytest directly, it enforces the test-first constraint at the process level, so agents cannot bypass the cycle even when code is generated dynamically.

何时使用

  • Blocking agent-generated code from running before tests pass
  • Enforcing test presence in automated pipelines
  • Running pytest suites before executing generated scripts
  • Treating lint warnings as hard errors in CI workflows
  • Guarding non-deterministic agent outputs with regression checks

示例工作流

输入

User asks: run my_script.py, but only if all tests in tests/ pass

智能体
  1. 1

    Agent calls tdd.py with --tests tests/ --run 'python my_script.py'

  2. 2

    tdd.py checks that tests/ exists and contains test files

  3. 3

    tdd.py runs pytest on the test suite

  4. 4

    If any test fails or no tests are found, tdd.py exits with an error and blocks execution

  5. 5

    If all tests pass, tdd.py runs my_script.py

输出

my_script.py executes only after the full test suite passes

安装

clawhub install cerbug45/agents-skill-tdd-helper

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接