Agent skill
hook
Use PROACTIVELY when you need to create, update, configure, or validate Claude hooks for various events and integrations
Install this agent skill to your Project
npx add-skill https://github.com/aiskillstore/marketplace/tree/main/skills/emz1998/hook
SKILL.md
1. Context
- Main Objective: Create or update Claude Code hook scripts named $1 with requirements: $2
- Secondary Objective: Ensure hooks are properly linked in settings and follow security best practices
- User Input: [$1 = hook name, $2 = hook requirements/description]
2. Workflow
Phase 1: Discovery & Analysis [P0]
- T001: Assess if you needed more context about hook specifications. If so, read
.claude/skills/hook/hooks.md[P0] - T002: Check if hook already exists in
.claude/hooks/directory [P0] - T003: Review
@.claude/settings.local.jsonfor existing hook configurations [P1] - T004: Identify appropriate Claude Code events to hook into [P1]
- T005: Assess security and performance implications [P2]
Phase 2: Implementation [P0]
- T006: Create new hook script OR update existing hook script in
.claude/hooks/[P0] - T007: Implement hook logic with proper error handling [P0]
- T008: Add logging and debugging capabilities [P1]
- T009: Create input validation and sanitization routines [P1]
- T010: Document hook behavior in script comments [P2]
Phase 3: Configuration [P1]
- T011: Update
@.claude/settings.local.jsonto link the hook [P0] - T012: Configure appropriate event triggers [P1]
- T013: Set necessary permissions and access levels [P1]
- T014: Ensure compatibility with existing hooks [P2]
Phase 4: Validation [P1]
- T015: Test hook execution without creating test files [P0]
- T016: Verify error handling and edge cases [P1]
- T017: Check for security vulnerabilities [P1]
- T018: Validate performance impact [P2]
- T019: Provide comprehensive report to main agent [P0]
3. Implementation Strategy
- For new hooks: Create script file in
.claude/hooks/following naming convention - For updates: Read existing hook, preserve working logic, apply requested changes
- Use Python or Bash depending on complexity requirements
- Implement idempotent operations where possible
- Follow existing hook patterns in the codebase for consistency
- Read
.claude/skills/hook-writer/hooks.mdfor hook specifications PROACTIVELY
4. Constraints
- Must update
@.claude/settings.local.jsonto link hooks - Must test hooks after generation without creating test files
- Never create hooks that modify critical system files
- Never implement hooks with hardcoded credentials
- Never write hooks that can cause infinite loops
- Never bypass security validations or access controls
- Never create hooks without proper error handling
- Never create test files when testing hooks
5. Success Criteria
- Hook script exists and is syntactically valid
- Hook is properly linked in
settings.local.json - Hook executes successfully on target event
- Error handling covers common failure scenarios
- No security vulnerabilities detected
- Comprehensive report provided to main agent upon completion
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
perigon-backend
Perigon ASP.NET Core + EF Core + Aspire conventions
perigon-agent
Pointers for Copilot/agents to apply Perigon conventions
perigon-angular
Angular 21+ standalone/Material/signal conventions for Perigon WebApp
fastapi-mastery
Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation, Pydantic models, or FastAPI-specific features.
context7-efficient
Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.
browser-use
Browser automation using Playwright MCP. Navigate websites, fill forms, click elements, take screenshots, and extract data. Use when tasks require web browsing, form submission, web scraping, UI testing, or any browser interaction.
Didn't find tool you were looking for?