frappe-syntax-serverscripts

Write sandbox-safe Frappe Server Scripts with correct event-to-hook mappings.

Updated May 31, 2026
One-click install
npx skills add https://github.com/anonymousminati/Res-POS --skill frappe-syntax-serverscripts-anonymousminati
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: frappe-syntax-serverscripts
Source: https://github.com/anonymousminati/Res-POS/tree/main/.claude/skills/syntax/frappe-syntax-serverscripts
Command: npx skills add https://github.com/anonymousminati/Res-POS --skill frappe-syntax-serverscripts-anonymousminati

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill helps you write Frappe and ERPNext Server Scripts correctly the first time, avoiding sandbox failures, import-related errors, and hook confusion that often break automation in production.

Core Features & Use Cases

  • Sandbox-safe Python guidance: Explains what is available inside Server Scripts and what is blocked, including the no-import rule and the preloaded frappe namespace.
  • Event mapping and lifecycle control: Clarifies which UI events map to internal hooks so you can choose the right trigger for validation, calculation, submission, cancellation, or cleanup.
  • API, scheduler, and permission patterns: Provides ready-to-apply patterns for whitelisted endpoints, cron jobs, and role-based filtering.
  • Use case: A custom ERPNext workflow needs to validate a document, auto-fill linked values, expose a small API, and run nightly cleanup without moving logic into a custom app.

Quick Start

Ask for a Server Script pattern for your specific Frappe DocType event, and include the script type, goal, and any fields or validation rules you want handled.

Frequently Asked Questions about frappe-syntax-serverscripts

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

FAQPage Schema
How do I write Frappe Server Scripts without triggering sandbox errors?▼

To write Frappe Server Scripts without sandbox errors, you must use the preloaded frappe namespace and avoid any imports. Your logic must be sandbox-compatible, using parameterized database access to prevent execution failures.

What is the correct event-to-hook mapping for ERPNext Document Events?▼

Event-to-hook mapping for ERPNext Document Events links UI triggers to internal hooks, allowing you to specify exact lifecycle phases for validation, calculation, submission, cancellation, or cleanup operations.

Can I create API endpoints and Scheduler Events using Frappe Server Scripts?▼

Yes, you can create API endpoints and Scheduler Events using Frappe Server Scripts. The system provides ready-to-apply patterns for whitelisted endpoints and cron jobs without needing a custom app.

Why does my Frappe Server Script fail when I try to import a Python module?▼

Frappe Server Scripts fail upon importing Python modules because the sandbox environment enforces a strict no-import rule. You must rely solely on the preloaded frappe namespace for all automation logic.

How do I configure Permission Queries for role-based filtering in ERPNext?▼

To configure Permission Queries for role-based filtering in ERPNext, apply the provided parameterized database access patterns within your Server Script to securely restrict document visibility based on user roles.

Do I need to build a custom Frappe app to automate document validation?▼

No, you do not need to build a custom Frappe app to automate document validation. You can handle validation, auto-filling linked values, and nightly cleanup directly within sandbox-safe Server Scripts.