Skip to content
Back to skills

Red Phase Write Failing Tests

ASecurity

Sub-skill of sparc-refinement: Red Phase - Write Failing Tests (+2).

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 9, 2026
developmenttypescriptgo

Security analysis

A100/100

Scanned September 9, 2026

npx -y skills add vamseeachanta/workspace-hub --skill red-phase-write-failing-tests --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Red Phase Write Failing Tests?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Red Phase Write Failing Tests
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vamseeachanta-red-phase-write-failing-tests/badge)](https://www.skillsdirectory.com/skills/vamseeachanta-red-phase-write-failing-tests)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sparc-refinement-red-phase-write-failing-tests
description: 'Sub-skill of sparc-refinement: Red Phase - Write Failing Tests (+2).'
version: 1.0.0
category: development
type: reference
scripts_exempt: true
---

# Red Phase - Write Failing Tests (+2)

## Red Phase - Write Failing Tests


```typescript
// Step 1: Write test that defines desired behavior
describe('AuthenticationService', () => {
  let service: AuthenticationService;
  let mockUserRepo: jest.Mocked<UserRepository>;
  let mockCache: jest.Mocked<CacheService>;

  beforeEach(() => {
    mockUserRepo = createMockRepository();
    mockCache = createMockCache();

*See sub-skills for full details.*

## Green Phase - Make Tests Pass


```typescript
// Step 2: Implement minimum code to pass tests
export class AuthenticationService {
  private failedAttempts = new Map<string, number>();
  private readonly MAX_ATTEMPTS = 5;
  private readonly LOCK_DURATION = 15 * 60 * 1000; // 15 minutes

  constructor(
    private userRepo: UserRepository,
    private cache: CacheService,

*See sub-skills for full details.*

## Refactor Phase - Improve Code Quality


```typescript
// Step 3: Refactor while keeping tests green
export class AuthenticationService {
  constructor(
    private userRepo: UserRepository,
    private cache: CacheService,
    private logger: Logger,
    private config: AuthConfig,
    private eventBus: EventBus
  ) {}

*See sub-skills for full details.*

Attribution

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

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.