Best fit
- Usar este skill al escribir nuevas funcionalidades, corregir bugs o refactorizar código. Aplica el desarrollo guiado por pruebas con 80%+ de cobertura incluyendo pruebas unitarias, de integración y E2E.
affaan-m/ECC
Usar este skill al escribir nuevas funcionalidades, corregir bugs o refactorizar código. Aplica el desarrollo guiado por pruebas con 80%+ de cobertura incluyendo pruebas unitarias, de integración y E2E.
npx skills add https://github.com/affaan-m/ECC --skill "docs/es/skills/tdd-workflow"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Reorganized from the pinned upstream SKILL.md
According to the pinned SKILL.md from affaan-m/ECC: Este skill garantiza que todo el desarrollo de código siga los principios TDD con cobertura de pruebas completa.
npx skills add https://github.com/affaan-m/ECC --skill "docs/es/skills/tdd-workflow"Best fit
Bring this context
Expected outputs
Key source sections
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
Escribir nuevas funcionalidades
SIEMPRE escribir primero las pruebas, luego implementar el código para que pasen.
SIEMPRE escribir primero las pruebas, luego implementar el código para que pasen.
Mínimo 80% de cobertura (unit + integración + E2E)
Funciones y utilidades individuales
SkillSignal prompt templates
These prompts were written by SkillSignal from the source structure; they are not upstream text.
Task-start prompt
Confirm source fit, inputs, and outputs before acting.
Use tdd-workflow to help me with: [specific task]. Context: [files, data, or background]. Constraints: [environment, scope, and prohibited actions]. Before acting, check the pinned SKILL.md and explain which sections apply, what inputs are still missing, and what you will deliver.
Source-guided execution
Make the Agent explicitly follow the key extracted sections.
Apply the pinned tdd-workflow source to [task]. Pay particular attention to these source sections: “Cuándo Activar”, “Principios Fundamentales”, “1. Pruebas ANTES del Código”, “2. Requisitos de Cobertura”, “3. Tipos de Prueba”. Preserve the important decision at each step. Mark facts not covered by the source as “needs confirmation” instead of inventing them. Then verify the result against my acceptance criteria: [criteria].
Result-review prompt
Check omissions, permissions, and source drift before delivery.
Review the current tdd-workflow result: (1) does it satisfy the original task; (2) were any applicable steps or limits in the pinned SKILL.md missed; (3) did it perform any unauthorized file, command, network, or data action; and (4) which conclusions remain unverified? List issues first, then fix only what the source or user authorization supports.
Output checklist
The task matches the purpose documented in the SKILL.md.
The source section “Cuándo Activar” has been checked.
The source section “Principios Fundamentales” has been checked.
The source section “1. Pruebas ANTES del Código” has been checked.
The source section “2. Requisitos de Cobertura” has been checked.
Inputs, constraints, and acceptance criteria are explicit.
Unverified facts, compatibility, and outcome claims are clearly marked.
Any file, command, network, or data action has been reviewed.
Choose a different workflow
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailUse this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailUse this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
A separate implementation from affaan-m/ECC; compare its source, maintenance signals, and permission requirements.
Open source detailFAQ
Este skill garantiza que todo el desarrollo de código siga los principios TDD con cobertura de pruebas completa.
The catalog detected this source-specific install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/es/skills/tdd-workflow". Inspect the command and pinned source before running it.
No dedicated Agent platform is declared in the pinned source record.
Quality breakdown
Based on traceable docs and repository signals; stars are not treated as quality.
Compare before choosing
These links are selected from shared tasks, functions, stacks, platforms, and same-name variants. Compare the source owner, documentation, permissions, and maintenance signals.
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
새 기능 작성, 버그 수정 또는 코드 리팩터링 시 이 스킬을 사용하세요. 단위, 통합, E2E 테스트를 포함한 80% 이상의 커버리지로 테스트 주도 개발을 시행합니다.
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.
Este skill garantiza que todo el desarrollo de código siga los principios TDD con cobertura de pruebas completa.
SIEMPRE escribir primero las pruebas, luego implementar el código para que pasen.
HEAD actual en la rama activa y pertenezca a la secuencia de la tarea actualComo [rol], quiero [acción], para que [beneficio]
Ejemplo:
Como usuario, quiero buscar mercados semánticamente,
para encontrar mercados relevantes incluso sin palabras clave exactas.
Para cada journey de usuario, crear casos de prueba completos:
describe('Semantic Search', () => {
it('returns relevant markets for query', async () => {
// Implementación de la prueba
})
it('handles empty query gracefully', async () => {
// Probar caso borde
})
it('falls back to substring search when Redis unavailable', async () => {
// Probar comportamiento de fallback
})
it('sorts results by similarity score', async () => {
// Probar lógica de ordenamiento
})
})
npm test
# Las pruebas deben fallar — aún no hemos implementado
Este paso es obligatorio y es la compuerta ROJO para todos los cambios en producción.
Antes de modificar lógica de negocio u otro código de producción, se debe verificar un estado ROJO válido mediante una de estas rutas:
Una prueba que solo se escribió pero no se compiló y ejecutó no cuenta como ROJO.
No editar código de producción hasta que este estado ROJO esté confirmado.
Si el repositorio está bajo Git, crear un commit de checkpoint inmediatamente después de que esta etapa esté validada. Formato de mensaje de commit recomendado:
test: add reproducer for <feature or bug>Escribir el código mínimo para que las pruebas pasen:
// Implementación guiada por las pruebas
export async function searchMarkets(query: string) {
// Implementación aquí
}
Si el repositorio está bajo Git, preparar la corrección mínima ahora pero diferir el commit de checkpoint hasta que VERDE esté validado en el Paso 5.
npm test
# Las pruebas ahora deben pasar
Volver a ejecutar el mismo objetivo de prueba relevante después de la corrección y confirmar que la prueba anteriormente fallida ahora está en VERDE.
Solo después de un resultado VERDE válido se puede proceder a refactorizar.
Si el repositorio está bajo Git, crear un commit de checkpoint inmediatamente después de que VERDE esté validado. Formato de mensaje de commit recomendado:
fix: <feature or bug>Mejorar la calidad del código manteniendo las pruebas en verde:
Si el repositorio está bajo Git, crear un commit de checkpoint inmediatamente después de que el refactor esté completo y las pruebas sigan en verde. Formato de mensaje de commit recomendado:
refactor: clean up after <feature or bug> implementationnpm run test:coverage
# Verificar que se alcanzó 80%+ de cobertura
import { render, screen, fireEvent } from '@testing-library/react'
import { Button } from './Button'
describe('Button Component', () => {
it('renders with correct text', () => {
render(<Button>Click me</Button>)
expect(screen.getByText('Click me')).toBeInTheDocument()
})
it('calls onClick when clicked', () => {
const handleClick = jest.fn()
render(<Button onClick={handleClick}>Click</Button>)
fireEvent.click(screen.getByRole('button'))
expect(handleClick).toHaveBeenCalledTimes(1)
})
it('is disabled when disabled prop is true', () => {
render(<Button disabled>Click</Button>)
expect(screen.getByRole('button')).toBeDisabled()
})
})
import { NextRequest } from 'next/server'
import { GET } from './route'
describe('GET /api/markets', () => {
it('returns markets successfully', async () => {
const request = new NextRequest('http://localhost/api/markets')
const response = await GET(request)
const data = await response.json()
expect(response.status).toBe(200)
expect(data.success).toBe(true)
expect(Array.isArray(data.data)).toBe(true)
})
it('validates query parameters', async () => {
const request = new NextRequest('http://localhost/api/markets?limit=invalid')
const response = await GET(request)
expect(response.status).toBe(400)
})
it('handles database errors gracefully', async () => {
// Mockear fallo de base de datos
const request = new NextRequest('http://localhost/api/markets')
// Probar manejo de errores
})
})
import { test, expect } from '@playwright/test'
test('user can search and filter markets', async ({ page }) => {
// Navegar a la página de mercados
await page.goto('/')
await page.click('a[href="/markets"]')
// Verificar que la página cargó
await expect(page.locator('h1')).toContainText('Markets')
// Buscar mercados
await page.fill('input[placeholder="Search markets"]', 'election')
// Esperar debounce y resultados
await page.waitForTimeout(600)
// Verificar resultados de búsqueda mostrados
const results = page.locator('[data-testid="market-card"]')
await expect(results).toHaveCount(5, { timeout: 5000 })
// Verificar que los resultados contienen el término de búsqueda
const firstResult = results.first()
await expect(firstResult).toContainText('election', { ignoreCase: true })
// Filtrar por estado
await page.click('button:has-text("Active")')
// Verificar resultados filtrados
await expect(results).toHaveCount(3)
})
test('user can create a new market', async ({ page }) => {
// Hacer login primero
await page.goto('/creator-dashboard')
// Completar formulario de creación de mercado
await page.fill('input[name="name"]', 'Test Market')
await page.fill('textarea[name="description"]', 'Test description')
await page.fill('input[name="endDate"]', '2025-12-31')
// Enviar formulario
await page.click('button[type="submit"]')
// Verificar mensaje de éxito
await expect(page.locator('text=Market created successfully')).toBeVisible()
// Verificar redirección a la página del mercado
await expect(page).toHaveURL(/\/markets\/test-market/)
})
src/
├── components/
│ ├── Button/
│ │ ├── Button.tsx
│ │ ├── Button.test.tsx # Pruebas unitarias
│ │ └── Button.stories.tsx # Storybook
│ └── MarketCard/
│ ├── MarketCard.tsx
│ └── MarketCard.test.tsx
├── app/
│ └── api/
│ └── markets/
│ ├── route.ts
│ └── route.test.ts # Pruebas de integración
└── e2e/
├── markets.spec.ts # Pruebas E2E
├── trading.spec.ts
└── auth.spec.ts
jest.mock('@/lib/supabase', () => ({
supabase: {
from: jest.fn(() => ({
select: jest.fn(() => ({
eq: jest.fn(() => Promise.resolve({
data: [{ id: 1, name: 'Test Market' }],
error: null
}))
}))
}))
}
}))
jest.mock('@/lib/redis', () => ({
searchMarketsByVector: jest.fn(() => Promise.resolve([
{ slug: 'test-market', similarity_score: 0.95 }
])),
checkRedisHealth: jest.fn(() => Promise.resolve({ connected: true }))
}))
jest.mock('@/lib/openai', () => ({
generateEmbedding: jest.fn(() => Promise.resolve(
new Array(1536).fill(0.1) // Mock de embedding de 1536 dimensiones
))
}))
npm run test:coverage
{
"jest": {
"coverageThresholds": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
}
}
}
// No probar estado interno
expect(component.state.count).toBe(5)
// Probar lo que los usuarios ven
expect(screen.getByText('Count: 5')).toBeInTheDocument()
// Se rompe fácilmente
await page.click('.css-class-xyz')
// Resiliente a cambios
await page.click('button:has-text("Submit")')
await page.click('[data-testid="submit-button"]')
// Las pruebas dependen unas de otras
test('creates user', () => { /* ... */ })
test('updates same user', () => { /* depende de la prueba anterior */ })
// Cada prueba configura sus propios datos
test('creates user', () => {
const user = createTestUser()
// Lógica de prueba
})
test('updates user', () => {
const user = createTestUser()
// Lógica de actualización
})
npm test -- --watch
# Las pruebas se ejecutan automáticamente al cambiar archivos
# Se ejecuta antes de cada commit
npm test && npm run lint
# GitHub Actions
- name: Run Tests
run: npm test -- --coverage
- name: Upload Coverage
uses: codecov/codecov-action@v3
Recuerda: Las pruebas no son opcionales. Son la red de seguridad que permite refactorización con confianza, desarrollo rápido y confiabilidad en producción.