← 返回
开发者工具 中文

Reliable Tool Context

Build reliable tool context from command output using artifacts and compact reproducible code queries.
利用工件和简洁可复现的代码查询,从命令输出中构建可靠的工具上下文。
zmaciel
开发者工具 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 1
Stars
📥 656
下载
💾 7
安装
1
版本
#latest

概述

Reliable Tool Context

Use this skill to build reliable tool context whenever command output will be

analyzed by the model and correctness matters. Capture once, query from

artifacts, and return compact answers without copying raw payloads into model

context.

CLI Decision Rule

Use Sift to establish reliable tool context when any of these are true:

  • Output will be consumed by the model (analysis, transformation, or follow-up

querying).

  • Pagination exists or may exist (pagination.next.kind=="command").
  • JSON schema/root confidence is low, or rows may be heterogeneous (even for

small payloads).

  • You need reproducibility, redaction discipline, or auditability.

Use direct CLI only when all of these are true:

  • Output is clearly small.
  • Schema/root path is obvious.
  • It is a one-off human inspection with no follow-up model reasoning.

Required workflow

  1. Capture output as an artifact:
sift-gateway run --json -- <command>
  1. Keep only artifact_id plus a short summary in prompt context.
  2. Handle pagination explicitly only when present. If

pagination.next.kind=="command", continue with:

sift-gateway run --json --continue-from <artifact_id> -- <next-command-with-next_params-applied>
  1. Query artifacts with explicit root path and compact output:
sift-gateway code --json <artifact_id> '$' --code "def run(data, schema, params): return [{'id': row.get('id'), 'status': row.get('status')} for row in data[:20]]"
  1. Resolve root path from response hints, not guesswork:
    • Current run behavior uses canonical root path $; use $ for follow-up

code queries.

  • If response_mode=="schema_ref" and schemas are present, use schema

root_path as the source of truth.

  • Treat sample_item as a preview row only.

Schema discovery protocol

  • Do not use jq '.[0]' (or equivalent "first-item" shortcuts) to infer schema

or root path. Many payloads are object-wrapped, have multiple candidate roots,

or include heterogeneous rows where first-item heuristics are misleading.

  • In Sift responses, sample_item is emitted only when Sift can verify

consistent item shape across the resolved list. If sample_item is absent,

inspect schemas; for current run captures, schema root_path should be

$.

  • If sample_item_text_truncated is true, treat long text fields as truncated

previews and confirm details with a focused code query.

Guardrails

  • sift-gateway code defaults to --scope all_related; start with

--scope single for anchor-only analysis and widen scope only when needed.

  • Start with run(data, schema, params); move to `run(artifacts, schemas,

params)` only when cross-artifact joins are required.

  • Use pure Python first; do not assume optional packages are available.
  • Return aggregates or top <= 20 rows; avoid full-record dumps.
  • Never paste raw captured payloads back into context.
  • Do not claim completeness until pagination.retrieval_status == COMPLETE.

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 14:46 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

developer-tools

Agent Browser

matrixy
专为AI智能体优化的无头浏览器自动化CLI,支持无障碍树快照和基于引用的元素选择。
★ 427 📥 118,474
developer-tools

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 68 📥 180,601
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 672 📥 324,682