Skip to content

Conversation

@csells
Copy link
Contributor

@csells csells commented Dec 20, 2025

This PR provides new "AI Best Practices" docs to the Flutter docs in the "AI solutions" section of the site.

Screenshot 2025-12-20 at 6 08 05 AM

It's also the first real-world test of a proof-of-concept "shamsify" tool that used the markdown content downloaded from a Google Doc (the original Flutter AI Best Practices doc) to produce 100% of the content for this PR, including the following:

  • Multi-page splitting - Splits documents at H1 headings into separate pages
  • Image extraction - Extracts embedded base64 images with LLM-generated alt text and semantic filenames (e.g., crossword-app-main-screen.png instead of image1.png)
  • Link refactoring - Converts inline links to reference-style with LLM-generated semantic tags
  • URL substitution - Replaces common URLs with {{site.github}}, {{site.pub-pkg}}, etc.
  • Code block detection - LLM-based language detection; auto-converts javascriptdart
  • Note conversion - Transforms **NOTE:** blocks to :::note syntax
  • Numbered lists - Converts markdown lists to HTML <ol>/<li>
  • Cleanup - Removes Google Docs artifacts (\!!, \__, \[[, etc.)
  • Front matter - Generates YAML with title, LLM-generated description, and prev/next navigation

The work would previously have taken 6+ hours of concentrated, error-prone, detail-oriented manual human labor.

The tool executed the transformation from the source doc in 3m 4.98s:

$ ~shamsify/example/main.dart -p flutter/website/src/content/ai-best-practices ~/Downloads/Flutter\ AI\ Best\ Practices.md

Transforming: /Users/csells/Downloads/Flutter AI Best Practices.md
Pages output: /Users/csells/code/Forks/flutter/website/src/content/ai-best-practices
Images output: /Users/csells/code/Forks/flutter/website/site/web/assets/images/docs/ai-best-practices
Topic: ai-best-practices

Extracting images...
Splitting document at H1 headings...
Found 6 sections: Flutter AI best practices, Prompting, Structure & Output, Tool Calls (aka Function Calls), Mode of Interaction, Developer Experience
Normalizing titles for sentence case...
Processing section 1 of 6: Flutter AI best practices
  - Refactoring code blocks...
  - Removing escaped characters...
  - Converting numbered lists...
  - Rewriting image paths...
  - Removing spurious .md links...
  - Refactoring links...
  - Converting notes...
  - Generating description via LLM...
  ✓ Section complete
Processing section 2 of 6: Prompting
  - Refactoring code blocks...
  - Removing escaped characters...
  - Converting numbered lists...
  - Rewriting image paths...
  - Removing spurious .md links...
  - Refactoring links...
  - Converting notes...
  - Generating description via LLM...
  ✓ Section complete
Processing section 3 of 6: Structure & Output
  - Refactoring code blocks...
  - Removing escaped characters...
  - Converting numbered lists...
  - Rewriting image paths...
  - Removing spurious .md links...
  - Refactoring links...
  - Converting notes...
  - Generating description via LLM...
  ✓ Section complete
Processing section 4 of 6: Tool Calls (aka Function Calls)
  - Refactoring code blocks...
  - Removing escaped characters...
  - Converting numbered lists...
  - Rewriting image paths...
  - Removing spurious .md links...
  - Refactoring links...
  - Converting notes...
  - Generating description via LLM...
  ✓ Section complete
Processing section 5 of 6: Mode of Interaction
  - Refactoring code blocks...
  - Removing escaped characters...
  - Converting numbered lists...
  - Rewriting image paths...
  - Removing spurious .md links...
  - Refactoring links...
  - Converting notes...
  - Generating description via LLM...
  ✓ Section complete
Processing section 6 of 6: Developer Experience
  - Refactoring code blocks...
  - Removing escaped characters...
  - Converting numbered lists...
  - Rewriting image paths...
  - Removing spurious .md links...
  - Refactoring links...
  - Converting notes...
  - Generating description via LLM...
  ✓ Section complete
Wrote index.md
Wrote prompting.md
Wrote structure-output.md
Wrote tool-calls-aka-function-calls.md
Wrote mode-of-interaction.md
Wrote developer-experience.md
Wrote crossword-task-list-showing-solved-clues.png to /Users/csells/code/Forks/flutter/website/site/web/assets/images/docs/ai-best-practices
Wrote crossword-companion-app-displaying-a-con.png to /Users/csells/code/Forks/flutter/website/site/web/assets/images/docs/ai-best-practices
Wrote app-task-list-showing-crossword-clues-fo.png to /Users/csells/code/Forks/flutter/website/site/web/assets/images/docs/ai-best-practices
Wrote crossword-companion-interface-showing-a.png to /Users/csells/code/Forks/flutter/website/site/web/assets/images/docs/ai-best-practices
Wrote crossword-companion-app-showing-a-5x5-gr.png to /Users/csells/code/Forks/flutter/website/site/web/assets/images/docs/ai-best-practices
Wrote crossword-companion-app-interface-showin.png to /Users/csells/code/Forks/flutter/website/site/web/assets/images/docs/ai-best-practices

Done! Generated 6 pages.

Presubmit checklist

  • If you are unwilling, or unable, to sign the CLA, even for a tiny, one-word PR, please file an issue instead of a PR.
  • If this PR is not meant to land until a future stable release, mark it as draft with an explanation.
  • This PR follows the Google Developer Documentation Style Guidelines—for example, it doesn't use i.e. or e.g., and it avoids I and we (first-person pronouns).
  • This PR uses semantic line breaks
    of 80 characters or fewer.

@csells csells requested review from a team and sfshaza2 as code owners December 20, 2025 14:21
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @csells, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request integrates new, detailed documentation on AI best practices for Flutter applications. The content, which covers essential aspects like effective prompting, managing structured input/output, implementing tool calls, and optimizing developer experience with AI, was efficiently generated using an innovative automation tool. This update aims to provide Flutter developers with robust guidance for building reliable and high-quality AI-powered features.

Highlights

  • New AI Best Practices Documentation: This PR introduces a comprehensive set of new documentation pages focused on 'AI Best Practices' for Flutter developers, covering topics from prompting to tool calls and developer experience.
  • Automated Content Generation with 'shamsify' Tool: The entire documentation content was generated using a proof-of-concept 'shamsify' tool, which automates various Markdown transformations, image extraction, and front matter generation from a Google Doc source.
  • Significant Efficiency Gains: The 'shamsify' tool drastically reduced the effort required for content creation, transforming a process that would typically take 6+ hours of manual labor into just over 3 minutes.
  • Enhanced Documentation for Link Checking: Instructions have been added to the README.md file, guiding contributors on how to build the site and check for broken links using dart run dash_site build and dart run dash_site check-link-references.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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 PR adds a comprehensive set of documents on "AI Best Practices" for Flutter development, which is a great addition. The content is well-structured and covers important topics from prompting to developer experience. The automated generation of this content from a Google Doc is impressive. I've found a few typos, formatting issues, and a couple of errors in the Dart code snippets across the new markdown files. While the PR checklist mentions adherence to semantic line breaks, many lines in the new documentation exceed the 80-character limit. Addressing these points will improve the clarity and correctness of the documentation. The update to README.md is clear and helpful.

@flutter-website-bot
Copy link
Collaborator

flutter-website-bot commented Dec 20, 2025

Visit the preview URL for this PR (updated for commit bdbe64e):

https://flutter-docs-prod--pr12853-ai-best-practices-q99zuata.web.app

csells and others added 10 commits December 20, 2025 06:31
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>
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>
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>
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>
@csells
Copy link
Contributor Author

csells commented Dec 20, 2025

/gemini review the updated content

Copy link
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 PR adds a comprehensive set of documents on "AI Best Practices" for Flutter development. The content is well-structured and covers important topics from prompting to developer experience. The automated generation of this content from a Google Doc is impressive.

My review focuses on improving clarity, fixing typos, and ensuring consistency with the project's style guidelines. I've noticed a few areas for improvement:

  • Semantic Line Breaks: The PR description states adherence to semantic line breaks of 80 characters or fewer, but many paragraphs in the new markdown files exceed this limit. I've added a comment with an example, but this applies to most of the new documentation pages.
  • Code Snippets: Some Dart code snippets contain ... which is not valid syntax. These should be replaced with // ... to indicate omitted code.
  • Consistency: There are minor inconsistencies like trailing newlines in files and capitalization in prompt examples.

Overall, this is a great addition to the Flutter documentation. The suggested changes are mostly minor and aim to polish the content for a better reader experience.

csells and others added 8 commits December 20, 2025 07:11
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>
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>
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>
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>
@sfshaza2 sfshaza2 changed the title Add link checking instructions to README.md Add AI best practices and Crossword Companion docs Dec 20, 2025
Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

Mostly lgtm, but I have a couple concerns. @parlough, please weigh in:

  1. The text in these new docs use "curly" or "fancy" single- and double-quotes but we mostly use regular single- and double-quotes on the website. (I use "vi" to edit website docs, which can cause matching fails since I'm searching for regular single- and double-quotes.)

  2. The top-level directory for these docs is ai-best-practices. This seems a little counter-intuitive to me, especially as the primary reason for these pages is to document Crossword Companion. Also, this makes three top-level AI-related directories: ai, ai-toolkit, and ai-best-practices. That seems rather top-heavy to me, AI-wise.

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