AgentFiles
Use this skill for runtime-facing AgentFiles work:
- - publish files or text as artifacts
- fetch artifact content or metadata
- search or list recent artifacts
- create share links
- verify the current principal with INLINECODE0
- run polling
watch loops for sidecars or wrappers
Do not reimplement AgentFiles API calls inside the skill unless the user explicitly asks for a direct API path. This skill is a thin wrapper around the existing CLI.
Workflow
- 1. Run AgentFiles commands directly:
agentfiles <subcommand> .... - Pass argv directly. Never build shell strings around AgentFiles commands.
- If a command needs auth or namespace context, start with
agentfiles whoami or agentfiles config --show. - Prefer
agentfiles setup for default onboarding. Use connect <runtime> only when the user wants a dedicated runtime credential. - For
watch, remember that V1 is polling-only. Read references/runtime-notes.md when you need caveats or troubleshooting.
Common Patterns
- - Verify auth: INLINECODE9
- Show config: INLINECODE10
- Publish text: INLINECODE11
- Publish file: INLINECODE12
- Fetch content: INLINECODE13
- Fetch metadata: INLINECODE14
- Search: INLINECODE15
- List: INLINECODE16
- Share: INLINECODE17
- Watch: INLINECODE18
Handoff
- - Hand off with content: INLINECODE19
- Pipe content: INLINECODE20
- Thread a conversation: INLINECODE21
- Reply back: INLINECODE22
- Hand off a file: INLINECODE23
- Search a thread: INLINECODE24
Some runtimes may expose this as /handoff. Slash syntax is sugar, not a dependency.
Read references/commands.md for the command matrix. Read references/runtime-notes.md for auth, browser-based connect, polling caveats, and sandbox/network notes.
Behavior
- - Prefer an installed
agentfiles binary on PATH. - If it is unavailable, fall back to the published
agentfiles-cli package through npm. - Expect network approval when npm needs to download the published CLI package.
- Keep
setup as the default onboarding path and connect as the advanced/manual path. - Credentials should come from the browser-approved CLI flow and the local
~/.attach/config.json file. - Do not ask the user to paste API keys into the skill or inline them in commands unless they explicitly choose the manual env-based path.
- Preserve CLI behavior. Do not reinterpret command output unless the user asks for a reformatted result.
AgentFiles
使用此技能进行面向运行时的AgentFiles工作:
- - 将文件或文本发布为制品
- 获取制品内容或元数据
- 搜索或列出最近的制品
- 创建分享链接
- 使用whoami验证当前主体
- 为边车或包装器运行轮询watch循环
除非用户明确要求直接使用API路径,否则不要在技能内部重新实现AgentFiles API调用。此技能是现有CLI的轻量封装。
工作流程
- 1. 直接运行AgentFiles命令:agentfiles <子命令> ...
- 直接传递argv。切勿围绕AgentFiles命令构建shell字符串。
- 如果命令需要认证或命名空间上下文,请以agentfiles whoami或agentfiles config --show开始。
- 默认入门路径优先使用agentfiles setup。仅当用户需要专用运行时凭证时使用connect 。
- 对于watch,请记住V1仅支持轮询。当需要注意事项或故障排除时,请阅读references/runtime-notes.md。
常见模式
- - 验证认证:agentfiles whoami
- 显示配置:agentfiles config --show
- 发布文本:agentfiles publish --content ... --title ...
- 发布文件:agentfiles publish ./path/to/file -n --title
- 获取内容:agentfiles get
- 获取元数据:agentfiles get --meta
- 搜索:agentfiles search -n
- 列出:agentfiles list -n
- 分享:agentfiles share
- 监视:agentfiles watch -n --json
交接
- - 带内容交接:agentfiles handoff codex --content 请审查此补丁
- 管道传输内容:echo 审查备注 | agentfiles handoff codex
- 串联对话:agentfiles handoff codex --content ... --thread pr7-review
- 回复:agentfiles handoff claude_code --reply-to-artifact-id --content 看起来不错
- 交接文件:agentfiles handoff codex ./review.md
- 搜索对话:agentfiles search pr7-review -n
某些运行时可能将其暴露为/handoff。斜杠语法是语法糖,并非依赖项。
请阅读references/commands.md了解命令矩阵。阅读references/runtime-notes.md了解认证、基于浏览器的connect、轮询注意事项以及沙箱/网络说明。
行为
- - 优先使用PATH上已安装的agentfiles二进制文件。
- 如果不可用,则回退到通过npm发布的agentfiles-cli包。
- 当npm需要下载已发布的CLI包时,需获得网络批准。
- 将setup作为默认入门路径,connect作为高级/手动路径。
- 凭证应来自浏览器批准的CLI流程和本地的~/.attach/config.json文件。
- 除非用户明确选择基于环境变量的手动路径,否则不要要求用户将API密钥粘贴到技能中或内联到命令中。
- 保留CLI行为。除非用户要求重新格式化结果,否则不要重新解释命令输出。