Agent skill

Frappe Errors Clientscripts

by Impertio-Studio in Impertio-Studio/Frappe_Claude_Skill_Package

A skill your agent uses when debugging or preventing errors in Frappe Client Scripts.

MITAuto-check passedDevelopment

Install Frappe Errors Clientscripts

skills CLI
$ npx skills add Impertio-Studio/Frappe_Claude_Skill_Package --skill frappe-errors-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-errors-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/errors/frappe-errors-clientscripts .claude/skills/frappe-errors-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-errors-clientscripts
GitHub stars
187
Token cost
~2.4k tokens
SKILL.md length
508 words
Files
4 (incl. references)
Skills in repo
61
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when debugging or preventing errors in Frappe Client Scripts.

  • Works in 6 steps: cur_frm vs frm: The #1 Beginner Mistake → Async/Await: Silent Failure Without… → Child Table Access: Wrong Pattern → …
  • Preventing errors in Frappe Client Scripts
  • SKILL.md covers Error Diagnosis Flowchart, Error Message → Cause → Fix…, Critical Error Patterns and Debug Tools, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Frappe Errors Clientscripts is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package. Use when debugging or preventing errors in Frappe Client Scripts. Prevents TypeError, frappe.call failures, async/await mistakes, curfrm vs frm confusion, field not found, child table access errors, timing issues, CSRF token errors, and permission denied on frappe.call. Covers error diagnosis flowchart and debug tools for v14/v15/v16. Keywords: client script error, TypeError, frappe.call, async await,, Cannot read properties of undefined, TypeError, browser console error, script not running, form not updating…

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/anti-patterns.md`, `references/examples.md` and `references/patterns.md`). Compatibility notes: Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.

It sits in Development, covering Async programming, Web application vulnerabilities and Diagrams. 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

  • Preventing errors in Frappe Client Scripts
  • Tasks that involve Async programming
  • Tasks that involve Web application vulnerabilities

Example prompts

  • “/frappe-errors-clientscripts”

Requirements

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

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. cur_frm vs frm: The #1 Beginner Mistake
  2. Async/Await: Silent Failure Without try/catch
  3. Child Table Access: Wrong Pattern
  4. Timing: setup vs refresh
  5. frappe.throw() Scope: Only Works in validate
  6. Recursion Guard with Flags

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).

    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 Errors Clientscripts loads about 2.4k tokens when it runs, and up to ~9.1k if it reads all its reference files. Until then it costs about 152 tokens; SKILL.md has 508 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~152
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
~9.1k

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). 508 words, ~2,441 tokens.

Download SKILL.mdSave it as .claude/skills/frappe-errors-clientscripts/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
frappe-errors-clientscripts
description
Use when debugging or preventing errors in Frappe Client Scripts. Prevents TypeError, frappe.call failures, async/await mistakes, cur_frm vs frm confusion, field not found, child table access errors, timing issues, CSRF token errors, and permission denied on frappe.call. Covers error diagnosis flowchart and debug tools for v14/v15/v16. Keywords: client script error, TypeError, frappe.call, async await,, Cannot read properties of undefined, TypeError, browser console error, script not running, form not updating. cur_frm, field not found, child table, CSRF, permission denied.
compatibility
Claude Code, Claude.ai Projects, Claude API. Frappe v14-v16.
license
MIT
metadata.author
OpenAEC-Foundation
metadata.version
2.0

Client Script Errors — Diagnosis and Resolution

Cross-refs: frappe-syntax-clientscripts (syntax), frappe-impl-clientscripts (workflows), frappe-errors-serverscripts (server-side).


Error Diagnosis Flowchart

ERROR IN CLIENT SCRIPT
│
├─► TypeError: Cannot read properties of undefined
│   ├─► "frm.doc.fieldname" → Field does not exist on DocType
│   ├─► "r.message.value" → Server returned null/error
│   └─► "row.fieldname" in child table → Row not fetched correctly
│
├─► frappe.call fails silently
│   ├─► Missing error callback → Add error handler
│   ├─► 403 Forbidden → Method not whitelisted (@frappe.whitelist)
│   ├─► 417 Expectation Failed → Server-side frappe.throw()
│   └─► 401 Unauthorized → Session expired or CSRF token invalid
│
├─► Uncaught (in promise) → Missing try/catch on async frappe.call
│
├─► Field appears blank after set_value → Timing issue (setup vs refresh)
│
├─► cur_frm is undefined → Using cur_frm in list/report context
│
└─► frappe.throw() does not prevent save → Used outside validate event

Error Message → Cause → Fix Table

Error MessageCauseFix
TypeError: Cannot read properties of undefined (reading 'fieldname')Field does not exist on DocType or doc not loadedALWAYS check frm.doc exists before accessing fields
TypeError: frm.set_value is not a functionUsing cur_frm shortcut that is undefinedALWAYS use the frm parameter from event handler
Uncaught (in promise)Unhandled async rejection from frappe.callALWAYS wrap async calls in try/catch
CSRFTokenError / 403 with CSRFToken mismatch after session timeoutALWAYS use frappe.call() (handles CSRF automatically)
Not permitted / 403 on frappe.callServer method missing @frappe.whitelist()ALWAYS add @frappe.whitelist() decorator to API methods
frappe.throw() not preventing savefrappe.throw() used outside validate eventALWAYS use frappe.throw() only in validate
field not found: xyz in set_queryFieldname typo or field not in child tableVerify exact fieldname against DocType definition
row.item_code is undefinedAccessing child row wrong — locals not syncedUse frappe.get_doc(cdt, cdn) in child table events
frm.set_value not workingCalled in setup before form fully loadedMove field-setting logic to refresh event
Maximum call stack exceededCircular trigger — field change fires own handlerUse frm.flags guard to break recursion

Critical Error Patterns

1. cur_frm vs frm: The #1 Beginner Mistake
javascript
// ❌ WRONG — cur_frm is undefined in many contexts
frappe.ui.form.on('Sales Order', {
    customer(frm) {
        cur_frm.set_value('territory', 'Default');  // BREAKS in list view
    }
});

// ✅ CORRECT — ALWAYS use the frm parameter
frappe.ui.form.on('Sales Order', {
    customer(frm) {
        frm.set_value('territory', 'Default');
    }
});

Rule: NEVER use cur_frm. ALWAYS use the frm parameter passed to every event handler.

2. Async/Await: Silent Failure Without try/catch
javascript
// ❌ WRONG — Unhandled rejection crashes silently
frappe.ui.form.on('Sales Order', {
    async customer(frm) {
        let r = await frappe.call({
            method: 'myapp.api.get_data',
            args: { customer: frm.doc.customer }
        });
        frm.set_value('credit_limit', r.message.limit);  // r.message may be null
    }
});

// ✅ CORRECT — try/catch with null check
frappe.ui.form.on('Sales Order', {
    async customer(frm) {
        if (!frm.doc.customer) return;
        try {
            let r = await frappe.call({
                method: 'myapp.api.get_data',
                args: { customer: frm.doc.customer }
            });
            if (r.message) {
                frm.set_value('credit_limit', r.message.limit || 0);
            }
        } catch (error) {
            console.error('Customer fetch failed:', error);
            frappe.show_alert({
                message: __('Could not load customer details'),
                indicator: 'red'
            }, 5);
        }
    }
});
3. Child Table Access: Wrong Pattern
javascript
// ❌ WRONG — frm.doc.items[0] may not reflect latest state
frappe.ui.form.on('Sales Order Item', {
    item_code(frm, cdt, cdn) {
        let row = frm.doc.items.find(r => r.name === cdn);  // fragile
        row.rate = 100;  // Does not trigger UI refresh
    }
});

// ✅ CORRECT — Use frappe.get_doc and frappe.model.set_value
frappe.ui.form.on('Sales Order Item', {
    item_code(frm, cdt, cdn) {
        let row = frappe.get_doc(cdt, cdn);
        if (!row.item_code) return;
        frappe.model.set_value(cdt, cdn, 'rate', 100);  // Triggers refresh
    }
});
4. Timing: setup vs refresh
javascript
// ❌ WRONG — set_value in setup, form not ready
frappe.ui.form.on('Sales Order', {
    setup(frm) {
        frm.set_value('company', 'My Company');  // May not work
    }
});

// ✅ CORRECT — set_query in setup, set_value in refresh/onload
frappe.ui.form.on('Sales Order', {
    setup(frm) {
        // Filters belong in setup
        frm.set_query('customer', () => ({ filters: { disabled: 0 } }));
    },
    refresh(frm) {
        // Value changes belong in refresh (or onload for new docs)
        if (frm.is_new()) {
            frm.set_value('company', 'My Company');
        }
    }
});
5. frappe.throw() Scope: Only Works in validate
javascript
// ❌ WRONG — throw in customer change does NOT prevent save
frappe.ui.form.on('Sales Order', {
    customer(frm) {
        if (!frm.doc.customer) {
            frappe.throw(__('Customer required'));  // Stops script, NOT save
        }
    }
});

// ✅ CORRECT — throw in validate prevents save
frappe.ui.form.on('Sales Order', {
    customer(frm) {
        if (!frm.doc.customer) {
            frappe.msgprint({ message: __('Customer required'), indicator: 'orange' });
        }
    },
    validate(frm) {
        if (!frm.doc.customer) {
            frappe.throw(__('Customer is required'));  // Prevents save
        }
    }
});
6. Recursion Guard with Flags
javascript
// ❌ WRONG — discount change triggers amount recalc, which triggers discount...
frappe.ui.form.on('Sales Order', {
    discount_percent(frm) {
        frm.set_value('grand_total', calculate(frm));  // Fires on_change loop
    }
});

// ✅ CORRECT — Use flags to break the cycle
frappe.ui.form.on('Sales Order', {
    discount_percent(frm) {
        if (frm.flags.skip_recalc) return;
        frm.flags.skip_recalc = true;
        frm.set_value('grand_total', calculate(frm));
        frm.flags.skip_recalc = false;
    }
});

Debug Tools

ToolHow to UseWhen
Browser Console (F12)console.log(frm.doc)Inspect form state
console.table()console.table(frm.doc.items)View child table rows
JSON.parse(JSON.stringify(frm.doc))Deep-clone for snapshotAvoid circular refs in console
frappe.boot.developer_modeCheck if dev mode onConditional debug logging
frappe.ui.toolbar.clear_cache()Clear client cacheAfter deploying script changes
Network tab (F12)Filter XHR requestsInspect frappe.call payloads
frappe.show_alert({message: 'debug', indicator: 'blue'}, 5)Visual debug in UIQuick feedback without console

Show full SKILL.md (186 more words)Show less

ALWAYS / NEVER Rules

ALWAYS
  1. Use the frm parameter — NEVER use cur_frm [v14+]
  2. Wrap async frappe.call in try/catch — Unhandled rejections fail silently
  3. Use __() for all user-facing strings — Required for translation
  4. Collect multiple validation errors before calling frappe.throw()
  5. Use frappe.get_doc(cdt, cdn) to access child table rows in events
  6. Put frappe.throw() only in validate to prevent save
  7. Check r.message for null before accessing server response properties
  8. Use frappe.model.set_value(cdt, cdn, field, value) in child table events
NEVER
  1. NEVER use alert(), confirm(), or prompt() — Use frappe.msgprint / frappe.confirm
  2. NEVER expose stack traces to users — Log to console, show friendly message
  3. NEVER use cur_frm — It is unreliable and undefined in many contexts
  4. NEVER leave console.log in production — Use conditional frappe.boot.developer_mode check
  5. NEVER mix .then() and await in the same function — Pick one pattern
  6. NEVER call frm.set_value in setup — Form is not ready; use refresh or onload
  7. NEVER ignore the error callback on frappe.call when using callback style

Reference Files

FileContents
references/examples.mdReal error scenarios with diagnosis
references/anti-patterns.mdCommon mistakes with before/after fixes
references/patterns.mdDefensive error handling patterns

© 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/errors/frappe-errors-clientscripts of Impertio-Studio/Frappe_Claude_Skill_Package.

  • SKILL.md
  • references/anti-patterns.md
  • references/examples.md
  • references/patterns.md

Open the folder on GitHubat commit 36cfa80

Compare with similar skills

Frappe Errors 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 Errors Clientscripts compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Frappe Errors Clientscripts this skillImpertio-Studio/Frappe_Claude_Skill_Package187—~2.4kAutomated safety check: PassMIT
Wooyun Legacytanweai/wooyun-legacy1.8k—~1.9kAutomated safety check: PassCustom licence
Debugging Output And Previewing HTML Using Rayanonaddy/anonaddy4.9k—~2.3kAutomated safety check: PassAGPL-3.0
Go Concurrency Patternswshobson/agents40k9 repos~693Automated safety check: PassMIT
Julessanjay3290/ai-skills4311 repos~2.1kAutomated safety check: PassApache-2.0
DebuggerTheDecipherist/claude-code-mastery-project-starter-kit338—~669Automated safety check: NotesMIT

Similar skills

  • Wooyun Legacy

    tanweai/wooyun-legacy

    WooYun business logic vulnerability methodology — 22,132 real cases across 6 domains (authentication bypass, authorization bypass, payment tampering, information disclosure, logic flaws…

    1.8k GitHub stars~1.9k tokensUpdated 2 mo ago
    SecurityAuto-check passed
  • A skill your agent uses when user says "send to Ray," "show in Ray," "debug in Ray," "log to Ray," "display in Ray," or wants to visualize data, debug output, or show diagrams in the Ray desktop…

    4.9k GitHub stars~2.3k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Reference patterns for goroutines, channels, sync primitives and context in Go, covering worker pools, pipelines, graceful shutdown and race-condition debugging.

    40k GitHub starsUsed in 9 repos~693 tokens
    DevelopmentAuto-check passed
  • Jules

    sanjay3290/ai-skills

    Delegate coding tasks to Google Jules AI agent for asynchronous execution.

    431 GitHub starsUsed in 1 repo~2.1k tokens
    DevelopmentAuto-check passed
  • Debugger

    TheDecipherist/claude-code-mastery-project-starter-kit

    Diagnose failures by root cause, not symptom. An agent skill from TheDecipherist/claude-code-mastery-project-starter-kit.

    338 GitHub stars~669 tokensUpdated 3 mo ago
    DevelopmentAuto-check: notes
  • Supabase Advanced Troubleshooting

    jeremylongshore/tons-of-skills-marketplace

    Deep Supabase diagnostics: pgstatstatements for slow queries, lock debugging with pglocks, connection leak detection, RLS policy conflicts, Edge Function cold starts, and Realtime connection drop…

    2.8k GitHub stars~2.8k tokensUpdated today
    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 Errors Clientscripts

What does Frappe Errors Clientscripts do?

A skill your agent uses when debugging or preventing errors in Frappe Client Scripts. Frappe Errors Clientscripts is an agent skill from Impertio-Studio/Frappe_Claude_Skill_Package. Use when debugging or preventing errors in Frappe Client Scripts.

When should I use Frappe Errors Clientscripts?

Frappe Errors Clientscripts fits situations like: preventing errors in Frappe Client Scripts; tasks that involve Async programming; tasks that involve Web application vulnerabilities.

How do I install Frappe Errors Clientscripts in Claude Code?

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

How do I install Frappe Errors Clientscripts in Codex?

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

Can I use Frappe Errors 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-errors-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-errors-clientscripts, .gemini/skills/frappe-errors-clientscripts, .github/skills/frappe-errors-clientscripts and .opencode/skills/frappe-errors-clientscripts in your project.

What does Frappe Errors Clientscripts need to run?

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

Does Frappe Errors 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 Errors 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 Errors Clientscripts use?

Frappe Errors 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 Errors Clientscripts use?

About 2.4k tokens (SKILL.md is roughly 9.8k 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 6.7k tokens, read only when the agent opens those files.

What are the alternatives to Frappe Errors Clientscripts?

Skills that share tags, products or a category with Frappe Errors Clientscripts: Wooyun Legacy (tanweai/wooyun-legacy, 1.8k stars), Debugging Output And Previewing HTML Using Ray (anonaddy/anonaddy, 4.9k stars), Go Concurrency Patterns (wshobson/agents, 40k stars) and Jules (sanjay3290/ai-skills, 431 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Frappe Errors 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.