Bỏ qua tới nội dung
TakoAPI
Quay lại kỹ năng

agents-skill-tdd-helper

bởi cerbug45

CLI Utilities
570Lượt tải do clawskills.sh công bố
1Lượt xem
0 lượt thíchĐăng nhập để thích kỹ năng này
—Chưa có đánh giá
Đánh giá của bạn

Tóm tắt

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

Mô tả

Kỹ năng này làm gì

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.

Khi nào nên dùng

  • 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

Quy trình ví dụ

ĐẦU VÀO

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

AGENT
  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

ĐẦU RA

my_script.py executes only after the full test suite passes

Cài đặt

clawhub install cerbug45/agents-skill-tdd-helper

Chạy lệnh CLI, hoặc dán prompt vào Claude Code, Cursor, Codex hay coding agent bạn đang dùng.

Liên kết