In-Editor Automated Refactoring Interface Brief
Create a design brief for inline IDE refactoring tools and multi-file code transformation previews.
Use this template when developing developer tooling interfaces inside IDEs or text editors. It establishes rigorous UX requirements for side-by-side diffs, AST-aware transformations, and non-destructive code rewrites.
Role: Staff Developer Tooling UI/UX Designer specializing in code intelligence and in-editor keyboard ergonomics.
Context
- Host IDE platform: {{ide_environment}}
- Code transformation scope: {{ast_modification_types}}
- Keybinding bindings: {{keyboard_shortcut_scheme}}
- Validation gates: {{safety_verification_states}}
- Concurrency & merge logic: {{conflict_resolution_model}}
- Velocity targets: {{developer_experience_metrics}}
Task
Author a comprehensive interface brief for an in-editor refactoring engine UI that provides clear diff previews, guarantees non-destructive edits, and reduces cognitive load during multi-file automated code rewrites.
Method
- Establish the HUD container paradigm (inline lens, peek view, side panel, or modal) optimized for {{ide_environment}}.
- Detail the unified vs. split diff viewer components, outlining how syntax highlighting and AST change tokens are differentiated.
- Map the state progression from code analysis to dry-run verification using {{safety_verification_states}}.
- Define the micro-interactions and keystroke flows based on {{keyboard_shortcut_scheme}} to allow full headless operation.
- Specify UI feedback for dirty workspaces and collision handling according to {{conflict_resolution_model}}.
- Architect the multi-file review list with granular stage/unstage/reject controls per hunk.
- Detail telemetry-safe feedback loops to track {{developer_experience_metrics}} without leaking source code.
Constraints
- MUST preserve the developer's cursor position and viewport scroll anchor upon applying or canceling changes.
- MUST NOT block the main IDE thread or render unfocused modal overlays that steal system focus.
- Contrast ratios for semantic code token changes must pass WCAG AA standards in both light and dark themes.
- Provide an instantaneous undo/revert micro-interaction for applied batch edits.
Output format
Structure the specification brief into these clear sections:
- Architectural HUD Specification (Placement, overlay mechanics, and host IDE integration)
- Interactive Diff & Token Preview Component (Visual state taxonomy, hunk actions, and AST markers)
- Safety Gate & Pre-Flight Validation UI (Error chips, blocking states, and dry-run indicators)
- Keystroke Navigation Table (Mapped keybindings, modifier states, and accessibility hooks)
- Error & Conflict Recovery Flows (Edge-case UI handling for file locks and external modifications)
Self-review
- Check that all {{ast_modification_types}} have clear representation in the multi-file preview schema.
- Verify keyboard navigation can execute the full accept/reject lifecycle without mouse input.
- Ensure conflict recovery states prevent accidental data loss in dirty Git repositories.
Explicit role, a named task, and discrete steps the model can follow.
Background, inputs and variables the model needs before it starts.
Hard boundaries — what the model must and must not do.
A named, field-level shape for the response.
Ordered work items that force analysis before an answer.
Length and structure that travel across frontier models.
Signal density — instruction weight without padding.
Documented variables so the scaffold adapts to new inputs.
Quality bar, assumptions and behaviour when inputs are thin.
How much real usage the template has behind it.