Task: Convert Project Rules To Claude Code Hooks — Productivity skill for Claude Code
You are an expert at converting natural language project rules into Claude Code hook configurations.
How to install Task: Convert Project Rules To Claude Code Hooks
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open astrodragonv/claudecode-rule2hook and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Task: Convert Project Rules To Claude Code Hooks does
You are an expert at converting natural language project rules into Claude Code hook configurations. Your task is to analyze the given rules and generate appropriate hook configurations following the
Alternatives in Productivity
- Cs2 Technical Analysis — You are an Expert 3D Technical Director specialized in CS2 (Counter-Strike 2) weapon and item pipelines 14.1k ★
- Linear - Ticket Management — You are tasked with managing Linear tickets, including creating tickets from thoughts documents, updating exis 10k ★
- New Task — Analyze task complexity and create actionable implementation plan 1.5k ★
README
Task: Convert Project Rules to Claude Code Hooks
You are an expert at converting natural language project rules into Claude Code hook configurations. Your task is to analyze the given rules and generate appropriate hook configurations following the official Claude Code hooks specification.
Instructions
If rules are provided as arguments, analyze those rules
If no arguments are provided, read and analyze the CLAUDE.md file from these locations:
./CLAUDE.md(project memory)./CLAUDE.local.md(local project memory)~/.claude/CLAUDE.md(user memory)
For each rule, determine:
- The appropriate hook event (PreToolUse, PostToolUse, Stop, Notification)
- The tool matcher pattern (exact tool names or regex)
- The command to execute
Generate the complete hook configuration following the exact JSON structure
Save it to `~/.claude/hooks.json` (merge with existing hooks if present)
Provide a summary of what was configured
Hook Events
PreToolUse
- When: Runs BEFORE a tool is executed
- Common Keywords: "before", "check", "validate", "prevent", "scan", "verify"
- Available Tool Matchers:
Task- Before launching agent tasksBash- Before running shell commandsGlob- Before file pattern matchingGrep- Before content searchingRead- Before reading filesEdit- Before editing single filesMultiEdit- Before batch editing filesWrite- Before writing/creating filesWebFetch- Before fetching web contentWebSearch- Before web searchingTodoRead- Before reading todo listTodoWrite- Before updating todo list
- Special Feature: Can block tool execution if command returns non-zero exit code
PostToolUse
- When: Runs AFTER a tool completes successfully
- Common Keywords: "after", "following", "once done", "when finished"
- Available Tool Matchers: Same as PreToolUse
- Common Uses: Formatting, linting, building, testing after file changes
Stop
- When: Runs when Claude Code finishes responding
- Common Keywords: "finish", "complete", "end task", "done", "wrap up"
- No matcher needed: Applies to all completions
- Common Uses: Final status checks, summaries, cleanup
Notification
- When: Runs when Claude Code sends notifications
- Common Keywords: "notify", "alert", "inform", "message"
- Special: Rarely used for rule conversion
Hook Configuration Structure
{
"hooks": {
"EventName": [
{
"matcher": "ToolName|AnotherTool|Pattern.*",
"hooks": [
{
"type": "command",
"command": "your-command-here"
}
]
}
]
}
}
Matcher Patterns
- Exact match:
"Edit"- matches only Edit tool - Multiple tools:
"Edit|MultiEdit|Write"- matches any of these - Regex patterns:
".*Edit"- matches Edit and MultiEdit - All tools: Omit matcher field entirely
Related Skills
Rule2hook
Task: Convert Project Rules to Claude Code Hooks
Ad Superpowers Plugin
Manage, analyze, and optimize your ad campaigns across 8 platforms through natural language in Claude Code and
Maestro Issue
Intent-driven issue lifecycle management — describe what you want in natural language (报告一个 bug / 列出开放 issue /
Matac
MATAC (Multi-Agent Task Allocation and Coordination) is a Python system for intelligent task management. It us
Pointely Search
Search Pointely for a captured team playbook matching a natural-language task.
Multi Aider Sub Agent
Run a multi aider_ai_code call with a sub agent call to fulfill the following tasks back to back in the most s
Related Agents
Intent Compiler Agent
Sits at the ingress boundary of the Language Facade. Takes human natural language input and compiles it into t
Feature Requestor
Turn a natural-language feature idea (with optional links) into .claude/INITIAL.md following the exact 4-secti
Cypher Author
Writes read-only Cypher for natural-language questions given the live graph schema and few-shot examples; also