|
| 1 | +--- |
| 2 | +name: vgv-create-project |
| 3 | +description: Scaffold a new Dart or Flutter project from a Very Good CLI template. Use when user says "create a new project", "start a new flutter app", "scaffold a package", "initialize a dart cli", "new flame game", or "generate a plugin". Supports flutter_app, dart_package, flutter_package, flutter_plugin, dart_cli, flame_game, and docs_site templates. |
| 4 | +allowed-tools: AskUserQuestion,mcp__very-good-cli__create,mcp__very-good-cli__packages_get,Read,Glob,Grep |
| 5 | +argument-hint: "[template] [project-name]" |
| 6 | +--- |
| 7 | + |
| 8 | +# Create Project |
| 9 | + |
| 10 | +Scaffold a new Dart or Flutter project using Very Good CLI templates. |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Core Standards |
| 15 | + |
| 16 | +- **Use the Very Good CLI MCP server to create projects and install dependencies** — never run CLI commands via shell |
| 17 | +- **Infer the template from context** — determine the right template based on what the user wants to build, not by asking them to pick a subcommand name |
| 18 | +- **Use `AskUserQuestion` only for information you cannot infer** — project name and organization are the most common missing pieces |
| 19 | +- **Install dependencies after creation** |
| 20 | + |
| 21 | +--- |
| 22 | + |
| 23 | +## Workflow |
| 24 | + |
| 25 | +### Step 1: Understand What the User Wants to Build |
| 26 | + |
| 27 | +Infer the template from the user's description. Do NOT ask users to pick a template name — figure it out from context: |
| 28 | + |
| 29 | +| User intent | Template | |
| 30 | +| --- | --- | |
| 31 | +| Building a mobile/web/desktop app | `flutter_app` | |
| 32 | +| Building a reusable library that uses Flutter widgets | `flutter_package` | |
| 33 | +| Building a reusable library with pure Dart (no Flutter) | `dart_package` | |
| 34 | +| Building a plugin that wraps platform-specific APIs | `flutter_plugin` | |
| 35 | +| Building a command-line tool | `dart_cli` | |
| 36 | +| Building a 2D game | `flame_game` | |
| 37 | +| Building a documentation site | `docs_site` | |
| 38 | + |
| 39 | +If the intent is ambiguous, use `AskUserQuestion` to clarify with a high-level question about what they're building — not which template they want. |
| 40 | + |
| 41 | +### Step 2: Gather Missing Parameters |
| 42 | + |
| 43 | +Use `AskUserQuestion` to collect only what you cannot infer. Batch questions into a single call when possible. Do NOT ask for optional parameters (description, output directory, application ID, etc.) unless the user brings them up. |
| 44 | + |
| 45 | +### Step 3: Create and Set Up |
| 46 | + |
| 47 | +1. Create the project using the Very Good CLI MCP server |
| 48 | +2. Install dependencies using the Very Good CLI MCP server |
| 49 | +3. Suggest relevant follow-up skills (**layered-architecture**, **bloc**, **testing**, etc.) |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## Key Domain Knowledge |
| 54 | + |
| 55 | +- Use `dart_package` (not `flutter_package`) for data layer and repository layer packages in the **layered-architecture** pattern — these must not depend on Flutter SDK |
| 56 | +- If a user provides a project name with dashes, convert to underscores — Dart package names only allow lowercase letters, numbers, and underscores |
| 57 | +- Templates that produce apps, plugins, or games require an organization name — do not skip this or it defaults to `com.example.verygoodcore` |
| 58 | + |
| 59 | +--- |
| 60 | + |
| 61 | +## Examples |
| 62 | + |
| 63 | +### User says "Create a new Flutter app" |
| 64 | + |
| 65 | +1. Infer: `flutter_app` |
| 66 | +2. Ask for project name and organization |
| 67 | +3. Create, install dependencies, suggest **layered-architecture** and **bloc** |
| 68 | + |
| 69 | +### User says "I need a package for my weather API client, put it in packages/" |
| 70 | + |
| 71 | +1. Infer: "API client" → pure Dart → `dart_package`, name `weather_api_client`, output `packages/` |
| 72 | +2. Everything is clear — no questions needed |
| 73 | +3. Create and install dependencies |
| 74 | + |
| 75 | +### User says "I want to build something for iOS and Android with bluetooth" |
| 76 | + |
| 77 | +1. Ambiguous: app or plugin? Ask to clarify |
| 78 | +2. Gather remaining parameters based on answer |
| 79 | +3. Create and install dependencies |
| 80 | + |
| 81 | +### User says "Create a new package" |
| 82 | + |
| 83 | +1. Ambiguous: Flutter or pure Dart? Ask to clarify |
| 84 | +2. Ask for project name |
| 85 | +3. Create and install dependencies |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Troubleshooting |
| 90 | + |
| 91 | +### MCP server not connected |
| 92 | + |
| 93 | +- Verify the Very Good CLI MCP server is running |
| 94 | +- Confirm `very_good` is installed: `dart pub global activate very_good_cli` |
| 95 | +- Confirm `very_good` is on PATH |
| 96 | + |
| 97 | +### Invalid project name error |
| 98 | + |
| 99 | +- Names must be valid Dart package names: lowercase letters, numbers, underscores only |
| 100 | +- Dashes are not allowed — convert `my-app` to `my_app` |
| 101 | + |
| 102 | +### Dependencies fail to install after creation |
| 103 | + |
| 104 | +- Verify the Dart SDK is installed and on PATH |
| 105 | +- Try running from the project root directory |
| 106 | + |
| 107 | +--- |
| 108 | + |
| 109 | +## Anti-Patterns |
| 110 | + |
| 111 | +| Anti-Pattern | Problem | Correct Approach | |
| 112 | +| --- | --- | --- | |
| 113 | +| Asking user to pick a template name | Users think in terms of what they're building, not CLI subcommands | Infer the template from context | |
| 114 | +| Over-asking for optional parameters | Slows down the workflow | Only ask for what you cannot infer | |
| 115 | +| Using `flutter_package` for a data layer | Adds unnecessary Flutter SDK dependency | Use `dart_package` for data and repository layer packages | |
| 116 | +| Skipping organization name for apps/plugins | Defaults to `com.example.verygoodcore` | Ask when the template requires it | |
0 commit comments