The prompt

Claude Artifacts Refactor with Safety Plan guides the model through a defined task while preserving the source prompt's useful structure and constraints. Use it when planning, writing, reviewing, or debugging software and you want a response that is easier to evaluate and act on.

text prompt
You are a staff engineer. Refactor for maintainability without changing external behavior. Refactor goal {{refactorGoal}} Code context - Language and framework: {{stack}} - Current code (paste one or more files): {{codeContext}} - Existing tests (if any): {{existingTests}} Constraints {{constraints}} Hard requirements 1) Output as ONE Claude Artifact titled: "Refactor Pack" 2) Start with: - Behavior preservation statement - Risk assessment (what could break) - Small-step refactor plan (3 to 8 steps) 3) Then provide code changes as incremental unified diffs. - Group diffs by step number. - After each step, list what to run or verify. 4) Add or update tests to guard behavior. 5) Include a backout plan. Diff format Step N: <short name> File: path/to/file.ext ```diff unified diff ``` Refactor rules - Do not change public APIs unless explicitly requested. - Prefer extracting functions and clarifying types over cleverness. - If you introduce new modules, keep naming consistent with the repo. - Keep cyclomatic complexity lower than before and call it out. End with - Before and after summary - Remaining technical debt list - Suggested follow-up PRs

Tune the prompt, not the plumbing.

Every control comes from this prompt’s content schema. Changes stay in your browser and update instantly.

Customized prompt1232 characters
You are a staff engineer. Refactor for maintainability without changing external behavior. Refactor goal a specific refactor goal Code context - Language and framework: a specific stack - Current code (paste one or more files): Paste the relevant source material and context here. - Existing tests (if any): a specific existing tests Constraints a specific constraints Hard requirements 1) Output as ONE Claude Artifact titled: "Refactor Pack" 2) Start with: - Behavior preservation statement - Risk assessment (what could break) - Small-step refactor plan (3 to 8 steps) 3) Then provide code changes as incremental unified diffs. - Group diffs by step number. - After each step, list what to run or verify. 4) Add or update tests to guard behavior. 5) Include a backout plan. Diff format Step N: <short name> File: path/to/file.ext ```diff unified diff ``` Refactor rules - Do not change public APIs unless explicitly requested. - Prefer extracting functions and clarifying types over cleverness. - If you introduce new modules, keep naming consistent with the repo. - Keep cyclomatic complexity lower than before and call it out. End with - Before and after summary - Remaining technical debt list - Suggested follow-up PRs

Useful structure, room to move.

Claude Artifacts Refactor with Safety Plan guides the model through a defined task while preserving the source prompt's useful structure and constraints. Use it when planning, writing, reviewing, or debugging software and you want a response that is easier to evaluate and act on.

The prompt establishes the job first, then supplies concrete decisions a model can act on. The variables preserve that structure while letting you change the subject, context, or output.