CSS Flexbox Layout Formatter skill for Claude and Codex
Gives you a copy-ready Flexbox snippet and matching HTML skeleton from a handful of choices, so a prototype row or column layout is on screen in a minute…
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 someone wants a quick Flexbox prototype from a few settings such as direction, justify, align, item count, and gap, with the HTML to try it. Do not use for diagnosing an existing layout, multi-row responsive grids, or page-level layouts with headers and footers. Related topics: coding, css.
What it will ask you for
- Container width (free text, e.g. "100% or 800px")
- Flex direction (choose one: row, row-reverse, column, column-reverse)
- Justify content (choose one: flex-start, flex-end, center, space-between, space-around, space-evenly)
- Align items (choose one: stretch, flex-start, flex-end, center, baseline)
- Number of items (number from 1 to 12)
- Item size pattern (choose one: Equal widths, Fixed widths, Content-sized, First item grows, Last item grows, Shrink to fit)
- Gap between items (px) (number from 0 to 64)
How it works
- Write the container rule with display: flex and the chosen direction, justify, align, and gap, commenting each working declaration.
- Implement the item size pattern with the flex shorthand and add a modifier class only when one item behaves differently.
- Generate the HTML skeleton with the exact item count, numbered content, and a visible background per item.
- Explain in plain sentences how the chosen justify and align values place items on each axis and what happens when space runs out.
What you get
One fenced code block with the CSS and HTML (CSS first, commented), then a short paragraph explaining the chosen properties.
What it watches out for
- Using width on items for equal columns instead of flex: 1 1 0, which stops working as soon as the gap or padding changes.
- Forgetting that align-items: stretch is the default, so a baseline or center choice silently changes item heights.
- Generating a skeleton with a different number of items than requested, which hides how the pattern distributes space.
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.