implementing-stories

kecbigmt's avatarfrom kecbigmt

Guides the implementation inner loop with TDD practices. Use when coding a feature, writing tests, following red-green-refactor cycle, or working through acceptance criteria incrementally.

⭐0stars🔀0forks📁View on GitHub🕐Updated Jan 2, 2026

When & Why to Use This Skill

This Claude skill automates and enforces the Test-Driven Development (TDD) inner loop, specifically focusing on the Red-Green implementation cycle. It helps developers maintain high code quality by ensuring every feature is driven by failing tests first, followed by minimal functional implementation to pass those tests, thereby reducing bugs and ensuring strict adherence to acceptance criteria.

Use Cases

  • Feature Implementation: Systematically building new software components by defining expected behaviors through tests before writing any functional code.
  • Regression Prevention: Ensuring that new features do not break existing functionality by strictly following a test-first methodology.
  • Technical Debt Management: Tracking implementation progress and identifying areas for future refactoring through automated story log updates and status reporting.
  • Incremental Development: Breaking down complex user stories into small, manageable behaviors that can be verified independently through the Red-Green cycle.
nameimplementing-stories
descriptionImplement using TDD Red-Green cycle. Focus on Red-Green only; refactoring is separate step.

Implementing Stories (Red-Green)

Implement using TDD Red-Green cycle. Refactoring happens separately with fresh context.

Context

Find story log, understand codebase, identify what to implement.

Principles

  • Small steps: one behavior at a time
  • Test-driven: write test first
  • Red-Green focus: get tests passing, skip cleanup

TDD Cycle

Red: Write Failing Test

  • Write test defining behavior
  • Scaffold symbols (avoid "not found")
  • Confirm fails for right reason

Key: Fails because feature missing, not syntax error.

Green: Make It Pass

  • Implement minimum to pass
  • No extras or cleanup
  • Confirm passes

Don't worry about quality/duplication. Refactoring is next phase.

Map Criteria

For each criterion:

  1. Identify behavior
  2. Write test (Given-When-Then)
  3. Implement minimum
  4. Next criterion (skip refactoring)

Update Story Log (REQUIRED)

CRITICAL: Must update before finishing.

### Implementation (Red-Green)

**Status: Complete - Ready for Refactor**

**Implemented:**
- [Criterion]: [Approach]

**Decisions:**
- [Decision]: [Why]

**Tests:**
- [Test file]: [What tests]
- Status: All passing (X)

**Technical debt:**
- [Item]: Duplication needing refactor
- [Item]: Naming improvements

**Next:** Refactor

Steps:

  1. Find story log (docs/stories/**/*.story.md)
  2. Update "Completed Work Summary"
  3. Save and verify

When to Stop

  • All criteria have passing tests
  • All tests pass
  • No syntax/type errors
  • Story log updated

Only after story log updated, pass to Refactor.

Pitfalls

  • Skipping tests
  • Big steps
  • Premature cleanup (resist refactoring)
  • Ignoring error handling
  • Over-implementation