{"slug": "tailwind-css-in-flutter-i-gave-two-ai-agents-the-same-page-and-only-one-got", "title": "Tailwind CSS in Flutter: I gave two AI agents the same page, and only one got keyboard focus right", "summary": "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.", "body_md": "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.\n\n**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.\n\nFlutter 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.\n\nwind_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.\n\nWhat you'll walk away with:\n\n`wind-ui` skill installed for Claude Code, Cursor, Codex or Copilot with one Dart command\nLet's start.\n\nFirst, bring the package into your project:\n\n```\nflutter pub add wind_kit material_ui\n```\n\n`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`.\n\nwind_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:\n\n```\nWDiv(\n  className: 'p-6 mx-4 bg-white dark:bg-gray-800 rounded-xl shadow-lg hover:shadow-xl',\n  child: WText('Hello', className: 'text-xl font-bold'),\n)\n```\n\nIn 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.\n\nIt'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.\n\nThe 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:\n\n`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.\n\n`main.dart` wraps the app once, with `WindTheme` above `MaterialApp`, so every route and overlay reaches the palette:\n\nThe skill lives in the wind_kit repository. Dart's skills CLI installs it, no Node needed:\n\n```\ndart run skills@ add https://github.com/anilcancakir/wind_kit --agent claude --all\nCloning https://github.com/anilcancakir/wind_kit...\nUpdating https://github.com/anilcancakir/wind_kit...\n  [claude] Installed wind-ui\nInstalled 1 skill(s) for claude at .claude/skills.\n```\n\n`--agent` also takes `cursor`, `codex`, `copilot`, `cline`, `opencode`, `antigravity` and `generic`.\n\n**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.\n\nThe 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:\n\n`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.\nRemember that last one. It comes back.\n\nNow 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:\n\n```\nThis Flutter app uses wind_kit for styling. Build a pricing page in lib/pricing_page.dart\nand show it from lib/main.dart in place of the placeholder home.\n\nThe page has a heading and a one-line subheading, a Monthly / Yearly toggle, and three\nplan cards (Starter, Pro, Team). Each card shows a price, four features with check icons\nand a \"Choose plan\" button. Pro is highlighted as the recommended plan. The cards sit in\none column on a phone and in three columns from 768 px wide.\n\nUse wind_kit className styling and the palette aliases in lib/config/theme.dart. When you\nare done, run `flutter analyze` and fix what it reports. Do not run the app.\n```\n\nBoth runs finished on their own:\n\n|  | Without the skill | With the skill | \n|---|---|---|\n| What it read first | wind_kit's `llms.txt` and pages under`doc/` in the pub cache | The `wind-ui` skill and its widget reference | \n| Turns | 13 | 13 | \n| Time | 97 s | 91 s | \n| Cost | $0.71 | $0.62 | \n| `flutter analyze` | No issues found | No issues found | \n\nLet's give it a shot. This is the page the agent with the skill wrote, at desktop width:\n\n*The pricing page from the agent with the skill*\n\nThe 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.\n\nSo where is the difference? Put the mouse down.\n\nOn the page without the skill, I clicked an empty spot and pressed Tab twice:\n\n*Two Tabs in: focus is somewhere, the screen doesn't say where*\n\nNothing changed. Then I pressed Enter:\n\n*Enter switched the plan to yearly: the focus was on Yearly all along*\n\nThe 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.\n\nThe same two Tabs on the page with the skill, and Yearly turns into a darker pill:\n\n*With the skill, two Tabs in: Yearly says it has focus*\n\nOne more Tab, and the focused \"Choose plan\" gets an accent border:\n\n*With the skill: the focused button says so*\n\nThe code shows why. This is the toggle button's `className` without the skill:\n\n```\nclassName: 'px-4 py-2 rounded-full selected:bg-accent',\n```\n\nAnd with it:\n\n```\nclassName: '''\n  flex flex-row items-center gap-2\n  px-5 py-2.5 rounded-full\n  bg-transparent hover:bg-surface focus:bg-surface\n  selected:bg-accent selected:hover:bg-accent-hover selected:focus:bg-accent-hover\n  cursor-pointer duration-150 ease-in-out\n''',\n```\n\nThe 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.\n\nAt the bottom of the page without the skill:\n\n*Without the skill: the page colour stops where the content stops*\n\n`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.\n\nHere is the whole page the agent wrote with the skill, unchanged apart from the path comment on top:\n\n`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.\n\n```\nflutter pub add wind_kit material_ui\ndart run skills@ add https://github.com/anilcancakir/wind_kit --agent claude --all\n```\n\nEvery class, every widget and the theme options are on the [wind_kit page](https://anilcancakir.com/wind_kit).\n\nDo 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.\n\nThat's all.\n\n*Originally published on [my blog](https://anilcancakir.com/blog/tailwind-css-flutter-ai-agent).*", "url": "https://wpnews.pro/news/tailwind-css-in-flutter-i-gave-two-ai-agents-the-same-page-and-only-one-got", "canonical_source": "https://dev.to/anilcancakir/tailwind-css-in-flutter-i-gave-two-ai-agents-the-same-page-and-only-one-got-keyboard-focus-right-4", "published_at": "2026-11-29 21:38:00+00:00", "updated_at": "2026-11-29 21:45:15.770513+00:00", "lang": "en", "topics": ["ai-agents", "ai-tools", "developer-tools", "ai-products"], "entities": ["wind_kit", "wind-ui", "Flutter", "Dart", "Claude Code", "Cursor", "Codex", "GitHub Copilot"], "also_reported_by": [], "takeaway": "Shipping a SKILL.md plus reference files inside a package and installing it with 'dart run skills@ add <repo> --agent claude' gave one agent correct Flutter keyboard focus behavior that the skill-less agent missed, even though both passed flutter analyze.", "recommendation": {"advice": "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.", "playbook": "coding-agents", "playbook_url": "https://wpnews.pro/playbooks/coding-agents"}, "alternates": {"html": "https://wpnews.pro/news/tailwind-css-in-flutter-i-gave-two-ai-agents-the-same-page-and-only-one-got", "markdown": "https://wpnews.pro/news/tailwind-css-in-flutter-i-gave-two-ai-agents-the-same-page-and-only-one-got.md", "text": "https://wpnews.pro/news/tailwind-css-in-flutter-i-gave-two-ai-agents-the-same-page-and-only-one-got.txt", "jsonld": "https://wpnews.pro/news/tailwind-css-in-flutter-i-gave-two-ai-agents-the-same-page-and-only-one-got.jsonld"}}