frappe-syntax-hooks

Write Frappe hooks.py configurations with correct syntax and handler signatures.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This skill prevents Frappe/ERPNext hook configuration mistakes that can silently break production behavior, routing, scheduler jobs, permissions, and overrides.

Core Features & Use Cases

  • Hook category coverage: app metadata, frontend asset injection, installation/migration lifecycle, scheduler events, session/auth hooks, request middleware, permissions, DocType overrides/extensions, website/portal routing, files, email, PDF, Jinja, boot/client data, fixtures, and method overrides.
  • Version-aware guidance (v14/v15/v16): includes v16+ extend_doctype_class recommendations and v14/v15 override behavior notes.
  • Production guardrails: emphasizes required bench migrate after hooks.py changes and highlights common anti-patterns like heavy work in bootinfo or mismatched override signatures.

Quick Start

Use the frappe-syntax-hooks skill when writing hooks.py for a custom ERPNext app that needs scheduler tasks, website routing, permission filtering, and safe controller extensions.

Frequently Asked Questions about frappe-syntax-hooks

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

FAQPage Schema
How do I configure scheduler events in Frappe hooks.py?ā–¼

Configure scheduler events in Frappe hooks.py by mapping cron syntax to handler functions within the scheduler_events dictionary. This Skill provides deterministic patterns to ensure production-safe background job execution for v14/v15/v16.

What's the best way to override DocType controllers in Frappe without breaking production?ā–¼

The best way to override DocType controllers is using version-aware patterns like v16+ extend_doctype_class or v14/v15 override behavior notes. This ensures safe controller extensions with correct signatures and required bench migrate steps.

Why do my Frappe website routing customizations fail after updating hooks.py?ā–¼

Frappe website routing customizations fail when hooks.py contains incorrect syntax or omits required operational steps. Applying production-safe routing configurations and running bench migrate after hooks changes resolves these issues.

Can I use Frappe hooks.py to enforce custom permissions and request middleware?ā–¼

Yes, Frappe hooks.py supports custom permissions and request middleware configuration. This Skill delivers deterministic guidance for permission enforcement and middleware with safe SQL practices across v14/v15/v16.

What are common anti-patterns when writing Frappe hooks.py for bootinfo and frontend assets?ā–¼

Common anti-patterns include performing heavy work in bootinfo and mismatched override signatures for frontend asset injection. Production-safe patterns avoid these issues by ensuring correct hook syntax and handler signatures.