Hooks Automation
できること
このスキルは、AIのコーディング操作の前後で自動的に動くフックを設定します。ファイルの整形やセッション状態の保存などです。日常の処理を自動化したい開発者向けです。
使う場面
- ✓AIが行うすべての変更の後で、コードが自動的に整形されてほしいとき。
- ✓前回のセッションの続きから、AIに再開させたいとき。
- ✓タスクが始まる前に、定期的なチェックを実行したいとき。
スキルのリンク
https://github.com/ruvnet/RuView/blob/main/.claude/skills/hooks-automation/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“ファイルを編集するたびに、コードが自動で整形されるようにしてください。セッションが終わったら、メモを保存してください。”
毎週5つの新しいスキル。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
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
AgentDB Advanced Features
102kエージェントが、複数のマシンにまたがるデータベースの同期や、ベクトル検索とメタデータによる絞り込みの組み合わせなど、AgentDBの高度な機能を示します。
AgentDB Learning Plugins
102kエージェントが、過去の経験から改善する強化学習の手法を使って、AgentDB向けの学習プラグインを作成・学習できるよう支援します。
AgentDB Memory Patterns
102kエージェントが、AgentDBを永続メモリとして使い、セッションをまたいで会話と文脈を覚えられるよう支援します。
AgentDB Performance Optimization
102kエージェントが、圧縮、高速な検索インデックス、キャッシュを使って、AgentDBの検索を高速化し、メモリ使用量を減らす方法を示します。
似ているスキル
add-model-provider
394k安全なセットアップコマンドで新しいAIモデルプロバイダーをOpenClawに接続し、APIキーを平文で残さず、ライブテストを行うようエージェントを支援します。
acp-router
394kClaude CodeやCursorなどのコーディングアシスタントに、OpenClaw経由でタスクを渡し、その作業がそのツール内で行われるようエージェントを支援します。
browser-automation
394kログイン、タブ、応答しなくなったページからの復旧を含め、Webページを段階的に操作するようエージェントに教えます。