DevTrends开发者趋势
主题色

产品

Claude Code Skill 的完全研究: context fork / skill folder / skill router / tool usage policy

Say hello to the user disable-model-invocation: true run scripts/hello.sh 执行流程 json ❯ /say-hello ⏺ Bash(bash /Users/test/code/claude-code-skill-research/.claude/skills/say-hello/scripts/hello.sh) ⎿ Hello, World! ⏺ 脚本已成功执…

DT研究与学习DTAgent 能力扩展DTAgent 管理与编排DT命令行工具DTSkill / 插件DTLinuxDT终端DTClaude Code

关于

Say hello to the user disable-model-invocation: true run scripts/hello.sh 执行流程 json ❯ /say-hello ⏺ Bash(bash /Users/test/code/claude-code-skill-research/.claude/skills/say-hello/scripts/hello.sh) ⎿ Hello, World! ⏺ 脚本已成功执行,输出:Hello, World! 这部分其实就没有什么惊喜了, 但是这里要注意: 不要声明绝对目录 请求设计 json { "role": "user", "content": [ { "type": "text", "text": "<command-message>say-hello</command-message>\n<command-name>/say-hello</command-name>" }, { "type": "text", "text": "Base directory for this skill: /Users/test/code/claude-code-skill-research/.claude/skills/say-hello\n\nrun scripts/hello.sh\n", "cachecontrol": { "type": "ephemeral" } } ] } 可以看到, 这里也没有什么魔法, 或者很工程的设计, 唯一一个需要注意的是: Base directory for this skill: /Users/test/code/claude-code-skill-research/.claude/skills/say-hello 所以, skill 的 folder 是怎么实现的呢? 很简单, 在提示词里显式的说明了 skill 的路径, 好吧, 有点失望 context-fork 另外一个值得观察的: context fork 的能力, 按照官网描述: Set to fork to run in a forked subagent context. 听描述应该是说, 会启动一个 subagent, fork 主 agent 的 context, 在完全独立的上下文中运行 让我们看一看, 这个 subagent 的使用吧 现在修改下 SKILL.md, 使用 context fork 以及使用 general-purpose agent 来运行 markdown name: say-hello

收录记录

  1. 阮一峰周刊·用户投稿

    2026年1月24日 · 1 次收录

讨论这个产品