refactor

Review and update spec files with user approval after implementation.

4|Updated Apr 26, 2026
One-click install
npx skills add https://github.com/curdx/curdx-flow --skill refactor-curdx
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactor
Source: https://github.com/curdx/curdx-flow/tree/main/plugins/curdx-flow/skills/refactor
Command: npx skills add https://github.com/curdx/curdx-flow --skill refactor-curdx

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill solves the problem of keeping spec files (requirements, design, and tasks) accurate after implementation learnings, so Claude Code does not drift from the real outcome.

Core Features & Use Cases

  • Spec-first refactoring: Resolves the active spec directory, reads current spec files and execution learnings from .progress.md, and prepares a controlled review flow.
  • User-approved, file-by-file changes: Reviews requirements → design → tasks section-by-section with explicit user approval to decide what to update, skip, or rewrite.
  • Specialist delegation and cascade handling: Delegates file edits to the refactor-specialist agent, then manages downstream cascades (including optional regeneration via the original specialists) and updates state, progress, and optionally commits.

Quick Start

Run refactor to review and update your active spec after implementation learnings: curdx-flow refactor.

Frequently Asked Questions about refactor

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

FAQPage Schema
How do I update spec files after implementation learnings without losing context?

Spec refactoring reviews requirements, design, and tasks against implementation learnings, applying user-approved section-level edits to keep documentation aligned with the real project outcome.

When do I need to refactor spec documentation in a workflow?

You need spec refactoring after execution phases when implementation learnings cause divergence. It resolves the active spec directory, reads current progress, and updates files to prevent documentation drift from the actual codebase state.

How does section-level spec refactoring handle downstream cascades?

Section-level spec refactoring handles downstream cascades by delegating file edits to a specialist agent, managing dependent updates across spec stages, and optionally regenerating downstream files via original specialists before finalizing state and progress.

Can I review and approve spec changes file-by-file during refactoring?

Yes, you review and approve spec changes file-by-file. The process evaluates requirements, design, and tasks section-by-section, requiring explicit user approval to decide what to update, skip, or rewrite.

What state files are required to coordinate task planning and spec updates?

Coordinating task planning and spec updates requires resolving the target spec directory and reading .curdx-state.json and .progress.md files to extract current execution learnings and manage the controlled review flow.