ui-refactor

Specialized skill for refactoring legacy Android views to View Binding and enforcing Leanback UI standards.

199 stars

Best use case

ui-refactor is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Specialized skill for refactoring legacy Android views to View Binding and enforcing Leanback UI standards.

Teams using ui-refactor should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ui-refactor/SKILL.md --create-dirs "https://raw.githubusercontent.com/NineWorlds/serenity-android/main/prompts/skills/ui-refactor/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ui-refactor/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ui-refactor Compares

Feature / Agentui-refactorStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Specialized skill for refactoring legacy Android views to View Binding and enforcing Leanback UI standards.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Skill: UI Refactor (Leanback & View Binding)

## Purpose
This skill provides deep expertise in migrating legacy Android layouts to View Binding and ensuring compliance with the project's Leanback/TV UI standards.

## Guidelines & Constraints
- **View Binding**: All `findViewById` calls must be removed.
- **Null Safety**: Use `_binding` and `binding` pattern in Fragments to avoid leaks.
- **Leanback**: Ensure focus effects are present for all interactive elements.
- **Naming**: IDs must be `snake_case`.

## Trigger Logic
- Activated when the user requests a UI refactor, View Binding migration, or new TV screen implementation.

## Instructions
1.  **Analyze Layout**: Identify all IDs and nested includes.
2.  **Generate Binding**: Use the generated binding class for the layout.
3.  **Migration**: Replace manual view lookups with binding references.
4.  **Verification**: Confirm focus behavior in D-pad navigation.

## References
- `prompts/agents/ui-standards.md`
- `prompts/agents/architecture.md`

Related Skills

fp-refactor

31392
from sickn33/antigravity-awesome-skills

Comprehensive guide for refactoring imperative TypeScript code to fp-ts functional patterns

Software DevelopmentClaude

codebase-cleanup-refactor-clean

31392
from sickn33/antigravity-awesome-skills

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

Code Refactoring & QualityClaude

code-refactoring-tech-debt

31392
from sickn33/antigravity-awesome-skills

You are a technical debt expert specializing in identifying, quantifying, and prioritizing technical debt in software projects. Analyze the codebase to uncover debt, assess its impact, and create acti

code-refactoring-refactor-clean

31392
from sickn33/antigravity-awesome-skills

You are a code refactoring expert specializing in clean code principles, SOLID design patterns, and modern software engineering best practices. Analyze and refactor the provided code to improve its quality, maintainability, and performance.

Developer ToolsClaude

code-refactoring-context-restore

31392
from sickn33/antigravity-awesome-skills

Use when working with code refactoring context restore

Code AnalysisClaude

refactor-pass

5
from alexsee/bsh3

Performs an automated refactor pass on recent code changes to improve simplicity, remove dead code, and straighten logic flows. It includes a critical step to verify behavior by running build/tests after modifications.

Coding & Development

tdd-workflows-tdd-refactor

31392
from sickn33/antigravity-awesome-skills

Use when working with tdd workflows tdd refactor

swiftui-view-refactor

31392
from sickn33/antigravity-awesome-skills

Refactor SwiftUI views into smaller components with stable, explicit data flow.

orchestrate-batch-refactor

31392
from sickn33/antigravity-awesome-skills

Plan and execute large refactors with dependency-aware work packets and parallel analysis.

review-and-refactor

28865
from github/awesome-copilot

Review and refactor code in your project according to defined instructions

refactor

28865
from github/awesome-copilot

Surgical code refactoring to improve maintainability without changing behavior. Covers extracting functions, renaming variables, breaking down god functions, improving type safety, eliminating code smells, and applying design patterns. Less drastic than repo-rebuilder; use for gradual improvements.

refactor-method-complexity-reduce

28865
from github/awesome-copilot

Refactor given method `${input:methodName}` to reduce its cognitive complexity to `${input:complexityThreshold}` or below, by extracting helper methods.