frappe-impl-hooks

Configure Frappe hooks.py for doc_events, scheduler_events, permissions, and DocType overrides.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-hooks-impertio-studio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frappe-impl-hooks
Source: https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package/tree/main/skills/source/impl/frappe-impl-hooks
Command: npx skills add https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-hooks-impertio-studio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents production-breaking Frappe customizations by guiding you through correct, version-aware implementation of hooks.py configurations in custom apps, including the safest transaction and handler-signature patterns.

Core Features & Use Cases

  • doc_events workflows: Implement document lifecycle handlers for external DocTypes using the correct event mapping and safe handler signatures to avoid lost changes and silent failures.
  • scheduler_events workflows: Configure scheduled jobs (including cron and long-running tasks) with the correct “no arguments” constraint and queue/timeout strategy.
  • override/extend permission, assets, and fixtures: Apply the right approach per Frappe version for extending DocType behavior (V16 extend vs V14/15 override), enforce list/document permissions, and inject bootinfo/assets/doctype_js and scoped fixtures to avoid cross-app conflicts.

Use Case Example: You need to add validation and follow-up logic to an ERPNext Sales Invoice from your custom app, schedule a daily reconciliation job, and ensure only the right users can see invoice lists and cancel closed records—without breaking transactions, migrations, or multi-app override behavior.

Quick Start

Ask the AI: Implement hooks.py for a Frappe custom app to add doc_events for Sales Invoice validate and on_submit, create a daily_long scheduler task for sync, enforce permission_query_conditions and has_permission, and wire extend_bootinfo and doctype_js while following correct handler signatures and migrate steps.

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 doc_events in Frappe hooks.py without breaking transactions?

To implement doc_events in Frappe hooks.py safely, map document lifecycle events to handlers using correct signatures and avoid manual commits to prevent lost changes and silent failures during transactions.

What is the difference between extend_doctype_class and override_doctype_class in Frappe?

In Frappe, extend_doctype_class is the version-appropriate method for V16 to safely extend DocType behavior, whereas override_doctype_class applies to V14 and V15 for overriding classes.

How do I configure scheduler_events for daily and long-running tasks in Frappe?

Configure Frappe scheduler_events by mapping daily, cron, or _long queues to handler functions, ensuring the no-argument constraint is met and applying the correct timeout strategy for long-running jobs.

Can I enforce custom permissions and bootinfo injections through Frappe hooks?

Yes, you can enforce list and document permissions using permission_query_conditions and has_permission, and inject bootinfo or assets via hooks to control access and extend client-side functionality.

Why do my Frappe fixtures cause cross-app conflicts during migration?

Frappe fixtures cause cross-app conflicts when unscoped, so you must apply scoped fixtures in hooks.py to isolate custom app data and ensure clean migrations across multiple installed apps.