一键导入
unit-testing
Genera tests unitarios e integración para backend y/o frontend. Lee la spec y el código implementado. Requiere spec APPROVED e implementación completa.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Genera tests unitarios e integración para backend y/o frontend. Lee la spec y el código implementado. Requiere spec APPROVED e implementación completa.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orquesta el flujo ASDD completo. Fase 1 (Spec) → Fase 2 (Backend ∥ Frontend) → Fase 3 (Tests ∥) → Fase 4 (QA).
Propone qué flujos automatizar, con qué framework, en qué orden y bajo qué criterios de ROI. Evalúa repetitividad, estabilidad, impacto y costo manual para priorizar la hoja de ruta de automatización.
Genera una spec técnica ASDD en .github/specs/<feature>.spec.md. Obligatorio antes de cualquier implementación.
Mapea flujos críticos, genera escenarios Gherkin y define datos de prueba desde la spec. Output en docs/output/qa/.
Implementa un feature completo en el backend. Requiere spec con status APPROVED en .github/specs/.
Implementa un feature completo en el frontend. Requiere spec con status APPROVED en .github/specs/.
| name | unit-testing |
| description | Genera tests unitarios e integración para backend y/o frontend. Lee la spec y el código implementado. Requiere spec APPROVED e implementación completa. |
| argument-hint | <nombre-feature> [backend|frontend|ambos] |
.github/specs/<feature>.spec.md (criterios de aceptación)
código implementado en backend/ y/o frontend/
.claude/rules/backend.md (stack de test: pytest + pytest-asyncio)
.claude/rules/frontend.md (stack de test: Vitest + Testing Library)
backend/tests/| Archivo | Cubre |
|---|---|
routes/test_<feature>_router.py | Endpoints: 200/201, 400, 401, 404, 422 |
services/test_<feature>_service.py | Lógica: happy path + errores de negocio |
repositories/test_<feature>_repository.py | Queries: parámetros y retornos correctos |
frontend/src/__tests__/| Archivo | Cubre |
|---|---|
components/<Feature>.test.* | Render + interacciones (click, submit) |
hooks/use<Feature>.test.* | Estado inicial + respuesta API + error handling |
pages/<Feature>Page.test.* | Render completo con providers |
# Backend — AAA con AsyncMock (pytest-asyncio)
@pytest.mark.asyncio
async def test_create_success():
# GIVEN
repo = AsyncMock()
repo.find_by_name.return_value = None
repo.insert.return_value = {"id": "abc", "name": "test"}
# WHEN
result = await FeatureService(repo).create(FeatureCreate(name="test"))
# THEN
assert result["id"] == "abc"
repo.insert.assert_called_once()
// Frontend — mock service + renderHook (Vitest + Testing Library)
vi.mock('../../services/featureService');
getFeatures.mockResolvedValue([{ id: '1' }]);
const { result } = renderHook(() => useFeature());
await waitFor(() => expect(result.current.items).toHaveLength(1));
Ver .claude/rules/testing.md — AAA, aislamiento, determinismo, cobertura ≥ 80%.
tests/ o __tests__/. No modificar código fuente.