@mdddj

梁典典的 OpenClaw 插件

梁典典的 OpenClaw 插件

Current version
v0.1.0
code-pluginCommunitysource-linked

梁典典的 OpenClaw 插件

这是一个可扩展的 OpenClaw 增强插件。当前先内置语音回复策略,并已经改成按功能模块拼装系统提示的结构,后面继续扩展更多能力时,不需要再把主入口重写一遍。

当前内置能力

  • 注册 before_prompt_build 插件钩子
  • 只对指定的消息渠道生效,默认是 feishu
  • 通过语音回复模块,引导智能体调用指定技能触发词,例如 $feishu-tts
  • 通过本地脚本能力模块,告诉智能体当前环境里有哪些文本转语音脚本可以使用
  • 通过补充提示规则模块,追加全局业务规则或回复风格约束
  • 所有能力统一走模块化配置结构

结构

  • src/index.js:插件入口,只负责注册 hook 和拼装结果
  • src/config.js:配置 Schema 和标准化逻辑
  • src/features/script-capabilities.js:本地脚本能力提示模块
  • src/features/voice-reply.js:语音回复功能模块
  • src/features/prompt-rules.js:补充提示规则功能模块
  • src/features/index.js:功能模块注册与系统提示拼装入口

建议的插件配置

{
  "plugins": {
    "entries": {
      "liangdiandian-openclaw-plugin": {
        "enabled": true,
        "config": {
          "enabledProviders": ["feishu"],
          "globalInstruction": "默认使用简洁、专业的中文回复。",
          "features": {
            "voiceReply": {
              "enabled": true,
              "skillTrigger": "$feishu-tts",
              "fallbackToText": true
            },
            "scriptCapabilities": {
              "enabled": true,
              "ttsScriptPath": "C:\\Users\\Administrator\\.openclaw\\workspace\\scripts\\send_voice.py",
              "ttsCommandTemplate": "python {scriptPath} \"{text}\" --receive-id {receiveId}",
              "ttsExampleCommand": "python C:\\Users\\Administrator\\.openclaw\\workspace\\scripts\\send_voice.py \"老板,我现在是 DeepSeek V4 Flash 模型,比较轻量,响应快。有什么需要处理的,直接说就行。\" --receive-id ou_422c2039d8e327534280dce1160c286d",
              "notes": [
                "如果需要发送语音,优先考虑调用这个脚本。",
                "执行前要把示例里的文本替换为当前这轮真正的回复内容。"
              ]
            },
            "promptRules": {
              "enabled": true,
              "instructions": [
                "如果信息不确定,先明确说明限制,不要编造。",
                "涉及操作步骤时,优先给出最短可执行方案。"
              ]
            }
          }
        }
      }
    }
  }
}

配置约束

  • 当前版本不保留旧配置兼容层
  • 所有能力都应通过 features.* 结构配置
  • 插件 idliangdiandian-openclaw-plugin

后续扩展方式

  • 新增一个功能模块文件到 src/features/
  • src/features/index.js 里注册这个模块
  • src/config.jsopenclaw.plugin.json 里补充对应配置项

说明

  • 这个插件本身不会直接合成或上传音频,它负责通过提示词引导智能体调用已有能力
  • 所选技能必须已经安装,并且当前智能体运行时可以正常调用
  • 如果后面你要接入审批、消息改写、工具路由、渠道策略这类能力,可以继续沿用现在这套模块化结构

Source and release

Source repository

mdddj/liangdiandian-openclaw-plugin

Open repo

Source commit

42607505843181d5be0ef2cbd6a3cdd21e031cf7

View commit

Install command

openclaw plugins install clawhub:liangdiandian-openclaw-plugin

Metadata

  • Package: liangdiandian-openclaw-plugin
  • Created: 2026/05/06
  • Updated: 2026/05/06
  • Executes code: Yes
  • Source tag: main

Compatibility

  • Built with OpenClaw: 2026.5.4
  • Plugin API range: >=2026.5.4
  • Tags: latest
  • Files: 15