Registry/code-refactor
Workflow

code-refactor

Multi-step workflow for review, refactor suggestions, and documentation generation.

4.0

Sign in to vote

codedocs

What it does

A three-phase refactoring workflow: (1) static analysis to identify smells, (2) LLM-generated refactor proposals with rationale, (3) automatic docstring and inline comment generation for changed functions. Each phase produces a structured diff that can be applied selectively.

How it works

Phase 1 uses AST parsing (via ts-morph) to extract structural metrics. Phase 2 feeds those metrics plus the source code to an LLM with a structured output schema for refactor proposals. Phase 3 generates JSDoc comments for any function whose signature changed in Phase 2. All phases are independently resumable from a checkpoint file.