vgv-ai-flutter-plugin
CLAUDE.md168 starsChanged 3 months agoMITView on GitHub
The hooks/ directory contains SessionStart, PreToolUse, and PostToolUse hooks defined in hooks.json. These run when a session begins: These run before a tool call is executed: The first two PreToolUse hooks are plugin-level (defined in hooks.json) and share common utilities from vgv-cli-common.sh. The following hook is agent-scoped — it is declared in the flutter-reviewer agent's frontmatter, not in hooks.json, so it only fires for that agent: - Bash matcher → allow-readonly-git.sh — restricts the flutter-reviewer agent's Bash to single-line git…
In this repository16 other files it gives its agents.
- AGENTS.mdAGENTS.md
- accessibilitySkill
- animationsSkill
- blocSkill
- create-projectSkill
- dart-flutter-sdk-upgradeSkill
- green-gateSkill
- internationalizationSkill
- layered-architectureSkill
- license-complianceSkill
- material-themingSkill
- navigationSkill
- static-securitySkill
- testingSkill
- ui-packageSkill
- very-good-analysis-upgradeSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 38
All hook scripts require jq to parse the hook payload (they skip gracefully if jq is not installed).
- Distinctive: line 49
Add cases there when changing hook behavior.
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
@AGENTS.md
<!-- First line is the @AGENTS.md import (Claude Code memory), not a heading. -->Hooks
The hooks/ directory contains SessionStart, PreToolUse, and PostToolUse hooks defined in hooks.json.
SessionStart Hooks
These run when a session begins:
warn-missing-mcp.sh— checks if Very Good CLI is installed and >= 1.3.0; outputs a warning to Claude's context if missing, outdated, or present but unable to run becausedartis not on thePATHhooks inherit (non-blocking)
PreToolUse Hooks
These run before a tool call is executed:
mcp__.*very-good-cli__.*matcher →check-vgv-cli.sh— readstool_namefrom the payload and exits 0 unless the caller is a Very Good CLI tool, so a host that does not apply the matcher cannot have the decision land on an unrelated tool; for its own tools it auto-approves the call by returning a PreToolUseallowdecision, so it is always permitted regardless of run mode (interactive, headless, orskipAutoPermissionPrompt) and never dead-ends when the tool isn't onpermissions.allow; denies with an install/upgrade message if the CLI is missing or < 1.3.0, and stands aside when the CLI is present but its version cannot be read (dartmissing fromPATH), leaving normal permission handling to apply. The.*in the matcher covers both the baremcp__very-good-cli__*server (repo-root.mcp.json) and the plugin-namespacedmcp__plugin_<plugin>_very-good-cli__*form used when installed from a marketplaceBashmatcher →block-cli-workarounds.sh— prevents direct CLI bypass of VGV CLI commands through the host's shell tool (Bash, orShellon other hosts); exits 0 when the payload names a non-shell tool, so an unrelated tool carrying acommandargument is never inspected; when the CLI is present but cannot run becausedartis missing fromPATH, the denial says so rather than redirecting to an MCP server that cannot start; exits 2 on failure (blocking)
The first two PreToolUse hooks are plugin-level (defined in hooks.json) and share common utilities
from vgv-cli-common.sh. The following hook is agent-scoped — it is declared in the
flutter-reviewer agent's frontmatter, not in hooks.json, so it only fires for that agent:
Bashmatcher →allow-readonly-git.sh— restricts theflutter-revieweragent's Bash to single-linegit diff/git statusonly; denies anything else, including compound or multi-line commands, shell expansion ($), and the--output/--ext-diffoptions that write files or run programs (blocking). Enforces the agent's read-only contract.
PostToolUse Hooks
These run after a tool call completes:
Edit|Writematcher →analyze.sh— runsdart analyzeon the modified.dartfile; exits 2 on failure (blocking — Claude must fix the issue)Edit|Writematcher →format.sh— runsdart formaton the modified.dartfile; always exits 0 (non-blocking)
All hook scripts require jq to parse the hook payload (they skip gracefully if jq is not installed).
Hook scoping
A matcher in hooks.json is a filter, not a guarantee — hosts name tools differently and do not
all treat a non-matching matcher as exclusionary. Every hook therefore confirms from its own
payload that the call is its business before deciding, and exits 0 when it is not. Scope on
tool_name rather than on the presence of a tool_input field, since field names such as
command are not unique to one tool.
hooks/scripts/*_test.sh covers the hook scripts and runs in CI under the Script Tests job.
Add cases there when changing hook behavior.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

