frappe-hooks-expert

Configure Frappe hooks in hooks.py for doc_events, scheduler, and extension points.

1|Updated Jan 16, 2025
One-click install
npx skills add https://github.com/kehwar/frappe_tweaks --skill frappe-hooks-expert
Or copy as Structured Prompt for Agentā–¼
Please help me install this Agent Skill.
Skill: frappe-hooks-expert
Source: https://github.com/kehwar/frappe_tweaks/tree/main/.github/skills/frappe-hooks-expert
Command: npx skills add https://github.com/kehwar/frappe_tweaks --skill frappe-hooks-expert

SYSTEM DOCUMENTATION & REQUIREMENTS

šŸ’” This Skill includes references (resource) components.

What problem does it solve?

Frappe developers often struggle to design, implement, and coordinate hooks across apps; this skill provides a structured guide to understand application hooks, document hooks, permission hooks, scheduler hooks, UI/Jinja hooks, and request-job hooks for reliable extension without touching core code.

Core Features & Use Cases

  • Comprehensive overview of hook categories including application, installation, document events, permission, scheduler, UI, Jinja, request-job, and other hooks.
  • Practical guidance on hook registration, execution order, multi-app coordination, debugging strategies, and best practices for robust, maintainable extensions.
  • Real-world scenarios showing how to register hooks in hooks.py, troubleshoot issues, and extend Frappe framework capabilities.

Quick Start

Modify hooks.py to register your hook handlers, implement the functions at the referenced paths, then restart bench and run tests to verify behavior.

Frequently Asked Questions about frappe-hooks-expert

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

FAQPage Schema
How do I configure doc_events in Frappe to extend framework behavior without modifying core code?ā–¼

Frappe scheduler hooks allow you to run background tasks at defined intervals by registering functions in hooks.py. You configure them to execute periodic jobs, ensuring robust extension of framework capabilities for automated workflows.

What is the execution order of Frappe hooks when multiple apps register the same extension point?ā–¼

The execution order of Frappe hooks depends on the application registration order defined in the framework. You must coordinate multi-app hooks carefully by consulting execution order documentation to ensure precise registration and predictable behavior across your applications.

How do I debug Frappe hooks that are not triggering or executing correctly?ā–¼

When exposing safe globals or website permissions in Frappe hooks, you must validate security implications to prevent unauthorized access. Configuring permission hooks in hooks.py allows you to control access rules and extend framework security behavior safely.

What types of Frappe hooks are available for customizing application and UI behavior?ā–¼

Available Frappe hooks include application hooks, document events, permission hooks, scheduler hooks, UI hooks, Jinja hooks, and request-job hooks. These extension points in hooks.py allow you to customize framework behavior comprehensively across different layers of the application.