flutter-duit-bdui
Skill106 starsChanged 7 months agoMITView on GitHub
Integrate, fix, review, migrate, test, or debug Duit / flutter_duit backend-driven UI in Flutter applications. Use when a task mentions DUIT, flutter_duit, backend-driven UI, BDUI, server-driven UI, XDriver, DuitViewHost, DuitRegistry, HTTP or WebSocket transports, custom Duit widgets, components, capability delegates, compile-time DUIT flags, or rendering JSON layouts from a backend.
In this repository10 other files it gives its agents.
- agents-md-generatorSkill
- dart-driftSkill
- flutter-adaptive-uiSkill
- flutter-animationsSkill
- flutter-architectureSkill
- flutter-driftSkill
- flutter-internationalizationSkill
- flutter-navigationSkill
- flutter-networkingSkill
- flutter-testingSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
18 rules. About 0 are common, 11 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
Prefer pubspec.lock or the existing dependency constraint.
- Very specific: line 34
If adding the package, check current official package docs or run flutter pub add flutter_duit when dependency installation is part of the …
- Distinctive: line 37
If the package major version is not 4.x, verify API names before using any examples from this skill.
- Very specific: line 40
Use XDriver.remote for backend-driven screens loaded from a server.
- Very specific: line 41
Use XDriver.static for local JSON, tests, previews, or offline fixtures.
- Distinctive: line 42
Use custom widgets/components only when server JSON must render UI that the built-in collection cannot represent.
- Distinctive: line 44
Use capability delegates only for framework behavior changes such as custom transport, logging, focus, scripting, native modules, or action …
- Distinctive: line 47
Read only the routed resources needed for the scenario.
- Very specific: line 91
Do not use older or unverified constructor shapes such as XDriver(...), HttpTransportManager(options: ...), headers, or WSTransportManager …
- Distinctive: line 114
Do not invent server JSON schema, action payloads, event formats, or widget attributes.
- Very specific: line 116
Do not add duit_kernel directly unless the task requires kernel models, custom extensions, or APIs not exported by flutter_duit.
- Distinctive: line 118
Do not register custom widgets after the app has already tried to render layouts that use them.
- Distinctive: line 120
Do not keep a driver as an unowned global unless the existing architecture has a clear lifecycle owner and cleanup path.
- Distinctive: line 122
Do not silently downgrade unknown widget behavior in development.
- Distinctive: line 125
Do not promise WebSocket, native module, scripting, or component support from this skill alone.
- Distinctive: line 130
Run the strongest available validation for the target project:
- Distinctive: line 142
If any validation command is unavailable, blocked by dependency download, platform setup, or missing project context, say which check did …
- Very specific: line 147
If the target version/API cannot be verified, stop before writing speculative Duit code that may not compile.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter Duit Backend-Driven UI
You are a Flutter BDUI integration engineer for Duit and flutter_duit.
Principle 0
flutter_duit has changed its public API across major versions. Do not write
driver, transport, registry, or widget-host code from memory. First identify the
installed or target package version, then use examples and API shapes that match
that version. If the version cannot be determined, use current official docs as
the default and state the assumption.
Workflow
- Identify the task type: install, render a remote/static layout, add a custom widget, register components, configure transport, customize capabilities, tune compile-time flags, or debug rendering/lifecycle issues.
- Inspect the target Flutter project before editing:
pubspec.yaml,pubspec.lockwhen present, existing Duit setup, app entrypoint, state management, routing, and test conventions. - Determine the
flutter_duitversion:- Prefer
pubspec.lockor the existing dependency constraint. - If adding the package, check current official package docs or run
flutter pub add flutter_duitwhen dependency installation is part of the user request. - If the package major version is not 4.x, verify API names before using any examples from this skill.
- Prefer
- Choose the smallest integration path that fits the product need:
- Use
XDriver.remotefor backend-driven screens loaded from a server. - Use
XDriver.staticfor local JSON, tests, previews, or offline fixtures. - Use custom widgets/components only when server JSON must render UI that the built-in collection cannot represent.
- Use capability delegates only for framework behavior changes such as custom transport, logging, focus, scripting, native modules, or action execution.
- Use
- Read only the routed resources needed for the scenario.
- Implement with normal Flutter ownership rules: keep driver lifecycle in a
StatefulWidgetor equivalent owner, register custom widgets before rendering layouts, and dispose drivers/managers that own resources. - Validate in the target project. If validation cannot run, report the blocker and the residual risk instead of implying the integration is proven.
Current 4.x API Guardrail
For flutter_duit 4.x, prefer the public shapes shown by current package
examples:
final driver = XDriver.remote(
transportManager: HttpTransportManager(
url: "/layout",
baseUrl: "http://localhost:3000",
defaultHeaders: {
"Content-Type": "application/json",
},
),
);DuitViewHost.withDriver(
driver: driver,
placeholder: const CircularProgressIndicator(),
);final driver = XDriver.static(
{
"type": "Text",
"id": "1",
"attributes": {
"data": "Hello, World!",
},
},
transportManager: StubTransportManager(),
);Do not use older or unverified constructor shapes such as
XDriver(...), HttpTransportManager(options: ...), headers, or
WSTransportManager unless the installed package version and API reference
confirm them.
Resource Routing
| Task | Read | Why |
| Driver lifecycle, remote/static/native mode, event streams, or public methods | references/public_api.md | Version-aware API contracts and 4.x examples |
| Custom capabilities, custom transport, logging, focus, scripting, native modules, or action execution | references/capabilities.md | Delegate responsibilities and implementation guardrails |
Compile-time DUIT behavior flags or --dart-define usage | references/environment_vars.md | Supported flags, defaults, and command examples |
| Rendering failures, initialization errors, theme issues, or memory leaks | references/troubleshooting.md | Symptom-to-action debugging checklist |
External sources to verify when API details matter:
https://pub.dev/packages/flutter_duithttps://pub.dev/documentation/flutter_duit/latest/https://github.com/Duit-Foundation/flutter_duithttps://www.duit.pro/docs/
Constraints
- Do not invent server JSON schema, action payloads, event formats, or widget attributes. Inspect existing backend contracts, fixtures, docs, or tests.
- Do not add
duit_kerneldirectly unless the task requires kernel models, custom extensions, or APIs not exported byflutter_duit. - Do not register custom widgets after the app has already tried to render layouts that use them.
- Do not keep a driver as an unowned global unless the existing architecture has a clear lifecycle owner and cleanup path.
- Do not silently downgrade unknown widget behavior in development. Prefer surfacing schema issues early unless the user explicitly wants permissive fallback behavior.
- Do not promise WebSocket, native module, scripting, or component support from this skill alone; verify the exact API for the installed package version.
Validation
Run the strongest available validation for the target project:
flutter pub getafter dependency changes.dart formaton edited Dart files.flutter analyzefor Flutter projects.- Existing focused tests, or
flutter testwhen the change touches shared UI, actions, parsing, or lifecycle behavior. - For static layout work, add or run a smoke test/widget preview that renders a
minimal
DuitViewHost.withDriver. - For remote transport work, verify base URL, route, headers, auth handling, loading state, error state, and driver disposal.
If any validation command is unavailable, blocked by dependency download, platform setup, or missing project context, say which check did not run and why.
Fallback
If the target version/API cannot be verified, stop before writing speculative
Duit code that may not compile. Ask for the intended flutter_duit version or
permission to inspect/install dependencies. If the user asks for a best-effort
draft anyway, mark the code as version-assumed and list the validation still
needed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

