Hooks Automation

Automates pre/post-operation hooks, session state, and memory coordination for Codex Flow workflows.

Updated May 11, 2026
One-click install
npx skills add https://github.com/Turgunoff/mebellar_app --skill hooks-automation-turgunoff
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: Hooks Automation
Source: https://github.com/Turgunoff/mebellar_app/tree/main/.agents/skills/hooks-automation
Command: npx skills add https://github.com/Turgunoff/mebellar_app --skill hooks-automation-turgunoff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually validating edits, formatting code, tracking session state, and coordinating multiple agents across development sessions is repetitive and error-prone. This Skill automates those tasks through a configurable hook system integrated with Codex Flow CLI and MCP tools. ## Core Features & Use Cases - Pre/Post-Operation Hooks: Validate syntax, assign agents, auto-format code, and train neural patterns around every edit, bash command, task, or search. - Session & Memory Management: Persist context across sessions, restore prior state, export metrics, and synchronize shared memory across swarm agents. - Git & MCP Integration: Wire hooks into pre-commit/pre-push quality gates and coordinate with MCP swarm tools for agent spawning and neural training. - Use Case: A team running multi-agent refactoring configures post-edit hooks so every modified file is auto-formatted, logged to coordination memory, and used to train patterns, while a session-end hook exports metrics and a summary report. ## Quick Start Set up the hooks system in my project by initializing Codex Flow with hooks and configuring pre-edit and post-edit automation in my settings file.

Frequently Asked Questions about Hooks Automation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up automation hooks in Codex Flow?▼

Run npx Codex-flow init --hooks to generate a .Codex/settings.json with pre-configured hooks. Then define PreToolUse and PostToolUse matchers that invoke commands like npx Codex-flow hook pre-edit or post-edit with the target file path.

How do I auto-format code after every file edit?▼

Add a PostToolUse hook matching Write, Edit, and MultiEdit that runs npx Codex-flow hook post-edit --file with the edited path. The hook applies language-specific formatters such as Prettier, Black, or gofmt and can store the edit context in memory.

Can hooks integrate with Git pre-commit checks?▼

Yes. Add a script to .git/hooks/pre-commit that loops over staged files, runs the pre-edit hook with syntax validation, and blocks the commit if validation fails. Post-commit and pre-push hooks can log metrics and enforce quality thresholds.

Does the hooks system work with MCP swarm tools?▼

Yes. Hooks internally call MCP tools such as memory_usage, agent_spawn, and neural_train to persist coordination state, register agents, and train patterns. MCP integration is optional but required for cross-agent memory synchronization.

Why are my hooks not executing?▼

Check that .Codex/settings.json has valid syntax, the matcher patterns match the tool names, and the Codex Flow CLI is on your PATH. Enable debug mode with CLAUDE_FLOW_DEBUG=true and inspect the daily hook logs for errors.

What are the limitations of hook-based automation?▼

Hooks add latency to every matched operation, so heavy logic should run asynchronously with continueOnError enabled. Long-running hooks can hit configured timeouts, and memory entries need TTLs and cleanup to avoid unbounded growth.