Skip to content

Add two skills to the genui package#800

Merged
redbrogdon merged 7 commits intoflutter:mainfrom
redbrogdon:skills-baby-skills
Apr 15, 2026
Merged

Add two skills to the genui package#800
redbrogdon merged 7 commits intoflutter:mainfrom
redbrogdon:skills-baby-skills

Conversation

@redbrogdon
Copy link
Copy Markdown
Collaborator

@redbrogdon redbrogdon commented Mar 16, 2026

This PR introduces two new AI agent skills for the GenUI package, along with a brief update to the README.md.

Specifically, this adds:

  • integrate-genui-firebase: Guides AI agents on how to integrate the GenUI package into a Flutter app and set up a basic conversational agent using Firebase AI Logic, covering everything from initialization to surface rendering.
  • create-catalog-item Provides instructions for AI agents on how to create a new CatalogItem widget, including defining the data schema, widget builder, action resolution, and handling imports.
  • README update: Adds a short blurb to the root README.md to introduce or document these new capabilities.

Both of these have been evaluated manually, but I don't yet have a dataset for doing automated evals for them.

Pre-launch Checklist

  • I read the [Flutter Style Guide] recently, and have followed its advice.
  • I signed the [CLA].
  • I read the [Contributors Guide].
  • [N/A] I have added sample code updates to the [changelog].
  • [N/A] I updated/added relevant documentation (doc comments with ///).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces two new AI agent skills and updates the README. The new skills provide detailed instructions for an AI, and my review focuses on improving the robustness and correctness of the code examples within these skills. I've suggested changes to make the code safer and more idiomatic, particularly around error handling and event processing. Additionally, I've noted a URL in the README that appears to point to a personal fork instead of the canonical repository.

Note: Security Review has been skipped due to the limited scope of the PR.

Comment thread packages/genui/skills/integrate-genui-firebase/SKILL.md
Comment thread README.md Outdated
Comment thread packages/genui/skills/create-catalog-item/SKILL.md Outdated
Comment thread packages/genui/skills/create-catalog-item/SKILL.md
@gspencergoog
Copy link
Copy Markdown
Collaborator

Looks like there are copyright issues (which are not your fault). I'd try syncing to head and see if they go away.

Copy link
Copy Markdown
Collaborator

@jacobsimionato jacobsimionato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fantastic!

- Implement the `widgetBuilder: (itemContext)`:
- Cast `itemContext.data` to `Map<String, Object?>`.
- Parse the data using the data class `fromJson` method: `_<SchemaName>Data.fromJson(json)`.
- Return the corresponding Widget class and pass the required data.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to have something in here about subscribing to dynamic values using the utilities like BoundString etc. E.g. if you change the title to A2uiSchemas.stringReference, and then use BoundString, similar to this:

https://github.com/flutter/genui/blob/main/packages/genui/lib/src/catalog/basic_catalog_widgets/text.dart

_conversation.events.listen((event) {
switch (event) {
case ConversationSurfaceAdded added:
_onSurfaceAdded(added.surfaceId);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to add a bit more context around how to manage the conversation state here and in step 11. E.g. perhaps this could call a fictional method called _addUIMessageToConversation(added.surfaceId) and then below in step 11, there could be something like:

Widget buildConversationTurn(MyTurn turn) {
  if (turn.surfaceId != null) {
      return Surface(turn.surfaceId);
  } else {
      // build non-UI conversation turn
  }
}

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added some additional text in step 9 to talk about different kinds of UI patterns (conversational vs. named, positioned surfaces) and what to do when surfaces are added. I'm hoping that this skill can work for both.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea. I have literally never worked with a bound value before, though, so that's something for me to learn. I can either add it to this skill or create a separate "bind to a value" skill.

redbrogdon and others added 7 commits April 15, 2026 09:42
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@redbrogdon
Copy link
Copy Markdown
Collaborator Author

Thanks for the review, and sorry for letting this dangle for so long. I'm going to merge the current version and then start on a resource for binding to values. Suggestions for more skills are very welcome!

@redbrogdon redbrogdon merged commit 1e91c8c into flutter:main Apr 15, 2026
32 checks passed
@redbrogdon redbrogdon deleted the skills-baby-skills branch April 15, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants