Skip to content

feat: warn when FFCA layer validation prerequisites are missing - #15

Open
ryzizub wants to merge 2 commits into
mainfrom
feat/warn-missing-prereqs
Open

ryzizub wants to merge 2 commits into
mainfrom
feat/warn-missing-prereqs

Conversation

@ryzizub

@ryzizub ryzizub commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

validate_layers.sh exits 0 silently when jq or dart is 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 when dart or jq is not on PATH. Always exits 0. Modeled on warn-missing-mcp.sh from vgv-ai-flutter-plugin.
  • hooks/warn_missing_prereqs_test.sh: stubbed-PATH tests, run in the existing Hook Tests CI job.
  • README Hooks section, AGENTS.md, CLAUDE.md, and CONTRIBUTING.md updated.

Reviewer note: the hook doesn't parse the stdin payload, since jq may be the missing tool. It scans CLAUDE_PROJECT_DIR (or $PWD) up to depth 6 and prunes hidden, build, and node_modules dirs.

🤖 Generated with Claude Code

@ryzizub
ryzizub force-pushed the feat/warn-missing-prereqs branch from 3827676 to 90d0b5a Compare September 30, 2026 08:57
@ryzizub
ryzizub requested a review from a team as a code owner September 30, 2026 08:57
ryzizub and others added 2 commits October 1, 2026 15:40
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>
@ryzizub
ryzizub force-pushed the feat/warn-missing-prereqs branch from 90d0b5a to 13d98cc Compare October 1, 2026 13:40

@erickzanardo erickzanardo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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' \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants