You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+76-5Lines changed: 76 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,11 +11,82 @@ Our criteria for good code also enables us to achieve 100% test coverage.
11
11
12
12
Good code has...
13
13
14
-
-as few branches as possible
15
-
-injectable dependencies
16
-
-well-named identifiers
17
-
-no sibling dependencies in the same architectural layer
14
+
-As few branches as possible
15
+
-Injectable dependencies
16
+
-Well-named identifiers
17
+
-No sibling dependencies in the same architectural layer
18
18
19
19
To avoid sibling dependencies, state must either be lifted up to a common ancestor and passed down, or pushed down and subscribed to.
20
20
21
-
See CONTRIBUTING.md for development details.
21
+
See @CONTRIBUTING.md for development details.
22
+
23
+
## Project Overview
24
+
25
+
Very Good CLI is a Dart command-line tool by Very Good Ventures for generating scalable project templates and running developer commands. It is published on pub.dev as `very_good_cli`.
26
+
27
+
## Common Commands
28
+
29
+
```bash
30
+
# Install dependencies
31
+
dart pub get &&cd bricks/test_optimizer && dart pub get &&cd ../../
32
+
33
+
# Run unit tests (excludes expensive pull-request-only and e2e tests)
34
+
flutter test -x pull-request-only -x e2e
35
+
36
+
# Run a single test file
37
+
flutter test test/src/commands/create/create_test.dart
38
+
39
+
# Format code
40
+
dart format lib test
41
+
42
+
# Analyze code (strict: warnings and infos are fatal)
All commands return `Future<int>` (exit codes from `universal_io`'s `ExitCode`). Top-level commands: `create`, `test`, `packages`, `dart`, `update`, `mcp`.
59
+
60
+
### Create Command System
61
+
62
+
`CreateCommand` has subcommands for each template type (flutter_app, dart_package, dart_cli, docs_site, flame_game, flutter_package, flutter_plugin).
63
+
64
+
All subcommands extend `CreateSubCommand` and use mixins for optional features:
65
+
-`OrgName` — adds `--org-name` flag
66
+
-`MultiTemplates` — supports `--template` flag with multiple template choices
67
+
-`Publishable` — adds `--publishable` flag
68
+
69
+
Templates use Mason for code generation. Each template has a bundle, a `Template` class, and an `onGenerateComplete` hook. Template source code lives in separate repos under `VeryGoodOpenSource/very_good_templates`.
70
+
71
+
### CLI Abstraction Layer (`lib/src/cli/`)
72
+
73
+
-`DartCli`, `FlutterCli`, `GitCli` — wrappers around shell commands
74
+
-`ProcessOverrides` — zone-based dependency injection for mocking `Process.run` in tests
75
+
-`TestCliRunner` — test execution logic with coverage collection
76
+
77
+
### Testing Patterns
78
+
79
+
-**100% test coverage required** for all PRs
80
+
- Mocking with `mocktail`
81
+
- Constructor injection for dependencies (`Logger`, `PubUpdater`, generators)
82
+
-`@visibleForTesting` used for test-only overrides (e.g., `argResultOverrides`)
83
+
- Test tags in `dart_test.yaml`: `pull-request-only` for expensive CI-only tests
84
+
- E2E tests in `e2e/` create real projects and run full workflows
85
+
- Test optimizer brick in `bricks/test_optimizer/` generates optimized test entry points
0 commit comments