Ne Zaman Aktifleştirmelisiniz
Yeni özellikler veya fonksiyonellik yazarken
affaan-m/ECC
Yeni özellikler yazarken, hata düzeltirken veya kod refactor ederken bu skill'i kullanın. Unit, integration ve E2E testlerini içeren %80+ kapsam ile test güdümlü geliştirmeyi zorlar.
npx skills add https://github.com/affaan-m/ECC --skill "docs/tr/skills/tdd-workflow"Source checked Jul 28, 2026·Refresh due Oct 26, 2026
Reorganized from the pinned upstream SKILL.md
Bu skill tüm kod geliştirmenin kapsamlı test kapsamı ile TDD ilkelerini takip etmesini sağlar.
npx skills add https://github.com/affaan-m/ECC --skill "docs/tr/skills/tdd-workflow"The pinned source contains enough sections and task detail for a source-grounded deep guide; automated content is still not an independent test.
1,341 source words · 47 usable sections
Testing workflow
Sections are extracted automatically from the pinned SKILL.md and link back to the source.
Yeni özellikler veya fonksiyonellik yazarken
HER ZAMAN önce testleri yazın, sonra testleri geçmesi için kod uygulayın.
HER ZAMAN önce testleri yazın, sonra testleri geçmesi için kod uygulayın.
Minimum %80 kapsam (unit + integration + E2E)
Bireysel fonksiyonlar ve yardımcı araçlar
SkillSignal prompt templates
These prompts were written by SkillSignal from the source structure; they are not upstream text.
Source-grounded prompt
Use for a testing task while explicitly checking the source sections.
Use tdd-workflow for this testing task: [task]. Inputs and constraints: [details]. Work through these pinned SKILL.md sections: “Ne Zaman Aktifleştirmelisiniz”, “Temel İlkeler”, “1. Koddan ÖNCE Testler”, “2. Kapsam Gereksinimleri”, “3. Test Tipleri”. Cite the concrete requirements that shape each step, do not invent capabilities absent from the source, and verify the result against: [acceptance criteria].
Verification checklist
The source section “Ne Zaman Aktifleştirmelisiniz” has been checked.
The source section “Temel İlkeler” has been checked.
The source section “1. Koddan ÖNCE Testler” has been checked.
The source section “2. Kapsam Gereksinimleri” has been checked.
Static permission evidence
These are source excerpts matched by deterministic rules, not findings of malicious behavior, safety, or actual execution.
SKILL.md · L80
npm testThe documentation asks the agent to run terminal commands or scripts.
SKILL.md · L96
npm testThe documentation asks the agent to run terminal commands or scripts.
SKILL.md · L149
const request = new NextRequest('http://localhost/api/markets')The documentation includes network, browsing, or remote request actions.
SKILL.md · L159
const request = new NextRequest('http://localhost/api/markets?limit=invalid')The documentation includes network, browsing, or remote request actions.
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
Bu skill tüm kod geliştirmenin kapsamlı test kapsamı ile TDD ilkelerini takip etmesini sağlar.
The source record exposes this install command: npx skills add https://github.com/affaan-m/ECC --skill "docs/tr/skills/tdd-workflow". Inspect the command and pinned source before running it.
Static rules flagged exec-script, network in the source; the page lists the matching lines and excerpts.
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.
Use it for testing and engineering tasks; the detail page covers purpose, installation, and practical steps.
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.
Bu skill tüm kod geliştirmenin kapsamlı test kapsamı ile TDD ilkelerini takip etmesini sağlar.
HER ZAMAN önce testleri yazın, sonra testleri geçmesi için kod uygulayın.
[Rol] olarak, [eylem] yapmak istiyorum, böylece [fayda] elde ederim
Örnek:
Kullanıcı olarak, marketleri semantik olarak aramak istiyorum,
böylece tam anahtar kelimeler olmasa bile ilgili marketleri bulabilirim.
Her kullanıcı hikayesi için kapsamlı test senaryoları oluşturun:
describe('Semantik Arama', () => {
it('sorgu için ilgili marketleri döndürür', async () => {
// Test implementasyonu
})
it('boş sorguyu zarif şekilde işler', async () => {
// Uç durumu test et
})
it('Redis kullanılamazsa substring aramaya geri döner', async () => {
// Fallback davranışını test et
})
it('sonuçları benzerlik skoruna göre sıralar', async () => {
// Sıralama mantığını test et
})
})
npm test
# Testler başarısız olmalı - henüz implement etmedik
Testleri geçmesi için minimal kod yazın:
// Testler tarafından yönlendirilen implementasyon
export async function searchMarkets(query: string) {
// Implementasyon buraya
}
npm test
# Testler artık geçmeli
Testleri yeşil tutarken kod kalitesini iyileştirin:
npm run test:coverage
# %80+ kapsam sağlandığını doğrula
import { render, screen, fireEvent } from '@testing-library/react'
import { Button } from './Button'
describe('Button Bileşeni', () => {
it('doğru metinle render eder', () => {
render(<Button>Tıkla</Button>)
expect(screen.getByText('Tıkla')).toBeInTheDocument()
})
it('tıklandığında onClick\'i çağırır', () => {
const handleClick = jest.fn()
render(<Button onClick={handleClick}>Tıkla</Button>)
fireEvent.click(screen.getByRole('button'))
expect(handleClick).toHaveBeenCalledTimes(1)
})
it('disabled prop true olduğunda devre dışı kalır', () => {
render(<Button disabled>Tıkla</Button>)
expect(screen.getByRole('button')).toBeDisabled()
})
})
import { NextRequest } from 'next/server'
import { GET } from './route'
describe('GET /api/markets', () => {
it('marketleri başarıyla döndürür', 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('query parametrelerini validate eder', async () => {
const request = new NextRequest('http://localhost/api/markets?limit=invalid')
const response = await GET(request)
expect(response.status).toBe(400)
})
it('veritabanı hatalarını zarif şekilde işler', async () => {
// Veritabanı başarısızlığını mock'la
const request = new NextRequest('http://localhost/api/markets')
// Hata işlemeyi test et
})
})
import { test, expect } from '@playwright/test'
test('kullanıcı marketleri arayabilir ve filtreleyebilir', async ({ page }) => {
// Markets sayfasına git
await page.goto('/')
await page.click('a[href="/markets"]')
// Sayfanın yüklendiğini doğrula
await expect(page.locator('h1')).toContainText('Markets')
// Marketleri ara
await page.fill('input[placeholder="Marketleri ara"]', 'election')
// Debounce ve sonuçları bekle
await page.waitForTimeout(600)
// Arama sonuçlarının gösterildiğini doğrula
const results = page.locator('[data-testid="market-card"]')
await expect(results).toHaveCount(5, { timeout: 5000 })
// Sonuçların arama terimini içerdiğini doğrula
const firstResult = results.first()
await expect(firstResult).toContainText('election', { ignoreCase: true })
// Duruma göre filtrele
await page.click('button:has-text("Aktif")')
// Filtrelenmiş sonuçları doğrula
await expect(results).toHaveCount(3)
})
test('kullanıcı yeni market oluşturabilir', async ({ page }) => {
// Önce login ol
await page.goto('/creator-dashboard')
// Market oluşturma formunu doldur
await page.fill('input[name="name"]', 'Test Market')
await page.fill('textarea[name="description"]', 'Test açıklama')
await page.fill('input[name="endDate"]', '2025-12-31')
// Formu gönder
await page.click('button[type="submit"]')
// Başarı mesajını doğrula
await expect(page.locator('text=Market başarıyla oluşturuldu')).toBeVisible()
// Market sayfasına yönlendirmeyi doğrula
await expect(page).toHaveURL(/\/markets\/test-market/)
})
src/
├── components/
│ ├── Button/
│ │ ├── Button.tsx
│ │ ├── Button.test.tsx # Unit testler
│ │ └── Button.stories.tsx # Storybook
│ └── MarketCard/
│ ├── MarketCard.tsx
│ └── MarketCard.test.tsx
├── app/
│ └── api/
│ └── markets/
│ ├── route.ts
│ └── route.test.ts # Integration testler
└── e2e/
├── markets.spec.ts # E2E testler
├── 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 1536-boyutlu embedding
))
}))
npm run test:coverage
{
"jest": {
"coverageThresholds": {
"global": {
"branches": 80,
"functions": 80,
"lines": 80,
"statements": 80
}
}
}
}
// İç state'i test etme
expect(component.state.count).toBe(5)
// Kullanıcıların gördüğünü test et
expect(screen.getByText('Sayı: 5')).toBeInTheDocument()
// Kolayca bozulur
await page.click('.css-class-xyz')
// Değişikliklere karşı dayanıklı
await page.click('button:has-text("Gönder")')
await page.click('[data-testid="submit-button"]')
// Testler birbirine bağımlı
test('kullanıcı oluşturur', () => { /* ... */ })
test('aynı kullanıcıyı günceller', () => { /* önceki teste bağımlı */ })
// Her test kendi verisini hazırlar
test('kullanıcı oluşturur', () => {
const user = createTestUser()
// Test mantığı
})
test('kullanıcı günceller', () => {
const user = createTestUser()
// Güncelleme mantığı
})
npm test -- --watch
# Dosya değişikliklerinde testler otomatik çalışır
# Her commit öncesi çalışır
npm test && npm run lint
# GitHub Actions
- name: Run Tests
run: npm test -- --coverage
- name: Upload Coverage
uses: codecov/codecov-action@v3
Unutmayın: Testler opsiyonel değildir. Güvenli refactoring, hızlı geliştirme ve production güvenilirliği sağlayan güvenlik ağıdırlar.