CSS Flexbox Layout Refactoring Tool skill for Claude and Codex
Converts legacy float, inline-block, or table-cell layout CSS into Flexbox while preserving the rendered result, with the refactored stylesheet and a note on…
Install it once and Claude or Codex runs it for you. When your request matches, your AI loads the skill, asks for anything it is missing, and works through the template itself. Prefer to fill it in by hand? See the full prompt template.
Download the skill (.zip) · View SKILL.md
When it is used
Use when old float, inline-block, or table-cell layout CSS should be migrated to Flexbox without altering the page's appearance. Do not use for writing a new layout from a description, debugging a layout that already uses Flexbox, or moving to CSS Grid. Related topics: coding, css.
What it will ask you for
- Original CSS (longer free text)
- Target elements (choose any: .header, .nav, .footer, .sidebar, .content, .card-list, .form-row)
- Desired layout direction (choose one: row, column, row-reverse, column-reverse)
- Gap size (px) (number from 0 to 64)
- Include vendor prefixes (choose one: Yes, No)
- Oldest browser to support (free text, e.g. "Safari 14 or IE11 or evergreen only")
How it works
- Describe what the original CSS renders: which elements align, stretch, clear, and which margins are fake gutters.
- Map each legacy technique to its Flexbox equivalent and apply it on the chosen target elements with selectors unchanged.
- Delete declarations that no longer have any effect on flex items and record each removal.
- Add vendor prefixes only when requested and only for the oldest named browser.
- Write the change list with old rule, new rule, and the visual difference to verify in a browser.
What you get
A fenced code block with the complete refactored CSS, then a bullet list of major changes, each with the old rule, the new rule, and what to check visually.
What it watches out for
- Renaming classes during the refactor, which forces markup changes and turns a CSS-only task into a template rewrite.
- Leaving float and clear on the new flex items; they are ignored but mislead the next reader into thinking they matter.
- Replacing a margin gutter with gap but forgetting the old margin on the last child, which doubles the final spacing.
How to install
Claude.ai and the Claude desktop app
- Download the skill .zip.
- Open Settings, then Capabilities, and find Skills.
- Choose Upload skill and select the .zip.
- Ask Claude for help with the task. It loads the skill when your request matches.
Claude Code
- Download the skill .zip.
- Unzip it into ~/.claude/skills/ (or .claude/skills/ inside a project).
- Start a new session. Claude Code loads the skill when your request matches.
Codex
- Download the skill .zip.
- Unzip it into ~/.agents/skills/ (or .agents/skills/ inside a project).
- Codex picks it up on its own. Type $ and the skill name to use it, or just ask for the task.
Cursor
- Download the Cursor rule (.mdc).
- Save it in .cursor/rules/ inside your project.
- Cursor's agent applies the rule when your request matches its description.
AGENTS.md (Codex, Cursor, and other coding agents)
- Copy the AGENTS.md section.
- Paste it into AGENTS.md at the root of your repository, creating the file if needed.
- Coding agents that read AGENTS.md follow it when your request fits.