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.
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
vgv_ai_cli is a Dart command-line tool by Very Good Ventures that configures Very Good AI coding agents and tooling. The executable is vgv_ai.
The repo is a pub workspace monorepo: the root pubspec.yaml declares workspace: [packages/vgv_ai_plugins, packages/vgv_ai_cli], each package uses resolution: workspace, and there is one shared pubspec.lock at the root. vgv_ai_plugins resolves the pinned VGV Claude Code plugins and parses them into a harness-neutral asset model; vgv_ai_cli depends on it.
| Requirement | Why | Symptom when wrong |
|---|---|---|
Dart SDK ^3.14.0 (CI pins 3.14.0) |
The code uses 3.13 syntax | dart pub get fails version solving. Worse, on 3.12 dart analyze reports experiment_not_enabled_off_by_default against the new(...) constructors — do not "fix" that by rewriting them, fix the SDK |
very_good_cli ^1.5.0 |
Pub workspace coverage support | Coverage dies with Directory listing failed, path = './coverage/'. A stale binary also prints Invalid kernel binary format version — reactivate with dart pub global activate very_good_cli "^1.5.0" |
jq |
Agent hooks parse their payloads with it | Guard hooks error out; the analyze and format hooks silently do nothing |
gh, authenticated with org access |
This repo is private | Push and PR creation fail |
macOS and Linux are supported; on Windows, use WSL. jq must be on PATH for the Codex, Copilot
and Antigravity hooks. Native Windows, including Git Bash, is untested: the CLI builds paths with
the host separator and the hook scripts expect POSIX ones.
Upgrading very_good_cli does not reach the MCP server until the agent session restarts — the server binds its binary at session start.
Run these from packages/vgv_ai_cli unless noted.
# Install dependencies (from the repo root or the package)
dart pub get
# Format code
dart format --set-exit-if-changed .
# Analyze code (strict: warnings and infos are fatal)
dart analyze --fatal-infos --fatal-warnings lib test
# Run a single test file
dart run test test/src/commands/update_command_test.dart
# Run tests by name (--plain-name matches substrings, so this runs both
# 'handles pub update errors' and 'handles pub update process errors')
dart run test --plain-name 'handles pub update'
# Run the CLI from source
dart run bin/vgv_ai.dart --helpFull test run with coverage is the one exception. With the VGV AI Flutter Plugin active, a hook denies dart test, flutter test, very_good test, dart create, flutter create, very_good create, and very_good packages when they are the first two tokens of a Bash command (note very_good packages get is blocked while dart pub get is not), so run it through the very_good_cli MCP test tool instead. That tool takes no file path and no name filter, which is why the single-test commands above use dart run test — a form the hook does not catch,. The CI step, from the reusable dart_package.yml workflow, is equivalent to:
very_good dart test -j 4 --coverage --min-coverage 100 --optimizationEntry point: bin/vgv_ai.dart → VgvAiCliCommandRunner (lib/src/command_runner.dart), which extends CompletionCommandRunner<int> from cli_completion, so shell completion is built in.
All commands are Command<int> subclasses in lib/src/commands/, exported from commands.dart, and return the int from a mason_logger ExitCode (e.g. ExitCode.success.code). main in bin/vgv_ai.dart passes the runner's result to _flushThenExit.
The runner owns three cross-cutting behaviors that individual commands do not repeat:
- Dependency injection.
Logger(mason_logger),PubUpdaterandInstallationare constructor parameters with real defaults.Installation.currentreadsPlatform.resolvedExecutable:dartmeans pub, aCellarpath means Homebrew, anything else the install script, and only pub letsupdateupdate in place. Commands receive theLoggerfrom the runner rather than creating one. This is what makes the whole CLI testable. - Error handling.
FormatExceptionandUsageExceptionare caught inrun()and converted toExitCode.usage.codewith usage output. Commands do not handle these themselves. - Update check. After every command except
update,_checkForUpdates()comparespackageVersionagainst pub.dev and prints an upgrade prompt. Thecompletioncommand is fast-tracked and skips this entirely.
Under lib/src/, each folder is one layer, and the rule for where a type lives is:
model/holds only the types two or more feature layers share:Harness,PlannedChangewithChangeModeandDocumentFormat,InstallManifestwith its entries,Contributionwith theDriftandSubtractionits methods return, andDocumentCodec, the one definition of how documents are decoded and compared. A value a shared type returns lives beside it, even when only one feature reads it. It imports nothing else undersrc/.document/edits config text throughTomlTextandMarkdownText, and writes files safely through theFileextensions. It importsmodel/.detect/,resolve/,translate/,reconcile/andmanifest/are the features: finding the installed harnesses, fetching and parsing the pinned plugins, turning the plugins into each harness's files, applying planned changes, and verifying or reversing what the manifest records. Each importsmodel/anddocument/, never another feature.<feature>/model/holds every type the feature itself defines, its public results and the values it passes between its own steps alike, one class per file, exported from<feature>/model/model.dart. A status enum lives in the file of the result it describes, asReverseOutcomedoes besideReversedEntryandChangeOutcomebesideAppliedChange. A service such asReconcilertakes theDocumentCodecthrough its constructor, while a value type such asTomlTextuses the default. The classes that do the work sit at the feature's root.commands/orchestrate the features and own persistence and reporting.installloads and saves the manifest throughManifestStore, whileReconciler.applyandManifestAuditor.reversetake the manifest and return it updated.- A command big enough to define its own types gets a folder,
commands/<command>/, with those types incommands/<command>/model/under the same rules as<feature>/model/.doctoris the example:Finding,ReportSectionandContentPlandescribe its report and nothing else reads them. Helpers several commands share, such asHarnessSelectionanduserHome, sit at the root ofcommands/.
Each layer has a barrel, such as model/model.dart, document/document.dart or manifest/manifest.dart. A file imports another layer through its barrel, and imports a file in its own folder directly.
A result with one status enum, such as EntryHealth or ReversedEntry, is built only through a constructor per verdict, so a field that means something for one verdict cannot be set on another. A shape that would be a record or a Map becomes a class or an extension type, and a map appears only at the boundary that needs one, through toJson or toMap.
- Create
lib/src/commands/<name>_command.dartwith aCommand<int>subclass takingrequired this._logger. - Export it from
lib/src/commands/commands.dart. addCommand(...)it in theVgvAiCliCommandRunnerconstructor.
translate/ keeps what every harness shares at its root: Translator, the HarnessTranslator base, the agents brick helpers (AgentsBrick, AgentsVars, renderedChange) and HookScripts. Everything that belongs to one harness sits in translate/translators/, and test/src/translate/ mirrors that layout.
- Add the value to
Harnessinlib/src/model/harness.dart. - Give it its templates in
bricks/agents/and regenerate the bundle withtool/generate_agents_bundle.sh. - Create
lib/src/translate/translators/<harness>_translator.dartwith aHarnessTranslatorsubclass, plus a<harness>_compat.dartbeside it if its hooks need one. - Export them from
translators/translators.dartand add the translator toharnessTranslatorsintranslators/harness_translators.dart. - Test them under
test/src/translate/translators/.
ADDING_A_HARNESS.md walks through each step, with the brick layout, the hook machinery, and every existing test a new harness has to be added to.
lib/src/version.dart carries the version release-please writes. Never edit it by hand, and never bump a version by hand either.
Each package releases on its own, through its own release PR (separate-pull-requests). A grouped PR holding only one package is never tagged by release-please. release-please bumps each package's own pubspec.yaml. A pin bump lands in vgv_ai_plugins, so it reaches Homebrew and install-script users only once the CLI releases too. Only this file needs the generic updater and carries an x-release-please-version marker. Nothing else should ever get that marker, least of all pubspec.yaml: release-please's dart updater rewrites the whole YAML and strips comments, so a marker there is silently lost.
The CLI depends on vgv_ai_plugins with a hosted caret constraint, the way mason_cli depends on mason, and the workspace resolves it from packages/vgv_ai_plugins locally. Before 1.0, feat: bumps the minor and so does a breaking change (bump-minor-pre-major), which takes the new version out of the caret's range. The workspace then fails to resolve, so the raise_plugins_constraint job in .github/workflows/release_please.yaml rewrites the constraint to the vgv_ai_plugins version in the manifest, on the vgv_ai_plugins release branch, after every release-please run, since release-please force-pushes that branch and would drop a hand-made commit. When both release PRs are open, merge the vgv_ai_plugins one first. Never raise it by hand.
The CLI is tagged vX.Y.Z and vgv_ai_plugins as vgv_ai_plugins-vX.Y.Z. pub_publish.yaml publishes the CLI on the former, and pub_publish_plugins.yaml publishes vgv_ai_plugins on the latter. Each tag pattern must match the one set for that package on pub.dev.
You should not need to bump the version by hand at all: release-please owns it. It writes the bump into pubspec.yaml and, through the CLI's extra-files entry, into this file, so verify-version passes on the release PR.
- Linting:
very_good_analysis^11.0.0 with no rule overrides, the same as Very Good CLI. Generated files are excluded in theanalyzersection rather than by turning rules off. - Every public class carries
/// {@template name}//// {@endtemplate}, and declares its constructor in the body under/// {@macro name}—this;, orthis { ... }when it has one. The declaration is not optional:public_member_api_docsreads a primary constructor as an undocumented member, and the class's own doc comment does not satisfy it. - The codebase uses Dart 3.13 syntax. Unnamed constructors are declared with the
newkeyword —new({required this._logger}), notUpdateCommand({...}). Empty class bodies use a semicolon —class _MockLogger extends Mock implements Logger;. That is for private classes such as test doubles; a public class still needs a body to hold the documented constructor above. - Commits and PR titles follow Conventional Commits.
- 100% test coverage required. New code needs tests covering success, failure, and usage-error paths.
- Mocking with
mocktail. - Tests exercise commands through
VgvAiCliCommandRunner.run(['update'])rather than instantiating theCommanddirectly, so argument parsing and the runner's error handling are covered too. test/helpers/command_helper.dartholdsTestRunner, the mockedLogger,ProgressandPubUpdaterevery command test shares, already stubbed. Go through itsrun/buildinstead of constructing aVgvAiCliCommandRunnerin the test, and re-stub a mock only where a test needs a different answer.- Assertions verify logger calls (
verify(() => logger.info(...)).called(1)) alongside the exit code.
.claude/settings.json is committed and enables two plugins from the VGV marketplace: vgv-wingspan (brainstorm → plan → build → review workflows) and vgv-ai-flutter-plugin (Dart quality gates, MCP tools, hooks).
It pins the marketplace catalog to commit ecfa5e93 (marketplace 1.1.0), which declares both plugins at 0.0.5 (it also lists a third plugin, which is not enabled here). That pins the versions the catalog declares; each plugin entry sources from its own repo without a ref of its own, so plugin content still tracks those default branches. Expect some drift, and re-pin the SHA when you want a newer catalog.
The flutter plugin runs dart analyze and dart format automatically after every .dart Edit or Write. Analyze failures come back as work to do, which is why the SDK requirement above matters so much.
This is a pure Dart CLI with no widgets, so the rule is: any skill gated on Flutter widgets, theming, or navigation does not apply here. The ones that do include green-gate, testing, license-compliance, very-good-analysis-upgrade, dart-flutter-sdk-upgrade, and create-project (its dart_cli template is what this repo is).
main has no branch protection yet. The permissions.deny entries blocking force-push are a guardrail against accident, not enforcement; they do not stop git -C . push --force or similar.
Most workflows under .github/workflows/ are path-filtered, and every reusable workflow comes from very_good_workflows through the floating @v2 tag.
ci.yamlruns on every PR againstmain, with no path filter, and again whenever the PR title or description is edited. Its jobs aresemantic-pull-requestandspell-check.vgv_ai_cli.yamlruns on changes to itself,packages/vgv_ai_cli/lib/**,packages/vgv_ai_cli/test/**,packages/vgv_ai_cli/pubspec.yaml,packages/vgv_ai_plugins/lib/**,packages/vgv_ai_plugins/pubspec.yaml,bricks/**andtool/**. Its jobs arebuild(the reusabledart_package.ymlinpackages/vgv_ai_cli),verify-bundleandverify-pins.vgv_ai_plugins.yamlruns on changes to itself andpackages/vgv_ai_plugins/**. Its only job isbuild(the reusabledart_package.ymlinpackages/vgv_ai_plugins).- Both
buildjobs also run the cognitive complexity check on their package'slib, which fails when any function scores above 15. Split a function that crosses it into smaller ones rather than raising the threshold. Run it locally with thecognitive_complexityscanner from kevmoo/analytica.dart. release_please.yamlruns on every push tomain. release-please owns versions and changelogs (.release-please-config.json,.release-please-manifest.json). Each package has its own release PR, and merging it tags the CLIvX.Y.Zorvgv_ai_pluginsasvgv_ai_plugins-vX.Y.Z. Never bump a version or edit aCHANGELOG.mdby hand.check_links.yamlruns lychee over every markdown and Dart file on PRs and weekly. Placeholder URLs in fixtures, and links into private sibling repos, are listed in.lycheeignore.license_check.yamlruns on changes to itself and either package'spubspec.yaml. Dependency licenses are restricted toMIT,BSD-3-Clause,BSD-2-Clause,Apache-2.0.- A PR that touches only markdown or other files outside these filters still runs
ci.yamlandcheck_links.yaml, but no build. - PR titles must be conventional commits. The
semantic-pull-requestjob inci.yamlchecks this on every PR. - Markdown is spell-checked with cspell against the VGV dictionaries; add project-specific words to
wordsin.github/cspell.json. Thespell-checkjob inci.yamlincludes**/*.mdand.*/**/*.md, excludesbricks/**/__brick__/**, and runs withmodified_files_only: false, so it lints every markdown file whenever it runs. verify-bundleregeneratespackages/vgv_ai_cli/lib/src/templateswithtool/generate_agents_bundle.sh(mason_cli0.1.3) and fails if the committed bundle differs. Run the script wheneverbricks/agentschanges.- The pinned plugins in
vgvPlugins(packages/vgv_ai_plugins/lib/src/plugin_ref.dart) are bumped by.github/workflows/bot_bump_plugin_pins.yaml. Every Monday it runspackages/vgv_ai_plugins/tool/bump_plugin_pins.dart, which moves each pin to its plugin's latest GitHub release, and opens or updates one PR onvgvbot/bump_plugin_pins. The tool rewrites theversionandgitReflines of eachPluginRef(...)block in place, so keep that shape when editing the file by hand. - The bot PR is opened with the default
GITHUB_TOKEN, so CI does not start on it by itself. Push a commit to it, or close and reopen it, before merging. Itsverify-pinsjob runstest/pinned_plugins_test.dart(taggedpinned-plugins, skipped by default), which clones the real pinned plugins and translates them for every harness. Run it locally withdart run test --run-skipped -t pinned-plugins.