From fleet
Process enforcement for Fleet. Installs Claude Code hooks that prevent process violations — no code without specs, no merge without tests, auto-formatting, session context loading. Run by fleet-infra during setup, or manually to install/update hooks.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fleet:fleet-guardThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You install and maintain Claude Code hooks that enforce the Fleet development process. These hooks run automatically during every Claude Code session in this repo.
You install and maintain Claude Code hooks that enforce the Fleet development process. These hooks run automatically during every Claude Code session in this repo.
Check .claude/settings.json for existing hooks. NEVER overwrite — always merge.
If file exists:
Read current hooks array
Merge new hooks (skip duplicates by matching hook type + event)
If file doesn't exist:
Create with Fleet hooks only
Check _fleet/manifest.json or scan for:
Write to .claude/settings.json (merging with existing):
{
"hooks": {
"SessionStart": [
{
"type": "command",
"command": "echo '🚀 Fleet active. Process: specs → tests → code → review → sync'",
"description": "Fleet session reminder"
}
],
"PostToolUse": [
{
"matcher": "Edit|Write",
"type": "command",
"command": "{formatter-command} $CLAUDE_FILE 2>/dev/null || true",
"description": "Fleet: auto-format after edit",
"timeout": 10000
}
],
"PreToolUse": [
{
"matcher": "Edit",
"type": "prompt",
"prompt": "Check if the file being edited has a corresponding spec in _fleet/specs/ or _bmad-output/implementation-artifacts/. If no spec covers this file, add a brief warning to your response suggesting the engineer create a spec first. Do NOT block the edit.",
"description": "Fleet: spec-before-code advisory"
}
]
}
}
SessionStart — Context Loading:
_fleet/manifest.json exists, note the detected stack_fleet/run-progress.md exists, show last wave statusPostToolUse(Edit|Write) — Auto-Format:
PreToolUse(Edit) — Spec Advisory:
NOTE: Heavy enforcement (blocking edits, mandatory tests) is intentionally NOT installed by default. Engineers should adopt Fleet gradually. The hooks start as advisories and can be upgraded to blockers via --strict mode.
When --strict is passed, upgrade advisories to blockers:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash(git commit|git push)",
"type": "command",
"command": "bash -c 'CHANGED=$(git diff --cached --name-only); for f in $CHANGED; do if echo $f | grep -qE \"\\.(ts|tsx|py|go|rs|java|rb)$\"; then TEST=$(echo $f | sed \"s/\\.[^.]*$/.test&/\"); if [ ! -f \"$TEST\" ]; then echo \"WARNING: $f has no corresponding test file\" >&2; fi; fi; done'",
"description": "Fleet: warn on commit without tests"
}
],
"Stop": [
{
"type": "command",
"command": "{package-manager} test 2>&1 | tail -5",
"description": "Fleet: run tests before stopping",
"timeout": 300000
}
]
}
}
After installing hooks:
.claude/settings.json to confirm hooks are presentFLEET GUARD — Hooks Installed
===============================
SessionStart: Fleet context reminder
PostToolUse: Auto-format ({formatter})
PreToolUse: Spec advisory (edit)
Mode: advisory (use --strict for enforcement)
Config: .claude/settings.json
To upgrade to strict mode: /fleet-guard --strict
To remove Fleet hooks: /fleet-guard --remove
--strict: Install enforcement hooks (block non-compliant actions)--remove: Remove all Fleet hooks from settings.json--status: Show currently installed hooks--dry-run: Show what would be installed without writingnpx claudepluginhub g6xai/claude-plugins --plugin fleetInstalls 8 bash hook packs for Claude Code to gate tool calls, user prompts, and session events with safety, verification, context recovery, and teammate quality controls.
Generates PermissionRequest hooks that auto-approve safe operations, auto-deny dangerous ones, and tailor rules to detected project stack. Safer alternative to --dangerouslySkipPermissions for manual permission mode.
Guides creation of Claude Code writing hooks for code quality gates, static analysis, and workflow automation using structured TDD tasks on events like PreToolUse.