ワンクリックで
test-python
ALWAYS invoke this skill when writing or fixing tests for Python. NEVER write or fix Python tests without this skill.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
ALWAYS invoke this skill when writing or fixing tests for Python. NEVER write or fix Python tests without this skill.
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | test-python |
| description | ALWAYS invoke this skill when writing or fixing tests for Python. NEVER write or fix Python tests without this skill. |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep, Skill |
Invoke the python:python-standards skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
Invoke the python:python-test-standards skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
Invoke the spec-tree:test skill before proceeding. If that skill is unavailable, report the missing skill and continue with the closest available workflow.
<mode_detection> Determine the mode before editing:
| Mode | Signal | Action |
|---|---|---|
| Write | The node has no Python evidence file for the assertion | Follow <write_workflow> |
| Fix | /audit-python-tests rejected existing Python evidence | Follow <fix_workflow> |
| Split | The test requires source architecture changes first | Change source contract first |
NEVER create a test workaround for code that lacks source-owned contracts, typed dependency boundaries, or observable behavior. </mode_detection>
<write_workflow> Run this workflow for new Python tests:
/test to select the assertion type, execution level, and any Stage 5 exception.<source_contract_gate>: inspect the code under test and identify the production contract the test will exercise.test_<subject>.<evidence>.<level>[.<runner>].py.tests/ directory.product_testing.generators.*.product_testing.harnesses.*; rely on conftest.py only for explicit pytest discovery imports.</write_workflow>
<fix_workflow> Run this workflow for rejected Python tests:
conftest.py shim.<source_contract_gate> and fix source architecture before fixing test syntax when the finding exposes missing source contracts.product_testing.harnesses.*.product_testing.fixtures/ for inert files only.tests/helpers, tests/support, node-local test-infrastructure modules, and fixture body code from conftest.py.</fix_workflow>
<source_contract_gate> Before writing or repairing a test, answer these checks from the code under test:
If any answer is no, fix the source contract first. Do not hide the missing contract in a test constant, fixture file, or generator wrapper. </source_contract_gate>
Run the product's canonical test, lint, and type commands — the ones its `CLAUDE.md`, Justfile, Makefile, or package scripts document. When the product ships no wrapper, fall back to the tools directly only when they are installed:python3 -m pytest <node-path>/tests/ -v
python3 -m ruff check <node-path>/tests/
python3 -m mypy <node-path>/tests/
Report any tool the product lacks rather than silently skipping it.
Report the evidence created or repaired with:conftest.py shims touched<success_criteria> Python test work satisfies this skill when:
conftest.py contains discovery or registration only</success_criteria>
ALWAYS invoke this skill when diagnosing the health of a spec-tree or spx environment, when checking whether the SessionStart hook fired for the current session, or when troubleshooting a missing session identity, worktree claim, or unreachable spx CLI. NEVER guess why session state is missing without running these checks first.
ALWAYS invoke this skill when diagnosing the health of a spec-tree or spx environment, when checking whether the SessionStart hook fired for the current session, or when troubleshooting a missing session identity, worktree claim, or unreachable spx CLI. NEVER guess why session state is missing without running these checks first.
ALWAYS invoke this skill when diagnosing the health of a spec-tree or spx environment, when checking whether the SessionStart hook fired for the current session, or when troubleshooting a missing session identity, worktree claim, or unreachable spx CLI. NEVER guess why session state is missing without running these checks first.
ALWAYS invoke this skill when selecting the next executable slice to implement or deciding which spec-tree nodes /apply should build next from an implementation plan. NEVER choose the next nodes by ad hoc selection — this skill scopes an existing plan to demonstrable value before /apply runs.
ALWAYS invoke this skill when writing or fixing tests for Python. NEVER write or fix Python tests without this skill.
ALWAYS invoke this skill when writing or fixing tests for Python. NEVER write or fix Python tests without this skill.