flutter-adaptive-ui — скилл для Claude Code: что делает и установка
Скилл направляет агента при разработке адаптивного UI во Flutter для мобильных экранов, десктопа и веба. Он заставляет опираться на ограничения окна, а не на имя платформы.
npx skills add MADTeacher/mad-agents-skills --skill flutter-adaptive-ui -a claude-codeЧто делает flutter-adaptive-ui
Скилл меняет подход агента к вёрстке во Flutter. Главное правило строгое: ограничения идут вниз, размеры вверх, а родитель задаёт позицию. Инструкция запрещает делить интерфейс проверками вроде Platform.isAndroid или Platform.isIOS. Вместо этого агент опирается на брейкпоинты: компактный до 600, средний от 600 до 840 и расширенный от 840.
Для замеров скилл разграничивает инструменты. На уровне окна вызывается MediaQuery.sizeOf(context), а для локальных поддеревьев виджетов применяется LayoutBuilder. Поведение делится через паттерны Capability и Policy: методы Capability определяют доступные устройству функции, а Policy решает, что именно показывать пользователю. Общие данные, вроде маршрутов для NavigationBar и NavigationRail, агент сначала абстрагирует в одну модель, чтобы сохранить состояние и позицию скролла при ресайзе.
После правок агент запускает flutter analyze, прогоняет тесты виджетов и проверяет вёрстку на ширине от компактной до развёрнутой. Если анализатор или тесты запустить нельзя, агент обязан прямо заявить о рисках, а не выдавать результат за проверенный.
Какие задачи решает
- переделать экран мобильного приложения под десктоп и планшет
- устранить полосы переполнения overflow при изменении размера окна
- заменить проверки
Platform.is*на брейкпоинты иLayoutBuilder - объединить состояние навигации для
NavigationBarиNavigationRail - настроить управление с клавиатуры и фокус для больших экранов
Примеры запросов агенту
- Сделай этот экран профиля адаптивным: на десктопе покажи две колонки, а на телефоне оставь одну.
- Найди вёрстку с Platform.isIOS и перепиши её на брейкпоинты через LayoutBuilder.
- Проверь форму заказа на переполнение при ширине окна от 600 до 840 пикселей.
Как установить flutter-adaptive-ui
1Через Skills CLI (Vercel)
npx skills add MADTeacher/mad-agents-skills --skill flutter-adaptive-ui -a claude-code2Вручную: положить файлы
~/.claude/skills/flutter-adaptive-ui/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/flutter-adaptive-ui/
1Через Skills CLI (Vercel)
npx skills add MADTeacher/mad-agents-skills --skill flutter-adaptive-ui -a codex2Вручную: положить файлы
.agents/skills/flutter-adaptive-ui/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add MADTeacher/mad-agents-skills --skill flutter-adaptive-ui -a cursor2Вручную: положить файлы
.cursor/skills/flutter-adaptive-ui/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install MADTeacher/mad-agents-skills flutter-adaptive-ui2Вручную: положить файлы
.github/skills/flutter-adaptive-ui/SKILL.md1Через Skills CLI (Vercel)
npx skills add MADTeacher/mad-agents-skills --skill flutter-adaptive-ui -a gemini-cli2Командой платформы
gemini skills install https://github.com/MADTeacher/mad-agents-skills --path flutter-adaptive-uiВручную: положить файлы
.devin/skills/flutter-adaptive-ui/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add MADTeacher/mad-agents-skills --skill flutter-adaptive-ui -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о flutter-adaptive-ui
Как установить flutter-adaptive-ui в Claude Code?
Выполните команду npx skills add MADTeacher/mad-agents-skills --skill flutter-adaptive-ui -a claude-code.
Что делает flutter-adaptive-ui?
Скилл даёт агенту правила и паттерны для вёрстки Flutter-приложений под разные экраны, от мобильных телефонов до складных устройств и десктопа. Он учит ветвить интерфейс по доступным размерам, настраивать ввод с мыши или клавиатуры и сохранять состояние при изменении окна.
Почему скилл запрещает использовать Platform.isAndroid для вёрстки?
Платформа не гарантирует конкретный размер экрана: Android работает и на часах, и на планшетах, а десктопное окно можно сжать до мобильной ширины. Вёрстка должна зависеть от ограничений родителя и ширины окна, а не от названия операционной системы.
Исходный текст
SKILL.md · MIT
--- name: flutter-adaptive-ui description: Build, fix, review, and validate adaptive or responsive Flutter UIs for mobile, tablet, desktop, web, large screens, foldables, and mixed input devices. Use when creating breakpoint-driven layouts, responsive navigation, adaptive dialogs/lists/grids, keyboard/mouse/touch behavior, window-size decisions with MediaQuery or LayoutBuilder, or Capability and Policy patterns for platform-specific behavior. metadata: author: Stanislav [MADTeacher] Chernyshev version: "2.0" --- # Flutter Adaptive UI You are a Flutter adaptive UI implementation agent. Your job is to make the UI work from narrow mobile windows to expanded desktop/web layouts without guessing from device type. ## Principle 0 Adaptive Flutter UI is based on available constraints, not platform labels. Use window or parent constraints for layout decisions, keep touch usable first, and add mouse, keyboard, and platform behavior as explicit branches that can be tested. Core rule: constraints go down, sizes go up, parent sets position. Default breakpoints: - Compact: width < 600 - Medium: 600 <= width < 840 - Expanded: width >= 840 ## Workflow 1. Identify the user flow, target form factors, supported platforms, and the expensive failure mode: overflow, unreadable wide content, lost state, inaccessible keyboard flow, or wrong platform behavior. 2. Inspect existing widgets before changing layout. Find navigation, dialogs, lists, grids, fixed widths/heights, orientation checks, `Platform.*` layout checks, and custom input/focus handling. 3. Abstract shared data before branching. For example, create one destination model used by both `NavigationBar` and `NavigationRail`. 4. Measure the right space: - Use `MediaQuery.sizeOf(context)` for app-level or page-level window decisions. - Use `LayoutBuilder` when the branch depends on the parent constraints of a widget subtree. 5. Branch by breakpoints or capabilities, not by device type. Use compact/medium/expanded layouts for space changes; use Capability and Policy objects for what the app can do or should do. 6. Implement the smallest adaptive change that preserves state. Keep scroll position, selected navigation destination, form input, and focus stable across resize/orientation/fold changes. 7. Validate on at least compact and expanded widths. Include medium width when the implementation has a distinct tablet layout. ## Resource Routing | Task | Read/use | Purpose | |---|---|---| | Need the full adaptive design process | [adaptive-workflow.md](references/adaptive-workflow.md) | Abstract, measure, branch workflow and breakpoint choice | | Need constraints or overflow diagnosis | [layout-constraints.md](references/layout-constraints.md) | Flutter layout rules and edge cases | | Need basic layout widget guidance | [layout-basics.md](references/layout-basics.md) | Rows, columns, alignment, sizing, and composition | | Need common layout widget behavior | [layout-common-widgets.md](references/layout-common-widgets.md) | Container, GridView, ListView, Stack, Card, ListTile | | Need adaptive UX guardrails | [adaptive-best-practices.md](references/adaptive-best-practices.md) | Orientation, width, inputs, state, and performance guidance | | Need platform behavior branching | [adaptive-capabilities.md](references/adaptive-capabilities.md) | Capability and Policy structure | | Need responsive navigation starter code | [responsive_navigation.dart](assets/responsive_navigation.dart) | Copy only after fitting destinations and selected state to the target app | | Need Capability/Policy starter code | [capability_policy_example.dart](assets/capability_policy_example.dart) | Copy only after replacing placeholder behavior with real app services | Do not read every reference by default. Read only the routed material needed for the current failure mode or implementation path. ## Implementation Rules - Treat Dart snippets in `references/` as explanatory fragments unless the reference explicitly says otherwise. Use `assets/` for starter code. - Do not use `Platform.isIOS`, `Platform.isAndroid`, device names, or `OrientationBuilder` for layout decisions. Use available width/constraints instead. - Do not let large screens stretch text fields, cards, lists, or reading content across the full window without a deliberate max width or multi-column layout. - Start with a solid touch interaction, then add hover, shortcuts, focus traversal, and keyboard activation as accelerators. - Use `GridView.extent`, adaptive flex layouts, or constrained content widths for expanded layouts instead of duplicating whole screens when a local reflow is enough. - Keep Capability methods about what is possible and Policy methods about what should be shown or allowed. Name methods by the decision, not by the platform. - Treat bundled assets as starter examples. They are copy-ready only after `flutter analyze` passes in the target project or a scratch Flutter project. ## Validation After changing a Flutter project: 1. Run `flutter analyze`. 2. Run relevant widget tests when layout branching, navigation state, focus, or policy/capability behavior changed. 3. Manually or automatically check narrow (<600), medium (600-839 when used), and expanded (>=840) widths. 4. Verify no new overflow stripes, clipped text, lost selected state, lost scroll position, or broken keyboard traversal. 5. If validation cannot run, report the blocker and the risk. Do not present an adaptive UI change as verified without a width check or analysis result. ## Fallback If the target project lacks enough context to choose a final layout, implement the smallest reversible abstraction first: shared destination/data models, local `LayoutBuilder` branches, and isolated Capability/Policy interfaces. Ask the user only for product decisions that cannot be inferred from the app, such as which content should move, hide, or become primary on each form factor.
© Stanislav [MADTeacher] Chernyshev · MIT · MADTeacher/mad-agents-skills