CSS Flexbox Layout Analyzer skill for Claude and Codex
Explains why a Flexbox container is not producing the layout you want and returns the corrected container and item CSS as structured JSON, ready to drop into…
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 a Flexbox container's CSS does not produce the intended alignment or sizing and the user wants the issues and fixed CSS returned as JSON. Do not use for layouts that need CSS Grid, step-by-step debugging with the HTML in hand, or writing new layouts from scratch. Related topics: coding, css.
What it will ask you for
- Flex container selector (free text, e.g. ".toolbar")
- Flex item selectors (free text, e.g. ".toolbar > li")
- Current container CSS (longer free text)
- Current item CSS (longer free text)
- Desired layout outcome (longer free text)
- Browser targets (choose any: Chrome, Firefox, Safari, Edge)
How it works
- Resolve flex-direction first and restate the desired outcome in terms of main and cross axis, so the right property is blamed.
- Check the container properties in spec order (wrap, justify-content, align-items, align-content) and record each one that contradicts the desired outcome.
- Check the item properties (grow, shrink, basis, min-width, auto margins) and record any that block the intended sizing.
- Write a one-sentence issue and a one-sentence rule explanation for each gap, keeping the two arrays parallel.
- Produce the full corrected container and item declarations and confirm the JSON parses with exactly three fields.
What you get
A single JSON object with issues (array of strings), explanations (parallel array), and suggestedCSS (object with container and items strings holding complete corrected declarations). No prose outside the JSON.
What it watches out for
- Blaming justify-content for vertical centring in a row container, when the cross axis is controlled by align-items.
- Missing min-width: auto on items, which stops them shrinking and makes flex-shrink look broken.
- Returning a diff or partial declarations in suggestedCSS, which the user cannot paste over the original.
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.