3.2 KiB
3.2 KiB
name, description, x-personal-mcp
| name | description | x-personal-mcp | |||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| pytest-scaffold | Plan and optionally scaffold pytest file and class structure for selected Python modules while preserving concise behavior-focused test names and one-line intent docstrings. |
|
Pytest Scaffold
Use this prompt to consistently plan and scaffold pytest test modules for selected Python source modules.
Inputs
- Required:
- target_modules: one or more module paths under src/
- mode: one of plan-only or scaffold
- Optional:
- path_strategy: preference for how source paths map into tests/
- naming_style: preference for concise method naming style
Required References
Load these in order and apply only the relevant sections:
- Primary conventions: Pytesting Skill
- Hierarchy and naming: Naming and Organization
- Marker and fixture defaults: Pytest Docs Notes
Workflow
- Inspect the current tests/ layout and infer existing naming and grouping conventions.
- Propose a concise hierarchy plan first:
- test file paths
- class hierarchy
- method naming pattern
- fixture placement choices (tests/conftest.py or subtree conftest.py)
- If mode is scaffold, implement only the scaffold structure:
- create missing test modules
- create class hierarchy
- add one-line docstrings to each class and test method
- keep test method names short and behavior-focused
- Treat docstring-only scaffolds as an intentionally stable baseline for later fill-in work.
- Validate collection with:
- uv run pytest --collect-only -q
- Report outcomes:
- files created or updated
- collection result
- ambiguities and follow-up choices
Naming Defaults
- Class naming:
- Test as a top-level subject class
- nested Test classes where extra context improves readability
- Test top-level classes for standalone module functions
- Method naming:
- test_<short_outcome>
- one behavior target per method
- one-line docstring for full intent
Authoring Rules
- Keep scope focused on structure and naming in this prompt.
- Do not fill test implementation details unless explicitly requested.
- Preserve established repository conventions when they are already present.
- If input constraints conflict, ask one concise clarifying question before editing.
Output Contract
Return:
- Discovery summary and references used.
- Proposed or applied test tree.
- Class and method naming map.
- Validation command result.
- Open questions only when they block completion.