delegated-file-edit-verification
它能做什么
这项技能告诉 AI,在另一个工具或智能体声称完成编辑后,应直接核实文件。它适合使用 AI 辅助工具制作电子表格、数据库或其他文件的人。
适用场景
- ✓当另一个智能体说它已保存或更新了某个文件,我需要确认的时候。
- ✓当任务取决于文件是否位于某个确切的文件夹或位置的时候。
- ✓当电子表格或数据文件必须有正确的表头和行数的时候。
技能链接
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/delegated-file-edit-verification/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“一个辅助工具说它已经更新了我的电子表格。请检查文件本身,并告诉我它是否真的成功了。”
每周 5 个新技能,1 分钟读完。
工作原理
在交出任务之前,AI 会写下输出必须包含的内容。辅助工具完成后,它会检查文件是否存在、位置、结构和数量,如果报告与实际不符,则使用完整路径重新运行。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Delegated File Edit Verification
Use this workflow whenever another agent, subprocess, or delegated tool claims it successfully created or modified a file. The goal is to prevent false acceptance of incomplete, misplaced, or incorrect edits.
This skill is especially useful for structured files such as spreadsheets, CSVs, databases, and generated artifacts, but the same pattern applies to any delegated file-edit task.
Core principle
Never accept a delegated "done" message on summary alone.
Immediately verify the result yourself in the target workspace using direct commands that inspect:
- file existence
- exact path
- expected structure
- expected size or counts
- key headers, fields, or identifiers
If the delegate's summary and your verification disagree, treat the task as incomplete. Re-run the task using absolute paths and explicit acceptance checks.
When to use this
Use this workflow when:
- a sub-agent says it wrote or updated a file
- the task depends on a specific workspace or output location
- the output is structured and can be checked mechanically
- prior executions showed path confusion, stale files, or inconsistent summaries
- correctness matters more than trusting the delegate's narrative
Procedure
1. Record the intended output contract before delegating
Before handing off the task, write down the minimum facts that must be true if the task succeeds.
Include:
- absolute target path
- required file name
- required file type
- expected sheets, tabs, tables, or sections
- expected row counts or approximate size
- required headers or columns
- any sentinel values that should appear
Example contract:
- file exists at
/workspace/results/report.xlsx - workbook contains sheets
summaryanddata datasheet has more than 1,000 rows- headers include
id,created_at,status
Do not rely on vague goals like "updated spreadsheet correctly."
2. Delegate with explicit acceptance criteria
When delegating, include:
- the absolute input path
- the absolute output path
- the exact required structure
- a request to report what was changed
- a request to include paths actually used
Good delegation prompt:
- Read
/workspace/input/source.xlsx - Write the cleaned workbook to
/workspace/output/cleaned.xlsx - Ensure sheets
summaryandrecordsexist - Ensure
recordsincludes headersid,date,amount - Report the exact absolute path written and row counts per sheet
3. Verify immediately after the delegate reports success
Do not move on. Run direct checks in the target workspace right away.
For all files, verify:
- the file exists at the expected absolute path
- modification time is recent
- file size is plausible
- there is not a second similarly named file in another directory
For structured files, verify the internal structure too:
- workbook sheet names
- CSV header row
- row counts
- required columns
- sample records or sentinel values
4. Prefer direct machine checks over narrative summaries
Trust commands and file inspection, not the delegate's prose.
Examples of useful checks:
- list the exact file path
- print sheet names
- count rows
- print header names
- inspect a few sample rows
- compare timestamps before and after
5. If verification conflicts with the delegated summary, mark the task incomplete
Examples of conflicts:
- delegate says file exists, but it does not
- delegate claims sheet
dataexists, but workbook contains different sheets - reported row count differs materially from actual count
- expected headers are missing
- output was written to a relative or unexpected location
- the delegate inspected one file but wrote another
When this happens:
- do not accept the result
- state the exact mismatch
- rerun the task
- require absolute paths for every input and output
- require a final report tied to those exact paths
6. Re-run with absolute paths and constrained scope
The most common recovery is to eliminate ambiguity.
On rerun:
- provide absolute paths only
- restate the acceptance contract
- instruct the delegate to verify its own output before reporting success
- ask it to print the exact path and structural facts used
Example rerun instruction:
- Re-run using only these absolute paths:
- input:
/workspace/input/source.xlsx - output:
/workspace/output/cleaned.xlsx
- input:
- Before reporting success, verify:
- file exists
- workbook sheets are
summaryandrecords recordsrow count exceeds 1000- headers
常见问题
如果辅助工具的报告有误怎么办?
指南要求把任务视为未完成,并使用绝对路径和明确的检查重新运行。
哪些文件适合这种方法?
对于电子表格、CSV 和数据库等结构化文件最为有用。
它也检查内容吗?
会。它既检查大小和数量,也检查关键的表头、字段或标识符。
详情
作者的原始描述
Verify delegated file-edit results directly in the target workspace before accepting success, and rerun with absolute paths if the delegate's report conflicts with reality.
repo: HKUDS/AgentPilot
热度
- GitHub 星标
- 7.8k
- 排名
- #12851
- 许可证
- MIT
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
agentpilot
7.8k帮你的智能体准备任务并运行 AgentPilot 循环,逐步改进项目:循环会提出修改、测试修改并为其打分。
openspace
7.8k帮你的智能体设置 OpenSpace,这是一个用于存储和获取智能体技能的工具,并通过 MCP 将其连接到你的 AI 应用。
rsi-arena
7.8k帮你的智能体设置并运行标准 AI 基准测试,例如 AIME 和 Terminal-Bench,用来比较不同的改进方法。
experiment-guide
7.8k帮你的智能体规划小型实验、阅读实验结果并记录发现,同时研究如何改进一个程序。