Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/divinevideo/divine-mobile/git-worktree-precommit-hook-flutter-failurenpx skills add divinevideo/divine-mobile --skill git-worktree-precommit-hook-flutter-failuregit clone --depth 1 https://github.com/divinevideo/divine-mobileWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/divinevideo/divine-mobile/git-worktree-precommit-hook-flutter-failure)<a href="https://agentmods.dev/skills/divinevideo/divine-mobile/git-worktree-precommit-hook-flutter-failure"><img src="https://agentmods.dev/badge/skills/divinevideo/divine-mobile/git-worktree-precommit-hook-flutter-failure.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00153 | $0.01023 |
| Opus 5 | $0.00077 | $0.00511 |
| Sonnet 5 | $0.00031 | $0.00205 |
| Haiku 4.5 | $0.00015 | $0.00102 |
Grade A, and why
git-worktree-precommit-hook-flutter-failure scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Git Worktree Pre-Commit Hook Flutter Failure
Problem
When using git worktree for parallel development, pre-commit hooks that run
flutter analyze fail during git commit even though:
- Running
flutter analyzedirectly in the worktree passes with no issues - Running the pre-commit hook script manually passes
- The hook passes in the main repo checkout
Root Cause
Git sets GIT_DIR, GIT_INDEX_FILE, and GIT_WORK_TREE environment variables
during hook execution. In a worktree, GIT_DIR points to
.git/worktrees/<name>/ instead of .git/. When flutter analyze internally
runs flutter pub get, pub chokes on this worktree-style GIT_DIR path and
fails to resolve dependencies.
The failure is invisible when the hook uses 2>/dev/null on stderr — you only
see "Resolving dependencies..." then the failure message, with the actual error
suppressed.
Context / Trigger Conditions
- Using
git worktree addfor parallel branch development - Pre-commit hook runs
flutter analyzeordart analyze - Hook output shows "Resolving dependencies..." then immediately fails
- No actual analysis errors are reported
- The hook uses
set -e(exit on error) 2>/dev/nullmay hide the actual failure cause
Diagnosis
Reproduce the exact failure by simulating git's hook environment:
# This will FAIL (simulates hook execution in worktree)
GIT_DIR=/path/to/main/.git/worktrees/<name> \
flutter analyze --no-fatal-infos 2>/dev/null
# This will PASS (without git env vars)
flutter analyze --no-fatal-infos
Solution
Add unset GIT_DIR GIT_INDEX_FILE GIT_WORK_TREE to the pre-commit hook
after all git commands but before any flutter/dart commands.
#!/bin/bash
set -e
cd "$(git rev-parse --show-toplevel)/mobile"
# Git operations (these NEED the git env vars)
STAGED_DART_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep '\.dart$' || true)
if [ -z "$STAGED_DART_FILES" ]; then
echo "No Dart files staged, skipping checks"
exit 0
fi
# Unset git env vars BEFORE running flutter/dart commands.
# Git sets these during hook execution, and flutter pub get
# (called internally by flutter analyze) chokes on worktree-style
# GIT_DIR paths.
unset GIT_DIR GIT_INDEX_FILE GIT_WORK_TREE
# Now flutter/dart commands work in both main repo and worktrees
dart format --output=none --set-exit-if-changed lib test
flutter analyze --no-fatal-infos
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 3d ago First seen · 104 lines · 153 tokens per session scan A 10c5120e4cdc
git-worktree-precommit-hook-flutter-failure is a skill published in the GitHub repository divinevideo/divine-mobile (265 stars, last pushed today), licensed MPL-2.0. It adds 153 tokens to every session and 1,023 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
git-advanced-workflows
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
gsd-audit-fix
Autonomous audit-to-fix pipeline — find issues, classify, fix, test, commit.
git-mastery
Advanced Git: rebase, bisect, reflog, cherry-pick, worktrees, LFS. Triggers: rebase, bisect, cherry-pick, reflog, force push, merge conflict, worktree.
git-bisect-assistant
Automatically performs git bisect to identify the first bad commit that introduced a bug or failure. Use when debugging regressions, tracking down when a test started failing, or identifying which commit broke functionality. Handles flaky tests with retry logic and provides comprehensive reports with bisect logs and…
semantic-szz-analyzer
Identify bug-introducing commits using semantic analysis that extends traditional SZZ algorithm. Distinguishes semantic changes from refactorings or code movements using control-flow and data-flow similarity analysis. Use when analyzing bug-fix commits to trace back to bug-introducing changes, investigating software…
szz-bug-introducing-commit-identifier
Identifies bug-introducing commits using SZZ-style analysis based on bug-fixing commits, commit history, and code blame information. Use this skill when you need to trace bugs back to their origin, identify which commits introduced bugs, analyze bug-fix commits to find root causes, perform software repository mining…