diff --git a/README.md b/README.md index e05be7f..35f99a0 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ page on dart.dev or the ## Known issues - Running a Flutter app from within Gemini CLI and then triggering a Hot Reload - does not work in Flutter stable <= 3.37.0. + does not work in Flutter stable <= 3.35.0. Tracking issue: [gemini-cli-extensions/flutter#15](https://github.com/gemini-cli-extensions/flutter/issues/15) ## 🐛 Troubleshooting diff --git a/commands/create-app.toml b/commands/create-app.toml index 94ae571..52388e0 100644 --- a/commands/create-app.toml +++ b/commands/create-app.toml @@ -32,28 +32,54 @@ Then create the package directory, if it doesn't already exist. **VERY IMPORTANT**: Change directories to the package directory now so that future operations are relative to that directory. -## Design document +## Feature specification directory -Develop a **DETAILED** Markdown-formatted design document that follows all of the guidance you have about Dart and Flutter design patterns, rules, best practices, and core principles. Save the design document in specs/DESIGN.md in the package directory. Feel free to use your available tools to research any aspects of the design that need clarification. +Create a numbered feature directory under `specs/` to organize all specification documents. The directory should be named with a three-digit prefix followed by a kebab-case feature name (e.g., `specs/001-my-app-name/`). If other numbered directories already exist in `specs/`, use the next available number. -The design doc should (at least) include sections for: +## Design documents -- An overview +Develop **DETAILED** Markdown-formatted design documents that follow all of the guidance you have about Dart and Flutter design patterns, rules, best practices, and core principles. Feel free to use your available tools to research any aspects of the design that need clarification. + +Create the following files in the feature specification directory: + +### specs/NNN-feature-name/spec.md +The main specification document containing: +- An overview of the app - A detailed analysis of the goal or problem - Alternatives considered -- A detailed design for the new package +- A detailed design for the new app - Any diagrams needed to explain the design, in Mermaid format. - Be sure to put quotes around labels that include special characters (e.g. parenthesis). - A summary of the design - References to research URLs used to arrive at the design. -Be sure to **actually fetch and read** the research URLs **before** writing the design document. Do actual web research on the topics that are important to the design. +### specs/NNN-feature-name/data-model.md +A dedicated document for the data model containing: +- Entity definitions and relationships +- Database schema (if applicable) +- State management structure +- Data flow diagrams in Mermaid format + +### specs/NNN-feature-name/plan.md +A high-level plan document containing: +- Project milestones +- Key deliverables +- Dependencies and risks +- Success criteria + +### specs/NNN-feature-name/checklists/requirements.md +A requirements checklist containing: +- [ ] Functional requirements (checkboxed list) +- [ ] Non-functional requirements (checkboxed list) +- [ ] User stories or acceptance criteria + +Be sure to **actually fetch and read** the research URLs **before** writing the design documents. Do actual web research on the topics that are important to the design. -You must ask the user to review this design document and they must approve it before you continue on to create the implementation plan. They must review and approve it first because if they ask for any changes, it may affect the implementation plan. +You must ask the user to review these design documents and they must approve them before you continue on to create the implementation plan. They must review and approve first because if they ask for any changes, it may affect the implementation plan. ## Implementation plan -After getting explicit approval from the user for the DESIGN.md document, Develop a **DETAILED** Markdown-formatted phased implementation plan of checkboxed tasks that need to be performed in order to finish developing the package. Save the implementation plan in specs/IMPLEMENTATION.md in the package directory. +After getting explicit approval from the user for the design documents, develop a **DETAILED** Markdown-formatted phased implementation plan of checkboxed tasks that need to be performed in order to finish developing the app. Save the implementation plan in `specs/NNN-feature-name/tasks.md` (in the same feature directory as the design documents). The implementation plan should include a section for a "Journal" which will be updated after each phase and contain a log of the actions taken, things learned, surprises, and deviations from the plan. It should be in chronological order. @@ -81,11 +107,13 @@ The implementation plan should specify after each phase that you should: - [ ] Run the analyze_files tool one more time and fix any issues. - [ ] Run any tests to make sure they all pass. - [ ] Run dart_format to make sure that the formatting is correct. -- [ ] Re-read the IMPLEMENTATION.md file to see what, if anything, has changed in the implementation plan, and if it has changed, take care of anything the changes imply. -- [ ] Update the IMPLEMENTATION.md file with the current state, including any learnings, surprises, or deviations in the Journal section. Check off any checkboxes of items that have been completed. +- [ ] Re-read the tasks.md file to see what, if anything, has changed in the implementation plan, and if it has changed, take care of anything the changes imply. +- [ ] Update the tasks.md file with the current state, including any learnings, surprises, or deviations in the Journal section. Check off any checkboxes of items that have been completed. +- [ ] Update the checklists/requirements.md file to check off any requirements that have been satisfied. - [ ] Use `git diff` to verify the changes that have been made, and create a suitable commit message for any changes, following any guidelines you have about commit messages. Be sure to properly escape dollar signs and backticks, and present the change message to the user for approval. - [ ] Wait for approval. Don't commit the changes or move on to the next phase of implementation until the user approves the commit. - [ ] After commiting the change, if the app is running, use the hot_reload tool to reload it. + - Hot reload only works reliably on Flutter at versions at or above 3.35.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app. In the last phase of the plan, include steps to: @@ -93,9 +121,9 @@ In the last phase of the plan, include steps to: - [ ] Create a GEMINI.md file in the project directory that describes the app, its purpose, and implementation details of the application and the layout of the files. - [ ] Ask the user to inspect the app and the code and say if they are satisfied with it, or if any modifications are needed. -You must ask the user to review this implementation plan and they must approve it before starting implementation. They must review and approve it before you begin because if they ask for any changes, the changes may affect the implementation. +You must ask the user to review the tasks.md implementation plan and they must approve it before starting implementation. They must review and approve it before you begin because if they ask for any changes, the changes may affect the implementation. ## Implementation -After getting explicit approval from the user for the IMPLEMENTATION.md document, begin implementing the plan. +After getting explicit approval from the user for the tasks.md document, begin implementing the plan. """ diff --git a/commands/create-package.toml b/commands/create-package.toml index 43eb218..58dd349 100644 --- a/commands/create-package.toml +++ b/commands/create-package.toml @@ -33,13 +33,19 @@ Then create the package directory, if it doesn't already exist. **VERY IMPORTANT**: Change directories to the package directory now so that future operations are relative to that directory. -## Design document +## Feature specification directory -Develop a **DETAILED** Markdown-formatted design document that follows all of the guidance you have about Dart and Flutter design patterns, rules, best practices, and core principles. Save the design document in specs/DESIGN.md in the package directory. Feel free to use your available tools to research any aspects of the design that need clarification. +Create a numbered feature directory under `specs/` to organize all specification documents. The directory should be named with a three-digit prefix followed by a kebab-case feature name (e.g., `specs/001-my-package-name/`). If other numbered directories already exist in `specs/`, use the next available number. -The design doc should (at least) include sections for: +## Design documents -- An overview +Develop **DETAILED** Markdown-formatted design documents that follow all of the guidance you have about Dart and Flutter design patterns, rules, best practices, and core principles. Feel free to use your available tools to research any aspects of the design that need clarification. + +Create the following files in the feature specification directory: + +### specs/NNN-feature-name/spec.md +The main specification document containing: +- An overview of the package - A detailed analysis of the goal or problem - Alternatives considered - A detailed design for the new package @@ -48,13 +54,33 @@ The design doc should (at least) include sections for: - A summary of the design - References to research URLs used to arrive at the design. -Be sure to **actually fetch and read** the research URLs **before** writing the design document. Do actual web research on the topics that are important to the design. +### specs/NNN-feature-name/data-model.md +A dedicated document for the data model containing: +- Entity definitions and relationships +- Data structures and types +- API contracts (if applicable) +- Data flow diagrams in Mermaid format + +### specs/NNN-feature-name/plan.md +A high-level plan document containing: +- Project milestones +- Key deliverables +- Dependencies and risks +- Success criteria + +### specs/NNN-feature-name/checklists/requirements.md +A requirements checklist containing: +- [ ] Functional requirements (checkboxed list) +- [ ] Non-functional requirements (checkboxed list) +- [ ] API requirements or acceptance criteria + +Be sure to **actually fetch and read** the research URLs **before** writing the design documents. Do actual web research on the topics that are important to the design. -You must ask the user to review this design document and they must approve it before you continue on to create the implementation plan. They must review and approve it first because if they ask for any changes, it may affect the implementation plan. +You must ask the user to review these design documents and they must approve them before you continue on to create the implementation plan. They must review and approve first because if they ask for any changes, it may affect the implementation plan. ## Implementation plan -After getting explicit approval from the user for the DESIGN.md document, Develop a **DETAILED** Markdown-formatted phased implementation plan of checkboxed tasks that need to be performed in order to finish developing the package. Save the implementation plan in specs/IMPLEMENTATION.md in the package directory. +After getting explicit approval from the user for the design documents, develop a **DETAILED** Markdown-formatted phased implementation plan of checkboxed tasks that need to be performed in order to finish developing the package. Save the implementation plan in `specs/NNN-feature-name/tasks.md` (in the same feature directory as the design documents). The implementation plan should include a section for a "Journal" which will be updated after each phase and contain a log of the actions taken, things learned, surprises, and deviations from the plan. It should be in chronological order. @@ -81,8 +107,9 @@ The implementation plan should specify after each phase that you should: - [ ] Run the analyze_files tool one more time and fix any issues. - [ ] Run any tests to make sure they all pass. - [ ] Run dart_format to make sure that the formatting is correct. -- [ ] Re-read the IMPLEMENTATION.md file to see what, if anything, has changed in the implementation plan, and if it has changed, take care of anything the changes imply. -- [ ] Update the IMPLEMENTATION.md file with the current state, including any learnings, surprises, or deviations in the Journal section. Check off any checkboxes of items that have been completed. +- [ ] Re-read the tasks.md file to see what, if anything, has changed in the implementation plan, and if it has changed, take care of anything the changes imply. +- [ ] Update the tasks.md file with the current state, including any learnings, surprises, or deviations in the Journal section. Check off any checkboxes of items that have been completed. +- [ ] Update the checklists/requirements.md file to check off any requirements that have been satisfied. - [ ] Use `git diff` to verify the changes that have been made, and create a suitable commit message for any changes, following any guidelines you have about commit messages. Be sure to properly escape dollar signs and backticks, and present the change message to the user for approval. - [ ] Wait for approval. Don't commit the changes or move on to the next phase of implementation until the user approves the commit. @@ -92,9 +119,9 @@ In the last phase of the plan, include steps to: - [ ] Create a GEMINI.md file in the project directory that describes the package, its purpose, and implementation details of the package and the layout of the files. - [ ] Ask the user to inspect the package and say if they are satisfied with it, or if any modifications are needed. -You must ask the user to review this implementation plan and they must approve it before starting implementation. They must review and approve it before you begin because if they ask for any changes, the changes may affect the implementation. +You must ask the user to review the tasks.md implementation plan and they must approve it before starting implementation. They must review and approve it before you begin because if they ask for any changes, the changes may affect the implementation. ## Implementation -After getting explicit approval from the user for the IMPLEMENTATION.md document, begin implementing the plan. +After getting explicit approval from the user for the tasks.md document, begin implementing the plan. """ diff --git a/commands/debug-app.toml b/commands/debug-app.toml index 01a96a3..097fc4a 100644 --- a/commands/debug-app.toml +++ b/commands/debug-app.toml @@ -34,6 +34,7 @@ Next, collect additional information required for debugging. Ask the user one qu Before diving into the code, let's verify the project's dependencies and environment. - [ ] Run `flutter doctor` to get the Flutter and Dart SDK versions and check for any issues reported. + - Hot reload only works reliably on Flutter at versions at or above 3.35.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app. - [ ] Use the `pub` tool with the `outdated` command to look for outdated packages or dependency conflicts in `pubspec.yaml` and `pubspec.lock`. - Run the command `pub` tool with `upgrade` to upgrade to latest versions. - If that isn't sufficient, sometimes upgrading the package version to a new major version can help. The `pub` tool can't do this, so run the command `dart pub upgrade --major-versions` to do this. @@ -62,7 +63,9 @@ The debugging strategy should be chosen to yield the best results and may involv - **Logging and Tracing:** - Add strategic logging statements to the code to trace execution flow. Prefer `debugPrint()` over `print()` for cleaner, non-interfering output. - - Use `hot_reload` to apply logging changes quickly while preserving the app's state. If the state needs to be reset, explain that a Hot Restart is needed, and you will need to stop and restart the app. + - Use `hot_reload` to apply logging changes quickly while preserving the app's state. + - Hot reload only works reliably on Flutter at versions at or above 3.35.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app. + - If the state needs to be reset, explain that a Hot Restart is needed, and you will need to stop and restart the app. - **Flutter DevTools & UI Inspection:** - **For UI and layout bugs:** Use the `get_widget_tree` tool to inspect the widget hierarchy and properties. diff --git a/commands/modify.toml b/commands/modify.toml index 8d93f10..a8d747d 100644 --- a/commands/modify.toml +++ b/commands/modify.toml @@ -31,13 +31,19 @@ First, make sure there are no uncommitted changes on the current branch. If ther If the user wants the work done on a new branch, create the branch now. -## Modification design document +## Feature specification directory -Develop a **DETAILED** Markdown-formatted design document that follows all of the guidance you have about Dart and Flutter design patterns, rules, best practices, and core principles. Save the design document in MODIFICATION_DESIGN.md in the top directory of the workspace. Feel free to use your available tools to research any aspects of the modification that are unclear. +Create a numbered feature directory under `specs/` to organize all specification documents. The directory should be named with a three-digit prefix followed by a kebab-case modification name (e.g., `specs/002-add-authentication/`). If other numbered directories already exist in `specs/`, use the next available number. -The design doc should (at least) include: +## Modification design documents -- An overview +Develop **DETAILED** Markdown-formatted design documents that follow all of the guidance you have about Dart and Flutter design patterns, rules, best practices, and core principles. Feel free to use your available tools to research any aspects of the modification that are unclear. + +Create the following files in the feature specification directory: + +### specs/NNN-feature-name/spec.md +The main specification document containing: +- An overview of the modification - A detailed analysis of the goal or problem - Alternatives considered - A detailed design for the modification @@ -46,13 +52,33 @@ The design doc should (at least) include: - A summary of the design - References to research URLs used to arrive at the design. -Be sure to **actually fetch and read** the research URLs **before** writing the design document. Do actual web research on the topics that are important to the design. +### specs/NNN-feature-name/data-model.md +A dedicated document for data model changes (if applicable) containing: +- Entity modifications +- Schema changes +- State management updates +- Data flow diagrams in Mermaid format + +### specs/NNN-feature-name/plan.md +A high-level plan document containing: +- Modification milestones +- Key deliverables +- Dependencies and risks +- Success criteria + +### specs/NNN-feature-name/checklists/requirements.md +A requirements checklist containing: +- [ ] Functional requirements for this modification (checkboxed list) +- [ ] Non-functional requirements (checkboxed list) +- [ ] Acceptance criteria + +Be sure to **actually fetch and read** the research URLs **before** writing the design documents. Do actual web research on the topics that are important to the design. -You must ask the user to review this design document and they must approve it before you continue on to create the implementation plan. They must review and approve it first because if they ask for any changes, it may affect the implementation plan. +You must ask the user to review these design documents and they must approve them before you continue on to create the implementation plan. They must review and approve first because if they ask for any changes, it may affect the implementation plan. ## Implementation plan -After getting explicit approval from the user for the MODIFICATION_DESIGN.md document, develop a **DETAILED** Markdown-formatted phased implementation plan of checkboxed tasks that need to be performed in order to finish the modification. Save the implementation plan in MODIFICATION_IMPLEMENTATION.md in the top of the repo. +After getting explicit approval from the user for the design documents, develop a **DETAILED** Markdown-formatted phased implementation plan of checkboxed tasks that need to be performed in order to finish the modification. Save the implementation plan in `specs/NNN-feature-name/tasks.md` (in the same feature directory as the design documents). The implementation plan should include a section for a "Journal" which will be updated after each phase and contain a log of the actions taken, things learned, surprises, and deviations from the plan. It should be in chronological order. @@ -68,11 +94,13 @@ The implementation plan should specify after each phase that you should: - [ ] Run the analyze_files tool one more time and fix any issues. - [ ] Run any tests to make sure they all pass. - [ ] Run dart_format to make sure that the formatting is correct. -- [ ] Re-read the MODIFICATION_IMPLEMENTATION.md file to see what, if anything, has changed in the implementation plan, and if it has changed, take care of anything the changes imply. -- [ ] Update the MODIFICATION_IMPLEMENTATION.md file with the current state, including any learnings, surprises, or deviations in the Journal section. Check off any checkboxes of items that have been completed. +- [ ] Re-read the tasks.md file to see what, if anything, has changed in the implementation plan, and if it has changed, take care of anything the changes imply. +- [ ] Update the tasks.md file with the current state, including any learnings, surprises, or deviations in the Journal section. Check off any checkboxes of items that have been completed. +- [ ] Update the checklists/requirements.md file to check off any requirements that have been satisfied. - [ ] Use `git diff` to verify the changes that have been made, and create a suitable commit message for any changes, following any guidelines you have about commit messages. Be sure to properly escape dollar signs and backticks, and present the change message to the user for approval. - [ ] Wait for approval. Don't commit the changes or move on to the next phase of implementation until the user approves the commit. - [ ] After commiting the change, if an app is running, use the hot_reload tool to reload it. + - Hot reload only works reliably on Flutter at versions at or above 3.35.0. If hot_reload fails, and they are using a version below that, inform the user and suggest either switching to the Flutter main channel or manually reloading the app. In the last phase of the plan, include steps to: @@ -80,9 +108,9 @@ In the last phase of the plan, include steps to: - [ ] Update any GEMINI.md file in the project directory so that it still correctly describes the app, its purpose, and implementation details and the layout of the files. - [ ] Ask the user to inspect the package (and running app, if any) and say if they are satisfied with it, or if any modifications are needed. -You must ask the user to review this implementation plan and they must approve it before starting implementation. They must review and approve it before you begin because if they ask for any changes, the changes may affect the implementation. +You must ask the user to review the tasks.md implementation plan and they must approve it before starting implementation. They must review and approve it before you begin because if they ask for any changes, the changes may affect the implementation. ## Implementation -After getting explicit approval from the user for the MODIFICATION_IMPLEMENTATION.md document, begin implementing the plan. +After getting explicit approval from the user for the tasks.md document, begin implementing the plan. """ diff --git a/flutter.md b/flutter.md index 1baabc9..38d2499 100644 --- a/flutter.md +++ b/flutter.md @@ -816,6 +816,13 @@ education levels, and learning styles. PLEASE. DON'T FORGET TO USE THE DART TOOLS. I BEG YOU. +- **Running Apps**: If the user asks to "run the app" or "start the app" and the + `launch_app` tool is not available or fails, provide clear guidance: + + > "To run your app, open a new terminal, cd into your project directory, and + > type `flutter run`. Or, open your IDE and use its Run features via the + > Flutter extension or plugin." + - **PREREQUISITES**: - Before calling tools which operate on the project, you must use the `create_project` tool to create a project if it doesn't already exist.