首页龙虾技能列表 › Platform Script Skills — Platform工具

📝 Platform Script Skills — Platform工具

v1.0.1

提供自研业务平台的脚本模板和编码规范。当用户需要编写 Groovy 后端脚本、JavaScript 表单脚本、SQL 查询、附件处理等代码时使用此技能。

0· 61·0 当前·0 累计
by @lan2898408767 (Lan2898408767)·MIT-0
下载技能包
License
MIT-0
最后更新
2026/3/28
安全扫描
VirusTotal
可疑
查看报告
OpenClaw
安全
medium confidence
The skill is internally consistent with its stated purpose (platform script templates and conventions), but the included templates contain examples that perform sensitive operations (password resets, deletes, raw SQL) and should be reviewed before use.
评估建议
This skill appears to be what it says: a set of platform-specific script templates and coding rules. Before using it in production, do the following: 1) Audit the bundled templates — do NOT copy-and-paste examples that print or modify account passwords, reset credentials to hardcoded values, or perform broad deletes. 2) Review SQL templates for unsafe string concatenation (risk of SQL injection) and prefer parameterized queries. 3) Test generated scripts in a sandbox/staging environment with lim...
详细分析 ▾
用途与能力
Name/description promise Groovy/JS/SQL/attachment templates and coding rules; the SKILL.md and references directory contain exactly those templates and platform-specific API calls (DataModelUtils, ScriptUtils, AccountUtils). No unrelated credentials, binaries, or installs are requested.
指令范围
Instructions are limited to reading the bundled references and generating platform scripts. However, the templates include examples that read account data, print passwords, reset passwords to a constant value, delete multiple records, and build SQL via string concatenation. Those examples are within the scope of an admin-focused script library but are sensitive and can cause destructive or privacy-impacting changes if copied verbatim or used without review.
安装机制
Instruction-only skill with no install spec and no code executed on install; this minimizes installation risk. All files are bundled with the skill (SKILL.md and references).
凭证需求
The skill requests no environment variables, no credentials, and no config paths. The SKILL.md references platform runtime functions (e.g., args$.getTokenFunc) which are expected for platform scripts and are not external secrets requested by the skill itself.
持久化与权限
always is false and the skill has no install actions that modify agent configuration or other skills. It does not request persistent privileges beyond standard skill inclusion.
安全有层次,运行前请审查代码。

License

MIT-0

可自由使用、修改和再分发,无需署名。

运行时依赖

无特殊依赖

版本

latestv1.0.12026/3/28

优化搜索关键词

● 可疑

安装命令 点击复制

官方npx clawhub@latest install shucheng-platform-script
镜像加速npx clawhub@latest install shucheng-platform-script --registry https://cn.clawhub-mirror.com

技能文档

为自研业务平台提供全面的脚本模板和编码规范。

何时使用

使用此技能的情况:

  • "帮我写一个平台脚本"
  • "需要数据增删改查的脚本"
  • "表单验证脚本怎么写"
  • "动态控制下拉框选项"
  • "合并多个 CI 附件为 PDF"
  • "发送邮件的脚本"
  • "SQL 查询/分页脚本"
  • "审批流程相关脚本"
  • "根据我的平台规则写代码"

何时不使用

不使用此技能的情况:

  • 通用编程问题(不使用平台特定 API)
  • 其他平台的脚本代码
  • 与平台无关的代码需求

技能位置

skills/platform-script-skills/

使用方法

当用户请求平台相关的脚本代码时,读取 references/ 目录中的完整模板文件,理解平台的特殊脚本规则,生成符合规范的可用代码。

核心能力

1. 基础脚本操作

  • 数据创建 (DataModelUtils.createCIByCIClassName)
  • 数据删除 (DataModelUtils.deleteCi, deleteCis)
  • 数据修改 (saveCi)
  • 数据查询 (getCIByPK, getCIByAttr, queryForListMap)
  • 脚本调用 (ScriptUtils.runScriptByCode)

2. 表单脚本操作

  • 数据验证 (validatorFunctions)
  • 动态字段控制 (disabledAttributes, dynamicDisabledAttrs)
  • 字段值变化 (changeFunctions)
  • 下拉框选项控制 (scriptFilterInOptions, setSelectOptionsFunc)
  • 字段显示控制 (controlFieldDisplayFunc)
  • 自动补全 (controlAutoCompleteFunc)
  • 父子表单通信 (addObserver, notifyParent)
  • 智能回填 (initBackFillData, initNestedFormData)

3. SQL 脚本操作

  • 数据查询 SQL
  • 数据修改 SQL (JDBCUtils.更新)
  • 分页处理 (LIMIT/OFFSET、逻辑分页)
  • 多表连接查询

4. 附件处理

  • 附件函数 (AttachmentsUtils.*)
  • 文件导出 (Excel、Word、PDF、zip)
  • 多 CI 附件转 PDF
  • PDF 合并
  • Word 合并

5. 审批流程

  • 自定义提交流程 (flow_base_start)
  • 自定义通过流程 (flow_pass)
  • 自定义加签脚本 (flow_add_object_by_standalone)

6. 工具函数

  • 日期格式化 (SimpleDateFormat)
  • 时间戳生成
  • 列表排序 (sortMapList)
  • 字符串处理 (removeTrailingZeros)

7. 业务特定脚本

  • 华龙业务相关
  • FOS 数据查询
  • 航班数据操作

特殊规范

变量命名

  • 使用中文变量名(如 def 主表数据, def 明细表数据
  • 遵循平台的字段命名规范

数据模型操作

// 单条记录
def 数据 = DataModelUtils.getCIByPK("表名",['ID':值])

// 多条记录 def 数据列表 = DataModelUtils.getCIByAttr("表名",['字段名':值])

// 保存 saveCi(数据)

// 删除 DataModelUtils.deleteCi(数据) DataModelUtils.deleteCis(数据列表)

表单脚本返回格式

if(args$){
    return {
        "validatorFunctions": fieldValidateMap,
        "disabledAttributes": list,
        "changeFunctions": feildMapFunc,
        "setSelectOptionsFunc": optionsFunc
    };
}else{
    return null;
}

脚本参数说明

  • args$ - 脚本参数变量
  • args$.data - 表单输入数据
  • args$.getFieldValueFunc - 获取字段值函数
  • args$.setFieldValueFunc - 设置字段值函数
  • args$.runScriptFunc - 调用后台脚本
  • args$.通知 - 打印信息 (错误/warning/info/成功)

重要提示

  • 访问 args$ 属性前先检查其是否存在
  • 监听脚本使用 ci$.dataFieldMap 访问当前数据
  • 附件字段需要使用 JsonSlurper 将大文本转换为 JSON
  • 导出文档时使用正确的模板占位符语法
  • 妥善处理 空 值避免异常

完整模板位置

所有完整代码示例存储在 references/platform-script-templates.txt 文件中,包含:

  • 完整的代码示例
  • 详细的注释说明
  • 各种场景的最佳实践

当需要编写具体脚本时,会参考此文件中的完整模板生成代码。

数据来源:ClawHub ↗ · 中文优化:龙虾技能库
OpenClaw 技能定制 / 插件定制 / 私有工作流定制

免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制

了解定制服务