testing-tdd-feature

Scaffold red-green-refactor cycles with failing unit tests for Swift features.

4|1|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill testing-tdd-feature
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-tdd-feature
Source: https://github.com/AutisticAF/claude-code-apple-dev-plugin/tree/main/skills/testing-tdd-feature
Command: npx skills add https://github.com/AutisticAF/claude-code-apple-dev-plugin --skill testing-tdd-feature

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

New feature development often produces uncertain code and hidden edge cases because implementation is written before a clear executable specification. This skill replaces guesswork with a repeatable red‑green‑refactor cycle so features are defined by failing tests and implemented only to satisfy those tests.

Core Features & Use Cases

  • Test-first scaffolding: Guide API design, write failing unit tests, and structure test suites before implementation.
  • Iterative implementation: Instruct the developer or AI to implement the minimal code to make each failing test pass, then refactor.
  • Integration and edge-case planning: Recommend integration tests and edge-case scenarios such as capacity, duplicates, and persistence.
  • Use Case: Create a FavoriteManager feature by first authoring tests for construction, add/remove semantics, duplicate handling, and capacity limits, then implement the class iteratively until all tests pass.

Quick Start

TDD a new FavoriteManager by writing failing tests for construction, add, remove, duplicates, and capacity, then iteratively implement the minimal code to pass each test.

Frequently Asked Questions about testing-tdd-feature

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use test-driven development to build a new feature in Swift?

Test-driven development builds Swift features by writing failing unit tests first, then implementing minimal code to pass them. This skill scaffolds the red-green-refactor cycle to define API surfaces and acceptance criteria before writing implementation logic.

What is the red-green-refactor workflow for unit testing?

The red-green-refactor workflow starts with a failing test, implements minimal code to make it pass, then refactors safely. This skill guides you to run unit tests between each step to ensure new features satisfy executable specifications and handle edge cases.

Can AI-assisted development follow a TDD workflow?

AI-assisted development can follow TDD by using failing unit tests as acceptance criteria and generating minimal implementations to satisfy each test. This skill provides the test scaffolding to keep AI-generated code anchored to executable specifications.

How do I write unit tests for edge cases like duplicates and capacity limits?

Writing unit tests for edge cases like duplicates and capacity limits requires planning integration scenarios during test scaffolding. This skill recommends structuring test suites to cover construction, add/remove semantics, and persistence before implementing the feature.

Does test-first scaffolding work for designing API surfaces in new modules?

Test-first scaffolding works for API surface design by defining module interfaces through failing unit tests before implementation. This skill guides you to author executable acceptance criteria that shape the API and iteratively implement minimal code to pass them.