generate_refactoring_code
Generates refactored code and a unified diff for a refactoring plan, using an LLM to produce the actual code changes and a git-style diff.
Instructions
Generate refactored code + a unified diff for one refactoring plan.
Opt-in code generation: turns a deterministic plan (from
``get_health(include=["refactoring"])`` — use a plan's ``id``) into the
actual named code and a git-style diff, grounded on the plan plus the real
source spans it references. For Extract Class the result carries an LCOM4
before/after self-check.
Disabled by default — returns an ``error`` unless ``refactoring.llm.enabled``
is set in the repo's ``.repowise/config.yaml``. Uses the repo's configured
provider/model (BYO key) and caches by a content hash, so an unchanged plan
never regenerates.
Args:
suggestion_id: The ``id`` of a plan from ``get_health(... "refactoring")``.
repo: Repo alias / id / path.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| repo | No | ||
| suggestion_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |