gskinnerteam/flutter-hatcha-app/genui
Claude Code and agent skill by gskinnerteam/flutter-hatcha-app
- community
Checking that the SKILL.md file is still in the repository.
Core GenUI framework for dynamic AI-driven UIs. Use when: working with Conversation, SurfaceController, Transport, Surface, SurfaceHost, Catalog, CatalogItem, CatalogItemContext, DataModel, DataContext, DataPath, A2uiSchemas, ClientFunction, PromptBuilder, A2UiClientCapabilities, data binding, A2UI message protocol, ChatMessage, UiEvent, or SurfaceDefinition.
Install
npx vskill@latest install gskinnerteam/flutter-hatcha-app/genuiSKILL.md
GenUI Package — API Reference
The genui package (v0.9.0) is the core framework for building Flutter applications with dynamically generated user interfaces powered by AI. The UI is not predefined — it is constructed in real-time through a conversation cycle between the app, an AI model, and the user. Implements the A2UI protocol v0.9.
When to Use
- Working with
Conversationlifecycle (send requests, listen for surfaces/text/errors) - Rendering dynamic UI with
Surfacewidget - Implementing a custom
Transport - Subscribing to or updating
DataModel/DataContextpaths - Working with
A2uiSchemasreference types - Using
CatalogItemContextproperties (data, dataContext, buildChild, dispatchEvent) - Processing
A2uiMessageprotocol messages (CreateSurface, UpdateComponents, UpdateDataModel, DeleteSurface) - Working with
ChatMessageorMessageParttypes - Defining custom
ClientFunctionimplementations - Building prompts with
PromptBuilder - Generating
A2UiClientCapabilitiesfrom catalogs
Project conventions for creating catalogue item _files_ (5-step convention, naming, example data rules, three-tier pattern) live in thecatalogue-itemsskill. This skill covers the _package API_.
Core Architecture
Interaction Flow
Quick Reference — Top-Level Classes
Conversation
High-level facade for managing a GenUI conversation. Orchestrates the SurfaceController and Transport.
| Property / Method | Type | Purpose | |
|---|---|---|---|
controller | SurfaceController | Manages surfaces | |
transport | Transport | AI communication | |
events | Stream<ConversationEvent> | Event stream (surfaces, text, errors) | |
state | ValueListenable<ConversationState> | Current conversation state | |
sendRequest(message) | Future<void> | Send user message to AI | |
dispose() | void | Clean up resources |
ConversationEvent (Sealed)
| Event | Key Fields | Purpose | |
|---|---|---|---|
ConversationSurfaceAdded | surfaceId, definition | New surface created | |
ConversationComponentsUpdated | surfaceId, definition | Components updated | |
ConversationSurfaceRemoved | surfaceId | Surface deleted | |
ConversationContentReceived | text | Text response from AI | |
ConversationWaiting | — | Waiting for response | |
ConversationError | error, stackTrace? | Error occurred |
ConversationState
Surface
Flutter widget that dynamically renders a UI from a SurfaceDefinition.
- Listens to
hostfor updates tosurfaceId - Recursively builds Flutter widgets from
Componentdefinitions via theCatalog - Dispatches user interactions back to the host
Transport (Interface)
Abstract interface for AI communication. Implement this to connect to a custom backend.
A2uiTransportAdapter
Push-based transport for imperative integration. Wraps A2uiParserTransformer to parse streaming text into A2UI messages.
| Method / Property | Type | Purpose | |
|---|---|---|---|
addChunk(text) | void | Feed text from LLM | |
addMessage(msg) | void | Inject raw A2uiMessage | |
incomingText | Stream<String> | Sanitized text for chat UI | |
incomingMessages | Stream<A2uiMessage> | Parsed A2UI messages | |
sendRequest(msg) | Future<void> | Delegates to onSend callback |
SurfaceController
Runtime controller for the GenUI system. Manages surfaces, data models, and message routing.
| Property / Method | Type | Purpose | |
|---|---|---|---|
catalogs | Iterable<Catalog> | Available component catalogs | |
surfaceUpdates | Stream<SurfaceUpdate> | Surface lifecycle events | |
onSubmit | Stream<ChatMessage> | Messages to submit to AI | |
activeSurfaceIds | Iterable<String> | Currently active surfaces | |
clientCapabilities | A2UiClientCapabilities | Auto-generated from catalogs | |
handleMessage(msg) | void | Process an A2uiMessage | |
contextFor(surfaceId) | SurfaceContext | Get context for a surface | |
dispose() | void | Clean up |
Implements both SurfaceHost and A2uiMessageSink.
PromptBuilder
Builds system prompts from catalogs and fragments for AI communication.
PromptFragments
Static utility methods for common prompt fragments:
| Method | Purpose | |
|---|---|---|
PromptFragments.acknowledgeUser() | Require AI to acknowledge user message | |
PromptFragments.requireAtLeastOneSubmitElement() | Require submit elements | |
PromptFragments.currentDate() | Inject current date | |
PromptFragments.uiGenerationRestriction() | Restrict to JSON text blocks |
A2UiClientCapabilities
Describes the client's UI rendering capabilities to the server.
InlineCatalogHandling | Behavior | |
|---|---|---|
none | Never inline; throw if catalog has no ID | |
missingIds | Inline only catalogs without a catalogId | |
all | Inline all catalogs |
SurfaceUpdate (Sealed)
Events broadcast when surfaces change.
Reference Docs
| Topic | File | Key Classes | |
|---|---|---|---|
| Data binding & A2uiSchemas | data-binding.md | DataModel, DataContext, DataPath, A2uiSchemas, DataContextExtensions | |
| Catalog & widget building | catalog-api.md | Catalog, CatalogItem, CatalogItemContext, BasicCatalog | |
| A2UI protocol & chat messages | messages.md | A2uiMessage, ChatMessage, MessagePart | |
| UI models, events & tools | ui-models.md | SurfaceDefinition, Component, SurfaceUpdate, UiEvent, SurfaceController |
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.github/skills/genui/SKILL.md
Popularity
- Repository stars
- 66
- Repository forks
- 7
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/gskinnerteam/flutter-hatcha-app/genui)