/hooks-automation
Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows.
Claude Code
$ npx -y skills add ruvnet/ruflo --skill hooks-automation --agent claude-code
Codex
$ npx skills add ruvnet/ruflo --skill hooks-automation -a codex -y
Cursor
$ npx skills add ruvnet/ruflo --skill hooks-automation -a cursor -y
Gemini CLI
$ npx skills add ruvnet/ruflo --skill hooks-automation -a gemini-cli -y
GitHub Copilot
$ npx skills add ruvnet/ruflo --skill hooks-automation -a github-copilot -y
OpenCode
$ npx skills add ruvnet/ruflo --skill hooks-automation -a opencode -y
Windsurf
$ npx skills add ruvnet/ruflo --skill hooks-automation -a windsurf -y
SKILL.md
hooks-automation.SKILL.mdname: hooks-automation
description: Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows.
Hooks Automation
Intelligent automation system that coordinates, validates, and learns from Claude Code operations through hooks integrated with MCP tools and neural pattern training.
What This Skill Does
This skill provides a comprehensive hook system that automatically manages development operations, coordinates swarm agents, maintains session state, and continuously learns from coding patterns. It enables automated agent assignment, code formatting, performance tracking, and cross-session memory persistence.
**Key Capabilities:**
- **Pre-Operation Hooks**: Validate, prepare, and auto-assign agents before operations
- **Post-Operation Hooks**: Format, analyze, and train patterns after operations
- **Session Management**: Persist state, restore context, generate summaries
- **Memory Coordination**: Synchronize knowledge across swarm agents
- **Git Integration**: Automated commit hooks with quality verification
- **Neural Training**: Continuous learning from successful patterns
- **MCP Integration**: Seamless coordination with swarm tools
Prerequisites
**Required:**
- Claude Flow CLI installed (`npm install -g claude-flow@alpha`)
- Claude Code with hooks enabled
- `.claude/settings.json` with hook configurations
**Optional:**
- MCP servers configured (claude-flow, ruv-swarm, flow-nexus)
- Git repository for version control
- Testing framework for quality verification
Quick Start
Initialize Hooks System
# Initialize with default hooks configuration
npx claude-flow init --hooks
This creates:
- `.claude/settings.json` with pre-configured hooks
- Hook command documentation in `.claude/commands/hooks/`
- Default hook handlers for common operations
Basic Hook Usage
# Pre-task hook (auto-spawns agents)
npx claude-flow hooks pre-task --description "Implement authentication"
# Post-edit hook (auto-formats and stores in memory)
npx claude-flow hooks post-edit --file "src/auth.js" --memory-key "auth/login"
# Session end hook (saves state and metrics)
npx claude-flow hooks session-end --session-id "dev-session" --export-metrics
---
Complete Guide
Available Hooks
Pre-Operation Hooks
Hooks that execute BEFORE operations to prepare and validate:
**pre-edit** - Validate and assign agents before file modifications
npx claude-flow hooks pre-edit [options]
Options:
--file, -f <path> File path to be edited
--auto-assign-agent Automatically assign best agent (default: true)
--validate-syntax Pre-validate syntax before edit
--check-conflicts Check for merge conflicts
--backup-file Create backup before editing
Examples:
npx claude-flow hooks pre-edit --file "src/auth/login.js"
npx claude-flow hooks pre-edit -f "config/db.js" --validate-syntax
npx claude-flow hooks pre-edit -f "production.env" --backup-file --check-conflicts
**Features:**
- Auto agent assignment based on file type
- Syntax validation to prevent broken code
- Conflict detection for concurrent edits
- Automatic file backups for safety
**pre-bash** - Check command safety and resource requirements
npx claude-flow hooks pre-bash --command <cmd>
Options:
--command, -c <cmd> Command to validate
--check-safety Verify command safety (default: true)
--estimate-resources Estimate resource usage
--require-confirmation Request user confirmation for risky commands
Examples:
npx claude-flow hooks pre-bash -c "rm -rf /tmp/cache"
npx claude-flow hooks pre-bash --command "docker build ." --estimate-resources
**Features:**
- Command safety validation
- Resource requirement estimation
- Destructive command confirmation
- Permission checks
**pre-task** - Auto-spawn agents and prepare for complex tasks
npx claude-flow hooks pre-task [options]
Options:
--description, -d <text> Task description for context
--auto-spawn-agents Automatically spawn required agents (default: true)
--load-memory Load relevant memory from previous sessions
--optimize-topology Select optimal swarm topology
--estimate-complexity Analyze task complexity
Examples:
npx claude-flow hooks pre-task --description "Implement user authentication"
npx claude-flow hooks pre-task -d "Continue API dev" --load-memory
npx claude-flow hooks pre-task -d "Refactor codebase" --optimize-topology
**Features:**
- Automatic agent spawning based on task analysis
- Memory loading for context continuity
- Topology optimization for task structure
- Complexity estimation and time prediction
**pre-search** - Prepare and optimize search operations
npx claude-flow hooks pre-search --query <query>
Options:
--query, -q <text> Search query
--check-cache Check cache first (default: true)
--optimize-query Optimize search pattern
Examples:
npx claude-flow hooks pre-search -q "authentication middleware"
**Features:**
- Cache checking for faster results
- Query optimization
- Search pattern improvement
Post-Operation Hooks
Hooks that execute AFTER operations to process and learn:
**post-edit** - Auto-format, validate, and update memory
npx claude-flow hooks post-edit [options]
Options:
--file, -f <path> File path that was edited
--auto-format Automatically format code (default: true)
--memory-key, -m <key> Store edit context in memory
--train-patterns Train neural patterns from edit
--validate-output Validate edited file
Examples:
npx claude-flow hooks post-edit --file "src/components/Button.jsx"
npx claude-flow hooks post-edit -f "api/a
Read more
name: hooks-automation description: Automated coordination, formatting, and learning from Claude Code operations using intelligent hooks with MCP integration. Includes pre/post task hooks, session management, Git integration, memory coordination, and neural pattern training for enhanced development workflows.
Hooks Automation
Intelligent automation system that coordinates, validates, and learns from Claude Code operations through hooks integrated with MCP tools and neural pattern training.
What This Skill Does
This skill provides a comprehensive hook system that automatically manages development operations, coordinates swarm agents, maintains session state, and continuously learns from coding patterns. It enables automated agent assignment, code formatting, performance tracking, and cross-session memory persistence.
**Key Capabilities:**
- **Pre-Operation Hooks**: Validate, prepare, and auto-assign agents before operations
- **Post-Operation Hooks**: Format, analyze, and train patterns after operations
- **Session Management**: Persist state, restore context, generate summaries
- **Memory Coordination**: Synchronize knowledge across swarm agents
- **Git Integration**: Automated commit hooks with quality verification
- **Neural Training**: Continuous learning from successful patterns
- **MCP Integration**: Seamless coordination with swarm tools
Prerequisites
**Required:**
- Claude Flow CLI installed (`npm install -g claude-flow@alpha`)
- Claude Code with hooks enabled
- `.claude/settings.json` with hook configurations
**Optional:**
- MCP servers configured (claude-flow, ruv-swarm, flow-nexus)
- Git repository for version control
- Testing framework for quality verification
Quick Start
Initialize Hooks System
# Initialize with default hooks configuration npx claude-flow init --hooks
This creates:
- `.claude/settings.json` with pre-configured hooks
- Hook command documentation in `.claude/commands/hooks/`
- Default hook handlers for common operations
Basic Hook Usage
# Pre-task hook (auto-spawns agents) npx claude-flow hooks pre-task --description "Implement authentication" # Post-edit hook (auto-formats and stores in memory) npx claude-flow hooks post-edit --file "src/auth.js" --memory-key "auth/login" # Session end hook (saves state and metrics) npx claude-flow hooks session-end --session-id "dev-session" --export-metrics
---
Complete Guide
Available Hooks
Pre-Operation Hooks
Hooks that execute BEFORE operations to prepare and validate:
**pre-edit** - Validate and assign agents before file modifications
npx claude-flow hooks pre-edit [options] Options: --file, -f <path> File path to be edited --auto-assign-agent Automatically assign best agent (default: true) --validate-syntax Pre-validate syntax before edit --check-conflicts Check for merge conflicts --backup-file Create backup before editing Examples: npx claude-flow hooks pre-edit --file "src/auth/login.js" npx claude-flow hooks pre-edit -f "config/db.js" --validate-syntax npx claude-flow hooks pre-edit -f "production.env" --backup-file --check-conflicts
**Features:**
- Auto agent assignment based on file type
- Syntax validation to prevent broken code
- Conflict detection for concurrent edits
- Automatic file backups for safety
**pre-bash** - Check command safety and resource requirements
npx claude-flow hooks pre-bash --command <cmd> Options: --command, -c <cmd> Command to validate --check-safety Verify command safety (default: true) --estimate-resources Estimate resource usage --require-confirmation Request user confirmation for risky commands Examples: npx claude-flow hooks pre-bash -c "rm -rf /tmp/cache" npx claude-flow hooks pre-bash --command "docker build ." --estimate-resources
**Features:**
- Command safety validation
- Resource requirement estimation
- Destructive command confirmation
- Permission checks
**pre-task** - Auto-spawn agents and prepare for complex tasks
npx claude-flow hooks pre-task [options] Options: --description, -d <text> Task description for context --auto-spawn-agents Automatically spawn required agents (default: true) --load-memory Load relevant memory from previous sessions --optimize-topology Select optimal swarm topology --estimate-complexity Analyze task complexity Examples: npx claude-flow hooks pre-task --description "Implement user authentication" npx claude-flow hooks pre-task -d "Continue API dev" --load-memory npx claude-flow hooks pre-task -d "Refactor codebase" --optimize-topology
**Features:**
- Automatic agent spawning based on task analysis
- Memory loading for context continuity
- Topology optimization for task structure
- Complexity estimation and time prediction
**pre-search** - Prepare and optimize search operations
npx claude-flow hooks pre-search --query <query> Options: --query, -q <text> Search query --check-cache Check cache first (default: true) --optimize-query Optimize search pattern Examples: npx claude-flow hooks pre-search -q "authentication middleware"
**Features:**
- Cache checking for faster results
- Query optimization
- Search pattern improvement
Post-Operation Hooks
Hooks that execute AFTER operations to process and learn:
**post-edit** - Auto-format, validate, and update memory
npx claude-flow hooks post-edit [options] Options: --file, -f <path> File path that was edited --auto-format Automatically format code (default: true) --memory-key, -m <key> Store edit context in memory --train-patterns Train neural patterns from edit --validate-output Validate edited file Examples: npx claude-flow hooks post-edit --file "src/components/Button.jsx" npx claude-flow hooks post-edit -f "api/a
📖 RuFlo Explained — Build an AI Team That Plans, Remembers, Tests, and Improves A 14-chapter guide: from the basic idea to a first useful task, then memory, agent teams, plugins, cost and verification. Agent = Model + Harness.
Other skills on ruflo.
More skills from other plugins.
agentmail
Use your assigned AgentMail inbox to read email tasks, explicitly send or reply, and check delivery. Provided automatically by…
bmad
Answers BMad questions and recommends the next skill from what is installed. Use when the user asks bmad for help, what to do…
Questions about hooks-automation.
- Which coding agents can use hooks-automation?
- hooks-automation installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.

