tool-design-data-plane

tool-design-data-plane is a cursor rule for Cursor from LiuYihey/Agent-Engineering. It costs 1,902 tokens per session, scanned A, original, MIT.

A guide to designing tools for coding agents so the agent makes decisions while files or database references carry bulk data. It recommends passing paths, IDs, or URIs instead of large data through the agent's text context.

In plain words
What is it for?
Use it when designing tools that read or write large tables, sequences, analysis results, or other files. It helps decide when to use input and output file paths and when small values should stay in the request.
Why use it?
It avoids extra cost, slow responses, truncated output, and errors caused by making an agent reproduce large datasets as text.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when designing tools that read or write large tables, sequences, analysis results, or other files. It helps decide when to use input and output file paths and when small values should stay in the request.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/liuyihey/agent-engineering/tool-design-data-plane
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/LiuYihey/Agent-Engineering

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for tool-design-data-plane

README.md
[![agentmods](https://agentmods.dev/badge/rules/liuyihey/agent-engineering/tool-design-data-plane/github.svg)](https://agentmods.dev/rules/liuyihey/agent-engineering/tool-design-data-plane)
Your own site
<a href="https://agentmods.dev/rules/liuyihey/agent-engineering/tool-design-data-plane"><img src="https://agentmods.dev/badge/rules/liuyihey/agent-engineering/tool-design-data-plane/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for tool-design-data-plane

Your own site · 80×15
<a href="https://agentmods.dev/rules/liuyihey/agent-engineering/tool-design-data-plane"><img src="https://agentmods.dev/badge/rules/liuyihey/agent-engineering/tool-design-data-plane.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,902 This file is loaded in full into every session.
When invoked 1,902 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.01902 $0.01902
Opus 5.5 $0.00761 $0.00761
Sonnet 5.5 $0.00380 $0.00380
Haiku 4.5 $0.00190 $0.00190

Measured 19d ago against content hash 91b1652116a0, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

tool-design-data-plane scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 19d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/tool-design-data-plane.mdc · 97 lines

How it starts

The opening of the file, as written. The whole thing — 97 lines — stays where its author put it; the contents beside it link to each section on GitHub.

工具设计指南:模型是控制面,不是数据面

一条总原则

模型负责计划、选择、判断(control plane);字节负责在系统之间流动(data plane)。 工具设计中唯一不能破坏的边界:批量数据不得以 token 形式穿过模型。

判断一个工具是否合格,只问一句:

这份数据的字符,是模型生成的,还是文件/数据库生成的?

只要答案是"模型生成的",就存在成本翻倍、内容失真、上下文丢失三个隐患。

为什么内联批量数据一定出问题

内联(inline)= 数据本体写在 tool call 参数或返回文本里;引用(reference)= 只传 path / id / uri。

失效模式 机制
成本与延迟 同一份数据付两次费(输入一次、输出一次),且必须串行生成完
保真度 模型输出是概率采样,不是内存拷贝;几百行数字必然串行、错位、凭印象补数
易失性 数据只活在上下文里,被 prune / compaction 裁掉后模型只剩"记忆",开始编造
规模上限 输出受 max_tokens 约束,超出就截断或空回合

本仓库实测(session d1c7fd14-1f2,612 条 CD8 设计打分):

  • 129 次工具调用:score_sequence 38 次(796 条序列)、run_analysis_code 76 次
  • 其中 33/76 的分析调用是纯搬运:7 次把 776 行分数敲进代码、26 次合并与长度校验返工
  • 同一个会话出现过连续 3 轮 text_len=0, stop_reason=max_tokens 的空回合
  • 这不是模型"不听话",而是它没有"复制"操作——只有重新生成

决策表

场景 正确做法
输入可能是批量数据(序列、行、表) 支持 input_path(CSV/TSV/JSON/FASTA),内联参数保留但降级为便捷通道
输出可能超过约 2 KB 或 50 行 支持 output_path,返回摘要 + 路径;缺失时保持原行为
输出是用来推理的(单任务配置、指标、记忆条目) 保持内联。读工具不要 handle 化
数据已经在磁盘上(data/、results/、artifacts/) 不要新增工具,让 agent 用 run_analysis_code 直接读写
需要用户看到/下载 写 artifacts/ 下,由 sandbox 自动注册 artifact

阈值不是教条:get_task_info 返回一个任务的完整 launch config 与质量档位是正确的——模型必须看全才能判断。读全 ≠ 搬全。

五条行业标准模式

  1. Handle over value:返回引用而不是值。代表:OpenAI Code Interpreter 的沙箱文件名、Anthropic Files API 的 file_id、MCP resources 的 URI、ADK artifacts。
  2. Push compute to data:让模型写查询/程序,数据不动。代表:Text-to-SQL(BigQuery、Databricks Genie)、Code Interpreter。本项目对应 query_table + run_analysis_code。
  3. Preview + handle:返回 schema、行数、头几行与路径,绝不返回全表。对应 df.head() / df.describe() / SQL LIMIT + COUNT。
  4. 双通道输出:机器通道落盘,模型通道只拿摘要。score_sequence 的 output_path 就是这个形态。
  5. 类型化契约 + 幂等:边界用 JSON Schema / Pydantic 校验一次;结果按 run_id 可重复读取,不必重算。

新增工具的验收清单

  • 批量输入可以走 input_path,不必让模型念数据
  • 大输出可以走 output_path,且不传时行为完全不变
  • 返回文本包含:做了什么、多少行、写到哪、怎么读回来
  • 截断必须显式说明(truncated + 分页/收窄建议),禁止静默截断
  • 写 artifacts/ 的产物会自动成为聊天里的可下载 artifact
  • 描述里写明 "read it back with run_analysis_code, do not retype"
  • 新增参数同步更新 yaml 描述、CORE.md、wiki、测试

Read the full file on GitHub · 97 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 19d ago First seen · 97 lines · 1,902 tokens per session scan A 91b1652116a0

Subscribe to this mod's changes

tool-design-data-plane is a cursor rule published in the GitHub repository LiuYihey/Agent-Engineering (6 stars, last pushed 7d ago), licensed MIT. It adds 1,902 tokens to every session, about $0.0076 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-13.

Related

tool-design-data-plane compared with cursor rules from other repositories

tool-design-data-plane next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
tool-design-data-planeLiuYihey/Agent-EngineeringCursor rule67d agoMITA1,902Cursor
ponytailDietrichGebert/ponytailCursor rule203k10d agoMITA604Cursor
angular-20angular/angularCursor rule102ktodayMITA0Cursor
dev-standardapache/supersetCursor rule76ktodayApache-2.0A1,147Cursor
prefer-assertions-over-defensive-checksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
prefer-direct-imports-over-module-mocksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
shared-plane-packagesprisma/ormCursor rule48ktodayApache-2.0A0Cursor