Hooks Automation
यह क्या करती है
यह स्किल AI के कोडिंग कामों से पहले और बाद में चलने वाले अपने-आप हुक सेट करती है, जैसे फ़ाइलें फ़ॉर्मेट करना या सत्र की स्थिति सहेजना। यह उन डेवलपर के लिए है जो रोज़ के कदम अपने-आप करवाना चाहते हैं।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि AI के हर बदलाव के बाद कोड अपने-आप फ़ॉर्मेट हो।
- ✓जब आप चाहते हैं कि AI पिछले सत्र में जहाँ छोड़ा था वहीं से आगे बढ़े।
- ✓जब हर काम शुरू होने से पहले नियमित जाँचें चलनी चाहिए।
Skill का लिंक
https://github.com/ruvnet/RuView/blob/main/.claude/skills/hooks-automation/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“ऐसा सेट कीजिए कि आप जब भी कोई फ़ाइल बदलें तो मेरा कोड अपने-आप फ़ॉर्मेट हो, और सत्र खत्म होने पर नोट्स सहेजें।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
हुक सेटिंग्स फ़ाइल में रखे छोटे कमांड होते हैं, जो चुने गए समय पर चलते हैं, जैसे किसी काम से पहले या बदलाव के बाद। स्किल दिखाती है कि इन्हें कैसे कॉन्फ़िगर करें और claude-flow टूल से कैसे जोड़ें।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
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.jsonwith 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.jsonwith 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 hook pre-task --description "Implement authentication"
# Post-edit hook (auto-formats and stores in memory)
npx claude-flow hook post-edit --file "src/auth.js" --memory-key "auth/login"
# Session end hook (saves state and metrics)
npx claude-flow hook 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 hook 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 hook pre-edit --file "src/auth/login.js"
npx claude-flow hook pre-edit -f "config/db.js" --validate-syntax
npx claude-flow hook 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 hook 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 hook pre-bash -c "rm -rf /tmp/cache"
npx claude-flow hook 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 hook 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 hook pre-task --description "Implement user authentication"
npx claude-flow hook pre-task -d "Continue API dev" --load-memory
npx claude-flow hook pre-task -d "Refactor codebase" --optimize-topology
Features:
- Automatic agent spawning based on task analysis
- Memory loading for context continuity
अक्सर पूछे जाने वाले सवाल
हुक कहाँ सेट होते हैं?
आपके प्रोजेक्ट की एक सेटिंग्स फ़ाइल में, जैसे .claude/settings.json।
इस्तेमाल से पहले क्या चाहिए?
हुक चालू वाला Claude Code, claude-flow टूल, और हुक कॉन्फ़िगरेशन वाली सेटिंग्स फ़ाइल।
क्या यह सत्र की मेमोरी सहेज सकती है?
हाँ। स्किल सत्र प्रबंधन और सत्रों के बीच साझा मेमोरी को कवर करती है।
जानकारी
लेखक का मूल विवरण
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.
repo: ruvnet/RuView
लोकप्रियता
- GitHub स्टार
- 102k
- रैंकिंग में स्थान
- #834
- लाइसेंस
- MIT
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
AgentDB Advanced Features
102kयह आपके एजेंट को AgentDB के उन्नत फ़ीचर दिखाती है, जैसे कई मशीनों के बीच डेटाबेस सिंक करना और मेटाडेटा फ़िल्टर के साथ वेक्टर सर्च।
AgentDB Learning Plugins
102kयह आपके एजेंट को AgentDB के लिए लर्निंग प्लगइन बनाने और ट्रेन करने देती है, जो पिछले अनुभव से सुधरने वाले रीइनफ़ोर्समेंट लर्निंग तरीकों पर चलते हैं।
AgentDB Memory Patterns
102kयह आपके एजेंट को AgentDB को स्थायी मेमोरी स्टोर बनाकर सत्रों के पार बातचीत और संदर्भ याद रखने देती है।
AgentDB Performance Optimization
102kयह आपके एजेंट को AgentDB सर्च तेज़ करने और मेमोरी उपयोग घटाने का तरीका दिखाती है, कंप्रेशन, तेज़ सर्च इंडेक्स और कैशिंग से।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।