返回顶部
r

reliable-tool-context可靠工具上下文

Build reliable tool context from command output using artifacts and compact reproducible code queries.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
280
下载量
免费
免费
1
收藏
概述
安装方式
版本历史

reliable-tool-context

可靠工具上下文

当命令输出将由模型分析且正确性至关重要时,使用此技能构建可靠工具上下文。一次性捕获,从工件中查询,并返回简洁答案,无需将原始负载复制到模型上下文中。

CLI 决策规则

当以下任一条件成立时,使用 Sift 建立可靠工具上下文:

  • - 输出将由模型消费(分析、转换或后续查询)。
  • 存在或可能存在分页(pagination.next.kind==command)。
  • JSON 模式/根路径置信度较低,或行可能异构(即使负载较小)。
  • 需要可重现性、编辑规范或可审计性。

仅当以下所有条件成立时,使用直接 CLI:

  • - 输出明显较小。
  • 模式/根路径明确。
  • 属于一次性人工检查,无需后续模型推理。

必要工作流程

  1. 1. 将输出捕获为工件:

bash
sift-gateway run --json --

  1. 2. 在提示上下文中仅保留 artifact_id 和简短摘要。
  2. 仅在存在分页时显式处理分页。如果 pagination.next.kind==command,继续执行:

bash
sift-gateway run --json --continue-from id> -- params-applied>

  1. 4. 使用显式根路径和紧凑输出查询工件:

bash
sift-gateway code --json $ --code def run(data, schema, params): return [{id: row.get(id), status: row.get(status)} for row in data[:20]]

  1. 5. 从响应提示中解析根路径,而非猜测:
  • - 当前 run 行为使用规范根路径 $;后续代码查询使用 $。
  • 如果 responsemode==schemaref 且存在 schemas,使用模式 rootpath 作为事实来源。
  • 仅将 sampleitem 视为预览行。

模式发现协议

  • - 不要使用 jq .[0](或等效的首项快捷方式)来推断模式或根路径。许多负载是对象包裹的,具有多个候选根路径,或包含异构行,其中首项启发式方法会产生误导。
  • 在 Sift 响应中,仅当 Sift 能验证解析列表中一致的项目形状时才发出 sampleitem。如果 sampleitem 缺失,检查 schemas;对于当前的 run 捕获,模式 rootpath 应为 $。
  • 如果 sampleitemtexttruncated 为 true,将长文本字段视为截断预览,并通过聚焦的代码查询确认详情。

防护措施

  • - sift-gateway code 默认使用 --scope allrelated;从 --scope single 开始进行锚点分析,仅在需要时扩大范围。
  • 从 run(data, schema, params) 开始;仅在需要跨工件连接时使用 run(artifacts, schemas, params)。
  • 优先使用纯 Python;不要假设可选包可用。
  • 返回聚合结果或最多 20 行;避免完整记录转储。
  • 切勿将原始捕获的负载粘贴回上下文中。
  • 在 pagination.retrievalstatus == COMPLETE 之前,不要声称完整性。

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 reliable-tool-context-1776207693 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 reliable-tool-context-1776207693 技能

通过命令行安装

skillhub install reliable-tool-context-1776207693

下载

⬇ 下载 reliable-tool-context v1.0.0(免费)

文件大小: 4.57 KB | 发布时间: 2026-4-15 12:27

v1.0.0 最新 2026-4-15 12:27
Initial release of reliable-tool-context skill.

- Enables building reliable tool context from command output using artifacts.
- Facilitates reproducible and auditable querying with compact code snippets.
- Provides detailed decision rules for using Sift Gateway vs. direct CLI.
- Includes a schema discovery protocol and code query guardrails.
- Promotes disciplined, non-redundant model context and safe handling of paginated data.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部