cd /news/ai-agents/tailwind-css-in-flutter-i-gave-two-a… · home › topics › ai-agents › article
[ARTICLE · art-178284] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

Tailwind CSS in Flutter: I gave two AI agents the same page, and only one got keyboard focus right

A developer built wind_kit, an open-source Tailwind CSS-style styling package for Flutter, and shipped a companion 'wind-ui' agent skill that teaches coding agents the rules that differ from web Tailwind. In a side-by-side test, two AI agents given the same Flutter pricing page prompt both produced code that compiled and passed flutter analyze, but only the agent with the skill installed rendered correct keyboard focus states. The skill installs via Dart's skills CLI and targets Claude Code, Cursor, Codex and Copilot, though the developer notes the CLI's 'get' command does not yet discover the skill from pub.dev.

recommendation

Install a package-specific agent skill before letting coding agents write Flutter UI code, since both agents compiled but only the skill-equipped one handled keyboard focus correctly.

more in playbook: Working with AI coding agents
by read7 min views9 publishedNov 29, 2026

Two AI agents, one prompt, one Flutter pricing page. Both pages compiled, both passed flutter analyze, and at a glance they look almost the same. Then I pressed Tab.

TL;DR: wind_kit lets you style Flutter widgets with Tailwind class strings, and its wind-ui agent skill teaches Claude Code, Cursor or Codex the rules that differ from web Tailwind. I gave two agents the same pricing page: both pages compiled and looked right, but only the one with the skill showed keyboard focus.

Flutter 3.50 was announced on 11 November, and the announcement says package authors can now ship agent skills inside a top-level skills/ directory of their pub.dev packages. The Dart docs give the reason in one line: "Without skills, AI coding agents often guess APIs, suggest deprecated methods, or miss architectural patterns specific to your library." A Tailwind-style package is a good place to test that claim, because your agent already knows Tailwind from the web, and the web is exactly where its habits come from.

wind_kit is my open source package: Tailwind CSS for Flutter. Its skill, wind-ui, is the rule book I give agents for it. There is a catch, and I'll be honest about it near the end.

What you'll walk away with:

wind-ui skill installed for Claude Code, Cursor, Codex or Copilot with one Dart command Let's start.

First, bring the package into your project:

flutter pub add wind_kit material_ui

material_ui is there because Flutter 3.50 deprecates package:flutter/material.dart in favour of the standalone package, so a wind_kit app imports MaterialApp from package:material_ui/material_ui.dart.

wind_kit reads a className string and builds the widget tree from it. A rounded card with a dark variant and a hover shadow is one widget:

WDiv(
  className: 'p-6 mx-4 bg-white dark:bg-gray-800 rounded-xl shadow-lg hover:shadow-xl',
  child: WText('Hello', className: 'text-xl font-bold'),
)

In plain Flutter, the same card is a Container with a BoxDecoration, two BoxShadow s and a brightness check, and the hover state needs a StatefulWidget and a MouseRegion on top.

It's not a literal Tailwind port, though. Some web classes have no Wind version: group-hover:, peer-*, backdrop-blur, @apply, negative margins. Wind drops what it can't build, and some drops are silent: text-7xl is past Wind's text-6xl cap, so it does nothing and says nothing. That's fine when you write the class yourself and see the result. It's a trap when an agent writes it from web habits.

The palette lives in one file, as aliases, so views use short names like bg-panel and text-ink and the hex values stay in one place:

syncWithSystem: false matters. Without it, Wind follows the OS brightness on start and your dark app turns light on a machine set to light mode.

main.dart wraps the app once, with WindTheme above MaterialApp, so every route and overlay reaches the palette:

The skill lives in the wind_kit repository. Dart's skills CLI installs it, no Node needed:

dart run skills@ add https://github.com/anilcancakir/wind_kit --agent claude --all
Cloning https://github.com/anilcancakir/wind_kit...
Updating https://github.com/anilcancakir/wind_kit...
  [claude] Installed wind-ui
Installed 1 skill(s) for claude at .claude/skills.

--agent also takes cursor, codex, copilot, cline, opencode, antigravity and generic.

Note: The Flutter 3.50 announcement also points to dart run skills@ get, which installs skills from your dependencies. get doesn't find wind_kit's skill today: the skill is not inside the pub.dev archive, and its folder name lacks the wind_kit- prefix get looks for. Add it from the repository as above.

The skill is a SKILL.md and nine reference files. Think of it as the house rules you give a new colleague on their first day. They already know how to code; the rules tell them how this house works. A few lines from it:

bg-, text-, border-, ring-, shadow- and fill- class gets a dark: peer in the same className, unless the colour reads the same in both modes. states: and prefixed classes like selected:bg-accent, never Dart string interpolation inside a group-hover: and text-7xl. hover: and focus: states. Remember that last one. It comes back.

Now the test. I made one small app with the theme above, copied it twice, and installed the skill in one copy only. Then I gave Claude Code the same prompt in both, headless, one run each:

This Flutter app uses wind_kit for styling. Build a pricing page in lib/pricing_page.dart
and show it from lib/main.dart in place of the placeholder home.

The page has a heading and a one-line subheading, a Monthly / Yearly toggle, and three
plan cards (Starter, Pro, Team). Each card shows a price, four features with check icons
and a "Choose plan" button. Pro is highlighted as the recommended plan. The cards sit in
one column on a phone and in three columns from 768 px wide.

Use wind_kit className styling and the palette aliases in lib/config/theme.dart. When you
are done, run `flutter analyze` and fix what it reports. Do not run the app.

Both runs finished on their own:

Without the skill With the skill
What it read first wind_kit's llms.txt and pages underdoc/ in the pub cache The wind-ui skill and its widget reference
Turns 13 13
Time 97 s 91 s
Cost $0.71 $0.62
flutter analyze No issues found No issues found

Let's give it a shot. This is the page the agent with the skill wrote, at desktop width:

The pricing page from the agent with the skill

The page from the agent without the skill looks almost the same, and I want to be fair to it: it did a good job. wind_kit ships its llms.txt and its docs inside the package, and the agent found them in the pub cache on its own. Both agents built every styled element from W-widgets, with no Container or Text, both routed the selected plan through states: instead of string interpolation, both set scrollPrimary on the scroll, and neither wrote a dark: peer, for the same reason: the palette is dark only.

So where is the difference? Put the mouse down.

On the page without the skill, I clicked an empty spot and pressed Tab twice:

Two Tabs in: focus is somewhere, the screen doesn't say where

Nothing changed. Then I pressed Enter:

Enter switched the plan to yearly: the focus was on Yearly all along

The prices switched to yearly. The focus was on Yearly the whole time, and nothing on the screen said so. For someone who moves through the page with a keyboard, that page is a guessing game.

The same two Tabs on the page with the skill, and Yearly turns into a darker pill:

With the skill, two Tabs in: Yearly says it has focus

One more Tab, and the focused "Choose plan" gets an accent border:

With the skill: the focused button says so

The code shows why. This is the toggle button's className without the skill:

className: 'px-4 py-2 rounded-full selected:bg-accent',

And with it:

className: '''
  flex flex-row items-center gap-2
  px-5 py-2.5 rounded-full
  bg-transparent hover:bg-surface focus:bg-surface
  selected:bg-accent selected:hover:bg-accent-hover selected:focus:bg-accent-hover
  cursor-pointer duration-150 ease-in-out
''',

The first agent did see focus: wind_kit's llms.txt names it as a state you can style, and the button and state pages it opened show focus: classes. None of the pages it read asks for one on every control. The skill makes it item three of its definition of done. That's the whole point of a skill: the docs tell an agent what exists, and the skill tells it what "done" means.

At the bottom of the page without the skill:

Without the skill: the page colour stops where the content stops

bg-surface sits on the scrolling box, so it ends where the content ends and the Scaffold colour shows under it. The page with the skill paints the background on an outer box and scrolls inside it. I can't tie this one to a single line of the skill; it's simply what this run did.

Here is the whole page the agent wrote with the skill, unchanged apart from the path comment on top:

flutter analyze was clean on both pages. You still press Tab yourself, or let an agent drive the app with a tool like Scaffold, AppBar, showDialog and ListView.builder stay Flutter. A grid in Wind is a static Wrap, so a long or growing list still wants ThemeData are the better call.dart run skills@ get doesn't install the skill today, for the two reasons in the note above.

flutter pub add wind_kit material_ui
dart run skills@ add https://github.com/anilcancakir/wind_kit --agent claude --all

Every class, every widget and the theme options are on the wind_kit page.

Do you give your agent package skills, or do you let it read the docs on its own? I'd like to hear what it gets wrong for you.

That's all.

Originally published on my blog.

── more in #ai-agents 4 stories · sorted by recency
── more on @wind_kit 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/tailwind-css-in-flut…] indexed:0 read:7min 2026-11-29 · —