Pirate Voice【免费下载链接】agentsBuild and deploy AI Agents on Cloudflare项目地址: https://gitcode.com/GitHub_Trending/agents1/agentsAnswer in a playful pirate voice while keeping the response useful.StyleUse light nautical phrasing such as aye, matey, shipshape, and charted course.Keep the meaning clear. Do not bury technical details under too much slang.Avoid stereotypes, insults, or hard-to-read spelling.If the user asks a technical question, answer the technical question first and add pirate flavor second.正文是激活后注入模型的完整操作指令。注意这份技能**没有引用文件、没有脚本**——它完全依赖提示词本身生效是「纯提示词型」技能的最小范例。 ## 二、description决定模型是否激活你的技能 在 Think 的技能加载机制中技能**不是常驻的系统提示词**。Think 只在每轮把技能目录catalog即 name description放入提示并暴露 activate_skill 工具只有当**当前请求与该技能的 description 匹配**时模型才会调用 activate_skill 拉取完整的 SKILL.md 指令。这一设计在 [design/skills.md](https://link.gitcode.com/i/bc9de836f20af5dbe6367bb8883aecc7) 的 Skill Loading 一节有明确描述常驻行为应放在 getSystemPrompt()而技能是可选的、按需加载的过程性指令。 因此 description 的质量直接决定技能能否被正确触发。分析 pirate-voice 的写法 yaml description: Rewrite or answer in a playful pirate voice. Use when the user asks for pirate tone, nautical phrasing, or says to talk like a pirate.它包含三个要素要素原文作用行为声明Rewrite or answer in a playful pirate voice告诉模型激活后要做什么触发信号user asks for pirate tone, nautical phrasing覆盖显式请求说海盗话兜底信号says to talk like a pirate覆盖同义表达提高召回对比同目录下其他技能可以总结出这套描述公式的一致性debug-plan/SKILL.mdCreate a systematic debugging plan... Use when the user asks how to investigate a failure, regression, or unexpected behavior.test-plan/SKILL.mdProduce a focused test plan for a change. Use when the user asks how to test a feature...release-notes/SKILL.mdDraft short release notes... Use when the user asks for changelogs, release notes...即「激活后行为 Use when 触发条件含近义改写」的固定句式。demo 前端侧栏展示技能名与描述见 client.tsx模型正是读取这条描述来做匹配决策所以描述应当写清「何时用、不用则不要激活」。三、风格约束的写法既要个性又要克制pirate-voice的## Style小节体现了风格类技能的核心设计哲学个性是增量不是替代。给出具体词汇示例而非空泛要求aye、matey、shipshape、charted course是四个可直接落地的航海措辞示例模型不必凭空发明风格更可控。以「保持含义清晰」为第一优先级Keep the meaning clear. Do not bury technical details under too much slang.—— 海盗腔是点缀技术内容必须清晰这是风格技能的可用性底线。显式排除负面模式Avoid stereotypes, insults, or hard-to-read spelling.用否定式把模型容易滑向的刻板印象、冒犯性措辞、难读的拼写如大量 arrr 变形拼写一次性排除。优先级排序answer the technical question first and add pirate flavor second.明确先答问题、后加风味的次序避免用户提问被风格淹没。这套「示例 约束 否定 优先级」的组合本质上是一次高质量的系统提示词工程。可以把它泛化到任意人设类技能极客腔、文言腔、教练腔……只需替换词汇示例与排除项。四、注册与激活从 getSkills() 到 activate_skill 的调用链pirate-voice之所以能生效靠的是 examples/agent-skills/src/server.ts 中SkillsAgent的三处关键接线import { callable, routeAgentRequest } from agents; import { Think, skills } from cloudflare/think; import bundledSkills from agents:skills; export class SkillsAgent extends ThinkEnv { getModel() { return cf/moonshotai/kimi-k2.7-code; } getSystemPrompt() { return [ You are a helpful assistant demonstrating Think Agent Skills., If a user request matches an available skill, call activate_skill before answering., Mention which skill you used when it is helpful for the demo. ].join(\n); } getSkills() { return [bundledSkills]; } getSkillScriptRunner() { return skills.runner({ loader: this.env.LOADER, workspaceInstance: this.workspace }); } callable() async listSkills() { return bundledSkills.list(); } }import bundledSkills from agents:skills这是 Vite 构建期虚拟模块指向该文件旁的./skills目录。agents/vite插件会在构建时发现所有含SKILL.md的子目录、解析 frontmatter 与正文、把references/、scripts/等资源打进包并生成确定性的 fingerprint详见 design/skills.md 的 Bundled Skills 小节。pirate-voice因此无需任何运行时文件系统。getSkills()返回技能源数组Think 注册后技能目录与activate_skill、read_skill_resource、run_skill_script三个技能工具在每轮被合并进工具集见 docs/think/tools.md 的 Tool Merge Order 第 5 项。pirate-voice只用到activate_skill。getSystemPrompt()里明确提示模型「匹配技能时先activate_skill再作答」这是激活链路能触发的前提。getSkillScriptRunner()是为需要执行脚本的技能如release-notes准备的纯提示词技能pirate-voice不需要它但它在示例中统一配置。激活后Think 默认会把解析出的SKILL.md投影进运行工作区Computer 场景为/workspace/.agents/skills/name/SKILL.md该文件本身也可被文件工具读取、编辑并影响后续回合见 design/skills.md 的 Workspace projection 小节。五、在 agent-skills 演示中运行与观察pirate-voice所在的应用是完整的可运行演示。运行方式见 examples/agent-skills/README.mdnpm install npm start前提是 Wrangler 已对开通 Workers AI 的账户完成认证——示例使用ai.remote: true与 Worker Loader 绑定本地开发会调用 Cloudflare 云服务。相关配置在 examples/agent-skills/wrangler.jsonc{ ai: { binding: AI, remote: true }, compatibility_flags: [nodejs_compat], worker_loaders: [{ binding: LOADER }], durable_objects: { bindings: [{ class_name: SkillsAgent, name: SkillsAgent }] }, migrations: [{ new_sqlite_classes: [SkillsAgent], tag: v1 }] }【免费下载链接】agentsBuild and deploy AI Agents on Cloudflare项目地址: https://gitcode.com/GitHub_Trending/agents1/agents创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考