sparc-refinement-red-phase-write-failing-tests
Sub-skill of sparc-refinement: Red Phase - Write Failing Tests (+2).
Best use case
sparc-refinement-red-phase-write-failing-tests is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Sub-skill of sparc-refinement: Red Phase - Write Failing Tests (+2).
Teams using sparc-refinement-red-phase-write-failing-tests should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/red-phase-write-failing-tests/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How sparc-refinement-red-phase-write-failing-tests Compares
| Feature / Agent | sparc-refinement-red-phase-write-failing-tests | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Sub-skill of sparc-refinement: Red Phase - Write Failing Tests (+2).
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# 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.*Related Skills
subagent-write-verification
Independently verify subagent-claimed file writes with filesystem and git checks before treating the artifact as real, before committing it, and before referencing the path in downstream prompts.
workspace-hub-sync-concurrent-writer-blocks
Handle repository_sync cleanup when workspace-hub root is being mutated by concurrent Codex/Codex/Gemini sessions.
live-writer-branch-cleanup-guard
Guardrails for multi-repo sync and branch cleanup when workspace-hub or another shared repo has active writer sessions, worktree-backed branches, or unrelated-history branches.
gtm-prospect-pipeline-phased-execution
Phased execution pattern for
sparc-specification
SPARC Specification phase specialist for requirements analysis, constraint identification, use case definition, and acceptance criteria creation
sparc-refinement
SPARC Refinement phase specialist for iterative improvement through TDD, code optimization, refactoring, performance tuning, and quality improvement
sparc-pseudocode
SPARC Pseudocode phase specialist for algorithm design, data structure selection, complexity analysis, and design pattern identification
sparc-architecture
SPARC Architecture phase specialist for system design, component architecture, interface design, scalability planning, and technology selection
discipline-refactor-phase-4-validation
Sub-skill of discipline-refactor: Phase 4: Validation.
discipline-refactor-phase-3-execution
Sub-skill of discipline-refactor: Phase 3: Execution.
discipline-refactor-phase-2-planning
Sub-skill of discipline-refactor: Phase 2: Planning.
discipline-refactor-phase-1-analysis
Sub-skill of discipline-refactor: Phase 1: Analysis.