SOC 직업 분류 기준
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill test-coverage-review명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
| name | test-coverage-review |
| description | > Use when this capability is needed. |
This skill audits test coverage in Python projects, identifies gaps, writes new tests, and verifies that the test suite passes — all following pytest best practices.
Read the best-practices reference file to ground your work:
cat references/best-practices.md
Use the practices and source citations in that file as your authoritative checklist.
Determine the mode from the user's request.
Use when the user says "review my tests", "check my coverage", or "are my tests good enough".
Step 1: Discover the project structure
Identify:
src/ layout)tests/, test/, or co-located)conftest.py files and shared fixturespyproject.toml, setup.cfg, or .coveragercStep 2: Map source modules to test files
For every public module in the package, check whether a corresponding test file exists. Flag modules with no test file at all.
| Source module | Test file | Status |
|---|---|---|
mypackage/api.py | tests/test_api.py | ✅ exists |
mypackage/parser.py | — | ❌ missing |
Step 3: Audit test quality
For each existing test file, check against the reference checklist:
test_<module>.py, classes prefixed Test,
methods prefixed test_.@pytest.fixture, not setUp() or
duplicated code.Step 4: Run coverage (if possible)
pytest tests/ --cov=<package> --cov-report=term-missing --tb=short -q
Report:
Step 5: Produce the audit report
Output a markdown table of findings:
| File | Issue | Severity | Source |
|---|---|---|---|
tests/test_api.py | No tests for error paths in fetch() | critical | [PYTEST-GOOD] |
tests/test_parser.py | _parse() mocked instead of tested directly | warning | [MOCK-BOUND] |
| — | No test file for mypackage/utils.py | critical | [COVERAGE] |
Severity levels:
Use when the user says "write tests for this", "add tests for this module", or has just finished a feature.
Step 1: Analyze the code under test
Read the module and identify:
Step 2: Plan test categories
For each public class or function, plan tests in these categories:
| Category | What to test |
|---|---|
| Happy path | Normal inputs produce expected outputs |
| Edge cases | Empty inputs, None, zero, boundary values |
| Error handling | Invalid inputs raise expected exceptions |
| Return types | Return values have correct types and structure |
| Side effects | External calls are made with correct arguments |
| State changes | Object state changes correctly after method calls |
Present the plan to the user before writing.
Step 3: Write the test file
Follow this structure:
"""Tests for <module description>."""
from unittest.mock import patch, MagicMock
import pytest
from <package>.<module> import <Class>, <function>
# ---------------------------------------------------------------------------
# Sample data
# ---------------------------------------------------------------------------
SAMPLE_DATA = ... # Module-level test data constants
# ---------------------------------------------------------------------------
# <ClassName> tests
# ---------------------------------------------------------------------------
class Test<ClassName>:
"""Tests for the <ClassName> <type>."""
def test_<behavior>(self):
"""Verify <what is being tested>."""
# Arrange
...
# Act
...
# Assert
...
Rules:
test_<module>.pyclass Test<Name>: with class docstrings"""Verify <what>."""# ---) between test classes@pytest.fixture, not setUp()Step 4: Mock at the boundary
Mock external dependencies only:
requests.get / requests.post for HTTP callsopen / pathlib.Path for file I/Otime.sleep, datetime.now when testing time-dependent logicDo NOT mock:
# CORRECT — mock the HTTP boundary
@patch("mypackage.api.requests.get")
def test_fetch_sends_timeout(self, mock_get):
mock_get.return_value = MagicMock(status_code=200, json=lambda: {})
client = APIClient()
client.fetch("https://example.com")
_, kwargs = mock_get.call_args
assert kwargs["timeout"] == 10
# WRONG — don't mock internal methods
@patch.object(Parser, "_transform") # ← test this directly instead
def test_parse(self, mock_transform):
...
Step 5: Run and verify
After writing tests:
# Run the new tests
pytest tests/test_<module>.py -v --tb=short
# Run the full suite to check for regressions
pytest tests/ --tb=short -q
# Check coverage of the new module
pytest tests/ --cov=<package>.<module> --cov-report=term-missing
Report the test count and pass/fail status. Note the count for the changelog entry:
- **tests/test_<module>.py**: N unit tests for <description>.
Use when the user says "improve my coverage", "fill the gaps", or coverage reports show low percentages.
Step 1: Identify uncovered code
Run coverage and parse the Missing column to identify:
Step 2: Prioritize by risk
Write tests for gaps in this order:
except blocks, validation failuresif/else pathsStep 3: Write gap-filling tests
Add tests to existing test files (don't create new files if a test file already exists for that module). Follow the same structure and conventions as the existing tests.
Step 4: Re-run coverage and report
Show before/after coverage numbers for the affected modules.
TestCase, self.assertEqual) into
a pytest-native project.Source: areed1192/finance-news-aggregator — distributed by TomeVault.