diyu-tdd-guide

Guide Python backend teams through a complete TDD workflow with pytest and asyncio.

Updated Jul 11, 2026
One-click install
npx skills add https://github.com/andyan77/diyu-agent --skill diyu-tdd-guide
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: diyu-tdd-guide
Source: https://github.com/andyan77/diyu-agent/tree/main/.claude/skills/diyu-tdd-guide
Command: npx skills add https://github.com/andyan77/diyu-agent --skill diyu-tdd-guide

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD 流程指导和治理材料,帮助团队在后端开发中坚持 Red-Green-Refactor 循环、提升测试覆盖率与隔离测试实践,减少回归风险并提高交付质量。

Core Features & Use Cases

  • 指导 Red-Green-Refactor 的完整工作流与测试工件的组织。
  • 提供 asyncio_mode=auto 的 pytest 配置和测试治理原则,适用于多租户和合规场景。
  • 适用于新功能开发与 bug 修复的测试驱动开发场景,包含参考材料与规范。

Quick Start

Start adopting TDD by writing tests first, running pytest with asyncio support, and verifying coverage and governance checks.

Frequently Asked Questions about diyu-tdd-guide

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement test-driven development for Python backends using pytest?

TDD for Python backends applies a Red-Green-Refactor workflow with pytest to write tests first, enforce code quality, and reduce regression risks. This guide provides complete workflow templates, governance documentation, and pytest configurations for feature development and bug fixes.

What is the Red-Green-Refactor cycle and how does it apply to asyncio testing?

The Red-Green-Refactor cycle is a strict TDD process of writing failing tests, making them pass, then refactoring code. For asyncio testing, it uses pytest with asyncio_mode=auto to validate asynchronous Python backend behavior and enforce isolation testing.

Can I use pytest with asyncio_mode=auto for multi-tenant compliance testing?

Yes, pytest with asyncio_mode=auto supports multi-tenant and compliance scenarios by applying defined testing governance principles and isolation testing. The workflow includes governance checks, coverage targets, and reference content to validate TDD configurations.

What's the best way to enforce TDD governance and code quality in Python?

Enforcing TDD governance involves applying frontmatter-driven metadata, defined coverage targets, and governance documentation to validate the TDD workflow. This approach ensures strict isolation testing and consistent code quality across Python backend projects.

Does TDD workflow guidance cover bug fixes or only new feature development?

TDD workflow guidance covers both new feature development and bug fixes across Python backends. It provides testing artifacts, reference materials, and strict Red-Green-Refactor cycles to improve delivery quality and reduce regression risk in all scenarios.