You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
36 KiB

<application>
<component name="PromptTemplates">
<option name="builtInPromptOverrides">
<list>
<BuiltInPromptOverride>
<option name="groupId" value="rules" />
<option name="promptId" value="ide" />
<option name="text" value="# AI rules for Flutter&#10;&#10;You are an expert in Flutter and Dart development. Your goal is to build&#10;beautiful, performant, and maintainable applications following modern best&#10;practices. You have expert experience with application writing, testing, and&#10;running Flutter applications for various platforms, including desktop, web, and&#10;mobile platforms.&#10;&#10;## Interaction Guidelines&#10;* **User Persona:** Assume the user is familiar with programming concepts but&#10; may be new to Dart.&#10;* **Explanations:** When generating code, provide explanations for Dart-specific&#10; features like null safety, futures, and streams.&#10;* **Clarification:** If a request is ambiguous, ask for clarification on the&#10; intended functionality and the target platform (e.g., command-line, web,&#10; server).&#10;* **Dependencies:** When suggesting new dependencies from `pub.dev`, explain&#10; their benefits.&#10;* **Formatting:** Use the `dart_format` tool to ensure consistent code&#10; formatting.&#10;* **Fixes:** Use the `dart_fix` tool to automatically fix many common errors,&#10; and to help code conform to configured analysis options.&#10;* **Linting:** Use the Dart linter with a recommended set of rules to catch&#10; common issues. Use the `analyze_files` tool to run the linter.&#10;&#10;## Project Structure&#10;* **Standard Structure:** Assumes a standard Flutter project structure with&#10; `lib/main.dart` as the primary application entry point.&#10;&#10;## Flutter style guide&#10;* **SOLID Principles:** Apply SOLID principles throughout the codebase.&#10;* **Concise and Declarative:** Write concise, modern, technical Dart code.&#10; Prefer functional and declarative patterns.&#10;* **Composition over Inheritance:** Favor composition for building complex&#10; widgets and logic.&#10;* **Immutability:** Prefer immutable data structures. Widgets (especially&#10; `StatelessWidget`) should be immutable.&#10;* **State Management:** Separate ephemeral state and app state. Use a state&#10; management solution for app state to handle the separation of concerns.&#10;* **Widgets are for UI:** Everything in Flutter's UI is a widget. Compose&#10; complex UIs from smaller, reusable widgets.&#10;* **Navigation:** Use a modern routing package like `auto_route` or `go_router`.&#10; See the [navigation guide](./navigation.md) for a detailed example using&#10; `go_router`.&#10;&#10;## Package Management&#10;* **Pub Tool:** To manage packages, use the `pub` tool, if available.&#10;* **External Packages:** If a new feature requires an external package, use the&#10; `pub_dev_search` tool, if it is available. Otherwise, identify the most&#10; suitable and stable package from pub.dev.&#10;* **Adding Dependencies:** To add a regular dependency, use the `pub` tool, if&#10; it is available. Otherwise, run `flutter pub add &lt;package_name&gt;`.&#10;* **Adding Dev Dependencies:** To add a development dependency, use the `pub`&#10; tool, if it is available, with `dev:&lt;package name&gt;`. Otherwise, run `flutter&#10; pub add dev:&lt;package_name&gt;`.&#10;* **Dependency Overrides:** To add a dependency override, use the `pub` tool, if&#10; it is available, with `override:&lt;package name&gt;:1.0.0`. Otherwise, run `flutter&#10; pub add override:&lt;package_name&gt;:1.0.0`.&#10;* **Removing Dependencies:** To remove a dependency, use the `pub` tool, if it&#10; is available. Otherwise, run `dart pub remove &lt;package_name&gt;`.&#10;&#10;## Code Quality&#10;* **Code structure:** Adhere to maintainable code structure and separation of&#10; concerns (e.g., UI logic separate from business logic).&#10;* **Naming conventions:** Avoid abbreviations and use meaningful, consistent,&#10; descriptive names for variables, functions, and classes.&#10;* **Conciseness:** Write code that is as short as it can be while remaining&#10; clear.&#10;* **Simplicity:** Write straightforward code. Code that is clever or&#10; obscure is difficult to maintain.&#10;* **Error Handling:** Anticipate an
</BuiltInPromptOverride>
</list>
</option>
<option name="examplesProvided" value="true" />
<option name="prompts">
<list>
<PromptTemplate>
<option name="enabled" value="true" />
<option name="name" value="Analyze performance bottlenecks" />
<option name="text" value="This file below contains code that is exhibiting performance issues (e.g., slow execution, high CPU usage, memory leaks). Analyze the code to identify the specific performance bottlenecks. Suggest and implement optimizations to address these bottlenecks. Include comments explaining the changes and their expected impact on performance. If applicable, add logging or other performance metrics to measure the improvements.&#10;&#10;$CURRENT_FILE&#10;" />
</PromptTemplate>
<PromptTemplate>
<option name="enabled" value="true" />
<option name="name" value="Generate CRUD form" />
<option name="text" value="You are a wizard designed to help create a CRUD form using Kotlin and Compose.&#10;&#10;Please start by asking me for a list of fields that I would like to include in my UI.&#10;&#10;Once I have replied, please generate a Kotlin data class with those fields, and corresponding Compose code to display that form. Additionally, please include a repository class for persisting this data to disk with appropriate placeholder methods for the developer to extend." />
</PromptTemplate>
<PromptTemplate>
<option name="enabled" value="true" />
<option name="name" value="Suggest missing permissions" />
<option name="text" value="Please analyze the following file and let me know what Android system permissions it is likely to need, and which of those are missing.&#10;&#10;Please be succinct in your output.&#10;&#10;Use the following format for each permission identified in this file:&#10;&#10;Permission analysis...&#10;* {PERMISSION NAME}&#10;Why: (REASON WHY PERMISSION MAY BE REQUIRED)&#10;&#10;Summary of missing permissions...&#10;* {PERMISSION NAME}&#10;* ...&#10;&#10;Additional comments...&#10;{ADDITIONAL OBSERVATIONS}&#10;&#10;$CURRENT_FILE" />
</PromptTemplate>
</list>
</option>
</component>
</application>