frappe-impl-hooks

Implement Frappe document event handlers and scheduled tasks for invoice validation and log cleanup.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/nathanabay/epc_bespo --skill frappe-impl-hooks-nathanabay
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-impl-hooks
Source: https://github.com/nathanabay/epc_bespo/tree/main/skills-frappe/impl/frappe-impl-hooks
Command: npx skills add https://github.com/nathanabay/epc_bespo --skill frappe-impl-hooks-nathanabay

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and scripts (resource) and assets (resource) components.

What problem does it solve?

This Skill provides comprehensive guidance for implementing hooks in Frappe applications, enabling developers to automate document events, scheduling, permissions, and UI customizations efficiently.

Core Features & Use Cases

  • Event Automation: Simplifies setting up document lifecycle hooks like validate, on_submit, and on_cancel for workflows such as invoicing, order processing, and audit logging.
  • Scheduled Tasks: Assists in configuring and writing recurring tasks for daily, weekly, or custom intervals, ensuring routine maintenance and data synchronization.
  • UI & Asset Customization: Guides on extending form behaviors, injecting client-side scripts, and managing global assets, enhancing user experience.
  • Permissions & Security: Facilitates the setup of permission query conditions and document-level permission controls, reinforcing data security.
  • Advanced Override & Extension: Explains extension mechanisms like extend_doctype_class and override_doctype_class for scalable customizations.
  • Best Practices & Anti-Patterns: Highlights common pitfalls such as committing inside hooks, infinite loops, and security risks with clear solutions.
  • Example Patterns: Provides ready-to-use code snippets for typical hook implementations, simplifying onboarding.
  • Migration Guidance: Offers step-by-step instructions for migrating logic between hooks, controllers, and server scripts, minimizing upgrade risks.

Quick Start

Implement a document validation hook to prevent negative invoice totals by adding a validate handler in your hooks.py, then define the corresponding function in your module.

Frequently Asked Questions about frappe-impl-hooks

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

FAQPage Schema
How do I implement document event hooks in Frappe to validate sales invoices?

To implement document event hooks for validating sales invoices, define a handler function in your module and register it in the validate event within hooks.py to check for non-negative totals before submission.

Can I extend Frappe doctype classes for scalable UI and permission customizations?

Yes, you can extend Frappe doctype classes using extension mechanisms like extend_doctype_class and override_doctype_class, allowing you to inject client-side scripts and set document-level permission controls securely.

What are common pitfalls when setting up Frappe hooks for event automation?

Common pitfalls when setting up Frappe hooks include committing transactions inside hooks, triggering infinite loops, and introducing security risks, which you can avoid by following established best practices and anti-pattern guidelines.

How do I migrate logic between Frappe hooks, controllers, and server scripts?

To migrate logic between Frappe hooks, controllers, and server scripts, follow step-by-step migration instructions to relocate your document event handlers safely and minimize upgrade risks.