一键导入
testing-python
Writes tests following TDD (using pytest and Hypothesis) and BDD best practices. Use when writing unit tests, integration tests, or BDD scenarios.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Writes tests following TDD (using pytest and Hypothesis) and BDD best practices. Use when writing unit tests, integration tests, or BDD scenarios.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Compacts verbose context into structured summary. Use after pollution sources (searches, logs, JSON) or at phase milestones.
Create a pull request from the current branch. Analyzes commits, generates title+body from PR template, pauses for approval, then pushes and creates PR. Use after committing changes.
Designs concise, streamlined backend systems matching exact task requirements. Use when planning APIs, data models, system architecture, or when the user requests backend design work.
Audits and aligns project documentation against authority chains (project docs and Claude Code infrastructure). Detects broken references, duplicates, scope creep, and chain breaks. Use when reviewing documentation health, fixing stale references, or enforcing single-source-of-truth.
Interactive Q&A to build UserStory.md from user input. Use when the user wants to create a user story document or start the assisted workflow.
Generates prd.json task tracking file from PRD.md requirements document. Use when initializing Ralph loop or when the user asks to convert PRD to JSON format for autonomous execution.
| name | testing-python |
| description | Writes tests following TDD (using pytest and Hypothesis) and BDD best practices. Use when writing unit tests, integration tests, or BDD scenarios. |
| compatibility | Designed for Claude Code |
| metadata | {"argument-hint":["test-scope or component-name"],"allowed-tools":"Read, Grep, Glob, Edit, Write, Bash"} |
Target: $ARGUMENTS
Writes focused, behavior-driven tests following project testing strategy.
Full documentation: docs/best-practices/
testing-strategy.md - Strategy, what to test, patterns to removetdd-best-practices.md - TDD methodologybdd-best-practices.md - BDD methodologyTDD (default): Use pytest for known cases, Hypothesis for edge cases. Works at unit/integration/acceptance levels.
BDD (optional): Use Given-When-Then for stakeholder collaboration on acceptance criteria.
See testing-strategy.md for full methodology comparison.
Cycle: RED (failing test) → GREEN (minimal pass) → REFACTOR (clean up)
Structure: Arrange-Act-Assert (AAA)
def test_order_processor_calculates_total():
# ARRANGE
items = [Item(price=10.00, qty=2), Item(price=5.00, qty=1)]
processor = OrderProcessor()
# ACT
total = processor.calculate_total(items)
# ASSERT
assert total == 25.00
| Priority | Area | Example |
|---|---|---|
| CRITICAL | Math formulas | Scores always in bounds |
| CRITICAL | Loop termination | Never hangs |
| HIGH | Input validation | Handles any text |
| HIGH | Serialization | Always valid JSON |
High-Value: Business logic, integration points, edge cases, contracts
Avoid: Library behavior, trivial assertions, implementation details, default constants, stale fixture patches (see testing-strategy.md → "Patterns to Remove")
See testing-strategy.md → "Patterns to Remove" for full list.
Format: test_{module}_{component}_{behavior}
test_user_service_creates_new_user()
test_order_processor_validates_items()
make test # All tests
make test_rerun # Rerun failed tests (fast iteration)
make validate # Full pre-commit validation
pytest tests/ -v # Verbose
pytest -k test_user_ # Filter by name
make test)