Duyệt miễn phí mỗi ngày. Lên Pro để cài đặt và dùng Airsc MCP không giới hạn.

Xem gói Pro
PluginAn toànReview & chất lượng codeNâng cao

tdd-guard

nizos · nizos/tdd-guard

Một plugin dành cho Claude Code giúp thực thi các nguyên tắc Phát triển hướng kiểm thử (TDD) bằng cách chặn các thay đổi mã bỏ qua kiểm thử.

Automated TDD enforcement for Claude Code

2.4k sao188Giấy phép: MITCập nhật 10 ngày trước0 lượt mở

Xem trước

▍

Bạn có thể làm gì với nó

  • Buộc Claude phải viết một bài kiểm thử không đạt trước khi triển khai bất kỳ logic tính năng mới nào.
  • Ngăn chặn agent thiết kế giải pháp quá mức bằng cách tuân thủ các yêu cầu TDD tối thiểu.
  • Đảm bảo tất cả các thay đổi mã đều vượt qua các quy tắc linting và kiểm thử hiện có trước khi tiếp tục.

Kiểm tra an toàn

An toàn

Không thấy dấu hiệu rủi ro trong các file đã quét.

Quét tự động các file trong repo. Luôn xem lại code trước khi chạy.

Trích từ README

TDD Guard

[!IMPORTANT] TDD Guard grew into Probity: the same TDD enforcement, now for Claude Code, Codex, and GitHub Copilot CLI, with more reliable validation and no test reporters to set up. New projects should start there. TDD Guard remains maintained for the projects that rely on it.

Automated Test-Driven Development enforcement for Claude Code.

TDD Guard ensures Claude Code follows Test-Driven Development principles. When your agent tries to skip tests or over-implement, TDD Guard blocks the action and explains what needs to happen instead.

Features

  • Test-First Enforcement - Blocks implementation without failing tests
  • Minimal Implementation - Prevents code beyond current test requirements
  • Lint Integration - Enforces refactoring using your linting rules
  • Customizable Rules - Adjust validation rules to match your TDD style
  • Flexible Validation - Choose faster or more capable models for your needs
  • Session Control - Toggle on and off mid-session

Getting Started

Requirements

  • Node.js 22+
  • A supported test framework (Vitest, Jest, Storybook, pytest, PHPUnit, Go, Rust, RSpec, Minitest)

Installation

Open Claude Code in your project and run:

  1. /plugin marketplace add nizos/tdd-guard
  2. /plugin install tdd-guard@tdd-guard
  3. /tdd-guard:setup

This adds the marketplace, installs the plugin, and configures the test reporter for your project. You may need to restart your terminal session or IDE extension for the setup skill to appear. For manual installation and configuration, see the installation guide.

Configuration

Security

TDD Guard hooks run with your user permissions. We maintain automated security scanning, dependency audits, and welcome source code review. See Claude Code's security considerations for more on hook safety.

Development

Contributing

Contributions are welcome! See the contributing guidelines to get started.

Contributors:

Support

  • Discussions - Ask questions and share ideas
  • Issues - Report bugs and request features

License

MIT

Xem mã nguồn trên GitHub