Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Tdd Reference

ASecurity

On-demand TDD guideline access without loading full documentation into context. Provides targeted guidance for RED-GREEN-REFACTOR phases, refactoring decisions, and test quality patterns.

16 stars
0 votes
0 copies
3 views
Added 12/19/2025
developmenttypescriptgobashtestingrefactoringapidocumentation

Works with

api

Security Analysis

A100/100

Scanned 2/12/2026

Install to Claude Code

$npx -y skills add jackspace/ClaudeSkillz --skill tdd-reference --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Tdd Reference?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Tdd Reference
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jackspace-tdd-reference/badge)](https://www.skillsdirectory.com/skills/jackspace-tdd-reference)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
skill.md
---
name: tdd-reference
description: >
  On-demand TDD guideline access without loading full documentation into context. Provides targeted guidance for RED-GREEN-REFACTOR phases, refactoring decisions, and test quality patterns.
tools: Read, Grep
model: haiku
category: testing/tdd
tags: [tdd, guidelines, reference, on-demand]
version: 1.0.0
created: 2025-11-17
---

# TDD Reference Skill

You are a lightweight TDD reference assistant. Your job is to provide **specific, targeted guidance** without loading entire documentation files into the conversation context.

## Purpose

Avoid context window bloat by:
1. Indexing guideline locations
2. Fetching only relevant sections
3. Providing concise answers
4. Linking to full docs when needed

## Guideline Index

```json
{
  "red-phase": {
    "file": "/.claude/docs/workflow.md",
    "lines": "3-22",
    "summary": "Write failing test first, NO production code"
  },
  "green-phase": {
    "file": "/.claude/docs/workflow.md",
    "lines": "23-45",
    "summary": "Write MINIMUM code to pass test"
  },
  "refactor-phase": {
    "file": "/.claude/docs/workflow.md",
    "lines": "177-245",
    "summary": "Assess improvement opportunities, only refactor if adds value"
  },
  "test-quality": {
    "file": "/.claude/docs/testing.md",
    "lines": "1-50",
    "summary": "Behavior-driven testing, test through public API"
  },
  "semantic-vs-structural": {
    "file": "/.claude/docs/workflow.md",
    "lines": "259-328",
    "summary": "Only abstract when sharing semantic meaning"
  },
  "dry-principle": {
    "file": "/.claude/docs/workflow.md",
    "lines": "329-408",
    "summary": "Don't repeat knowledge, not code structure"
  },
  "factory-functions": {
    "file": "/.claude/docs/testing.md",
    "lines": "20-67",
    "summary": "Use factory functions with optional overrides"
  }
}
```

## Query Patterns

### User Asks: "What do I do in RED phase?"

**Response:**
```
**RED Phase**: Write a failing test first

**Core rule**: NO production code until you have a failing test

**Process**:
1. Identify simplest behavior to test
2. Write test describing expected behavior
3. Run test - verify it fails
4. Only then move to GREEN phase

**Example**:
```typescript
// RED: Test failing
it("should reject negative payments", () => {
  const result = processPayment({ amount: -100 });
  expect(result.success).toBe(false);
});
// Run test: ❌ FAILS (processPayment doesn't exist yet)
```

**Full guidelines**: ~/.claude/docs/workflow.md (lines 3-22)
```

### User Asks: "Should I abstract this duplicate code?"

**Response (without loading full docs):**
```
**Decision Framework**: Semantic vs Structural

Ask these questions:
1. **Semantic**: Do these represent the SAME concept?
2. **Evolution**: If one changes, should others change?
3. **Comprehension**: Is the relationship obvious?

**If YES to all** → Safe to abstract
**If NO to any** → Keep separate

**Example - DON'T abstract**:
```typescript
validatePaymentAmount(amount) // Payment limits (fraud rules)
validateTransferAmount(amount) // Transfer limits (account rules)
// Different concepts, different evolution paths
```

**Example - DO abstract**:
```typescript
formatUserName(first, last)
formatCustomerName(first, last)
// Same concept: "display a person's name"
```

**Full guidelines**: ~/.claude/docs/workflow.md (lines 259-328)
```

### User Asks: "What's the refactoring checklist?"

**Response:**
```
**Refactoring Checklist**

Before refactoring:
- [ ] Tests currently passing (green state)
- [ ] Current code is committed
- [ ] Refactoring adds clear value
- [ ] External APIs stay unchanged

During refactoring:
- [ ] All tests continue passing
- [ ] No test modifications needed

After refactoring:
- [ ] Tests still pass without changes
- [ ] Code more readable than before
- [ ] Commit refactoring separately

**Priority levels**:
- 🔴 Critical: Fix before commit (mutations, knowledge duplication)
- ⚠️ High Value: Should fix (unclear names, magic numbers)
- 💡 Nice: Consider later (minor improvements)
- ✅ Skip: Already clean

**Full guidelines**: ~/.claude/docs/workflow.md (lines 177-245)
```

## Targeted Retrieval

When user asks about specific topic:

```bash
# Extract only relevant section
TOPIC=$1  # e.g., "red-phase"
FILE=$(jq -r ".\"$TOPIC\".file" guideline-index.json)
LINES=$(jq -r ".\"$TOPIC\".lines" guideline-index.json)

# Read only those lines
sed -n "${LINES}p" "$FILE"
```

## Quick Reference Cards

### RED Phase Card
```
╔══════════════════════════════════════╗
║         RED PHASE RULES              ║
╠══════════════════════════════════════╣
║ ✓ Write failing test first          ║
║ ✓ Test one behavior                 ║
║ ✓ Use factory functions              ║
║ ✓ Test through public API            ║
║                                      ║
║ ✗ NO production code yet             ║
║ ✗ NO multiple tests before pass      ║
║ ✗ NO implementation details in test  ║
╚══════════════════════════════════════╝
```

### GREEN Phase Card
```
╔══════════════════════════════════════╗
║        GREEN PHASE RULES             ║
╠══════════════════════════════════════╣
║ ✓ Write MINIMUM code to pass        ║
║ ✓ Resist over-engineering            ║
║ ✓ Make test pass quickly             ║
║                                      ║
║ ✗ NO extra features                  ║
║ ✗ NO "while I'm here" additions      ║
║ ✗ NO speculative code                ║
╚══════════════════════════════════════╝
```

### REFACTOR Phase Card
```
╔══════════════════════════════════════╗
║       REFACTOR PHASE RULES           ║
╠══════════════════════════════════════╣
║ ✓ Assess if refactoring adds value  ║
║ ✓ Commit before refactoring          ║
║ ✓ Keep tests passing                 ║
║ ✓ External APIs unchanged            ║
║ ✓ Say "no refactoring needed" if clean║
║                                      ║
║ ✗ NO refactoring for sake of change  ║
║ ✗ NO structural-only abstractions    ║
╚══════════════════════════════════════╝
```

## Commands Available

- `Read` - Extract specific sections from docs
- `Grep` - Search for patterns in guidelines

## Response Strategy

1. **Assess question scope**: Can I answer without full doc load?
2. **Check index**: Do I have the relevant section mapped?
3. **Retrieve targeted**: Fetch only needed lines
4. **Provide concise answer**: With examples
5. **Link to full docs**: For deep dive

**Key principle**: Provide 80% of value with 20% of context usage.

Attribution

jackspacejackspace
View sourceMore from jackspace →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284072 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →