Agent skill
run-tests
Executar testes com workflow TDD
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/run-tests-brunoccteixeira-ta-na-mao
SKILL.md
Comandos Rapidos
# Backend
pytest backend/tests/ # Todos os testes
pytest backend/tests/ -v --cov=app # Com coverage
pytest backend/tests/test_agent.py -v # Arquivo especifico
pytest backend/tests/ -k "test_consulta" # Por nome
# Frontend
cd frontend && npm test # Todos os testes
cd frontend && npm test -- --watch # Watch mode
cd frontend && npm test -- ChatMessage.test.tsx # Arquivo especifico
Workflow TDD (Red -> Green -> Refactor)
1. RED: Escrever teste que falha
# backend/tests/test_nova_feature.py
import pytest
from app.services.nova_feature import processar
@pytest.mark.asyncio
async def test_processar_retorna_resultado_esperado():
resultado = await processar("entrada")
assert resultado == "saida esperada"
2. GREEN: Implementar minimo para passar
# backend/app/services/nova_feature.py
async def processar(entrada: str) -> str:
return "saida esperada"
3. REFACTOR: Melhorar mantendo testes verdes
pytest backend/tests/test_nova_feature.py -v # Verificar que ainda passa
Fixtures Uteis (pytest)
@pytest.fixture
async def db_session():
async with AsyncSessionLocal() as session:
yield session
await session.rollback()
@pytest.fixture
def mock_cpf():
return "12345678901"
@pytest.fixture
def mock_beneficio():
return {"programa": "Bolsa Familia", "valor": 600.0}
Watch Mode
# Backend (usando pytest-watch)
ptw backend/tests/ -- -v
# Frontend
cd frontend && npm test -- --watch
Arquivos de Configuracao
backend/pytest.ini- Configuracao pytestbackend/.coveragerc- Configuracao coveragefrontend/vitest.config.ts- Configuracao Vitest
Coverage Report
pytest backend/tests/ --cov=app --cov-report=html
open backend/htmlcov/index.html
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?