sdd-full 4.8.0 → 4.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/bin.js +2 -2
  2. package/index.js +18 -12
  3. package/package.json +1 -1
  4. package/skills/README.md +155 -47
  5. package/skills/design-planning/ai-coding-rules/SKILL.md +13 -5
  6. package/skills/design-planning/design-to-code/SKILL.md +14 -5
  7. package/skills/design-planning/enterprise-spec/SKILL.md +13 -5
  8. package/skills/design-planning/flutter-av/SKILL.md +16 -5
  9. package/skills/design-planning/flutter-map/SKILL.md +14 -5
  10. package/skills/design-planning/function-sdd/SKILL.md +13 -5
  11. package/skills/design-planning/global-overlay-stack-standard/SKILL.md +14 -4
  12. package/skills/design-planning/ui-motion-interaction-standard/SKILL.md +14 -4
  13. package/skills/design-planning/ui-sdd-specialized/SKILL.md +14 -5
  14. package/skills/development-execution/flutter-errors/SKILL.md +15 -5
  15. package/skills/quality-assurance/bdd-acceptance/SKILL.md +14 -5
  16. package/skills/quality-assurance/flutter-test/SKILL.md +16 -5
  17. package/skills/requirement-analysis/sdd/mock_sdd.md +156 -0
  18. package/skills/rules/project_rules.md +127 -538
  19. package/skills/rules/user_rules.md +263 -0
  20. package/skills/special-tools/env-check/SKILL.md +13 -5
  21. package/skills/special-tools/ios-full-auto-debug/SKILL.md +15 -5
  22. package/skills/VERSION.md +0 -310
  23. package/skills/flutter-skills/.github/dependabot.yaml +0 -15
  24. package/skills/flutter-skills/.github/workflows/dart_skills_lint_workflow.yaml +0 -68
  25. package/skills/flutter-skills/.github/workflows/skills_tool.yaml +0 -51
  26. package/skills/flutter-skills/CODE_OF_CONDUCT.md +0 -3
  27. package/skills/flutter-skills/CONTRIBUTING.md +0 -36
  28. package/skills/flutter-skills/LICENSE +0 -26
  29. package/skills/flutter-skills/README.md +0 -50
  30. package/skills/flutter-skills/pubspec.yaml +0 -9
  31. package/skills/flutter-skills/resources/flutter_skills.yaml +0 -434
  32. package/skills/flutter-skills/skills/flutter-add-integration-test/SKILL.md +0 -163
  33. package/skills/flutter-skills/skills/flutter-add-widget-preview/SKILL.md +0 -145
  34. package/skills/flutter-skills/skills/flutter-add-widget-test/SKILL.md +0 -154
  35. package/skills/flutter-skills/skills/flutter-apply-architecture-best-practices/SKILL.md +0 -162
  36. package/skills/flutter-skills/skills/flutter-build-responsive-layout/SKILL.md +0 -139
  37. package/skills/flutter-skills/skills/flutter-fix-layout-issues/SKILL.md +0 -130
  38. package/skills/flutter-skills/skills/flutter-implement-json-serialization/SKILL.md +0 -153
  39. package/skills/flutter-skills/skills/flutter-setup-declarative-routing/SKILL.md +0 -255
  40. package/skills/flutter-skills/skills/flutter-setup-localization/SKILL.md +0 -210
  41. package/skills/flutter-skills/skills/flutter-use-http-package/SKILL.md +0 -175
  42. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/add-dart-lint-validation-rule/SKILL.md +0 -196
  43. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-best-practices/SKILL.md +0 -65
  44. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-checks-migration/SKILL.md +0 -158
  45. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-cli-app-best-practices/SKILL.md +0 -168
  46. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-doc-validation/SKILL.md +0 -87
  47. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-long-lines/SKILL.md +0 -101
  48. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-matcher-best-practices/SKILL.md +0 -136
  49. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-modern-features/SKILL.md +0 -266
  50. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-package-maintenance/SKILL.md +0 -92
  51. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-coverage/SKILL.md +0 -92
  52. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-coverage/example/lib/src/calculator.dart +0 -7
  53. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-coverage/example/pubspec.yaml +0 -8
  54. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-coverage/example/test/calculator_test.dart +0 -11
  55. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-coverage/scripts/interpret_coverage.dart +0 -95
  56. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-coverage/scripts/pubspec.yaml +0 -6
  57. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-coverage/scripts/test/interpret_coverage_test.dart +0 -93
  58. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/dart-test-fundamentals/SKILL.md +0 -173
  59. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/definition-of-done/SKILL.md +0 -27
  60. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/flutter_skills_ignore.json +0 -3
  61. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/grill-me/SKILL.md +0 -10
  62. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/ignore.json +0 -3
  63. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/test-driven-development/SKILL.md +0 -371
  64. package/skills/flutter-skills/tool/dart_skills_lint/.agents/skills/test-driven-development/testing-anti-patterns.md +0 -299
  65. package/skills/flutter-skills/tool/dart_skills_lint/AUTHORS +0 -7
  66. package/skills/flutter-skills/tool/dart_skills_lint/CHANGELOG.md +0 -12
  67. package/skills/flutter-skills/tool/dart_skills_lint/CONTRIBUTING.md +0 -51
  68. package/skills/flutter-skills/tool/dart_skills_lint/LICENSE +0 -27
  69. package/skills/flutter-skills/tool/dart_skills_lint/README.md +0 -203
  70. package/skills/flutter-skills/tool/dart_skills_lint/analysis_options.yaml +0 -296
  71. package/skills/flutter-skills/tool/dart_skills_lint/bench/README.md +0 -23
  72. package/skills/flutter-skills/tool/dart_skills_lint/bench/baseline_throughput.dart +0 -230
  73. package/skills/flutter-skills/tool/dart_skills_lint/bin/cli.dart +0 -10
  74. package/skills/flutter-skills/tool/dart_skills_lint/dart_skills_lint.yaml +0 -14
  75. package/skills/flutter-skills/tool/dart_skills_lint/documentation/feature_design_docs/PRODUCTION_READYNESS.md +0 -48
  76. package/skills/flutter-skills/tool/dart_skills_lint/documentation/feature_design_docs/completion_migration_plan.md +0 -99
  77. package/skills/flutter-skills/tool/dart_skills_lint/documentation/feature_design_docs/legacy_patterns_report.md +0 -110
  78. package/skills/flutter-skills/tool/dart_skills_lint/documentation/feature_design_docs/pub_vs_skill_report.md +0 -56
  79. package/skills/flutter-skills/tool/dart_skills_lint/documentation/knowledge/SPECIFICATION.md +0 -79
  80. package/skills/flutter-skills/tool/dart_skills_lint/documentation/knowledge/architecture_overview.md +0 -64
  81. package/skills/flutter-skills/tool/dart_skills_lint/lib/dart_skills_lint.dart +0 -11
  82. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/config_parser.dart +0 -156
  83. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/entry_point.dart +0 -354
  84. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/fixable_rule.dart +0 -20
  85. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/analysis_severity.dart +0 -15
  86. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/check_type.dart +0 -17
  87. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/ignore_entry.dart +0 -34
  88. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/ignore_entry.g.dart +0 -19
  89. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/skill_context.dart +0 -27
  90. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/skill_rule.dart +0 -27
  91. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/skills_ignores.dart +0 -26
  92. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/skills_ignores.g.dart +0 -24
  93. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/models/validation_error.dart +0 -31
  94. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rule_registry.dart +0 -79
  95. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rules/absolute_paths_rule.dart +0 -74
  96. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rules/description_length_rule.dart +0 -49
  97. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rules/disallowed_field_rule.dart +0 -61
  98. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rules/name_format_rule.dart +0 -167
  99. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rules/relative_paths_rule.dart +0 -72
  100. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rules/trailing_whitespace_rule.dart +0 -93
  101. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/rules/valid_yaml_metadata_rule.dart +0 -74
  102. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/skills_ignores_storage.dart +0 -36
  103. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/validation_session.dart +0 -559
  104. package/skills/flutter-skills/tool/dart_skills_lint/lib/src/validator.dart +0 -238
  105. package/skills/flutter-skills/tool/dart_skills_lint/pubspec.yaml +0 -28
  106. package/skills/flutter-skills/tool/dart_skills_lint/skills/README.md +0 -10
  107. package/skills/flutter-skills/tool/dart_skills_lint/skills/dart-skills-lint-validation/SKILL.md +0 -195
  108. package/skills/flutter-skills/tool/dart_skills_lint/skills-lock.json +0 -75
  109. package/skills/flutter-skills/tool/dart_skills_lint/test/absolute_paths_test.dart +0 -167
  110. package/skills/flutter-skills/tool/dart_skills_lint/test/cli_integration_test.dart +0 -683
  111. package/skills/flutter-skills/tool/dart_skills_lint/test/config_file_test.dart +0 -292
  112. package/skills/flutter-skills/tool/dart_skills_lint/test/custom_rule_test.dart +0 -122
  113. package/skills/flutter-skills/tool/dart_skills_lint/test/directory_structure_test.dart +0 -163
  114. package/skills/flutter-skills/tool/dart_skills_lint/test/field_constraints_test.dart +0 -178
  115. package/skills/flutter-skills/tool/dart_skills_lint/test/fixer_test.dart +0 -172
  116. package/skills/flutter-skills/tool/dart_skills_lint/test/ignore_models_test.dart +0 -63
  117. package/skills/flutter-skills/tool/dart_skills_lint/test/metadata_validation_test.dart +0 -116
  118. package/skills/flutter-skills/tool/dart_skills_lint/test/relative_path_flag_test.dart +0 -70
  119. package/skills/flutter-skills/tool/dart_skills_lint/test/relative_paths_test.dart +0 -172
  120. package/skills/flutter-skills/tool/dart_skills_lint/test/resolve_rules_test.dart +0 -82
  121. package/skills/flutter-skills/tool/dart_skills_lint/test/rule_naming_test.dart +0 -29
  122. package/skills/flutter-skills/tool/dart_skills_lint/test/skills_ignores_storage_test.dart +0 -89
  123. package/skills/flutter-skills/tool/dart_skills_lint/test/test_utils.dart +0 -19
  124. package/skills/flutter-skills/tool/dart_skills_lint/test/trailing_whitespace_test.dart +0 -152
  125. package/skills/flutter-skills/tool/generator/README.md +0 -150
  126. package/skills/flutter-skills/tool/generator/analysis_options.yaml +0 -143
  127. package/skills/flutter-skills/tool/generator/bin/skills.dart +0 -73
  128. package/skills/flutter-skills/tool/generator/lib/src/commands/base_skill_command.dart +0 -87
  129. package/skills/flutter-skills/tool/generator/lib/src/commands/base_yaml_command.dart +0 -83
  130. package/skills/flutter-skills/tool/generator/lib/src/commands/generate_skill_command.dart +0 -92
  131. package/skills/flutter-skills/tool/generator/lib/src/commands/update_readme_command.dart +0 -150
  132. package/skills/flutter-skills/tool/generator/lib/src/commands/update_skill_command.dart +0 -97
  133. package/skills/flutter-skills/tool/generator/lib/src/commands/validate_skill_command.dart +0 -284
  134. package/skills/flutter-skills/tool/generator/lib/src/models/skill_params.dart +0 -41
  135. package/skills/flutter-skills/tool/generator/lib/src/services/gemini_service.dart +0 -310
  136. package/skills/flutter-skills/tool/generator/lib/src/services/markdown_converter.dart +0 -226
  137. package/skills/flutter-skills/tool/generator/lib/src/services/prompts.dart +0 -72
  138. package/skills/flutter-skills/tool/generator/lib/src/services/resource_fetcher_service.dart +0 -84
  139. package/skills/flutter-skills/tool/generator/lib/src/services/skill_instructions.dart +0 -30
  140. package/skills/flutter-skills/tool/generator/pubspec.yaml +0 -32
  141. package/skills/flutter-skills/tool/generator/test/commands/base_skill_command_test.dart +0 -131
  142. package/skills/flutter-skills/tool/generator/test/commands/validate_skills_input_test.dart +0 -263
  143. package/skills/flutter-skills/tool/generator/test/custom_skill_rules/last_modified_rule.dart +0 -32
  144. package/skills/flutter-skills/tool/generator/test/generate_skills_retry_test.dart +0 -105
  145. package/skills/flutter-skills/tool/generator/test/generate_skills_test.dart +0 -519
  146. package/skills/flutter-skills/tool/generator/test/lint_skills_test.dart +0 -34
  147. package/skills/flutter-skills/tool/generator/test/markdown_converter_test.dart +0 -103
  148. package/skills/flutter-skills/tool/generator/test/markdown_table_test.dart +0 -131
  149. package/skills/flutter-skills/tool/generator/test/models/skill_params_test.dart +0 -37
  150. package/skills/flutter-skills/tool/generator/test/services/gemini_service_test.dart +0 -291
  151. package/skills/flutter-skills/tool/generator/test/services/markdown_converter_test.dart +0 -156
  152. package/skills/flutter-skills/tool/generator/test/services/resource_fetcher_service_test.dart +0 -188
  153. package/skills/flutter-skills/tool/generator/test/update_skills_test.dart +0 -241
  154. package/skills/flutter-skills/tool/generator/test/validate_skills_test.dart +0 -728
  155. /package/skills/{.agents → flutter}/skills/flutter-add-integration-test/SKILL.md +0 -0
  156. /package/skills/{.agents → flutter}/skills/flutter-add-widget-preview/SKILL.md +0 -0
  157. /package/skills/{.agents → flutter}/skills/flutter-add-widget-test/SKILL.md +0 -0
  158. /package/skills/{.agents → flutter}/skills/flutter-apply-architecture-best-practices/SKILL.md +0 -0
  159. /package/skills/{.agents → flutter}/skills/flutter-build-responsive-layout/SKILL.md +0 -0
  160. /package/skills/{.agents → flutter}/skills/flutter-fix-layout-issues/SKILL.md +0 -0
  161. /package/skills/{.agents → flutter}/skills/flutter-implement-json-serialization/SKILL.md +0 -0
  162. /package/skills/{.agents → flutter}/skills/flutter-setup-declarative-routing/SKILL.md +0 -0
  163. /package/skills/{.agents → flutter}/skills/flutter-setup-localization/SKILL.md +0 -0
  164. /package/skills/{.agents → flutter}/skills/flutter-use-http-package/SKILL.md +0 -0
@@ -1,51 +0,0 @@
1
- name: skills_tool
2
- permissions: read-all
3
-
4
- on:
5
- # Run CI on all PRs (against any branch) and on pushes to the main branch.
6
- pull_request:
7
- paths:
8
- - '.github/workflows/skills_tool.yaml'
9
- - 'tool/generator/**'
10
- push:
11
- branches: [ main ]
12
- paths:
13
- - '.github/workflows/skills_tool.yaml'
14
- - 'tool/generator/**'
15
- schedule:
16
- - cron: '0 0 * * 0' # weekly
17
-
18
- defaults:
19
- run:
20
- working-directory: tool/generator
21
-
22
- jobs:
23
- analyze_and_test:
24
- strategy:
25
- fail-fast: false
26
- matrix:
27
- os: [ubuntu-latest, macos-latest, windows-latest]
28
- runs-on: ${{ matrix.os }}
29
- steps:
30
- - uses: actions/checkout@v6
31
- - uses: dart-lang/setup-dart@v1
32
- with:
33
- sdk: stable
34
-
35
- - run: dart pub get
36
-
37
- - run: dart analyze --fatal-infos
38
-
39
- - run: dart test
40
-
41
- formatting_stable_ubuntu-latest:
42
- runs-on: ubuntu-latest
43
- steps:
44
- - uses: actions/checkout@v6
45
- - uses: dart-lang/setup-dart@v1
46
- with:
47
- sdk: stable
48
-
49
- - run: dart pub get
50
-
51
- - run: dart format --output=none --set-exit-if-changed .
@@ -1,3 +0,0 @@
1
- # Code of Conduct
2
-
3
- This repository follows the Flutter repository's [Code of Conduct](https://github.com/flutter/flutter/blob/main/CODE_OF_CONDUCT.md).
@@ -1,36 +0,0 @@
1
- # Contributing to Flutter Skills
2
-
3
- ## Note on contributions
4
-
5
- We are not yet open for direct contributions as we are still actively working on publishing a larger set of skills. Your experience using these skills is important to us. If you find a bug or have an idea for a skill you'd like to see added, please [file an issue][issue] or request following the insturctions below.
6
-
7
- We appreciate your feedback!
8
-
9
- ## Providing Feedback on an existing skill
10
- [File an issue][issue] and let us know:
11
- 1. What language model are you using? (Gemini 3.1 Flash, Claude Sonnet 4.6, etc)
12
- 2. What agent harness are you using? (Antigravity, Gemini CLI, Claude Code, Cursor)
13
- 3. Logs that show what prompt you used and steps the agent took to complete the task (Such as what skills it chose to use, MCP tools it used, etc).
14
-
15
- ## Requesting a skill
16
- First check if its on the [list of skills we plan to work on next][next skills] and feel free to comment if you'd like us to prioritize differently.
17
- If not [file an issue][issue] and we will prioritize it.
18
-
19
- ## Issue triage
20
-
21
- We regularly triage issues by looking at newly filed issues and determining what we should do about each of them. Triage issues as follows:
22
-
23
- - Open the [list of untriaged issues][untriaged_list].
24
- - For each issue in the list, do one of:
25
- - If we don't plan to fix the issue, close it with an explanation.
26
- - If we plan to fix the issue, add the `triaged` label and assign a priority: [P0][P0], [P1][P1], [P2][P2], or [P3][P3]. If you don't know which priority to assign, apply `P2`. If an issue is `P0` or `P1`, add it to a milestone.
27
-
28
- At the end of a triage session, the untriaged issue list should be as close to empty as possible.
29
-
30
- [issue]: https://github.com/flutter/skills/issues
31
- [next skills]: https://github.com/flutter/skills/issues/88
32
- [untriaged_list]: https://github.com/flutter/skills/issues?q=is%3Aissue+state%3Aopen+-label%3Atriaged
33
- [P0]: https://github.com/flutter/skills/labels?q=P0
34
- [P1]: https://github.com/flutter/skills/labels?q=P1
35
- [P2]: https://github.com/flutter/skills/labels?q=P2
36
- [P3]: https://github.com/flutter/skills/labels?q=P3
@@ -1,26 +0,0 @@
1
- Copyright 2026 The Flutter Authors. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without modification,
4
- are permitted provided that the following conditions are met:
5
-
6
- 1. Redistributions of source code must retain the above copyright notice, this
7
- list of conditions and the following disclaimer.
8
-
9
- 2. Redistributions in binary form must reproduce the above copyright notice,
10
- this list of conditions and the following disclaimer in the documentation
11
- and/or other materials provided with the distribution.
12
-
13
- 3. Neither the name of the copyright holder nor the names of its contributors
14
- may be used to endorse or promote products derived from this software without
15
- specific prior written permission.
16
-
17
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
21
- ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
- (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
- LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
24
- ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,50 +0,0 @@
1
- # Flutter Agent Skills
2
-
3
- Agent skills for Flutter, maintained by the Flutter team.
4
- A collection of skills providing tailored instructions for happy path Flutter app development workflows. By giving the agent actual domain expertise and repeatable workflows, you drastically reduce mistakes and ensure agents reliably complete the task following best practices.
5
-
6
- Skills are essentially simple folders of files that can be seen as complementary to MCP, where MCP gives an agent access to specialized tools and a Skill teaches the agent “how” to use tools for a specific task.
7
-
8
- You can also install the [Agent Skills for Dart](https://github.com/dart-lang/skills) for Dart tasks.
9
-
10
- ## Installation
11
-
12
- To install all skills into your project, run the following command.
13
- The `--agent universal` flag puts it in the standard `.agents/skills`
14
- folder that most agents use.
15
-
16
- ```bash
17
- npx skills add flutter/skills --skill '*' --agent universal
18
- ```
19
-
20
- ## Updating Skills
21
-
22
- To update, run the following command:
23
-
24
- ```bash
25
- npx skills update
26
- ```
27
-
28
- ## Available Skills
29
-
30
- | Skill | Description | Example prompt |
31
- |---|---|---|
32
- | [flutter-add-integration-test](skills/flutter-add-integration-test/SKILL.md) | Configures Flutter Driver for app interaction and converts MCP actions into permanent integration tests. Use when adding integration testing to a project, exploring UI components via MCP, or automating user flows with the integration_test package. | Add an integration test that validates the checkout experience |
33
- | [flutter-add-widget-preview](skills/flutter-add-widget-preview/SKILL.md) | Adds interactive widget previews to the project using the previews.dart system. Use when creating new UI components or updating existing screens to ensure consistent design and interactive testing. | Create a preview for the ProductCard widget with different price states |
34
- | [flutter-add-widget-test](skills/flutter-add-widget-test/SKILL.md) | Implement a component-level test using `WidgetTester` to verify UI rendering and user interactions (tapping, scrolling, entering text). Use when validating that a specific widget displays correct data and responds to events as expected. | Add a widget test for the CustomButton to verify the onTap callback is called |
35
- | [flutter-apply-architecture-best-practices](skills/flutter-apply-architecture-best-practices/SKILL.md) | Architects a Flutter application using the recommended layered approach (UI, Logic, Data). Use when structuring a new project or refactoring for scalability. | Refactor the authentication flow to follow the recommended layered architecture |
36
- | [flutter-build-responsive-layout](skills/flutter-build-responsive-layout/SKILL.md) | Use `LayoutBuilder`, `MediaQuery`, or `Expanded/Flexible` to create a layout that adapts to different screen sizes. Use when you need the UI to look good on both mobile and tablet/desktop form factors. | Make the home screen responsive so it displays a grid on tablets and a list on phones |
37
- | [flutter-fix-layout-issues](skills/flutter-fix-layout-issues/SKILL.md) | Fixes Flutter layout errors (overflows, unbounded constraints) using Dart and Flutter MCP tools. Use when addressing "RenderFlex overflowed", "Vertical viewport was given unbounded height", or similar layout issues. | Fix the overflow error on the profile page when the keyboard is visible |
38
- | [flutter-implement-json-serialization](skills/flutter-implement-json-serialization/SKILL.md) | Create model classes with `fromJson` and `toJson` methods using `dart:convert`. Use when manually mapping JSON keys to class properties for simple data structures. | Implement JSON serialization for the User model class |
39
- | [flutter-setup-declarative-routing](skills/flutter-setup-declarative-routing/SKILL.md) | Configure `MaterialApp.router` using a package like `go_router` for advanced URL-based navigation. Use when developing web applications or mobile apps that require specific deep linking and browser history support. | Set up GoRouter with paths for home, details, and settings |
40
- | [flutter-setup-localization](skills/flutter-setup-localization/SKILL.md) | Add `flutter_localizations` and `intl` dependencies, enable "generate true" in `pubspec.yaml`, and create an `l10n.yaml` configuration file. Use when initializing localization support for a new Flutter project. | Setup localization and add English and Spanish translations |
41
- | [flutter-use-http-package](skills/flutter-use-http-package/SKILL.md) | Use the `http` package to execute GET, POST, PUT, or DELETE requests. Use when you need to fetch from or send data to a REST API. | Use the http package to fetch the list of products from the API |
42
- ## Contributing
43
-
44
- We aren't accepting pull requests at this time, but we would love to hear your feedback!
45
-
46
- Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
47
-
48
- ## Code of Conduct
49
-
50
- Please see [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) for more information.
@@ -1,9 +0,0 @@
1
- name: skills_workspace
2
- publish_to: 'none'
3
-
4
- environment:
5
- sdk: ^3.10.8
6
-
7
- workspace:
8
- - tool/generator
9
- - tool/dart_skills_lint
@@ -1,434 +0,0 @@
1
- # Copyright (c) 2026, the Dart project authors. Please see the AUTHORS file
2
- # for details. All rights reserved. Use of this source code is governed by a
3
- # BSD-style license that can be found in the LICENSE file.
4
-
5
- # This is the configuration file for the skill generator.
6
- # To generate skills, use the following command (from the `tool` directory):
7
- # dart run skills generate-skill --config ../resources/flutter_skills.yaml --output ../skills
8
- - name: flutter-add-integration-test
9
- description: Configures Flutter Driver for app interaction and converts MCP
10
- actions into permanent integration tests. Use when adding integration
11
- testing to a project, exploring UI components via MCP, or automating user
12
- flows with the integration_test package.
13
- examplePrompt: "Add an integration test that validates the checkout experience"
14
- instructions: |
15
- 1. **Project Setup and Dependency Management:**
16
- * Add the `integration_test` package as a `dev_dependency` to your `pubspec.yaml` file. This can be done by running `flutter pub add 'dev:integration_test:{"sdk":"flutter"}'`.
17
- * Ensure the `flutter_test` package is also included as a `dev_dependency`.
18
- * Ensure `flutter_driver` is configured by importing `package:flutter_driver/driver_extension.dart' and calling `enableFlutterDriverExtension()`
19
-
20
- 2. **Interactive Exploration (Flutter Driver MCP)**
21
- * Once configured, use the `flutter-driver` MCP tools to explore the app:
22
- 1. **Launch**: Use `launch_app` with `target: "lib/main_test.dart"`.
23
- 2. **Inspect**: Use `get_widget_tree` to find `Key`s, `Text`, or `Type`s.
24
- 3. **Interact**: Use `tap`, `enter_text`, and `scroll` to execute your flow.
25
- 4. **Wait**: Always call `waitFor` or check `get_health` if transitions are slow.
26
- * If a widget isn't found, it might be unmounted in a `SliverList` or `ListView`. Use `scroll` or `scrollIntoView` first.
27
- 3. **Integration Test File Creation:**
28
- * Create a new directory named `integration_test/` within your project.
29
- * Inside this directory, create your test files with the format `<name>_test.dart`.
30
- * For running tests with `flutter drive`, create a `test_driver` directory and an `integration_test.dart` file within it, containing `integrationDriver()`.
31
-
32
- 4. **Writing Integration Tests:**
33
- * Integration tests verify the behavior of the complete app and can be used to validate how individual pieces work together or capture app performance on a real device. They are also known as end-to-end or GUI testing.
34
- * Use `flutter_test` APIs to write tests in a style similar to widget tests.
35
- * To verify a widget is displayed, load the main app widget using `tester.pumpWidget` and then use `expect` with `findsOneWidget`.
36
- * For user interactions like tapping, use `tester.tap` and then `tester.pumpAndSettle` to wait for UI changes.
37
- * To verify a widget is not displayed, use `expect` with `findsNothing`.
38
- * For scrolling, `integration_test` allows using `tester.scrollUntilVisible` to scroll to a specific item.
39
- * When working with `flutter_driver` (for migration or specific scenarios), `waitFor` is used to locate widgets, and `waitForAbsent` to ensure a widget is not present. `flutter_driver` also uses `driver.tap` for interactions and `driver.scroll` for scrolling.
40
- * Add `Key` parameters to widgets, such as `ValueKey('increment')`, to allow finding specific widgets within the test suite.
41
-
42
- 5. **Running Integration Tests:**
43
- * Integration tests can be run on a physical device or emulator using the `flutter drive` command.
44
- * To run tests on Chrome, launch `chromedriver` and then use `flutter drive --driver=test_driver/integration_test.dart --target=integration_test/app_test.dart -d chrome`.
45
- * To run as a headless test, use `flutter drive` with the `-d web-server` option.
46
- * For Android, you can build a debug APK using `flutter build apk --debug` and then build an Android test APK using `./gradlew app:assembleAndroidTest`.
47
- * Integration tests can also be run on Firebase Test Lab to automate testing on various devices. This involves creating an APK using Gradle and uploading it to the Firebase Test Lab Console.
48
- resources:
49
- - https://raw.githubusercontent.com/dart-lang/ai/refs/heads/main/pkgs/dart_mcp_server/README.md
50
- - https://docs.flutter.dev/cookbook/testing/integration
51
- - https://docs.flutter.dev/cookbook/testing/integration/introduction
52
- - https://docs.flutter.dev/cookbook/testing/integration/profiling
53
- - https://docs.flutter.dev/testing/integration-tests
54
- - https://docs.flutter.dev/testing/plugins-in-tests
55
- - https://docs.flutter.dev/testing/testing-plugins
56
- - name: flutter-fix-layout-issues
57
- description: Fixes Flutter layout errors (overflows, unbounded constraints)
58
- using Dart and Flutter MCP tools. Use when addressing "RenderFlex overflowed",
59
- "Vertical viewport was given unbounded height", or similar layout issues.
60
- examplePrompt: "Fix the overflow error on the profile page when the keyboard is visible"
61
- instructions: |
62
- 1. **Identify the Layout Error:**
63
- * Recognize common Flutter framework errors, including layout errors.
64
- * Look for specific error messages such as "RenderFlex overflowed", "Vertical viewport was given unbounded height", "An InputDecorator...cannot have an unbounded width", or "RenderBox was not laid out".
65
- * A solid red or grey screen can also indicate an error.
66
-
67
- 2. **Understand the Cause of the Error:**
68
- * **"Vertical viewport was given unbounded height"**: This error often occurs when a scrollable widget, like a `ListView` or `GridView`, is placed inside a `Column`. `ListView`s take all available vertical space unless constrained by a parent, and `Column`s don't impose height constraints on their children by default, leading to an inability to determine the `ListView`'s size.
69
- * **Unbounded Width Errors (e.g., `InputDecorator` or `TextField`)**: This happens when a `Row` contains a `TextFormField` or `TextField` without a width constraint. Similarly, a `Column` might try to be wider than its parent `Row` can allocate, causing an overflow. This is due to Flutter's layout process where parents pass down constraints, and children respond by passing up a size within those constraints. If a child, like a `Text` widget, determines its own width based on its content, and its parent (`Column`) adopts that width, it can clash with the parent's (`Row`) maximum horizontal space.
70
- * **"RenderBox was not laid out"**: This error is often a side effect of a primary error earlier in the rendering pipeline. It usually relates to violations of box constraints, meaning Flutter needs more information on how to constrain the widgets.
71
- * **"Incorrect use of ParentData widget"**: This error indicates that a `ParentDataWidget` is not placed directly inside a compatible ancestor widget. Certain widgets, like `Flexible` and `Expanded`, expect specific parent widgets such as `Row`, `Column`, or `Flex`. `Positioned` expects a `Stack`, and `TableCell` expects a `Table`.
72
-
73
- 3. **Apply the Appropriate Fix:**
74
- * **For "Vertical viewport was given unbounded height" (ListView in Column)**:
75
- * Specify the height of the `ListView`.
76
- * Wrap the `ListView` in an `Expanded` widget to make it take the remaining space in the `Column`.
77
- * Alternatively, use a `SizedBox` for an absolute height or a `Flexible` widget for a relative height.
78
- * **For unbounded width errors (e.g., `TextField` in `Row` or `Column` in `Row`)**:
79
- * Constrain the width of the widget (e.g., `InputDecorator`, `TextField`, or `Column`).
80
- * Wrap the widget in an `Expanded` widget.
81
- * Wrap the widget in a `Flexible` widget and specify a flex factor. An `Expanded` widget is equivalent to a `Flexible` widget with a flex factor of 1.0.
82
- * **For "RenderBox was not laid out"**: The solution involves providing more information to Flutter about how to constrain the widgets. Understanding how constraints work in Flutter is crucial.
83
- * **For "Incorrect use of ParentData widget"**: The fix is to place the `ParentDataWidget` inside its expected parent widget.
84
-
85
- 4. **Review and Refine:**
86
- * Compare your code to working examples if available.
87
- * Use automatic reformatting support in your Flutter editor.
88
- * Leverage Flutter's hot reload feature to accelerate development and see changes quickly.
89
- resources:
90
- - https://raw.githubusercontent.com/dart-lang/ai/refs/heads/main/pkgs/dart_mcp_server/README.md
91
- - https://docs.flutter.dev/get-started/fundamentals/layout
92
- - https://docs.flutter.dev/release/breaking-changes/layout-builder-optimization
93
- - https://docs.flutter.dev/testing/common-errors
94
- - https://docs.flutter.dev/testing/errors
95
- - https://docs.flutter.dev/tools/devtools/inspector
96
- - https://docs.flutter.dev/tools/devtools/legacy-inspector
97
- - https://docs.flutter.dev/tools/flutter-fix
98
- - https://docs.flutter.dev/ui/layout
99
- - https://docs.flutter.dev/ui/layout/constraints
100
- - https://docs.flutter.dev/ui/layout/tutorial
101
- - name: flutter-add-widget-preview
102
- description: Adds interactive widget previews to the project using the
103
- previews.dart system. Use when creating new UI components or updating
104
- existing screens to ensure consistent design and interactive testing.
105
- examplePrompt: "Create a preview for the ProductCard widget with different price states"
106
- instructions: |
107
- 1. Defining Widget Previews:
108
- * To preview a widget, use the `@Preview` annotation defined in `package:flutter/widget_previews.dart`.
109
- * This annotation can be applied to top-level functions that return a `Widget` or `WidgetBuilder`, static methods within a class that return a `Widget` or `WidgetBuilder`, or public `Widget` constructors and factories with no required arguments.
110
- * A basic example involves importing `package:flutter/widget_previews.dart` and `package:flutter/material.dart`, then defining a function annotated with `@Preview` that returns a `Widget`, such as a `Text` widget. For instance:
111
- ```dart
112
- import 'package:flutter/widget_previews.dart';
113
- import 'package:flutter/material.dart';
114
-
115
- @Preview(name: 'My Sample Text')
116
- Widget mySampleText() {
117
- return const Text('Hello, World!');
118
- }
119
- ```
120
-
121
- * Multiple preview configurations can be created by applying multiple `@Preview` annotations to a single function or constructor.
122
- * For common configurations, extend `MultiPreview` to create a custom annotation. `MultiPreview` also provides a `transform()` method to perform transformations on each preview at runtime.
123
-
124
- 2. Interacting with Previews:
125
- * As of Flutter 3.38, Android Studio, IntelliJ, and Visual Studio Code automatically start the Flutter Widget Previewer on launch.
126
- * Alternatively, the previewer can be started from the command line by navigating to the Flutter project's root directory and running `flutter widget-preview start`. This command launches a local server and opens a Widget Preview environment in Chrome that updates automatically with project changes.
127
- resources:
128
- - https://docs.flutter.dev/tools/widget-previewer
129
- - name: flutter-apply-architecture-best-practices
130
- description: Architects a Flutter application using the recommended layered
131
- approach (UI, Logic, Data). Use when structuring a new project or
132
- refactoring for scalability.
133
- examplePrompt: "Refactor the authentication flow to follow the recommended layered architecture"
134
- instructions: |
135
- **1. Understand the Core Principles and Layers:**
136
- * **Separation of Concerns** is the most important principle to follow when designing your Flutter app. This principle makes your code less error-prone by keeping widgets "dumb".
137
- * Flutter applications should be written in **layers**. Layered architecture organizes an application into distinct layers, each with specific roles and responsibilities.
138
- * Typically, applications are separated into 2 to 3 layers, depending on complexity. The three common layers are the UI layer, logic layer, and data layer.
139
- * The Flutter team strongly recommends using clearly defined **data and UI layers**.
140
- * Within each layer, further separate your application by **feature or functionality**. For example, authentication logic should be in a different class than search logic.
141
-
142
- **2. Structure the UI Layer:**
143
- * The **UI layer** displays data to the user that is exposed by the business logic layer, and handles user interaction. It is also commonly referred to as the 'presentation layer'.
144
- * The UI layer contains separate classes for UI logic and widgets.
145
- * Use **ViewModels and Views** in the UI layer. Views and ViewModels make up the UI layer of an application.
146
- * Implement the **MVVM architectural pattern** (Model-View-ViewModel) in the UI layer. MVVM separates a feature into three parts: Model, ViewModel, and View.
147
- * Write **reusable, lean widgets** that hold as little logic as possible. Do not put logic in widgets.
148
- * Use **ChangeNotifiers and Listenables** to handle widget updates. The ChangeNotifier API is part of the Flutter SDK and is a convenient way for widgets to observe changes in ViewModels.
149
-
150
- **3. Structure the Logic Layer (Optional):**
151
- * The **Logic layer** implements core business logic and facilitates interaction between the data layer and UI layer. It is commonly known as the 'domain layer'.
152
- * This layer is **optional** and only needs to be implemented if your application has complex business logic that happens on the client. Many apps are only concerned with presenting and changing data (CRUD apps).
153
-
154
- **4. Structure the Data Layer:**
155
- * The **data layer** exposes application data to the rest of the app and contains most of the business logic.
156
- * Use the **repository pattern** in the data layer. This pattern isolates data access logic from the rest of the application, creating an abstraction layer between business logic and underlying data storage mechanisms (databases, APIs, file systems, etc.).
157
- * In practice, this means creating **Repository classes and Service classes**.
158
- * Repositories and services represent the data of an application, or the model layer of MVVM.
159
- * Services interact with external APIs, such as client servers and platform plugins.
160
-
161
- **5. Project Organization and Best Practices:**
162
- * A single feature in an application might require a View, a ViewModel, one or more Repositories, and zero or more Services.
163
- * Well-organized code is easier for multiple engineers to work on with minimal code conflicts and is easier for new engineers to navigate and understand.
164
- * These recommendations are guidelines, not steadfast rules, and should be adapted to your unique requirements.
165
- * The Flutter team strongly recommends implementing these practices when starting a new application and strongly considering refactoring existing apps unless it fundamentally clashes with the current approach.
166
-
167
- resources:
168
- - https://docs.flutter.dev/app-architecture
169
- - https://docs.flutter.dev/app-architecture/case-study
170
- - https://docs.flutter.dev/app-architecture/case-study/data-layer
171
- - https://docs.flutter.dev/app-architecture/case-study/ui-layer
172
- - https://docs.flutter.dev/app-architecture/concepts
173
- - https://docs.flutter.dev/app-architecture/design-patterns
174
- - https://docs.flutter.dev/app-architecture/guide
175
- - https://docs.flutter.dev/app-architecture/recommendations
176
- - https://docs.flutter.dev/learn/pathway/how-flutter-works
177
- - https://docs.flutter.dev/reference/create-new-app
178
- - https://docs.flutter.dev/resources/architectural-overview
179
- - https://docs.flutter.dev/resources/faq
180
- - https://docs.flutter.dev/ui/layout/tutorial
181
- - name: flutter-build-responsive-layout
182
- description: Use `LayoutBuilder`, `MediaQuery`, or `Expanded/Flexible` to
183
- create a layout that adapts to different screen sizes. Use when you need the
184
- UI to look good on both mobile and tablet/desktop form factors.
185
- examplePrompt: "Make the home screen responsive so it displays a grid on tablets and a list on phones"
186
- instructions: |
187
- 1. **Determine the available space**:
188
- * Use `MediaQuery.sizeOf(context)` or `LayoutBuilder` to get the size of the window your app is currently running in.
189
- * `LayoutBuilder` builds a widget tree that can depend on the parent widget's size. Its builder callback provides `BoxConstraints` from its parent, which can be used to return different widgets based on the available space.
190
- * Avoid using `MediaQuery.orientationOf` or `OrientationBuilder` near the top of your widget tree to switch between different app layouts, as the device's orientation doesn't necessarily inform you of the app window's space.
191
- * Do not check for hardware types like "phone" or "tablet" when making layout decisions, as the space an app renders in isn't always tied to the full screen size of the device. Flutter apps can run in resizable windows, multi-window modes, or picture-in-picture.
192
- * For large screen devices, `MediaQuery` can be used to get the app window size rather than the physical device size.
193
- * Another approach is to use the `maxWidth` property of `BoxConstraints` by wrapping a widget like `GridView` in a `ConstrainedBox` or `Container`.
194
-
195
- 2. **Implement adaptive layouts based on available space**:
196
- * Use `LayoutBuilder` to return different layouts based on the `BoxConstraints` received. For example, you can check `constraints.maxWidth` to determine if the screen is large (e.g., `maxWidth > largeScreenMinWidth`) and return a different widget tree accordingly.
197
- * For small screens, you might use a navigation-style approach, while for large screens, you could use a `Row` to place elements side-by-side.
198
- * Consider using adaptive breakpoints, such as those recommended by Material Design.
199
-
200
- 3. **Manage widget sizing and positioning within layouts**:
201
- * Utilize `Expanded` and `Flexible` widgets within `Row`, `Column`, or `Flex` to distribute available space among children.
202
- * `Expanded` stretches a child to fill any remaining available space. It is equivalent to `Flexible` with a `flex` factor of 1.0.
203
- * `Flexible` allows a child to be sized to a specific size while still allowing it to expand or contract. You can specify a `flex` factor to determine the ratio in which `Expanded` or `Flexible` children consume available space. For example, a `flex` factor of 2 will make a widget twice as wide as others with a `flex` factor of 1.
204
- * To prevent widgets from gobbling up all horizontal space on large screens, consider constraining their width.
205
- * For lists with an unknown number of items, `ListView.builder` can be used to lazily render items.
206
-
207
- 4. **Consider specific device and orientation behaviors**:
208
- * Avoid locking screen orientation, as it can cause issues on foldable devices, potentially leading to letterboxing where the app is centered with black borders.
209
- * If screen orientation must be locked (though generally discouraged), use the `Display API` to get physical screen dimensions instead of `MediaQuery`. The `Display API` is useful in situations where `MediaQuery` might not receive the larger window size due to compatibility modes.
210
- * Android and Flutter design guidance recommends not locking screen orientation. Android large format tiers require both portrait and landscape support.
211
- * Support a variety of input devices, including basic mice, trackpads, and keyboard shortcuts.
212
- resources:
213
- - https://docs.flutter.dev/cookbook/design/orientation
214
- - https://docs.flutter.dev/get-started/fundamentals/layout
215
- - https://docs.flutter.dev/learn/pathway/tutorial/adaptive-layout
216
- - https://docs.flutter.dev/release/breaking-changes/layout-builder-optimization
217
- - https://docs.flutter.dev/testing/common-errors
218
- - https://docs.flutter.dev/ui
219
- - https://docs.flutter.dev/ui/adaptive-responsive
220
- - https://docs.flutter.dev/ui/adaptive-responsive/best-practices
221
- - https://docs.flutter.dev/ui/adaptive-responsive/general
222
- - https://docs.flutter.dev/ui/adaptive-responsive/large-screens
223
- - https://docs.flutter.dev/ui/adaptive-responsive/safearea-mediaquery
224
- - https://docs.flutter.dev/ui/layout
225
- - https://docs.flutter.dev/ui/layout/constraints
226
- - https://docs.flutter.dev/ui/layout/tutorial
227
- - https://docs.flutter.dev/ui/widgets/layout
228
- - name: flutter-setup-declarative-routing
229
- description: Configure `MaterialApp.router` using a package like `go_router`
230
- for advanced URL-based navigation. Use when developing web applications or
231
- mobile apps that require specific deep linking and browser history support.
232
- examplePrompt: "Set up GoRouter with paths for home, details, and settings"
233
- instructions: |
234
- 1. **Create a new Flutter application**:
235
- * Use the command `flutter create <app-name>`. For example, `flutter create deeplink_cookbook`.
236
-
237
- 2. **Add the `go_router` package as a dependency**:
238
- * Run `flutter pub add go_router`. The Flutter team maintains the `go_router` package, which offers a simple API for complex routing scenarios.
239
-
240
- 3. **Configure `MaterialApp.router` with a `GoRouter` object**:
241
- * In your `main.dart` file, import `package:go_router/go_router.dart'` and `package:flutter/material.dart'`.
242
- * Create a `GoRouter` object that defines your application's routes. This object will handle routing, including paths like '/' and '/details'.
243
- * Set up your `main` function to run `MaterialApp.router` and provide it with the `routerConfig` property, which should be your `GoRouter` object.
244
- * For example, you can define routes within the `GoRouter` object using `GoRoute` for different paths and their corresponding builders.
245
- * Routing packages like `go_router` are declarative, meaning they will consistently display the same screen(s) when a deep link is received.
246
-
247
- 4. **Configure deep linking for specific platforms (if needed)**:
248
- * **For iOS:**
249
- * If using a Flutter version earlier than 3.27, manually opt-in to deep linking by adding `FlutterDeepLinkingEnabled` with a value of `YES` to `Info.plist`.
250
- * If using third-party plugins for deep links (e.g., `app_links`), you should opt out of Flutter's default deep link handler by setting `FlutterDeepLinkingEnabled` to `NO` in `Info.plist`.
251
- * Add associated domains by launching Xcode, selecting the top-level Runner, clicking the Runner target, and then "Signing & Capabilities". Add a new capability for "Associated Domains" and enter `applinks:<web domain>`.
252
- * Open `ios/Runner/Runner.entitlements` and add the associated domain inside the `<dict>` tag.
253
- * Host an `apple-app-site-association` file in your web domain, which tells the mobile browser to open your iOS app instead of the browser. This file requires your app's `appID`, formatted as `<team id>.<bundle id>`.
254
- * **For Android:**
255
- * Web apps read the deep link path from the URL fragment by default, using the pattern `/#/path/to/app/screen`, but this can be changed by configuring the URL strategy.
256
- * To configure your Android application to handle deep links, refer to the deep linking documentation.
257
- resources:
258
- - https://docs.flutter.dev/cookbook/animation/page-route-animation
259
- - https://docs.flutter.dev/cookbook/effects/nested-nav
260
- - https://docs.flutter.dev/cookbook/navigation/named-routes
261
- - https://docs.flutter.dev/cookbook/navigation/navigate-with-arguments
262
- - https://docs.flutter.dev/cookbook/navigation/navigation-basics
263
- - https://docs.flutter.dev/cookbook/navigation/set-up-app-links
264
- - https://docs.flutter.dev/cookbook/navigation/set-up-universal-links
265
- - https://docs.flutter.dev/packages-and-plugins/using-packages
266
- - https://docs.flutter.dev/platform-integration/web
267
- - https://docs.flutter.dev/platform-integration/web/building
268
- - https://docs.flutter.dev/platform-integration/web/embedding-flutter-web
269
- - https://docs.flutter.dev/platform-integration/web/initialization
270
- - https://docs.flutter.dev/release/breaking-changes/deep-links-flag-change
271
- - https://docs.flutter.dev/release/breaking-changes/route-navigator-refactoring
272
- - https://docs.flutter.dev/tools/devtools/deep-links
273
- - https://docs.flutter.dev/ui/navigation
274
- - https://docs.flutter.dev/ui/navigation/deep-linking
275
- - https://docs.flutter.dev/ui/navigation/url-strategies
276
- - https://pub.dev/documentation/go_router/latest/topics/Configuration-topic.html
277
- - https://pub.dev/documentation/go_router/latest/topics/Deep%20linking-topic.html
278
- - https://pub.dev/documentation/go_router/latest/topics/Error%20handling-topic.html
279
- - https://pub.dev/documentation/go_router/latest/topics/Get%20started-topic.html
280
- - https://pub.dev/documentation/go_router/latest/topics/Named%20routes-topic.html
281
- - https://pub.dev/documentation/go_router/latest/topics/Navigation-topic.html
282
- - https://pub.dev/documentation/go_router/latest/topics/Redirection-topic.html
283
- - https://pub.dev/documentation/go_router/latest/topics/State%20restoration-topic.html
284
- - https://pub.dev/documentation/go_router/latest/topics/Transition%20animations-topic.html
285
- - https://pub.dev/documentation/go_router/latest/topics/Type-safe%20routes-topic.html
286
- - https://pub.dev/documentation/go_router/latest/topics/Upgrading-topic.html
287
- - https://pub.dev/documentation/go_router/latest/topics/Web-topic.html
288
- - name: flutter-add-widget-test
289
- description: Implement a component-level test using `WidgetTester` to verify
290
- UI rendering and user interactions (tapping, scrolling, entering text). Use
291
- when validating that a specific widget displays correct data and responds to
292
- events as expected.
293
- examplePrompt: "Add a widget test for the CustomButton to verify the onTap callback is called"
294
- instructions: |
295
- 1. **Add the `flutter_test` dependency**. This dependency should be included in the `dev_dependencies` section of your `pubspec.yaml` file. If you created your Flutter project using command-line tools or a code editor, this dependency might already be present.
296
- 2. **Create the widget to test**. For example, you might create a widget that displays a title and a message.
297
- 3. **Create a `testWidgets` test**. Use the `testWidgets()` function from the `flutter_test` package to define your test. This function automatically provides a `WidgetTester` for each test case. The `WidgetTester` allows you to build and interact with widgets in the test environment.
298
- 4. **Build the widget using the `WidgetTester`**. Use the `pumpWidget()` method provided by `WidgetTester` to build and render your widget within the test environment. For instance, you can create an instance of `MyWidget` with specific title and message values. After the initial `pumpWidget()` call, `WidgetTester` offers additional methods like `tester.pump()` to rebuild the widget, which is useful for `StatefulWidget`s or animations where Flutter doesn't automatically rebuild after state changes in the test environment.
299
- 5. **Search for the widget using a `Finder`**. `Finder` classes allow you to locate widgets in the test environment. For example, you can use `find.text('Your Text')` to find a `Text` widget.
300
- 6. **Verify the widget using a `Matcher`**. Widget-specific `Matcher` constants help confirm whether a `Finder` successfully locates a widget or multiple widgets. For example, `findsOneWidget` can verify that a `Text` widget appears exactly once in the widget tree. You can also use `matchesGoldenFile` to verify that a widget's rendering matches a specific bitmap image (golden file testing).
301
- 7. **Simulate user interactions**. The `WidgetTester` provides methods for simulating interactions like entering text, tapping, and dragging.
302
- * To enter text, use `enterText()`.
303
- * To tap, use `tap()`.
304
- * To drag, use `drag()`.
305
- * To handle scrolling, the `WidgetTester` class provides the `scrollUntilVisible()` method, which scrolls until a specific widget is visible. This is useful when the height of items in a list can vary.
306
- 8. **Rebuild the widget tree after interactions**. Since Flutter doesn't automatically rebuild widgets in the test environment after user interactions update the app's state, you need to call `pump()` or `pumpAndSettle()` methods provided by the `WidgetTester` to ensure the widget tree is rebuilt.
307
- 9. **Run the tests**. Execute the tests using the command `flutter test test/widget_test.dart` from the root of your project.
308
-
309
- A widget test (also known as a component test in other UI frameworks) aims to verify that a single widget's UI looks and interacts as expected. It involves multiple classes and requires a test environment that provides the appropriate widget lifecycle context. Widget tests are more comprehensive than unit tests because the widget being tested can receive user actions, perform layout, and instantiate child widgets. However, like unit tests, the widget test environment is a simpler implementation than a full UI system.
310
- resources:
311
- - https://docs.flutter.dev/app-architecture/case-study/testing
312
- - https://docs.flutter.dev/cookbook/testing/integration/introduction
313
- - https://docs.flutter.dev/cookbook/testing/unit/introduction
314
- - https://docs.flutter.dev/cookbook/testing/widget/introduction
315
- - https://docs.flutter.dev/cookbook/testing/widget/orientation
316
- - https://docs.flutter.dev/cookbook/testing/widget/scrolling
317
- - https://docs.flutter.dev/cookbook/testing/widget/tap-drag
318
- - https://docs.flutter.dev/get-started/fundamentals/user-input
319
- - https://docs.flutter.dev/release/breaking-changes/mock-platform-channels
320
- - https://docs.flutter.dev/testing
321
- - https://docs.flutter.dev/testing/integration-tests
322
- - https://docs.flutter.dev/testing/overview
323
- - https://docs.flutter.dev/testing/testing-plugins
324
- - name: flutter-setup-localization
325
- description: Add `flutter_localizations` and `intl` dependencies, enable
326
- "generate true" in `pubspec.yaml`, and create an `l10n.yaml` configuration
327
- file. Use when initializing localization support for a new Flutter project.
328
- examplePrompt: "Setup localization and add English and Spanish translations"
329
- instructions: |
330
- 1. **Add `flutter_localizations` and `intl` dependencies**:
331
- * Add `flutter_localizations` and `intl` packages to your `pubspec.yaml` file. You can do this by running `$ flutter pub add flutter_localizations --sdk=flutter` and `$ flutter pub add intl:any`.
332
- * The `flutter_localizations` package is a Flutter SDK package that enables the localization of ARB files and is often used with the `intl` package.
333
- * After adding the packages, your `pubspec.yaml` file should include entries like:
334
- ```yaml
335
- dependencies:
336
- flutter:
337
- sdk: flutter
338
- flutter_localizations:
339
- sdk: flutter
340
- intl: any
341
- ```
342
-
343
- * After adding a package dependency, run `flutter pub get` in your terminal to install it.
344
-
345
- 2. **Enable `generate: true` in `pubspec.yaml`**:
346
- * Open your `pubspec.yaml` file.
347
- * In the `flutter` section, add `generate: true`. This flag handles localization tasks.
348
- * The `flutter` section in `pubspec.yaml` is specific to Flutter.
349
-
350
- 3. **Create an `l10n.yaml` configuration file**:
351
- * Add a new YAML file named `l10n.yaml` to the root directory of your Flutter project.
352
- * This file can be used to specify options like `synthetic-package: false` to generate localized messages directly into source files instead of a synthetic package. You can also specify `arb-dir` or `output-dir` in this file.
353
-
354
- 4. **Configure `MaterialApp` or `CupertinoApp`**:
355
- * Import the `flutter_localizations` library.
356
- * Specify `localizationsDelegates` and `supportedLocales` for your `MaterialApp` or `CupertinoApp`. For example:
357
- ```dart
358
- import 'package:flutter_localizations/flutter_localizations.dart';
359
- // ...
360
- return const MaterialApp(
361
- title: 'Localizations Sample App',
362
- localizationsDelegates: [
363
- GlobalMaterialLocalizations.delegate,
364
- GlobalWidgetsLocalizations.delegate,
365
- GlobalCupertinoLocalizations.delegate,
366
- ],
367
- supportedLocales: [
368
- Locale('en'), // English
369
- Locale('es'), // Spanish
370
- ],
371
- home: MyHomePage(),
372
- );
373
- ```
374
-
375
- * After these steps, Material and Cupertino packages should be correctly localized in the supported locales, and widgets should adapt to localized messages and layout.
376
- resources:
377
- - https://docs.flutter.dev/ui/internationalization
378
- - name: flutter-use-http-package
379
- description: Use the `http` package to execute GET, POST, PUT, or DELETE
380
- requests. Use when you need to fetch from or send data to a REST API.
381
- examplePrompt: "Use the http package to fetch the list of products from the API"
382
- instructions: |
383
- 1. **Add the `http` package as a dependency**.
384
- * Run `flutter pub add http` in your terminal.
385
- 2. **Import the `http` package**.
386
- * Add `import 'package:http/http.dart' as http;` to your Dart file.
387
- 3. **Configure platform-specific permissions (if deploying to Android or macOS)**.
388
- * For Android, add the Internet permission to your `AndroidManifest.xml` file: `<uses-permission android:name="android.permission.INTERNET" />`.
389
- * For macOS, include the network client entitlement in `macos/Runner/DebugProfile.entitlements` and `macos/Runner/Release.entitlements` files: `<key>com.apple.security.network.client</key><true/>`.
390
- 4. **Make a network request**.
391
- * The `http` package provides methods for GET, POST, PUT, and DELETE operations.
392
- * For example, to make a GET request, use `http.get(Uri.parse('your_url'))`.
393
- * To make a POST request, use `http.post()`.
394
- * To make a PUT request, use `http.put()`.
395
- * You can add authorization headers to your requests using the `headers` parameter. For example: `headers: {HttpHeaders.authorizationHeader: 'Basic your_api_token_here'}`.
396
- * For POST requests, you might need to set `Content-Type` headers and encode the body as JSON.
397
- 5. **Handle the response**.
398
- * The `http.Response` object contains the server's response.
399
- * Check the `statusCode` of the response to determine success or failure (e.g., `200 OK` for success, `201 CREATED` for a successful POST).
400
- * Parse the JSON response if applicable.
401
- * Convert the response into a custom Dart object.
402
- * Handle errors by throwing exceptions, especially for non-success status codes, to prevent indefinite loading indicators.
403
- 6. **Display the data with Flutter**.
404
- * Use widgets like `FutureBuilder` to display data fetched asynchronously and handle loading and error states.
405
- * For long-running tasks, consider showing a `ProgressIndicator` widget.
406
- * For expensive computations like JSON parsing, perform them in a separate Isolate to avoid UI jank.
407
- resources:
408
- - https://docs.flutter.dev/cookbook/networking/authenticated-requests
409
- - https://docs.flutter.dev/cookbook/networking/background-parsing
410
- - https://docs.flutter.dev/cookbook/networking/delete-data
411
- - https://docs.flutter.dev/cookbook/networking/fetch-data
412
- - https://docs.flutter.dev/cookbook/networking/send-data
413
- - https://docs.flutter.dev/cookbook/networking/update-data
414
- - https://docs.flutter.dev/get-started/fundamentals/networking
415
- - name: flutter-implement-json-serialization
416
- description: Create model classes with `fromJson` and `toJson` methods using
417
- `dart:convert`. Use when manually mapping JSON keys to class properties for
418
- simple data structures.
419
- examplePrompt: "Implement JSON serialization for the User model class"
420
- instructions: |
421
- 1. **Import the `dart:convert` library**: Flutter includes a built-in `dart:convert` library that provides a straightforward JSON encoder and decoder. This library allows you to serialize JSON manually.
422
- 2. **Define a model class**: Create a plain model class, for example, named `User`. This class will contain the properties that correspond to your JSON structure.
423
- 3. **Implement a `fromJson` constructor**: Inside your model class, create a factory constructor, such as `User.fromJson()`, which takes a `Map` structure as input. This constructor is responsible for constructing a new instance of your model class from the JSON map. For example, if you receive a 200 OK response from a server, you can parse the JSON using `jsonDecode(response.body) as Map<String, dynamic>` and then pass it to your `fromJson` constructor.
424
- 4. **Implement a `toJson` method**: Add a `toJson()` method to your model class. This method converts an instance of your model class into a `Map`.
425
- 5. **Benefits of this approach**: Using model classes with `fromJson` and `toJson` methods provides type safety, autocompletion for fields, and compile-time exceptions. This helps combat issues like typos or incorrect type usage that would otherwise lead to runtime crashes.
426
- 6. **Considerations for `jsonDecode()`**: When using `jsonDecode()`, it returns a `dynamic` type, meaning the types of values are not known until runtime.
427
- 7. **Testing**: In a production application, it is important to ensure that serialization works correctly by having unit tests in place for both the `User.fromJson()` and `User.toJson()` methods.
428
- resources:
429
- - https://docs.flutter.dev/cookbook/networking/background-parsing
430
- - https://docs.flutter.dev/cookbook/networking/fetch-data
431
- - https://docs.flutter.dev/cookbook/networking/send-data
432
- - https://docs.flutter.dev/cookbook/networking/update-data
433
- - https://docs.flutter.dev/data-and-backend/serialization
434
- - https://docs.flutter.dev/data-and-backend/serialization/json