tdd-context-compaction-resilience

Preserve TDD workflow state across Claude Code context compaction.

Updated Nov 18, 2025
One-click install
npx skills add https://github.com/cajias/claude-skills --skill tdd-context-compaction-resilience
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-context-compaction-resilience
Source: https://github.com/cajias/claude-skills/tree/main/skills/tdd-context-compaction-resilience
Command: npx skills add https://github.com/cajias/claude-skills --skill tdd-context-compaction-resilience

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps Claude Code preserve progress during long TDD sessions when context compaction causes it to forget the current phase, repeat failed investigations, or lose track of what tests and fixes have already been tried.

Core Features & Use Cases

  • Phase Persistence: Records and restores RED, GREEN, and REFACTOR state so work resumes from the correct point.
  • Investigation Tracking: Maintains a structured log of failed attempts to prevent repeated exploration and duplicated debugging.
  • Compaction-Resistant Guardrails: Uses structured scratchpad markers and optional enforcement hooks to keep TDD discipline intact across long sessions.
  • Orchestration Discipline: Reminds the agent to delegate work, track dependencies, and coordinate parallel tasks instead of drifting into unstructured execution.

Quick Start

Ask the assistant to restore the current TDD phase, list the failed approaches already tried, and continue from the exact point recorded in the scratchpad.

Frequently Asked Questions about tdd-context-compaction-resilience

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

FAQPage Schema
How do I preserve TDD state when Claude Code context compaction resets my progress?

To preserve TDD state during context compaction, you need a structured scratchpad with compaction-resistant markers that record the current red-green-refactor phase, failed attempts, and task dependencies for seamless workflow restoration.

Why does my TDD workflow repeat failed debugging investigations after a long session?

TDD workflows repeat failed investigations because context compaction erases prior exploration logs. Maintaining a structured investigation log prevents duplicated debugging by tracking which approaches have already been tried.

How to resume a red-green-refactor cycle from the exact point recorded in a scratchpad?

Resuming a red-green-refactor cycle requires restoring the recorded phase state from a structured scratchpad, checking failed attempt logs, and continuing execution from the exact compaction-resistant marker left during the previous session.

Can I maintain TDD discipline across long debugging sessions without losing track of dependencies?

Yes, you can maintain TDD discipline across long debugging sessions by using compaction-resistant guardrails and orchestration rules that enforce dependency tracking, task delegation, and phase persistence throughout repeated investigation loops.

What's the best way to prevent premature implementation during extended TDD sessions?

Preventing premature implementation during extended TDD sessions requires structured scratchpad markers and optional enforcement hooks that enforce strict red-green-refactor discipline and prevent drifting into unstructured execution.