360 Secure SkillHub
360 安全技能中心

Tdd Helper

轻量级 TDD 流程助手,用脚本包装待执行任务:测试缺失或失败即中止,拒绝先运行产品代码,并可选将 lint 警告视为错误予以阻断;支持通过环境变量或 JSON 配置。测试用例与运行环境需用户自备。

cerbug45
cerbug45
热度 82.85
最近更新 2026-05-17 12:14:18
分类:开发依赖:代码执行 / 读写文件应用场景:代码生成 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 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"