kingscript-plugin-dev

Generates Kingdee Cosmic Kingscript plugin code with lifecycle guidance, ORM patterns, and BigDecimal financial calculations.

28|6|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/xiaods/kingscript-skills --skill kingscript-plugin-dev-xiaods
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: kingscript-plugin-dev
Source: https://github.com/xiaods/kingscript-skills
Command: npx skills add https://github.com/xiaods/kingscript-skills --skill kingscript-plugin-dev-xiaods

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Developing plugins for the Kingdee Cosmic (苍穹) platform requires deep knowledge of 11 plugin base classes, lifecycle events, ORM service interfaces, and SDK rate limits. This Skill packages that expertise into a knowledge base so AI assistants can generate correct, standards-compliant Kingscript/KS plugin code on demand. ## Core Features & Use Cases - 11 Plugin Type Coverage: Operation, form, list, convert, report, workflow, scheduled task, print, and import/export plugins with correct base classes and import paths. - Built-in Quality Guardrails: Enforces stateless design (no class properties), field preloading via onPreparePropertys, BigDecimal-only financial math, and SDK rate limits (50k rows, 150 queries per transaction). - Deep Reference Library: Dedicated manuals for ORM data services, BigDecimal precision math, F7 filtering, parent-child page interaction, message notifications, and common development cases. - Use Case: Ask for an accounts-payable save operation plugin that validates payment amount is greater than zero and blocks edits on audited bills, and receive a complete AbstractOperationServicePlugIn implementation with proper field preloading and BigDecimal checks. ## Quick Start Ask the AI assistant to write a Kingdee Cosmic save operation plugin for the payable bill that validates the payment amount must be greater than zero.

Frequently Asked Questions about kingscript-plugin-dev

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

FAQPage Schema
How do I write a Kingdee Cosmic operation plugin in Kingscript?▼

Extend AbstractOperationServicePlugIn, preload fields in onPreparePropertys, and place validation in beforeExecuteOperationTransaction and database sync in beginOperationTransaction. Export a singleton instance with let plugin = new MyPlugin() and export { plugin }.

What is the difference between BusinessDataServiceHelper and QueryServiceHelper?▼

BusinessDataServiceHelper returns structured, tree-shaped data that can be modified and saved back to the database. QueryServiceHelper returns flattened read-only rows with better performance, suitable for display-only queries.

Why must BigDecimal be used for financial calculations in Cosmic plugins?▼

JavaScript number arithmetic introduces floating-point errors such as 0.1 + 0.2 yielding 0.30000000000000004. BigDecimal provides exact decimal arithmetic with explicit rounding modes like ROUND_HALF_UP, which is mandatory for amounts, prices, and quantities.

Can I store state in class properties inside a Cosmic form plugin?▼

No. Plugin instances are shared and cached across all form instances, so class properties cause data leakage between pages. All state must use method-local variables, with context accessed via this.getModel() and this.getView().

What are the Kingdee Cosmic SDK rate limits for ORM queries?▼

A single query returns at most 50,000 rows and 100 fields, a transaction allows at most 150 queries and 100 DML operations, and one DML call affects at most 1,000 records. Direct DB or ORM access is forbidden; ServiceHelper interfaces must be used.

How do I pass parameters between a parent page and a popup form in Cosmic?▼

The parent sets custom parameters via FormShowParameter.setCustomParams before showForm, and the child reads them in afterCreateNewData through getFormShowParameter().getCustomParams(). For returning data, use returnDataToParent with the parent's closedCallBack, or share values via PageCache.