Elattar Flutter UI Director
Build interfaces that are finished. Finished means every surface handles its
states, every trigger answers the user, every failure is written in human words
with one next step, and every control works by keyboard, at every width, in both
themes.
Treat the design system as implementation material, not inspiration. Inspect the
public APIs the barrel exports before proposing a primitive.
Public names carry no prefix. They are ordinary nouns: Button, Card, Icon,
TextStyles, space. Never search for or compose an El* API; a name starting
with El is a retired spelling, not a widget.
Choose the depth
Match the process to the risk. Do not turn a copy edit or a read-only review
into a full product-delivery exercise.
- Quick — explanation, audit, documentation-only change, or one contained
correction with no new rendered behavior. Resolve the mode, inspect the
relevant source, make the scoped change, and run focused checks. No UI
contract, state matrix, capture set, or full suite unless the change affects
them.
- Standard — a change to an existing screen, component, interaction, or
responsive layout. Write a short contract for the affected surface, cover
the states that apply, and run focused tests plus the relevant width, theme,
text-scale, and accessibility checks.
- Full — a new screen or flow, a new system primitive, or a cross-system
foundation change. Use the complete workflow, verification ladder, scanner,
captures, and handoff gate.
Workflow
- Resolve the mode. Step 0 of system-map.md,
before reading or writing anything. Consumer mode and repository mode put the
system in different directories, and every path named in this skill is the
repository-mode name. If neither probe matches, say so and stop.
- Choose the depth. Quick, standard, or full. State it before acting.
- Classify the work. Product screen, package component, lineage-informed
port, agent console, documentation, or review and fix.
- Inventory the real APIs. Use the discovery commands for your mode in
system-map.md: barrel, source, tests, specimens.
Do not guess that a widget exists.
- Define the outcome. For standard work, write a short acceptance contract.
For full work, write ui-contract.md. Quick work
needs only the requested outcome and the focused check that proves it.
- Set the visual direction when visuals change.
visual-direction.md: one dominant idea, a
clear hierarchy, at most one supporting effect.
- Design the states that apply before the widgets.
states.md, errors.md,
feedback.md. Static documentation and read-only
reviews do not invent asynchronous states they do not have.
- Build. Compose exported widgets. Follow
page-blueprint.md for pages and sections, and
component-spec.md for anything reusable.
Product UI stays outside the system-owned component directory.
- Cover the relevant platform, access, theme, and copy rules.
responsive.md,
accessibility.md,
theming.md, copy.md. For
agent-facing work, agent-console.md.
- Verify in proportion to the depth. Use verify.md.
Run focused checks for quick work, the affected surface matrix for standard
work, and the complete ladder and gate for full work. Report only commands
actually run and limitations that matter.
Non-negotiable contract
Apply every clause relevant to the task. Source of truth, access, and
composition always apply. Completeness, errors, and feedback apply when the
surface reads data or accepts interaction; they are not paperwork for static
documentation.
Paths here are repository-mode names. In consumer mode substitute
lib/design_system/foundation/ for lib/src/design_system/foundation/,
lib/components/ui/ for lib/src/components/ui/, and lib/blocks/ for
lib/src/blocks/, and import through the generated barrels. See
system-map.md.
Effect and motion widgets are components: they live in
lib/src/components/ui/ alongside every other control. Motion values live in
lib/src/design_system/foundation/motion.dart. Complete application
compositions are blocks, under lib/src/blocks/.
Source of truth. Import through the entry point your mode provides. Never
reach past it into private internals. Geometry from space(...),
LayoutWidths, Containers, Breakpoints, Radii, or component APIs. Color
from ThemeScope.of(context) by semantic role. Type from StyledText and
TextStyles. Timing from MotionDurations, MotionCurves, and the motion
widgets. No raw colors, sizes, weights, tracking, leading, radii, shadows,
stock curves, or Duration literals outside the foundation, and no literal
hidden behind a local constant.
Completeness. Every surface that reads data handles loading, refreshing,
ready, empty, no results, and failure. Every write handles submitting, success,
and failure, and cannot be submitted twice. Every trigger produces exactly one
kind of feedback and leads to a next step. Every terminal state says what
happened and what to do now.
Errors are for people. No status code, stack trace, exception name, or
backend string in user copy. Failures are mapped to an AppError at the data
boundary and rendered with a title, a body, and one next step. Diagnostics live
behind a disclosure and in the log.
Access. Every icon-only control has a label. Every input has a visible
label. Focus is visible, ordered, trapped in overlays, and restored on close.
Async results are announced. Nothing is communicated by color alone. Text scales
to 200 percent without clipping.
Composition. Prefer a semantic system component over a styled Container,
Text, ElevatedButton, or an ad-hoc snackbar. Use status variants only for
their meaning, and keep one clear primary action. Never change a foundation
token to solve a single screen, and never use Theme.of(context) as a parallel
visual system.
Decisions and handoff
Choose the existing system contract before creating one.
- Reuse a primitive after inspecting its constructor, its test, and its example.
- In consumer mode, check whether the primitive is merely not installed yet:
elattar add --dry-run <item>. Installing beats hand-rolling.
- Add a system primitive only when it meets every requirement in
component-spec.md. One-off patterns stay in
product code.
- Installed sources in a consumer project are that project's own code and may be
edited, but
elattar add --overwrite replaces them. Record any customisation.
- Hand off at the chosen depth. Quick work names the changed files and focused
checks. Standard work adds the affected contract, states, and render checks.
Full work reports the API inventory, token and motion compliance, scanner,
automated and visual verification, and limitations from the complete gate.
References
- system-map.md mode discrimination, topology, discovery.
- ui-contract.md the artifact to write before any widget.
- states.md the state model and what renders each state.
- errors.md taxonomy, copy, and where failures appear.
- feedback.md one channel per trigger, timing, next step.
- page-blueprint.md pages, regions, lists, forms, flows.
- component-spec.md when a component is done.
- accessibility.md labels, focus, keyboard, announcements.
- responsive.md breakpoints, insets, input, content stress.
- theming.md tokens, both themes, effects.
- copy.md microcopy rules.
- visual-direction.md hierarchy, restraint, references.
- agent-console.md agent interaction requirements.
- traps.md common failure modes.
- verify.md the ladder, the scanner, and the gate.
Templates
- ui-state.md the sealed state model.
- app-error.md error taxonomy, mapper, and copy table.
- async-section.md one region, every state.
- page-scaffold.md a page whose regions fail independently.
- component-doc.md the component documentation block.
1---2name: elattar-flutter-ui-director3description: Build and review Flutter UI with Elattar's installed components and foundation tokens. Applies in the design-system repository and consumer apps with elattar.yaml when work touches screens, flows, components, responsive behavior, theming, accessibility, feedback, or UI documentation.4---56# Elattar Flutter UI Director78Build interfaces that are finished. Finished means every surface handles its9states, every trigger answers the user, every failure is written in human words10with one next step, and every control works by keyboard, at every width, in both11themes.1213Treat the design system as implementation material, not inspiration. Inspect the14public APIs the barrel exports before proposing a primitive.1516Public names carry no prefix. They are ordinary nouns: `Button`, `Card`, `Icon`,17`TextStyles`, `space`. Never search for or compose an `El*` API; a name starting18with `El` is a retired spelling, not a widget.1920## Choose the depth2122Match the process to the risk. Do not turn a copy edit or a read-only review23into a full product-delivery exercise.2425- **Quick** — explanation, audit, documentation-only change, or one contained26 correction with no new rendered behavior. Resolve the mode, inspect the27 relevant source, make the scoped change, and run focused checks. No UI28 contract, state matrix, capture set, or full suite unless the change affects29 them.30- **Standard** — a change to an existing screen, component, interaction, or31 responsive layout. Write a short contract for the affected surface, cover32 the states that apply, and run focused tests plus the relevant width, theme,33 text-scale, and accessibility checks.34- **Full** — a new screen or flow, a new system primitive, or a cross-system35 foundation change. Use the complete workflow, verification ladder, scanner,36 captures, and handoff gate.3738## Workflow39401. **Resolve the mode.** Step 0 of [system-map.md](references/system-map.md),41 before reading or writing anything. Consumer mode and repository mode put the42 system in different directories, and every path named in this skill is the43 repository-mode name. If neither probe matches, say so and stop.442. **Choose the depth.** Quick, standard, or full. State it before acting.453. **Classify the work.** Product screen, package component, lineage-informed46 port, agent console, documentation, or review and fix.474. **Inventory the real APIs.** Use the discovery commands for your mode in48 [system-map.md](references/system-map.md): barrel, source, tests, specimens.49 Do not guess that a widget exists.505. **Define the outcome.** For standard work, write a short acceptance contract.51 For full work, write [ui-contract.md](references/ui-contract.md). Quick work52 needs only the requested outcome and the focused check that proves it.536. **Set the visual direction when visuals change.**54 [visual-direction.md](references/visual-direction.md): one dominant idea, a55 clear hierarchy, at most one supporting effect.567. **Design the states that apply before the widgets.**57 [states.md](references/states.md), [errors.md](references/errors.md),58 [feedback.md](references/feedback.md). Static documentation and read-only59 reviews do not invent asynchronous states they do not have.608. **Build.** Compose exported widgets. Follow61 [page-blueprint.md](references/page-blueprint.md) for pages and sections, and62 [component-spec.md](references/component-spec.md) for anything reusable.63 Product UI stays outside the system-owned component directory.649. **Cover the relevant platform, access, theme, and copy rules.**65 [responsive.md](references/responsive.md),66 [accessibility.md](references/accessibility.md),67 [theming.md](references/theming.md), [copy.md](references/copy.md). For68 agent-facing work, [agent-console.md](references/agent-console.md).6910. **Verify in proportion to the depth.** Use [verify.md](references/verify.md).70 Run focused checks for quick work, the affected surface matrix for standard71 work, and the complete ladder and gate for full work. Report only commands72 actually run and limitations that matter.7374## Non-negotiable contract7576Apply every clause relevant to the task. Source of truth, access, and77composition always apply. Completeness, errors, and feedback apply when the78surface reads data or accepts interaction; they are not paperwork for static79documentation.8081Paths here are repository-mode names. In consumer mode substitute82`lib/design_system/foundation/` for `lib/src/design_system/foundation/`,83`lib/components/ui/` for `lib/src/components/ui/`, and `lib/blocks/` for84`lib/src/blocks/`, and import through the generated barrels. See85[system-map.md](references/system-map.md).8687Effect and motion widgets are components: they live in88`lib/src/components/ui/` alongside every other control. Motion values live in89`lib/src/design_system/foundation/motion.dart`. Complete application90compositions are blocks, under `lib/src/blocks/`.9192**Source of truth.** Import through the entry point your mode provides. Never93reach past it into private internals. Geometry from `space(...)`,94`LayoutWidths`, `Containers`, `Breakpoints`, `Radii`, or component APIs. Color95from `ThemeScope.of(context)` by semantic role. Type from `StyledText` and96`TextStyles`. Timing from `MotionDurations`, `MotionCurves`, and the motion97widgets. No raw colors, sizes, weights, tracking, leading, radii, shadows,98stock curves, or `Duration` literals outside the foundation, and no literal99hidden behind a local constant.100101**Completeness.** Every surface that reads data handles loading, refreshing,102ready, empty, no results, and failure. Every write handles submitting, success,103and failure, and cannot be submitted twice. Every trigger produces exactly one104kind of feedback and leads to a next step. Every terminal state says what105happened and what to do now.106107**Errors are for people.** No status code, stack trace, exception name, or108backend string in user copy. Failures are mapped to an `AppError` at the data109boundary and rendered with a title, a body, and one next step. Diagnostics live110behind a disclosure and in the log.111112**Access.** Every icon-only control has a label. Every input has a visible113label. Focus is visible, ordered, trapped in overlays, and restored on close.114Async results are announced. Nothing is communicated by color alone. Text scales115to 200 percent without clipping.116117**Composition.** Prefer a semantic system component over a styled `Container`,118`Text`, `ElevatedButton`, or an ad-hoc snackbar. Use status variants only for119their meaning, and keep one clear primary action. Never change a foundation120token to solve a single screen, and never use `Theme.of(context)` as a parallel121visual system.122123## Decisions and handoff124125Choose the existing system contract before creating one.126127- Reuse a primitive after inspecting its constructor, its test, and its example.128- In consumer mode, check whether the primitive is merely not installed yet:129 `elattar add --dry-run <item>`. Installing beats hand-rolling.130- Add a system primitive only when it meets every requirement in131 [component-spec.md](references/component-spec.md). One-off patterns stay in132 product code.133- Installed sources in a consumer project are that project's own code and may be134 edited, but `elattar add --overwrite` replaces them. Record any customisation.135- Hand off at the chosen depth. Quick work names the changed files and focused136 checks. Standard work adds the affected contract, states, and render checks.137 Full work reports the API inventory, token and motion compliance, scanner,138 automated and visual verification, and limitations from the complete gate.139140## References141142- [system-map.md](references/system-map.md) mode discrimination, topology, discovery.143- [ui-contract.md](references/ui-contract.md) the artifact to write before any widget.144- [states.md](references/states.md) the state model and what renders each state.145- [errors.md](references/errors.md) taxonomy, copy, and where failures appear.146- [feedback.md](references/feedback.md) one channel per trigger, timing, next step.147- [page-blueprint.md](references/page-blueprint.md) pages, regions, lists, forms, flows.148- [component-spec.md](references/component-spec.md) when a component is done.149- [accessibility.md](references/accessibility.md) labels, focus, keyboard, announcements.150- [responsive.md](references/responsive.md) breakpoints, insets, input, content stress.151- [theming.md](references/theming.md) tokens, both themes, effects.152- [copy.md](references/copy.md) microcopy rules.153- [visual-direction.md](references/visual-direction.md) hierarchy, restraint, references.154- [agent-console.md](references/agent-console.md) agent interaction requirements.155- [traps.md](references/traps.md) common failure modes.156- [verify.md](references/verify.md) the ladder, the scanner, and the gate.157158## Templates159160- [ui-state.md](templates/ui-state.md) the sealed state model.161- [app-error.md](templates/app-error.md) error taxonomy, mapper, and copy table.162- [async-section.md](templates/async-section.md) one region, every state.163- [page-scaffold.md](templates/page-scaffold.md) a page whose regions fail independently.164- [component-doc.md](templates/component-doc.md) the component documentation block.