Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计通过

frappe-desk-customization冰沙办公桌定制

Agent Skill

frappe-desk-customization 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,687

周安装

71

GitHub Stars

16

下载量

591
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:frappe-desk-customization(冰沙办公桌定制)
来源仓库:https://github.com/lubusin/agent-skills
仓库路径:skills/frappe-desk-customization
安装命令:
npx skills add https://github.com/lubusin/agent-skills --skill frappe-desk-customization
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/lubusin/agent-skills --skill frappe-desk-customization

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息。

  • 适合在需要围绕仓库状态或代码变更进行整理时使用。frappe-desk-customization 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发不必要操作。
  • 注意是否会触发联网、命令执行或文件读写,确保安全使用。

SKILL.md

Frappe Desk Customization

Customize the Frappe Desk admin UI with form scripts, list views, dialogs, and client-side APIs.

When to use

  • Adding custom buttons or actions to forms
  • Filtering Link fields dynamically
  • Toggling field visibility based on conditions
  • Customizing list view indicators and bulk actions
  • Building interactive dialogs and prompts
  • Adding client-side validation before save
  • Injecting scripts into other apps' DocTypes via hooks

Inputs required

  • Target DocType for customization
  • Whether script is app-level (version controlled) or Client Script (site-specific)
  • Events to hook into (refresh, validate, field change, etc.)
  • UI behavior requirements (buttons, filters, visibility)

Procedure

0) Choose script type

TypeLocationVersion ControlledUse Case
App-level form script<app>/<module>/doctype/<doctype>/<doctype>.jsYesStandard app behavior
Client ScriptDocType: Client ScriptNo (DB)Site-specific customization
Hook-injected scriptVia doctype_js in hooks.pyYesExtend other apps' DocTypes

1) Write form scripts

frappe.ui.form.on("My DocType", {
    // Called once during form setup
    setup(frm) {
        frm.set_query("customer", function() {
            return {
                filters: { "status": "Active" }
            };
        });
    },

    // Called every time form loads or refreshes
    refresh(frm) {
        if (frm.doc.status === "Draft") {
            frm.add_custom_button(__("Submit for Review"), function() {
                frappe.call({
                    method: "my_app.api.submit_for_review",
                    args: { name: frm.doc.name },
                    callback(r) {
                        frm.reload_doc();
                    }
                });
            }, __("Actions"));
        }

        // Toggle field visibility
        frm.toggle_display("discount_section", frm.doc.grand_total > 1000);

        // Set field properties
        frm.set_df_property("notes", "read_only", frm.doc.docstatus === 1);
    },

    // Called before save — return false to cancel
    validate(frm) {
        if (frm.doc.end_date < frm.doc.start_date) {
            frappe.msgprint(__("End date must be after start date"));
            frappe.validated = false;
        }
    },

    // Field change handler (use fieldname as key)
    customer(frm) {
        if (frm.doc.customer) {
            frappe.db.get_value("Customer", frm.doc.customer, "territory",
                function(r) {
                    frm.set_value("territory", r.territory);
                }
            );
        }
    },

    // Before save hook
    before_save(frm) {
        frm.doc.full_name = `${frm.doc.first_name} ${frm.doc.last_name}`;
    },

    // After save hook
    after_save(frm) {
        frappe.show_alert({
            message: __("Document saved successfully"),
            indicator: "green"
        });
    }
});

// Child table events
frappe.ui.form.on("My DocType Item", {
    qty(frm, cdt, cdn) {
        let row = locals[cdt][cdn];
        frappe.model.set_value(cdt, cdn, "amount", row.qty * row.rate);
        calculate_total(frm);
    },

    items_remove(frm) {
        calculate_total(frm);
    }
});

function calculate_total(frm) {
    let total = 0;
    (frm.doc.items || []).forEach(row => {
        total += row.amount || 0;
    });
    frm.set_value("grand_total", total);
}

2) Build dialogs and prompts

// Simple prompt
frappe.prompt(
    { fieldname: "reason", fieldtype: "Small Text", label: "Reason", reqd: 1 },
    function(values) {
        frappe.call({
            method: "my_app.api.reject",
            args: { name: frm.doc.name, reason: values.reason }
        });
    },
    __("Rejection Reason"),
    __("Reject")
);

// Multi-field dialog
let d = new frappe.ui.Dialog({
    title: __("Configure Settings"),
    fields: [
        { fieldname: "email", fieldtype: "Data", options: "Email", label: "Email", reqd: 1 },
        { fieldname: "frequency", fieldtype: "Select", options: "Daily\nWeekly\nMonthly", label: "Frequency" },
        { fieldname: "active", fieldtype: "Check", label: "Active", default: 1 }
    ],
    primary_action_label: __("Save"),
    primary_action(values) {
        frappe.call({
            method: "my_app.api.save_settings",
            args: values,
            callback() {
                d.hide();
                frappe.show_alert({ message: __("Settings saved"), indicator: "green" });
            }
        });
    }
});
d.show();

// Confirmation dialog
frappe.confirm(
    __("Are you sure you want to delete this?"),
    function() { /* Yes */ },
    function() { /* No */ }
);

3) Make server calls

// Standard call (callback)
frappe.call({
    method: "my_app.api.get_stats",
    args: { customer: frm.doc.customer },
    freeze: true,
    freeze_message: __("Loading..."),
    callback(r) {
        if (r.message) {
            frm.set_value("total_orders", r.message.total);
        }
    }
});

// Promise-based call
let result = await frappe.xcall("my_app.api.get_stats", {
    customer: frm.doc.customer
});

4) Customize list views

// my_app/public/js/sample_doc_list.js
// or via hooks: doctype_list_js = {"Sample Doc": "public/js/sample_doc_list.js"}

frappe.listview_settings["Sample Doc"] = {
    // Status indicator colors
    get_indicator(doc) {
        if (doc.status === "Open") return [__("Open"), "orange", "status,=,Open"];
        if (doc.status === "Closed") return [__("Closed"), "green", "status,=,Closed"];
        return [__("Draft"), "grey", "status,=,Draft"];
    },

    // Add bulk actions
    onload(listview) {
        listview.page.add_action_item(__("Mark as Closed"), function() {
            let names = listview.get_checked_items(true);
            frappe.call({
                method: "my_app.api.bulk_close",
                args: { names },
                callback() { listview.refresh(); }
            });
        });
    },

    // Hide default "New" button
    hide_name_column: true
};

5) Use realtime events

// Listen for server-side events
frappe.realtime.on("export_complete", function(data) {
    frappe.show_alert({
        message: __("Export complete: {0} records", [data.count]),
        indicator: "green"
    });
});

6) Inject scripts via hooks

To extend a DocType from another app without modifying it:

# hooks.py
doctype_js = {
    "Sales Order": "public/js/sales_order_custom.js"
}

doctype_list_js = {
    "Sales Order": "public/js/sales_order_list_custom.js"
}
# Rebuild assets after adding hook scripts
bench build --app my_app

7) Navigation and routing

// Navigate to a document
frappe.set_route("Form", "Sales Order", "SO-001");

// Navigate to list with filters
frappe.route_options = { "status": "Open" };
frappe.set_route("List", "Sales Order");

// Get current route
let route = frappe.get_route();

Verification

  • Form script loads without JS console errors
  • Custom buttons appear in correct conditions
  • Field visibility toggles work
  • Link field filters return correct options
  • Validation prevents invalid saves
  • List view indicators display correctly
  • Dialogs open, collect input, and submit

Failure modes / debugging

  • Script not loading: Check file path matches DocType; run bench build
  • Button not appearing: Check condition logic in refresh; verify frm.doc.docstatus
  • Event not firing: Verify event name matches exactly (case-sensitive)
  • Hook script ignored: Check hooks.py path; rebuild assets
  • frappe.call failing: Check method path; verify @frappe.whitelist() on server

Escalation

  • For server-side controller logic → frappe-doctype-development
  • For RPC endpoint implementation → frappe-api-development
  • For Frappe UI (Vue 3) frontends → frappe-frontend-development

References

Guardrails

  • Use frm.doc not doc directly: Always access document via frm.doc for consistency and reactivity
  • Validate before save: Use frm.validate() in validate event, not before_save
  • Async awareness: frappe.call() is async; use callbacks or async/await for sequential operations
  • Refresh after field changes: Call frm.refresh_field() or frm.refresh_fields() after programmatic changes
  • Check frm.is_new() appropriately: Some operations only make sense on saved documents

Common Mistakes

MistakeWhy It FailsFix
Missing frm.refresh_field() after set_valueUI doesn't updateCall frm.refresh_field('fieldname') after frm.set_value()
Wrong event hook nameEvent never firesUse exact names: refresh, validate, onload, before_save
Blocking UI with sync callsPage freezesUse frappe.call() with async: true (default)
Using cur_frm instead of frmBreaks in dialogs/multiple formsAlways use the frm parameter passed to handlers
Not checking frm.doc.docstatusButtons appear on submitted docsCheck frm.doc.docstatus == 0 before showing edit actions
console.log(frm.doc) showing stale dataDebugging confusionUse frm.reload_doc() or check network responses

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.88%
按下载量换算218

Claude

28.16%
按下载量换算166

Cursor

18.84%
按下载量换算111

Gemini CLI

10.6%
按下载量换算63

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills