Skip to content

Commit 8bd2e5b

Browse files
authored
Refine /create-app to place package more ergonomically (#66)
1 parent 9d8941b commit 8bd2e5b

File tree

3 files changed

+73
-40
lines changed

3 files changed

+73
-40
lines changed

README.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
Help Gemini CLI create, build, test, and run Flutter apps.
44

5-
* **Status: Experimental** - This is an experimental project. Features and commands may change drastically. We welcome your feedback!
5+
- **Status: Experimental** - This is an experimental project. Features and commands may change drastically. We welcome your feedback!
66

77
## ✨ Features
88

9-
- **🚀 Project Bootstrapping**: Create new Flutter projects from scratch with built-in best practices, including linters, documentation, and design planning.
10-
- **🔧 Guided Refactoring**: Execute complex refactoring tasks with automated planning, git branch management, and step-by-step implementation guides for your approval.
11-
- **✅ Automated Pre-Commit Checks**: Automatically format, analyze, and test your code before committing to maintain codebase quality.
12-
- **✍️ Smart Commit Messaging**: Generate descriptive, conventional commit messages based on your staged changes.
13-
- **🧠 Context Priming**: Initializes Gemini with specific rules and context for Dart and Flutter, ensuring high-quality, idiomatic code generation.
9+
- **🚀 Project Bootstrapping**: Create new Flutter projects from scratch with built-in best practices, including linters, documentation, and design planning.
10+
- **🔧 Guided Refactoring**: Execute complex refactoring tasks with automated planning, git branch management, and step-by-step implementation guides for your approval.
11+
- **✅ Automated Pre-Commit Checks**: Automatically format, analyze, and test your code before committing to maintain codebase quality.
12+
- **✍️ Smart Commit Messaging**: Generate descriptive, conventional commit messages based on your staged changes.
13+
- **🧠 Context Priming**: Initializes Gemini with specific rules and context for Dart and Flutter, ensuring high-quality, idiomatic code generation.
1414

1515
## 📋 Prerequisites
1616

@@ -25,9 +25,11 @@ Help Gemini CLI create, build, test, and run Flutter apps.
2525
Use the `gemini extensions install` command to install directly from the source repository:
2626

2727
```bash
28-
gemini extensions install https://github.com/gemini-cli-extensions/flutter.git
28+
gemini extensions install https://github.com/gemini-cli-extensions/flutter.git --auto-update
2929
```
3030

31+
The `--auto-update` is optional: if specified, it will update to new versions as they are released.
32+
3133
You can manage the extension with the following commands:
3234

3335
```bash
@@ -42,9 +44,10 @@ gemini extensions uninstall flutter
4244

4345
The new commands will be available in new Gemini CLI sessions. The following commands will be available (with or without the `flutter:` prefix):
4446

45-
- `/create-app` - Guides you through bootstrapping a new Flutter project with best practices.
46-
- `/refactor` - Manages a structured refactoring session with automated planning.
47-
- `/commit` - Automates pre-commit checks and generates a descriptive commit message.
47+
- `/create-app` - Guides you through bootstrapping a new Flutter project with best practices.
48+
- `/create-package` - Guides you through bootstrapping a new Dart package with best practices.
49+
- `/refactor` - Manages a structured refactoring session with automated planning.
50+
- `/commit` - Automates pre-commit checks and generates a descriptive commit message.
4851

4952
## 💡 Usage
5053

@@ -55,6 +58,7 @@ This extension provides powerful commands to automate key phases of the developm
5558
Initiates a guided process to bootstrap a new Flutter application, ensuring your project starts with a solid foundation.
5659

5760
**Process:**
61+
5862
1. Asks for the package's purpose, details, and desired location on your filesystem.
5963
2. Creates a new Flutter project with recommended settings and linter rules.
6064
3. Generates starter `pubspec.yaml`, `README.md`, and `CHANGELOG.md` files.
@@ -69,6 +73,7 @@ Initiates a guided process to bootstrap a new Flutter application, ensuring your
6973
Starts a structured session to refactor existing code. It helps you plan and execute changes safely and efficiently.
7074

7175
**Process:**
76+
7277
1. Asks for your high-level refactoring goals and what you want to accomplish.
7378
2. Offers to create a new `git` branch for the refactoring work, isolating changes.
7479
3. Generates a `REFACTOR.md` design document detailing the proposed changes.
@@ -83,6 +88,7 @@ Starts a structured session to refactor existing code. It helps you plan and exe
8388
Prepares your staged `git` changes for a clean, high-quality commit. It acts as an automated pre-commit hook and message generator.
8489

8590
**Process:**
91+
8692
1. Runs `dart fix` and `dart format` to clean and format your code.
8793
2. Executes the Dart analyzer to check for static analysis issues.
8894
3. Runs your project's test suite to ensure all tests are passing.
@@ -96,8 +102,8 @@ Prepares your staged `git` changes for a clean, high-quality commit. It acts as
96102

97103
This extension enforces a specific set of coding standards to ensure consistency and quality. These rules are defined in the extension's repository:
98104

99-
- **`flutter.md`**: Contains rules and best practices for writing Dart and Flutter code. These rules are opinionated, and we encourage you to review them to ensure they align with your style.
100-
- **`override`**: Contains important, high-priority rules that are appended to the end of all prompts to ensure they have the most weight.
105+
- **`flutter.md`**: Contains rules and best practices for writing Dart and Flutter code. These rules are opinionated, and we encourage you to review them to ensure they align with your style.
106+
- **`override`**: Contains important, high-priority rules that are appended to the end of all prompts to ensure they have the most weight.
101107

102108
## 🐛 Troubleshooting
103109

commands/create-app.toml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,41 +22,54 @@ Next, collect remaining information from the user, one question at a time.
2222
The information you need to collect includes, but might not be limited to:
2323
2424
- If there are ambiguous elements to the design, ask the user questions to clarify. When the goal is clear, or the user says to, then move on.
25-
- If the user didn't already give one, select a short descriptive name for the project.
26-
- Whether to do the work on the current git branch, or a new feature branch. Suggest a branch name.
25+
- If the user didn't already give one, select a short descriptive name for the package.
26+
- Whether to do the work on the current git branch, or a new feature branch.
27+
- Suggest a branch name, making sure it is a valid git branch name.
28+
- Which directory to use as the package directory. Suggest a location.
29+
30+
If the user wants the work done on a new branch, create the branch now.
31+
Then create the package directory, if it doesn't already exist.
32+
33+
**VERY IMPORTANT**: Change directories to the package directory now so that future operations are relative to that directory.
2734
2835
## Design document
2936
30-
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 DESIGN.md in the top directory of the new package. Feel free to use your available tools to research any aspects of the design that need clarification.
37+
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 DESIGN.md in the package directory. Feel free to use your available tools to research any aspects of the design that need clarification.
3138
3239
The design doc should (at least) include sections for:
3340
3441
- An overview
3542
- A detailed analysis of the goal or problem
3643
- Alternatives considered
3744
- A detailed design for the new package
38-
- Any diagrams needed to explain the design (in Mermaid format)
45+
- Any diagrams needed to explain the design, in Mermaid format.
46+
- Be sure to put quotes around labels that include special characters (e.g. parenthesis).
3947
- A summary of the design
4048
- References to research URLs used to arrive at the design.
4149
4250
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.
4351
4452
## Implementation plan
4553
46-
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 IMPLEMENTATION.md in the top directory of the new package.
54+
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 IMPLEMENTATION.md in the package directory.
4755
48-
The implementation plan should include a section for the "Journal" which will be updated after each phase.
56+
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.
4957
5058
The plan should include instructions similar to: "After completing a task, if you added any TODOs to the code or didn't fully implement anything, make sure to add new tasks so that you can come back and complete them later." to prevent leaving tasks unfinished.
5159
5260
In the first phase of the implementation plan, include:
5361
54-
- [ ] Create a Dart or Flutter project (as appropriate for the purpose) in the desired location using the name. Unless the user specifies otherwise, the project should support all of the default platforms. Use the create_project tool to create it. For Flutter projects, create an empty project using the `empty` flag for the tool.
55-
- [ ] Remove the boilerplate in the new project by removing the test dir, if any, and the README.md file.
62+
- [ ] Create a Dart or Flutter package (as appropriate for the purpose) in the package directory.
63+
- Unless the user specifies otherwise, the package should support all of the default platforms.
64+
- Use the create_project tool to create the package.
65+
- If the current directory is the package directory, use "." as the target for the create_project tool.
66+
- The name of the package directory (even if it is the current directory) must be a valid Dart package name. If it isn't, then inform the user and suggest an alternative (valid) directory name.
67+
- For Flutter packages, create an empty package using the `empty` flag for the tool.
68+
- [ ] Remove any boilerplate in the new package that will be replaced, including the test dir, if any.
5669
- [ ] Update the description of the package in the `pubspec.yaml` and set the version number to 0.1.0.
57-
- [ ] Update the README.md to include a short placeholder description of the project.
58-
- [ ] Update the CHANGELOG.md to have the initial version as 0.1.0.
59-
- [ ] Commit this empty version of the project to either a new branch or the current branch based on the user's preference.
70+
- [ ] Update the README.md to include a short placeholder description of the package.
71+
- [ ] Create the CHANGELOG.md to have the initial version of 0.1.0.
72+
- [ ] Commit this empty version of the package to either a new branch or the current branch based on the user's preference.
6073
6174
The implementation plan should specify after each phase that you should:
6275
@@ -66,13 +79,13 @@ The implementation plan should specify after each phase that you should:
6679
- [ ] Run any tests to make sure they all pass.
6780
- [ ] Run dart_format one more time to make sure that the formatting is still correct if you made any changes during the analysis and testing steps.
6881
- [ ] 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.
69-
- [ ] Update the IMPLEMENTATION.md file with the current state, including any learnings, surprises, or deviations in the Journal section.
82+
- [ ] 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.
7083
- [ ] 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.
7184
- [ ] Wait for approval. Don't commit the changes or move on to the next phase of implementation until the user approves the commit.
7285
73-
In the last phase of the plan, you should include a step to create a comprehensive README.md file for the package.
86+
In the last phase of the plan, include a step to create a comprehensive README.md file for the package.
7487
75-
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, they may affect the implementation.
88+
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.
7689
7790
## Implementation
7891

0 commit comments

Comments
 (0)