【opencode】opencode插件

1. opencode插件安装位置

Linux/macOS :~/.config/opencode/plugins/
Windows :%USERPROFILE%.config\opencode\plugins

说明:

2. 最简单的插件

新增两个插件:

复制代码
C:\Users\Administrator\.config\opencode\plugins\plugin-a.js
C:\Users\Administrator\.config\opencode\plugins\plugin-b.js

plugin-a.js:

typescript 复制代码
export const PluginA = async ({ client, directory }) => {
  return {
    'experimental.chat.system.transform': async (_input, output) => {
      (output.system ||= []).push('<EXTREMELY_IMPORTANT>plugin-a</EXTREMELY_IMPORTANT>');
    }
  };
};

plugin-b.js:

typescript 复制代码
export const PluginB = async ({ client, directory }) => {
  return {
    'experimental.chat.system.transform': async (_input, output) => {
      (output.system ||= []).push('<EXTREMELY_IMPORTANT>plugin-b</EXTREMELY_IMPORTANT>');
    }
  };
};

效果:

重启opencode:

说明:

  • 我们这时候问:"你的system prompt里有什么特殊标记?",可以从里面发现我们两个插件system prompt追加的东西已经带进去了。
  • 现在很多开源的skills核心能力就是在发送LLM前修改系统prompt,换句话说我们现在具备开发skills能力的前提了。
相关推荐
guyoung11 小时前
BoxAgnts介绍(6)——Agent多轮对话及Tool、Skill调用
agent·ai编程
Web极客码11 小时前
AI的下一个风口:智能助力超越ChatGPT
服务器·人工智能·ai编程
lili001213 小时前
AI编程三件套CI集成与质量门禁:从“看起来对“到“证据确凿“
java·人工智能·python·ci/cd·ai编程
大家的林语冰13 小时前
AI 遥控代码截图,录制终端动画,定制自动化批量制图流程,解放你的双手~
前端·ai编程·trae
是烨笙啊13 小时前
AI编程:项目管理
ide·人工智能·ai编程
是烨笙啊13 小时前
AI编程:胶水编程
ai编程
Are_You_Okkk_1 天前
基于MonkeyCode解析AI研发新模式,根治开发低效痛点
大数据·人工智能·开源·ai编程
Peter·Pan爱编程1 天前
14. Lambda 表达式:随手可写的函数对象
c++·算法·ai编程
百珏1 天前
个人理解的AI Code Review 架构的三代演进
架构·aigc·ai编程
人月神话Lee1 天前
【图像处理】Core Image 与 GPU 渲染管线——让滤镜飞起来
ios·ai编程·图像识别