All skills
lexler avatar
by Lada Kesselerlexler/skill-factory238 stars
61

Test-driven development (TDD) process used when writing code. Use whenever you are adding any new code, unless the user explicitly asks to skip TDD or the code is exploratory/spike.

Use this Skill: https://skilld.dev/gh/lexler/skill-factory/tdd

This session only. Nothing lands on disk.

referenceszombies.md

≈522 tokens on demand. Your agent reads this file only when SKILL.md points to it.

ZOMBIES - Test Case Discovery Heuristic

Structure

ZOM axis (simple → complex):

  • Z - Zero: initial state after creation (empty, not full, default values)
  • O - One: first item, first transition
  • M - Many: multiple items, more complex scenarios

BIE considerations (apply at each ZOM level):

  • B - Boundary: transitions between states, both directions (empty↔not-empty, not-full↔full)
  • I - Interface: let tests reveal what methods, parameters, and return types are needed
  • E - Exceptions: error conditions, and verify the object still works after errors

S - Simple scenarios, simple solutions (applies throughout)

Key principles

Test transitions, not just states. Verify moving from empty to not-empty, and back again.

Procrastinate deliberately. Defer implementation until tests demand it. Hard-coded return values are fine - tests will catch if you forget to generalize.

Interface emerges from tests. Don't design the API upfront. Write tests, and the needed methods reveal themselves.

Exceptions come last. Get happy paths working first, then test error conditions. Verify that failed operations don't corrupt the object.

Example: Circular buffer (FIFO)

[TEST] New buffer is empty                               <- Z
[TEST] New buffer is not full                            <- Z
[TEST] Put one item, buffer is not empty                 <- O
[TEST] Put then get returns the item                     <- O + I
[TEST] Put then get, buffer is empty again               <- O + B (transition back)
[TEST] Put three items, get returns them in order        <- M
[TEST] Fill to capacity, buffer is full                  <- M + B
[TEST] Wrap around: fill, empty, refill works            <- M + B
[TEST] Put to full buffer fails                          <- E
[TEST] Get from empty buffer fails                       <- E
[TEST] After failed put, buffer still works              <- E (integrity check)

Source: TDD Guided by ZOMBIES by James Grenning

Source: SKILL.md on GitHub

1 warning6d4 checks · Risk SAFE
  • Gen Agent Trust Hub6d

    The skill defines a structured methodology for Test-Driven Development (TDD) using the ZOMBIES heuristic. It provides clear instructions for the agent to follow a Red-Green-Refactor cycle and includes local reference documentation. No malicious patterns, hidden commands, or security risks were detected.

  • Socket6d

    No alerts

  • Snyk6d

    Risk: LOW · No issues

  • Runlayer7mo

    2/2 files flagged

Signed by skilld at 474433a. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 6 months ago

README badge

README badge for lexler/skill-factory/tdd