tdd-workflow
Detailed TDD workflow with examples, rationales, and anti-patterns.
Skill by pedromsmoreira
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/pedromsmoreira-tdd-workflow
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: testing, productivity
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/tdd-workflow
Tools it pre-approves 6
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Read,Write,Edit,Glob,Grep,Bash
What's inside
- Skill name
tdd-workflow- Description
- Detailed TDD workflow with examples, rationales, and anti-patterns. Use when following Red-Green-Refactor cycle.
- License
- MIT
- Allowed tools
- Read,, Write,, Edit,, Glob,, Grep,, Bash
- Instructions
- 323 lines in SKILL.md · view on GitHub
Before installing
- Pre-approves any shell command
Files (1)
- SKILL.md
SKILL.md (first lines)
# TDD Workflow
Detailed workflow for Test-Driven Development. For core principles, see `../../rules/test-driven-development.mdc`.
---
## The Cycle
```
RED (failing test) → GREEN (minimal code) → REFACTOR (clean up) → Repeat
```
---
## RED Phase - Write Failing Test
Write one minimal test showing what should happen.
### Good Example
```go
func TestRetryOperation_WithFailingOperation_RetriesThreeTimes(t *testing.T) {
t.Run("retries until success", func(t *testing.T) {
attempts := 0
operation := func() (string, error) {
attempts++
if attempts < 3 {
return "", errors.New("fail")
}
return "success", nil
}
result, err := RetryOperation(operation)
assert.NoError(t, err)
assert.Equal(t, "success", result)
assert.Equal(t, 3, attempts)
})
}
```
Clear name, tests real behavior, one thing.
### Bad Example
```go
func TestRetry(t *testing.T) {
t.Run("works", func(t *testing.T) {
mockFn := new(mocks.MockOperation)
mockFn.On("Execute").Return("", errors.New("fail")).Twice()
mockFn.On("Execute").Return("success", nil).Once()
RetryOperation(mockFn.Execute)
mockFn.AssertNumberOfCalls(t, "Execute", 3)
})
}
```
Vague name, tests mock not code.
**Do not use string-based expectations like `On("MethodName", ...)`.** For Go, use gomock with generated mocks and `EXPECT().MethodName(...)` so refactoring method names causes compile errors. See go-testing-practices.mdc.
### RED Phase Requirements
- One behavior per test
- Clear, descriptive name
- Real code (no mocks unless unavoidable)
---
## Verify RED - Watch It Fail
**MANDATORY. Never skip.**
```bash
go test -v ./path/to/package -run TestRetryOperation
```
Confirm:
- Test fails (not errors)
- Failure message is expected
- Fails because feature missing (not typos)
**Test passes?** You're testing existing behavior. Fix test.
**Test errors?** Fix error, re-run until it fails correctly.
---
## GREEN Phase - Minimal Code
Write simplest code to pass the test.
### Good Example
```go
func RetryOperation(fn func() (string, error)) (string, error) {
for i := 0; i < 3; i++ {
result, err := fn()
if err == nil {
return result, nil
}
if i == 2 {
return "", err
}
}
return "", errors.New("unreachable")
}
```
Just enough to pass.
### Bad Example
```go
func RetryOperation(
fn func() (string, error),
opts ...RetryOption,
) (string, error) {
config := &RetryConfig{
MaxRetries: 3,From pedromsmoreira/ai-configs, MIT.
More from pedromsmoreira/ai-configs
- 0.497score
conventional-commits
pedromsmoreira
Formats and validates commit messages per Conventional Commits (header grammar, optional body and footers, breaking changes).
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
go-backend
pedromsmoreira
Implements and modifies Go backend services for this project—gRPC handlers, services, domain logic, repositories, and Protocol Buffers—following idiomatic Go…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
http-rest-endpoints
pedromsmoreira
Create HTTP handlers and REST endpoints following shrtner project standards.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
rest-api-design
pedromsmoreira
Designs REST and HTTP endpoints for this project—URL structure, HTTP methods, status codes, request/response patterns, error handling, and versioning.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
git-commit
pedromsmoreira
Creates git commits safely with Conventional Commits messages.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
database-migrations
pedromsmoreira
Creates and manages PostgreSQL schema migrations with golang-migrate for this project.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
frontend-react
pedromsmoreira
Builds React 18+ and TypeScript UI for this project—components, Material-UI, Zustand, React Query, and REST API integration.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
user-stories
pedromsmoreira
Writes user stories, acceptance criteria, and backlog items for this project.
SkillCFreshness: C★ 1Claude Code +9 - 0.467score
testing
pedromsmoreira
Implements Test-Driven Development for this project—unit tests, integration tests with testcontainers, mocks, and regression tests.
SkillCFreshness: C★ 1Claude Code +9
Signals
- Stars
- 1
- Forks
- 0
- Open issues
- 0
- Last commit (this folder)
- May 9, 2026 (5 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/pedromsmoreira/ai-configs
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from pedromsmoreira
- 0.497score
conventional-commits
pedromsmoreira
Formats and validates commit messages per Conventional Commits (header grammar, optional body and footers, breaking changes).
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
go-backend
pedromsmoreira
Implements and modifies Go backend services for this project—gRPC handlers, services, domain logic, repositories, and Protocol Buffers—following idiomatic Go…
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
http-rest-endpoints
pedromsmoreira
Create HTTP handlers and REST endpoints following shrtner project standards.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
rest-api-design
pedromsmoreira
Designs REST and HTTP endpoints for this project—URL structure, HTTP methods, status codes, request/response patterns, error handling, and versioning.
SkillCFreshness: C★ 1Claude Code +9 - 0.497score
git-commit
pedromsmoreira
Creates git commits safely with Conventional Commits messages.
SkillCFreshness: C★ 1Claude Code +9 - 0.492score
database-migrations
pedromsmoreira
Creates and manages PostgreSQL schema migrations with golang-migrate for this project.
SkillCFreshness: C★ 1Claude Code +9
Cite this page
tdd-workflow skill. Agent Mart. https://agentmart.dev/skills/pedromsmoreira-tdd-workflow (last updated 2026-10-24)