Skip to content

Commit d04bbd7

Browse files
committed
Add 'Creating a New Project' skill and update registry (Fixes #36)
1 parent 4ad7731 commit d04bbd7

3 files changed

Lines changed: 108 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ npx skills update flutter/skills
3131
| [flutter-building-layouts](skills/flutter-building-layouts/SKILL.md) | Builds Flutter layouts using the constraint system and layout widgets. Use when creating or refining the UI structure of a Flutter application. |
3232
| [flutter-building-plugins](skills/flutter-building-plugins/SKILL.md) | Builds Flutter plugins that provide native interop for other apps to use. Use when creating reusable packages that bridge Flutter with platform-specific functionality. |
3333
| [flutter-caching-data](skills/flutter-caching-data/SKILL.md) | Implements caching strategies for Flutter apps to improve performance and offline support. Use when retaining app data locally to reduce network requests or speed up startup. |
34+
| [flutter-creating-projects](skills/flutter-creating-projects/SKILL.md) | Creates a new Flutter project using the CLI or an IDE. Use when initializing a new application, package, or plugin and understanding the generated project structure. |
3435
| [flutter-embedding-native-views](skills/flutter-embedding-native-views/SKILL.md) | Embeds native Android, iOS, or macOS views into a Flutter app. Use when integrating complex native components like maps or web views. |
3536
| [flutter-handling-concurrency](skills/flutter-handling-concurrency/SKILL.md) | Executes long-running tasks in background isolates to keep the UI responsive. Use when performing heavy computations or parsing large datasets. |
3637
| [flutter-handling-http-and-json](skills/flutter-handling-http-and-json/SKILL.md) | Executes HTTP requests and handles JSON serialization in a Flutter app. Use when integrating with REST APIs or parsing structured data from external sources. |

resources/flutter_skills.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,4 +1441,19 @@
14411441
rendering Flutter widgets as images for display in the native widget UI.
14421442
resources:
14431443
- https://codelabs.developers.google.com/flutter-home-screen-widgets#0
1444-
- https://pub.dev/packages/home_widget
1444+
- https://pub.dev/packages/home_widget
1445+
- name: flutter-creating-projects
1446+
description: Creates a new Flutter project using the CLI or an IDE. Use when initializing a new application, package, or plugin and understanding the generated project structure.
1447+
instructions: |
1448+
Creating a new Flutter project involves using the standard `flutter create`
1449+
command or the built-in project wizards in supported IDEs (VS Code,
1450+
Android Studio, IntelliJ). The process generates a standard directory
1451+
structure that includes a `lib/` folder for source code, a `test/` folder
1452+
for automated tests, and platform-specific directories for native code
1453+
integration. The `pubspec.yaml` file at the root of the project is used to
1454+
manage dependencies, assets, and app metadata.
1455+
resources:
1456+
- https://docs.flutter.dev/reference/create-new-app
1457+
- https://docs.flutter.dev/reference/flutter-cli
1458+
- https://docs.flutter.dev/app-architecture/guide#overview-of-project-structure
1459+
- https://docs.flutter.dev/get-started/test-drive
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
---
2+
name: "flutter-creating-projects"
3+
description: "Creates a new Flutter project using the CLI or an IDE. Use when initializing a new application, package, or plugin and understanding the generated project structure."
4+
metadata:
5+
model: "models/gemini-3.1-pro-preview"
6+
last_modified: "Sun, 22 Mar 2026 07:50:00 GMT"
7+
8+
---
9+
# Creating a New Project in Flutter
10+
11+
## Contents
12+
- [Core Concepts](#core-concepts)
13+
- [Architecture and Data Flow](#architecture-and-data-flow)
14+
- [Workflow: Creating a Project with the CLI](#workflow-creating-a-project-with-the-cli)
15+
- [Workflow: Creating a Project with an IDE](#workflow-creating-a-project-with-an-ide)
16+
- [Examples](#examples)
17+
18+
## Core Concepts
19+
20+
Flutter development begins with creating a project structure that contains all necessary code, assets, and platform-specific configurations.
21+
22+
* **Project Types:** Flutter supports multiple project types depending on your goal:
23+
* **Application (`app`):** A standard Flutter app for mobile, web, or desktop.
24+
* **Package (`package`):** A reusable Dart library (e.g., a state management utility).
25+
* **Plugin (`plugin`):** A package that includes native code for platform-specific integration (e.g., accessing camera APIs).
26+
* **Module (`module`):** A Flutter component designed to be embedded into an existing native app (Add-to-App).
27+
* **Creation Tools:** Projects can be initialized via the **Flutter CLI** (platform-agnostic) or **IDE Wizards** (VS Code, Android Studio, IntelliJ).
28+
29+
## Architecture and Data Flow
30+
31+
When a project is created, Flutter generates a standard directory structure. Understanding this structure is essential for organizing code and resources.
32+
33+
* **`lib/`**: The heart of the project. Contains Dart source code. `main.dart` is the default entry point.
34+
* **`pubspec.yaml`**: The project's manifest. Manages dependencies, assets (images, fonts), and versioning.
35+
* **`test/`**: Contains automated unit, widget, and integration tests.
36+
* **`android/`, `ios/`, `web/`, `linux/`, `macos/`, `windows/`**: Platform-specific "runners" that host the Flutter engine and handle native integration.
37+
* **`analysis_options.yaml`**: Configures linting rules for the project.
38+
39+
## Workflow: Creating a Project with the CLI
40+
41+
Use the Flutter CLI for precise control over project initialization and platform support.
42+
43+
1. **Open the Terminal** and navigate to your workspace.
44+
2. **Run `flutter create`**:
45+
* Basic command: `flutter create my_app_name`
46+
* Specify platforms: `flutter create --platforms=ios,android,web my_app_name`
47+
* Specify project type: `flutter create --template=plugin my_plugin_name`
48+
* Specify organization (package name): `flutter create --org com.example my_app`
49+
3. **Navigate to the directory**: `cd my_app_name`
50+
4. **Verify the setup**: Run `flutter doctor` to ensure your environment is ready for the selected platforms.
51+
52+
## Workflow: Creating a Project with an IDE
53+
54+
IDEs provide a visual, guided experience for project creation.
55+
56+
### Visual Studio Code
57+
1. Open the **Command Palette** (`Ctrl+Shift+P` or `Cmd+Shift+P`).
58+
2. Type `Flutter: New Project` and press Enter.
59+
3. Select the **Application** template (or another type).
60+
4. Choose a parent folder for the project.
61+
5. Enter the project name and press Enter.
62+
63+
### Android Studio / IntelliJ
64+
1. Select **New Flutter Project** from the Welcome screen or `File > New > New Project`.
65+
2. Select **Flutter** in the left sidebar.
66+
3. Ensure the **Flutter SDK path** is correct and click Next.
67+
4. Enter the Project name, location, and select supported platforms.
68+
5. Click **Finish**.
69+
70+
## Examples
71+
72+
### Basic Application Creation (CLI)
73+
Initialize a project for mobile and web with a custom organization name.
74+
75+
```bash
76+
flutter create --org com.mycompany --platforms=android,ios,web my_awesome_app
77+
```
78+
79+
### Creating a Dart Package (CLI)
80+
Initialize a reusable library without platform-specific code.
81+
82+
```bash
83+
flutter create --template=package my_utility_library
84+
```
85+
86+
### Project Structure Checklist
87+
After creation, verify the presence of these key files:
88+
- [ ] `lib/main.dart` (entry point)
89+
- [ ] `pubspec.yaml` (dependency management)
90+
- [ ] `analysis_options.yaml` (linting)
91+
- [ ] Platform folders for your targets (e.g., `android/`, `ios/`)

0 commit comments

Comments
 (0)