agentleFS
UfukCetinkaya57UfukCetinkaya57/backend-governance/.claude/skills/test-scaffold/SKILL.md

test-scaffold

Skill0 starsChanged 5 months agoMITView on GitHub

Test dosyasi olusturma pattern'leri - naming, yapi, edge case uretimi

4 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Test yazarken bu proseduru takip et.

    line 9
  2. Very specific:

    Test dosyasi, test edilen dosyanin yaninda veya tests/ klasorunde

    line 21
  3. Distinctive:

    Test ismi ne test ettigini acikca belirtmeli:

    line 41

≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Test Scaffold

Test yazarken bu proseduru takip et. Her test dosyasi icin standart yapi, naming ve minimum edge case listesi uygula.

Test Dosyasi Yapisi

1. Dosya Konumu ve Isimlendirme

Mevcut projenin test yapisini incele:

Glob: **/*.test.*, **/*.spec.*, **/tests/**, **/test/**, **/*Tests*, **/*Test.*

Mevcut pattern'e uy. Pattern yoksa:

  • Test dosyasi, test edilen dosyanin yaninda veya tests/ klasorunde
  • Isimlendirme: {dosya-adi}.test.{ext} veya {dosya-adi}.spec.{ext}

2. Test Yapisi (AAA)

Her test 3 bolumden olusur:

Arrange  → Test ortamini hazirla (data, mock, config)
Act      → Test edilecek aksiyonu calistir (TEK bir cagri)
Assert   → Sonucu dogrula (beklenen vs gerceklesen)

Kurallar:

  • Her test TEK bir davranisi test eder
  • Testler birbirine bagimli OLMAZ
  • Her test kendi verisini olusturur ve temizler

3. Test Isimlendirme

Test ismi ne test ettigini acikca belirtmeli:

Pattern: Should_{BeklenenSonuc}_When_{Kosul}

Ornekler:

  • Should_ReturnNotFound_When_UserDoesNotExist
  • Should_CreateUser_When_ValidInput
  • Should_Return401_When_TokenExpired
  • Should_ThrowValidationError_When_EmailInvalid

Stack'e gore camelCase veya snake_case kullan (mevcut convention'a uy).

Minimum Test Senaryolari

Service (Unit Test) Icin

Her service metodu icin EN AZ:

  1. Happy path — dogru input, basarili sonuc
  2. Gecersiz input — null, bos, yanlis tip
  3. Bulunamadi — var olmayan kaynak (ID yok, kullanici yok)
  4. Yetki hatasi — yetkisiz erisim denemesi (auth varsa)
  5. Edge case — sinir degerleri (0, max, negatif, cok uzun string)

Endpoint (Integration Test) Icin

Her endpoint icin EN AZ:

  1. 200/201 — basarili istek, dogru response body
  2. 400/422 — gecersiz input, validation hata mesaji kontrolu
  3. 401 — token'siz/gecersiz token ile erisim
  4. 403 — yetkisiz rol ile erisim (RBAC varsa)
  5. 404 — var olmayan kaynak
  6. 409 — cakisma (unique constraint varsa — duplicate email, vb.)

Edge Case Uretici

Asagidaki listeyi her test icin tara, uygulanabilir olanlari yaz:

KategoriDegerler
String"", " ", null, undefined, 1000+ karakter, unicode, emoji, <script>, SQL injection (' OR 1=1)
Sayi0, -1, MAX_INT, NaN, Infinity, ondalikli
Array/Liste[], tek eleman, 1000+ eleman, duplicate eleman
Tarihgecmis, gelecek, bugun, null, gecersiz format
IDvar olmayan, baskasina ait (IDOR), gecersiz format
Concurrentayni istek 2 kez ayni anda (race condition)

Mock Kurallari

  • Mock'la: Dis servisler (API, email, SMS), DB (unit test'te), dosya sistemi
  • Mock'lama: Is mantigi, validation, test edilen sinifin kendisi
  • Kural: Sadece test sinirlarinin DISINDAKI bagimliliklari mock'la
  • Asiri mock = gercek davranisi kacirirsin, test anlamsizlasir

Test Kontrol (Yazdiktan Sonra)

  • Her test TEK bir davranisi test ediyor mu?
  • Test isimleri aciklayici mi?
  • Happy path VE error path var mi?
  • Edge case'ler var mi? (en az 3)
  • Testler birbirinden bagimsiz mi?
  • Deterministic mi? (tarih, random, sira bagimli DEGIL mi?)
  • Assert'siz test yok mu? (her test bir sey dogrulamali)
  • Mock sadece dis bagimliliklarda mi?

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.