workflow-test-fix-cycle

Generates layered test suites and runs iterative fix cycles until tests pass.

2.1k|165|Updated Sep 7, 2025
One-click install
npx skills add https://github.com/catlog22/Claude-Code-Workflow --skill workflow-test-fix-cycle
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: workflow-test-fix-cycle
Source: https://github.com/catlog22/Claude-Code-Workflow/tree/main/.codex/skills/workflow-test-fix-cycle
Command: npx skills add https://github.com/catlog22/Claude-Code-Workflow --skill workflow-test-fix-cycle

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually writing tests for AI-generated or existing code and then chasing down every failure is slow and error-prone. This Skill automates the full loop: it generates progressive test layers (L0 static analysis through L3 E2E), executes them, diagnoses failures with CLI models, and applies fixes iteratively until the pass rate reaches 95%.

Core Features & Use Cases

  • Two-Phase Pipeline: Phase 1 creates a test session, gathers context, analyzes requirements with Gemini, and generates task JSONs; Phase 2 runs iterative test-fix cycles with a mandatory user confirmation gate in between.
  • Adaptive Strategy Engine: Automatically selects conservative, aggressive, or surgical fix strategies based on iteration count, pass rate trends, and regression detection.
  • AI Code Issue Detection: Scans for hallucinated imports, placeholder code, and mock leakage common in AI-generated code, with a CLI fallback chain (Gemini → Qwen → Codex).
  • Use Case: After completing an implementation session for a user authentication module, run the Skill in Session Mode to generate L0-L3 tests, then let it iterate fixes automatically until the suite passes at 95% or higher.

Quick Start

Run the workflow-test-fix-cycle skill on session WFS-user-auth-v2 to generate tests and iteratively fix failures until the pass rate reaches 95 percent.

Frequently Asked Questions about workflow-test-fix-cycle

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

FAQPage Schema
How do I run an automated test-fix cycle on existing code?

Invoke the workflow with a session ID like WFS-user-auth-v2 for Session Mode, or pass a text description or requirements file path for Prompt Mode. Phase 1 generates the test plan, and after your confirmation Phase 2 iterates fixes until the pass rate reaches 95%.

What test layers does the L0-L3 test generation cover?

L0 covers static analysis including compilation, imports, types, and AI code issues. L1 covers unit tests, L2 covers integration tests for component interactions and API contracts, and L3 covers optional end-to-end user journey tests.

Can I resume an interrupted test-fix session?

Yes, use the --resume-session flag with the test session ID, for example --resume-session="WFS-test-user-auth". This skips Phase 1 generation and loads the existing session state directly into Phase 2 execution.

What happens when the max iteration limit is reached?

The default limit is 10 iterations, adjustable with --max-iterations=N. If the pass rate stays below 95% after the limit, the workflow generates a failure report, marks the session blocked, and returns control to the user.

How does the strategy engine choose between conservative and aggressive fixes?

Iterations 1-2 use conservative single targeted fixes. When pass rate exceeds 80% with similar failure patterns it switches to aggressive batch fixes, and if a regression over 10% is detected it switches to surgical minimal changes with rollback.

Which CLI tools are used for failure analysis and what is the fallback order?

Gemini is the primary analysis tool, falling back to Qwen and then Codex. Fallback triggers on rate limits, timeouts, invalid task JSON output, low confidence scores below 0.4, or degraded analysis quality.