Agent skill

Frappe Impl Clientscripts

by Impertio-Studio in Impertio-Studio/Frappe_Claude_Skill_Package

A skill your agent uses when implementing client-side form features in Frappe/ERPNext: field visibility, cascading filters, calculated fields, custom buttons, server calls, form validation, child…

MITAuto-check passedDevelopment

Install Frappe Impl Clientscripts

skills CLI
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-clientscripts -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Impertio-Studio/Frappe_Claude_Skill_Package frappe-impl-clientscripts --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Impertio-Studio/Frappe_Claude_Skill_Package.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/source/impl/frappe-impl-clientscripts .claude/skills/frappe-impl-clientscripts && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
frappe-impl-clientscripts
GitHub stars
187
Token cost
~2.4k tokens
SKILL.md length
561 words
Files
4 (incl. references)
Skills in repo
61
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when implementing client-side form features in Frappe/ERPNext: field visibility, cascading filters, calculated fields, custom buttons, server calls, form validation, child…

  • Works in 7 steps: Navigate to Setup > Client Script (or… → Select the target DocType → ALWAYS set Enabled checkbox → …
  • Implementing client-side form features in Frappe/ERPNext: field visibility
  • SKILL.md covers Quick Decision: Client or…, Workflow 1: Create a Client…, Workflow 2: Choose the Right… and Workflow 3: Field Visibility…, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Frappe Impl Clientscripts is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package. Use when implementing client-side form features in Frappe/ERPNext: field visibility, cascading filters, calculated fields, custom buttons, server calls, form validation, child table logic, debugging. Covers step-by-step workflows from Setup Client Script through migration to custom app JS. Keywords: how to implement client script, form logic workflow, dynamic UI, calculate fields, frm.call, frappe.call, frappe.xcall, client script testing, field dependency, custom button, how to hide field, show field based on…

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/decision-tree.md`, `references/examples.md` and `references/workflows.md`). Compatibility notes: Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.

It sits in Development, covering Forms and validation and Debugging. The repository describes itself as: 60 deterministic Claude AI skills for Frappe Framework & ERPNext v14-v16 development and operations. The licence is MIT.

When your agent uses it

  • Implementing client-side form features in Frappe/ERPNext: field visibility
  • Cascading filters
  • Calculated fields
  • Form validation

Example prompts

  • “/frappe-impl-clientscripts”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Navigate to Setup > Client Script (or type "New Client Script" in awesomebar)
  2. Select the target DocType
  3. ALWAYS set Enabled checkbox
  4. Write script using the frappe.ui.form.on pattern
  5. Save — script is active immediately (no restart needed)
  6. Open target DocType form → test behavior
  7. Open browser DevTools Console (F12) for debugging

What it can do on your machine

Read from SKILL.md and the folder at commit 36cfa80. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are javascript and python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.

    From compatibility in the SKILL.md frontmatter.

Context cost

Frappe Impl Clientscripts loads about 2.4k tokens when it runs, and up to ~7.9k if it reads all its reference files. Until then it costs about 150 tokens; SKILL.md has 561 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~150
When it runs · the whole SKILL.md, loaded when a task matches
~2.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Impertio-Studio/Frappe_Claude_Skill_Package at commit 36cfa80, republished under its MIT licence (© Impertio-Studio). 561 words, ~2,423 tokens.

Download SKILL.mdSave it as .claude/skills/frappe-impl-clientscripts/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
frappe-impl-clientscripts
description
Use when implementing client-side form features in Frappe/ERPNext: field visibility, cascading filters, calculated fields, custom buttons, server calls, form validation, child table logic, debugging. Covers step-by-step workflows from Setup > Client Script through migration to custom app JS. Keywords: how to implement client script, form logic workflow, dynamic UI, calculate fields, frm.call, frappe.call, frappe.xcall, client script testing, field dependency, custom button, how to hide field, show field based on value, add button to form, calculate total, dynamic form.
compatibility
Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.
license
MIT
metadata.author
OpenAEC-Foundation
metadata.version
2.0

Client Scripts — Implementation Workflows

Step-by-step workflows for building client-side form features. For exact API syntax, see frappe-syntax-clientscripts.

Version: v14/v15/v16 | Note: v13 renamed "Custom Script" to "Client Script"

Quick Decision: Client or Server?

MUST the logic ALWAYS execute (imports, API, Data Import)?
├── YES → Server Script or Controller
└── NO  → What is the goal?
         ├── UI feedback / UX → Client Script
         ├── Show/hide fields → Client Script
         ├── Link filters → Client Script
         ├── Data validation → BOTH (client for UX, server for integrity)
         └── Calculations → Client for display, server for critical

Rule: ALWAYS use Client Scripts for UX. ALWAYS back critical logic with server-side validation.

Workflow 1: Create a Client Script via UI

  1. Navigate to Setup > Client Script (or type "New Client Script" in awesomebar)
  2. Select the target DocType
  3. ALWAYS set Enabled checkbox
  4. Write script using the frappe.ui.form.on pattern
  5. Save — script is active immediately (no restart needed)
  6. Open target DocType form → test behavior
  7. Open browser DevTools Console (F12) for debugging

When to migrate to custom app: ALWAYS migrate when the script exceeds 50 lines, needs version control, or must be deployed across environments.

Workflow 2: Choose the Right Event

WHAT DO YOU WANT?
├── Set link filters         → setup (once, earliest lifecycle)
├── Add custom buttons       → refresh (re-added after each render)
├── Show/hide fields         → refresh + {fieldname} (BOTH needed)
├── Validate before save     → validate (frappe.throw stops save)
├── Action after save        → after_save
├── Calculate on change      → {fieldname} handler
├── Child row added          → {tablename}_add
├── Child row removed        → {tablename}_remove
├── Child field changed      → Child DocType: {fieldname}
├── One-time init            → setup or onload
└── After full DOM render    → onload_post_render

See references/decision-tree.md for complete event timing matrix.

Workflow 3: Field Visibility Toggle

Goal: Show "delivery_date" only when "requires_delivery" is checked.

Step 1: Implement BOTH refresh and fieldname events:

javascript
frappe.ui.form.on('Sales Order', {
    refresh(frm) {
        frm.trigger('requires_delivery'); // Set initial state
    },
    requires_delivery(frm) {
        frm.toggle_display('delivery_date', frm.doc.requires_delivery);
        frm.toggle_reqd('delivery_date', frm.doc.requires_delivery);
    }
});

Why both? refresh sets state on form load. {fieldname} responds to user interaction. NEVER use only one — the form will show wrong state on load or on change.

Goal: Filter "city" based on selected "country".

javascript
frappe.ui.form.on('Customer', {
    setup(frm) {
        // ALWAYS set filters in setup — ensures consistency
        frm.set_query('city', () => ({
            filters: { country: frm.doc.country || '' }
        }));
    },
    country(frm) {
        frm.set_value('city', ''); // ALWAYS clear dependent field
    }
});

Rule: ALWAYS put set_query in setup. ALWAYS clear child fields when parent changes.

Workflow 5: Calculated Fields (Child Table)

Goal: Calculate row amounts and document totals.

javascript
frappe.ui.form.on('Invoice Item', {
    qty(frm, cdt, cdn) { calculate_row(frm, cdt, cdn); },
    rate(frm, cdt, cdn) { calculate_row(frm, cdt, cdn); },
    amount(frm) { calculate_totals(frm); }
});

frappe.ui.form.on('Invoice', {
    items_remove(frm) { calculate_totals(frm); }
});

function calculate_row(frm, cdt, cdn) {
    let row = frappe.get_doc(cdt, cdn);
    frappe.model.set_value(cdt, cdn, 'amount',
        flt(row.qty) * flt(row.rate));
}

function calculate_totals(frm) {
    let total = (frm.doc.items || []).reduce(
        (sum, row) => sum + flt(row.amount), 0);
    frm.set_value('grand_total', flt(total, 2));
}

Rules:

  • ALWAYS use flt() for numeric operations (handles null/undefined)
  • ALWAYS handle items_remove — totals must recalculate on row deletion
  • NEVER call refresh_field after set_value — it triggers automatically

Workflow 6: Server Calls: Which Method to Use

NEED TO CALL THE SERVER?
├── Fetch a single value?
│   └── frappe.db.get_value(doctype, name, fields)
│       Returns: Promise — lightweight, no whitelist needed
│
├── Call a document's controller method?
│   └── frm.call(method, args)
│       Requires: @frappe.whitelist() on controller method
│       Auto-includes: doctype, docname, doc context
│
├── Call a standalone whitelisted function?
│   └── frappe.call({method: 'dotted.path', args: {}})
│       Requires: @frappe.whitelist() decorator
│       Returns: Promise with r.message
│
└── Need Promise-only (no callback)?
    └── frappe.xcall('dotted.path', args)
        Same as frappe.call but returns clean Promise

Example — frm.call:

javascript
frm.call('calculate_taxes').then(r => {
    frm.reload_doc();  // Refresh after server-side changes
});

Example — frappe.xcall:

javascript
let result = await frappe.xcall(
    'myapp.api.check_credit', { customer: frm.doc.customer });

Workflow 7: Custom Button Implementation

javascript
frappe.ui.form.on('Sales Order', {
    refresh(frm) {
        // ALWAYS check conditions before adding buttons
        if (!frm.is_new() && frm.doc.docstatus === 1) {
            frm.add_custom_button(__('Create Invoice'), () => {
                create_invoice(frm);
            }, __('Create'));  // Group label
        }
    }
});

Rules:

  • ALWAYS add buttons in refresh — they are cleared on each render
  • ALWAYS check frm.is_new() — buttons on unsaved docs cause errors
  • ALWAYS wrap button labels in __() for translation
  • NEVER add buttons in setup or onload — UI not ready

Workflow 8: Async Validation with Server Check

javascript
frappe.ui.form.on('Sales Order', {
    async validate(frm) {
        if (!frm.doc.customer || !frm.doc.grand_total) return;

        let r = await frappe.call({
            method: 'myapp.api.check_credit',
            args: {
                customer: frm.doc.customer,
                amount: frm.doc.grand_total
            }
        });

        if (r.message && !r.message.allowed) {
            frappe.throw(__('Credit limit exceeded. Available: {0}',
                [r.message.available]));
        }
    }
});

Rules:

  • ALWAYS use async/await for server calls in validate
  • ALWAYS use frappe.throw() to stop save — msgprint does NOT stop it
  • NEVER put slow server calls in validate without user expectation
Show full SKILL.md (217 more words)Show less

Workflow 9: Debugging in Browser

  1. Open F12 DevTools > Console
  2. Add console.log(frm.doc) in your event handler
  3. Use cur_frm in Console to inspect current form state
  4. Check Network tab for failed frappe.call requests
  5. Use frappe.ui.form.handlers to see registered event handlers

Debug pattern:

javascript
frappe.ui.form.on('MyDocType', {
    my_field(frm) {
        console.log('Field changed:', frm.doc.my_field);
        // ... actual logic
    }
});

Workflow 10: Migrate Client Script to Custom App

  1. Create JS file: myapp/myapp/public/js/sales_order.js
  2. Move script content to the file (keep frappe.ui.form.on wrapper)
  3. Register in hooks.py:
    python
    doctype_js = {
        "Sales Order": "public/js/sales_order.js"
    }
  4. Run bench build (or bench watch for development)
  5. Delete the Client Script document from Setup
  6. Test on the form — behavior must be identical

ALWAYS migrate when: version control needed, multi-environment deployment, script > 50 lines, team collaboration required.

Performance Rules

RuleWhy
set_query in setup onlyPrevents re-registration on every refresh
Batch set_value callsfrm.set_value({a: 1, b: 2}) — one update, not two
Cache server responsesStore in frm._cache_key to avoid repeat calls
NEVER query in loopsFetch all data once, build lookup map
Use frappe.db.get_valueLighter than frappe.call for simple lookups
  • frappe-syntax-clientscripts — Exact API syntax and method signatures
  • frappe-errors-clientscripts — Error handling and common pitfalls
  • frappe-syntax-whitelisted — Server methods callable from client
  • frappe-core-database — frappe.db.* client-side API
  • frappe-impl-serverscripts — When to move logic server-side

See references/decision-tree.md for event selection. See references/workflows.md for extended patterns. See references/examples.md for 10+ complete examples.

© Impertio-Studio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (references) in skills/source/impl/frappe-impl-clientscripts of Impertio-Studio/Frappe_Claude_Skill_Package.

  • SKILL.md
  • references/decision-tree.md
  • references/examples.md
  • references/workflows.md

Open the folder on GitHubat commit 36cfa80

Compare with similar skills

Frappe Impl Clientscripts next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Frappe Impl Clientscripts compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Frappe Impl Clientscripts this skillImpertio-Studio/Frappe_Claude_Skill_Package187—~2.4kAutomated safety check: PassMIT
Corvus Standalone Evaluatorcorvus-dotnet/Corvus.JsonSchema199—~988Automated safety check: PassApache-2.0
Safe SQL Executionsupabase/supabase111k—~4.2kAutomated safety check: PassApache-2.0
Trellis Session Insightmindfold-ai/Trellis15k4 repos~1.7kAutomated safety check: PassAGPL-3.0
Native Data FetchingCherryHQ/cherry-studio-app4k6 repos~2.9kAutomated safety check: NotesMIT
Debugging Executionsn8n-io/n8n207k—~2.6kAutomated safety check: PassCustom licence

Similar skills

  • Corvus Standalone Evaluator

    corvus-dotnet/Corvus.JsonSchema

    Generate and use standalone schema evaluators (validation and annotation collection without full type generation), and understand the schema evaluation program that every generated type validates…

    199 GitHub stars~988 tokensUpdated today
    DevelopmentAuto-check passed
  • Safe SQL Execution

    supabase/supabase

    Official

    A skill your agent uses whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix…

    111k GitHub stars~4.2k tokensUpdated today
    DatabasesAuto-check passed
  • Trellis Session Insight

    mindfold-ai/Trellis

    Reach into past AI conversation history through the trellis mem CLI.

    15k GitHub starsUsed in 4 repos~1.7k tokens
    DevelopmentAuto-check passed
  • Native Data Fetching

    CherryHQ/cherry-studio-app

    A skill your agent uses when implementing or debugging ANY network request, API call, or data fetching.

    4k GitHub starsUsed in 6 repos~2.9k tokens
    DevelopmentAuto-check: notes
  • Official

    Debug failed or wrong-output workflow executions using executions tools.

    207k GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • Aoti Debug

    pytorch/pytorch

    Debug AOTInductor (AOTI) errors and crashes. An agent skill from pytorch/pytorch.

    104k GitHub starsUsed in 1 repo~1.7k tokens
    DevelopmentAuto-check passed

More from Impertio-Studio/Frappe_Claude_Skill_Package

All 61 skills in this repo
  • Frappe Agent Interpreter

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when receiving vague or unclear ERPNext/Frappe development requests that need interpretation.

    187 GitHub starsUsed in 1 repo~3.2k tokens
    Auto-check passed
  • Frappe Ops Website Deploy

    Impertio-Studio/Frappe_Claude_Skill_Package

    Deploy HTML/CSS websites to ERPNext/Frappe (v15/v16) as Web Pages via the REST API.

    187 GitHub stars~2.5k tokensUpdated 21 days ago
    Auto-check passed
  • Frappe Core API

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when building ERPNext/Frappe API integrations (v14/v15/v16) including REST API, RPC API, authentication, webhooks, and rate limiting.

    187 GitHub starsUsed in 1 repo~3.2k tokens
    Auto-check passed
  • Frappe Errors API

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when debugging or handling API errors in Frappe/ERPNext v14/v15/v16.

    187 GitHub starsUsed in 1 repo~4k tokens
    Auto-check passed
  • Frappe Impl Hooks

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when implementing hooks.py configurations in a Frappe custom app.

    187 GitHub starsUsed in 1 repo~3k tokens
    Auto-check passed
  • Frappe Impl Whitelisted

    Impertio-Studio/Frappe_Claude_Skill_Package

    A skill your agent uses when building API endpoints with @frappe.whitelist() in Frappe.

    187 GitHub starsUsed in 1 repo~3.1k tokens
    Auto-check passed

Categories

Questions about Frappe Impl Clientscripts

What does Frappe Impl Clientscripts do?

A skill your agent uses when implementing client-side form features in Frappe/ERPNext: field visibility, cascading filters, calculated fields, custom buttons, server calls, form validation, child…. Frappe Impl Clientscripts is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package. Use when implementing client-side form features in Frappe/ERPNext: field visibility, cascading filters, calculated fields, custom buttons, server calls, form validation, child table logic, debugging.

When should I use Frappe Impl Clientscripts?

Frappe Impl Clientscripts fits situations like: implementing client-side form features in Frappe/ERPNext: field visibility; cascading filters; calculated fields; form validation.

How do I install Frappe Impl Clientscripts in Claude Code?

Run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-clientscripts -a claude-code`. Or copy the skill folder (skills/source/impl/frappe-impl-clientscripts in Impertio-Studio/Frappe_Claude_Skill_Package) into .claude/skills/frappe-impl-clientscripts in your project. Claude Code loads it when a task matches its description.

How do I install Frappe Impl Clientscripts in Codex?

Run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-clientscripts -a codex`. Or copy the skill folder (skills/source/impl/frappe-impl-clientscripts in Impertio-Studio/Frappe_Claude_Skill_Package) into .agents/skills/frappe-impl-clientscripts in your project. Codex loads it when a task matches its description.

Can I use Frappe Impl Clientscripts in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-impl-clientscripts -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/frappe-impl-clientscripts, .gemini/skills/frappe-impl-clientscripts, .github/skills/frappe-impl-clientscripts and .opencode/skills/frappe-impl-clientscripts in your project.

What does Frappe Impl Clientscripts need to run?

SKILL.md names no scripts, command-line tools or credentials: Frappe Impl Clientscripts is instructions for the agent only. Our summary lists: Python 3. Compatibility (from SKILL.md): Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16..

Does Frappe Impl Clientscripts access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Frappe Impl Clientscripts safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Frappe Impl Clientscripts use?

Frappe Impl Clientscripts is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Frappe Impl Clientscripts use?

About 2.4k tokens (SKILL.md is roughly 9.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 5.5k tokens, read only when the agent opens those files.

What are the alternatives to Frappe Impl Clientscripts?

Skills that share tags, products or a category with Frappe Impl Clientscripts: Corvus Standalone Evaluator (corvus-dotnet/Corvus.JsonSchema, 199 stars), Safe SQL Execution (supabase/supabase, 111k stars), Trellis Session Insight (mindfold-ai/Trellis, 15k stars) and Native Data Fetching (CherryHQ/cherry-studio-app, 4k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Frappe Impl Clientscripts?

Impertio-Studio (a GitHub organization) maintains it in Impertio-Studio/Frappe_Claude_Skill_Package, which has 187 GitHub stars. The repository holds 61 skills in this directory. The repository was last updated on September 17, 2026.

Source: Impertio-Studio/Frappe_Claude_Skill_Package on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.