9thlevelsoftware/legion/hooks-integration
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Claude Code hooks for automated Legion lifecycle events
Install
npx vskill@latest install 9thlevelsoftware/legion/hooks-integrationSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Hooks Integration
Defines Claude Code hook configurations for automating Legion lifecycle events. Hooks are opt-in — users configure them in their Claude Code settings. This skill documents the recommended hooks and their behavior.
Section 1: Overview
Claude Code hooks execute shell commands before or after specific events (tool calls, commands, etc.). Legion leverages hooks for:
- Pre-build validation — validate plan schemas before execution starts
- Post-build outcome recording — auto-record outcomes to memory after builds
- Pre-ship security gate — run security scan before ship pipeline
- Post-commit state update — update STATE.md progress after commits
Hooks are configured in .claude/settings.json (project-level) or ~/.claude/settings.json (global). Users must opt in — Legion never auto-installs hooks.
Section 2: Recommended Hook Configurations
2.1: Pre-Build Plan Validation
Validates plan file integrity before /legion:build executes.
When: Before any Agent tool call (catches build agent spawns) What: Checks STATE.md exists and has required structure On failure: Blocks the agent spawn, displays error
2.2: Post-Build Outcome Notification
Notifies the user when a build phase completes.
When: After any Agent tool call completes What: Simple notification (can be extended to trigger memory recording) Note: Full outcome recording still happens in the build command — this hook is informational
2.3: Pre-Ship Security Gate
Runs a lightweight security check before /legion:ship creates a PR.
When: Before any Bash call that includes gh pr create What: Runs npm audit and blocks if critical vulnerabilities found On failure: Blocks PR creation with security warning
Section 3: Installation Guide
For Users
To enable Legion hooks, add the desired hook configurations to your project's .claude/settings.json:
- Open or create
.claude/settings.jsonin the project root - Add the
hookssection with desired configurations from Section 2 - Hooks activate immediately on the next Claude Code session
Configuration Tips
- Start with just the pre-build validation hook — it's the lowest-risk, highest-value
- The pre-ship security gate may produce false positives on projects with known audit issues
- Hooks run synchronously — keep commands fast (under 2 seconds)
- Use
process.exit(0)to pass silently,process.exit(1)to block with error
Removing Hooks
Delete the hooks section from .claude/settings.json. Hooks deactivate immediately.
Section 4: Integration with Legion Commands
| Command | Hook Point | Purpose | |
|---|---|---|---|
/legion:build | PreToolUse (Agent) | Validate plans before spawning build agents | |
/legion:build | PostToolUse (Agent) | Notify on agent completion | |
/legion:ship | PreToolUse (Bash) | Security gate before PR creation | |
/legion:review | PostToolUse (Agent) | Notify when review agents complete |
What Hooks Do NOT Replace
Hooks are lightweight automation. They do NOT replace:
- The full security-review skill (hooks run simple checks; the skill runs comprehensive OWASP analysis)
- The memory-manager outcome recording (hooks notify; the skill records structured outcomes)
- The authority-enforcer boundary checks (hooks can't access plan file context)
Section 5: Graceful Degradation
- If hooks are not configured: Legion operates identically to pre-hook behavior
- If a hook command fails to execute (not found, permission denied): Claude Code logs the error and continues
- Hooks are Claude Code-specific — other CLI adapters ignore this skill entirely
- Hook configurations in this skill are recommendations, not requirements
Security
- Security scanPassed, 93 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/hooks-integration/SKILL.md
Popularity
- Repository stars
- 72
- Repository forks
- 8
- Repository npm downloads, 30 days
- 468
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 3 Aug 2026, 2 months ago.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/9thlevelsoftware/legion/hooks-integration)