360 Secure SkillHub
360 安全技能中心

Tdd Helper

核心功能:通过tdd.py包装任务,无测试或测试失败时报错,拒绝先执行生产代码;可选监控代码检查警告,设警告为错误时阻止执行;支持环境变量或JSON配置。典型场景:开发非确定性代理时规范TDD流程。输入为命令行指定测试目录和生产代码运行命令,输出为执行结果或不符合要求的报错提示。

cerbug45
cerbug45
热度 82.90
最近更新 2026-05-17 12:14:18
分类:开发依赖:代码执行应用场景:自动化脚本 / DevOps

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add agents-skill-tdd-helper
Metadata
name
tdd-helper
description
Lightweight helper to enforce TDD-style loops for non-deterministic agents.
metadata
{"openclaw":{"requires":{"bins":["python3","pytest"]},"category":"development"}}

tdd-helper

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

Features

  • tdd.py wraps a task: fails if tests are absent or failing, refuses to run "prod" code first.
  • Watches for lint/warnings (optional) and blocks on warnings-as-errors.
  • Simple config via env or JSON.

Usage

# Define tests in tests/ or specify via --tests
python tdd.py --tests tests/ --run "python your_script.py"