Repository navigation
Conversation
3827676 to
90d0b5a
Compare
Add a SessionStart hook that tells Claude when dart or jq is missing in an FFCA-shaped repo, since validate_layers.sh skips silently without them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
90d0b5a to
13d98cc
Compare
erickzanardo
left a comment
There was a problem hiding this comment.
A few comments, but none blocking! LGTM
| # FFCA-shaped: a features/{feature}/{feature}_{domain,data,presentation} | ||
| # package somewhere under the project. Hidden, build, and node_modules folders | ||
| # are pruned so the scan stays fast on large repos. | ||
| ffca=$(find "$root" -mindepth 1 -maxdepth 6 \ |
There was a problem hiding this comment.
This only searches below the project root. validate_layers.sh walks up looking for a features/ folder, so a session started in apps/mobile_app of an FFCA monorepo gets no warning, while layer validation is still off for edits under ../../features.
Could we also walk the ancestors of $root for a features/ folder, the same way validate_layers.sh does, so the two hooks agree on what counts as an FFCA repo?
| ffca=$(find "$root" -mindepth 1 -maxdepth 6 \ | ||
| \( -name '.*' -o -name build -o -name node_modules \) -prune -o \ | ||
| \( -path '*/features/*/*_domain/pubspec.yaml' \ | ||
| -o -path '*/features/*/*_data*/pubspec.yaml' \ |
There was a problem hiding this comment.
nit: *_data* also matches packages like user_database or foo_dataset.
The naming convention is {feature}_data or {feature}_data_{backend}, so -path '*/features/*/*_data/pubspec.yaml' -o -path '*/features/*/*_data_*/pubspec.yaml' would match exactly what's intended.
| echo "--- FFCA repo, prerequisites missing ---" | ||
| tools jq | ||
| assert_warns "dart not found" "dart missing" | ||
| assert_not_mentions "jq," "dart missing" |
There was a problem hiding this comment.
This check always passes: the message never contains jq,, even when both tools are reported (dart, jq not found). Could we assert on the exact list instead, for example assert_not_mentions "jq not found" here, and assert_not_mentions "dart" (or check for : jq not found) in the jq-only case below? As written, neither case catches the wrong tool being listed.
validate_layers.shexits 0 silently whenjqordartis missing, so Claude never learns layer validation is off. This adds a SessionStart hook that warns Claude in that case.hooks/warn_missing_prereqs.sh: only runs in FFCA-shaped repos (features/*/*_{domain,data,presentation}packages under the project). Warns whendartorjqis not onPATH. Always exits 0. Modeled onwarn-missing-mcp.shfrom vgv-ai-flutter-plugin.hooks/warn_missing_prereqs_test.sh: stubbed-PATHtests, run in the existing Hook Tests CI job.Reviewer note: the hook doesn't parse the stdin payload, since
jqmay be the missing tool. It scansCLAUDE_PROJECT_DIR(or$PWD) up to depth 6 and prunes hidden,build, andnode_modulesdirs.🤖 Generated with Claude Code