Skip to content
cccskills
FreePublished on GitHub

test-first

Drive one feature through a strict TDD Red-Green-Refactor cycle with checklists for each phase. Use when implementing new functionality test-first, or when the user runs /test-first.

The English summary is being prepared. Showing the original description.

See how to install

Files included (1)

  • SKILL.md1.8 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Test-Driven Development

Implement TDD for: $ARGUMENTS

Quick Steps

  1. Write a failing test
  2. Run test, confirm failure
  3. Write minimal code to pass
  4. Refactor while keeping tests green
  5. Repeat

Red Phase - Write Failing Test

Test Design Principles

  • Test one specific behavior
  • Test name describes expected result
  • Test should fail (feature doesn't exist yet)

Must Test

  • Normal case
  • Edge cases
  • Error cases
  • Invalid input

Example

// auth/login.test.ts
it('should return JWT token for valid credentials', async () => {
  const res = await request(app)
    .post('/auth/login')
    .send({ email: 'test@example.com', password: 'password123' })

  expect(res.status).toBe(200)
  expect(res.body.token).toBeDefined()
})

Green Phase - Minimal Implementation

Implementation Principles

  • Write ONLY enough code to pass the test
  • Don't optimize yet
  • Don't worry about elegance
  • Just make it work

Refactor Phase - Clean Up

Refactoring Checklist

  • Is there code duplication?
  • Are variable names clear?
  • Are functions too long?
  • Is the logic too complex?

Refactoring Rules

  • Keep tests passing
  • Change one thing at a time
  • Run tests frequently

Test Quality Checklist

  • Unit tests cover core logic
  • Integration tests cover interactions
  • Test names clearly describe intent
  • Tests are independent and repeatable
  • Tests run fast (unit tests < 100ms)
  • Edge cases are covered

Follow TDD strictly. No shortcuts.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Validate custom agent file format and structure. Use after creating or editing an agent, before committing agent changes, or when an agent fails to load.

The English summary is being prepared. Showing the original description.

claude-world/director-mode-lite80Updated Aug 31, 2026

Generate custom agent from template. Use when creating a new subagent from scratch, or scaffolding an agent file with correct frontmatter.

The English summary is being prepared. Showing the original description.

claude-world/director-mode-lite80Updated Aug 31, 2026

agents

Free

List all available agents (core, expert, self-evolving). Use when the user asks what agents are available or runs /agents.

The English summary is being prepared. Showing the original description.

claude-world/director-mode-lite80Updated Aug 31, 2026

TDD-based autonomous development loop with checkpoint recovery and observability changelog

The English summary is being prepared. Showing the original description.

claude-world/director-mode-lite80Updated Aug 31, 2026

View and manage the runtime changelog for observability

The English summary is being prepared. Showing the original description.

claude-world/director-mode-lite80Updated Aug 31, 2026

Track development session events in a daily markdown changelog, including file changes, test results, and key decisions.

The English summary is being prepared. Showing the original description.

claude-world/director-mode-lite80Updated Aug 31, 2026

See all skills by claude-world

Report a problem with this skill