At its core, VGV prefers code that embodies clear, concise mental models. We prefer to think deeply about the problem we are solving and find the solution that best fits.
- Example 1: a file with many boolean variables might be implemented more cleanly as a state machine (using a bloc, cubit, or other package/pattern).
- Example 2: a file with a series of complex async operations may be better described as a series of stream transforms, an observable primitive, or even a composite.
If you recognize a key insight that would clean something up but do not have what you need on hand to implement it, please just say so. Adding a package reference is easy.
Our criteria for good code also enables us to achieve 100% test coverage.
Good code has...
- As few branches as possible
- Injectable dependencies
- Well-named identifiers
- No sibling dependencies in the same architectural layer
To avoid sibling dependencies, state must either be lifted up to a common ancestor and passed down, or pushed down and subscribed to.
See @CONTRIBUTING.md for development details.
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.
# Install dependencies
dart pub get && cd bricks/test_optimizer && dart pub get && cd ../../
# Run unit tests (excludes expensive pull-request-only and e2e tests)
flutter test -x pull-request-only -x e2e
# Run a single test file
flutter test test/src/commands/create/create_test.dart
# Format code
dart format lib test
# Analyze code (strict: warnings and infos are fatal)
dart analyze --fatal-infos --fatal-warnings .
# Auto-fix lint issues
dart fix --apply
# Activate local dev version
dart pub global activate --source path .Entry point: bin/very_good.dart → VeryGoodCommandRunner (extends CompletionCommandRunner<int>).
All commands return Future<int> (exit codes from universal_io's ExitCode). Top-level commands: create, test, packages, dart, update, mcp.
CreateCommand has subcommands for each template type (flutter_app, dart_package, dart_cli, docs_site, flame_game, flutter_package, flutter_plugin).
All subcommands extend CreateSubCommand and use mixins for optional features:
OrgName— adds--org-nameflagMultiTemplates— supports--templateflag with multiple template choicesPublishable— adds--publishableflag
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.
DartCli,FlutterCli,GitCli— wrappers around shell commandsProcessOverrides— zone-based dependency injection for mockingProcess.runin testsTestCliRunner— test execution logic with coverage collection
- 100% test coverage required for all PRs
- Mocking with
mocktail - Constructor injection for dependencies (
Logger,PubUpdater, generators) @visibleForTestingused for test-only overrides (e.g.,argResultOverrides)- Test tags in
dart_test.yaml:pull-request-onlyfor expensive CI-only tests - E2E tests in
e2e/create real projects and run full workflows - Test optimizer brick in
bricks/test_optimizer/generates optimized test entry points
- Linting:
very_good_analysis(strict Dart analysis rules) - Dartdoc templates:
/// {@template name}...{@endtemplate}//// {@macro name} - Commits follow Conventional Commits (used by release-please for automated versioning)
lib/src/version.dartis auto-generated — do not edit manually