소스 정보
- 저장소
- tomevault-io/skills-registry
- 최근 소스 활동
- 2026년 7월 3일 19:45
- 감지된 SKILL.md 언어
- 영어
- 스타
- 0
- 포크
- 0
설치 방법
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
소스 파일 검토
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
메뉴
기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.
설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill fastapi-run-backend-tests명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | fastapi-run-backend-tests |
| description | > Use when this capability is needed. |
Run pytest with smart defaults and short-name resolution.
Arguments: $ARGUMENTS
Locate the project's backend directory by scanning for common indicators:
# Collect ALL matching backend directories (don't break on first)
MATCHES=""
for dir in backend server app api src; do
if [ -d "$dir" ] && { [ -f "$dir/conftest.py" ] || [ -d "$dir/tests" ]; }; then
MATCHES="$MATCHES $dir"
fi
done
# Fallback: check for conftest.py or tests/ at project root
if [ -f "conftest.py" ] || [ -d "tests" ]; then
MATCHES="$MATCHES ."
fi
echo "Detected: $MATCHES"
If multiple directories found, present the list and ask the user to choose. Do not silently pick the first match — monorepos may have multiple test-bearing directories.
If a short name is given (e.g., auth), resolve it to a full test file path:
# Search by short name pattern
find {backend_dir}/tests -name "*${NAME}*.py" -type f 2>/dev/null
# Search by function name if --func given
grep -rl "def test_${FUNC}" {backend_dir}/tests/ 2>/dev/null
Resolution priority:
test_*.py or *_test.py files--func) → grep across test files to find containing file{backend_dir}/tests/cd {backend_dir} && PYTHONPATH=. pytest {path} -v --tb=short {flags}
| Argument | pytest Flag | Purpose |
|---|---|---|
--coverage | --cov=app --cov-report=term-missing | Show coverage with uncovered lines |
--collect-only | --collect-only -q | List test names without running |
-x | -x | Stop on first failure |
--file <name> | Resolved path | Run specific file |
--func <name> | -k <name> | Run tests matching name pattern |
# Run all tests
PYTHONPATH=. pytest tests/ -v --tb=short
# Run with coverage
PYTHONPATH=. pytest tests/ -v --cov=app --cov-report=term-missing
# Run specific test file by short name
PYTHONPATH=. pytest tests/test_auth.py -v --tb=short
# Run specific test function
PYTHONPATH=. pytest tests/test_auth.py::test_login_success -v --tb=short
# Run tests matching a keyword
PYTHONPATH=. pytest tests/ -v -k "auth and not admin"
# List tests without running
PYTHONPATH=. pytest tests/ --collect-only -q
Backend Tests: PASSED — {N} passed in {duration}s
If --coverage was used, include coverage summary:
Coverage: {X}% overall | {Y}% app/ | {Z}% models/
Uncovered: app/routes/admin.py:45-67, app/services/email.py:23-31
Backend Tests: FAILED — {N} passed, {M} failed
Failed Tests:
tests/test_auth.py::test_login_expired_token — AssertionError: 401 != 200
tests/test_users.py::test_create_duplicate — IntegrityError
Auto-invoking /fix-loop (STEP 7)...
Categorize failures using these standard categories:
ASSERTION_FAILURE — expected vs actual mismatchRUNTIME_EXCEPTION — unhandled exceptionFIXTURE_MISMATCH — setup/teardown issueMISSING_IMPORT — import not foundTIMEOUT — test exceeded time limit| Result | Action |
|---|---|
| All passed | Report success, suggest broader suite if only subset was run |
| Failures found | Auto-invoke /fix-loop (see STEP 7) |
| Coverage below 80% | Highlight uncovered files, suggest /tdd-failing-test-generator for gap filling |
| Flaky tests detected | Suggest re-running with --count=3 (pytest-repeat) to confirm |
Write machine-readable results to test-results/fastapi-run-backend-tests.json:
{
"skill": "fastapi-run-backend-tests",
"result": "PASSED|FAILED",
"timestamp": "<ISO-8601>",
"tests_run": "<total_count>",
"tests_failed": "<failed_count>",
"failures": [
{
"test": "<test_file>::<test_function>",
"category": "ASSERTION_FAILURE|RUNTIME_EXCEPTION|FIXTURE_MISMATCH|MISSING_IMPORT|TIMEOUT",
"file": "<test_file_path>:<line>",
"message": "<error_message>"
}
]
}
Create test-results/ directory if it doesn't exist. This JSON is consumed by downstream stage gates.
mkdir -p test-results
python3 -c "
import json, datetime
result = {
'skill': 'fastapi-run-backend-tests',
'result': '<PASSED_or_FAILED>',
'timestamp': datetime.datetime.now(datetime.timezone.utc).isoformat(),
'tests_run': '<N>',
'tests_failed': '<N>',
'failures': []
}
with open('test-results/fastapi-run-backend-tests.json', 'w') as f:
json.dump(result, f, indent=2)
"
If tests failed in STEP 4, automatically invoke the fix-and-learn pipeline. Do NOT just suggest — invoke directly.
Failure-count guard: If >10 test failures, report the count to the user and ask before auto-invoking /fix-loop — mass failures usually indicate an environment issue or broken import, not 10+ independent bugs. Fixing blindly wastes iterations and risks cascading changes.
Skill("fix-loop", args="<failure_output>\n\nretest_command: cd {backend_dir} && PYTHONPATH=. pytest {resolved_path} -v --tb=short -x")
This iterates: analyze → fix → retest until green (max 5 iterations).
If /fix-loop reports result: PASSED or result: FIXED:
Skill("learn-n-improve", args="session")
If /learn-n-improve is not available in this project, skip this step silently.
If /fix-loop exhausts 5 iterations without success:
/systematic-debugging for deeper investigationDo NOT auto-invoke fix-loop if:
--collect-only was used (no actual test execution)backend/PYTHONPATH=. to ensure cross-module imports work--tb=short for readable output (unless user requests --tb=long)/fix-loop on failure — do not just suggest itbackend/ — detect itPYTHONPATH=. — imports will breakSource: abhayla/claude-best-practices — distributed by TomeVault.