load-docs

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Load Documents

加载文档

The user wants documents pulled into your context window so you can work with them in later turns. Your job is to read every document they specified, completely, and then say "DONE".
用户希望将文档拉入你的上下文窗口,以便你在后续交互轮次中处理这些文档。你的任务是完整读取用户指定的每一份文档,然后回复“DONE”。

When the user gives you nothing

当用户未提供任何内容时

If the user invokes this skill without naming any documents, folders, or URLs, ask them what to load. Don't guess. One short question, then wait.
如果用户调用此技能但未指定任何文档、文件夹或URL,请询问他们要加载什么内容。不要猜测。只需简短提问,然后等待用户回复。

What counts as "a document"

什么属于“文档”范畴

Anything the user points at:
  • Local file paths (any type the
    Read
    tool supports — text, code, markdown, PDFs, notebooks, images)
  • Folders / directories — read everything inside, recursively, with sensible filtering (see below)
  • URLs — use
    WebFetch
    to retrieve and read the content
用户指向的任何内容:
  • 本地文件路径(
    Read
    工具支持的所有类型——文本、代码、Markdown、PDF、笔记本、图片)
  • 文件夹/目录——递归读取其中所有内容,并进行合理过滤(见下文)
  • URL——使用
    WebFetch
    工具获取并读取内容

Core rule: read it yourself, completely

核心规则:自行完整读取

Never delegate reading to a subagent. The whole point is that the content lands in your context so you can answer questions about it in later turns. A subagent's context is thrown away when it returns.
Read every document end-to-end. If a file is longer than what
Read
returns in one call (the tool defaults to 2000 lines and may truncate long lines), keep calling
Read
with
offset
advanced by the chunk size until you've covered the whole file. Don't stop at the first chunk and assume you've got the gist — the user is trusting you to actually have the full content available.
For PDFs longer than 10 pages, use the
pages
parameter to walk through page ranges (max 20 pages per call), continuing until the whole PDF is covered.
For URLs,
WebFetch
returns the content in one shot — you don't need to chunk, but if the response is clearly truncated (e.g., the page is enormous), note this honestly rather than pretending you got it all.
切勿将读取任务委托给子Agent。 该技能的核心目的是让内容进入你的上下文,以便你在后续轮次中回答相关问题。子Agent的上下文在返回结果后会被丢弃。
完整读取每一份文档。 如果文件长度超过
Read
工具单次调用返回的内容(工具默认返回2000行,可能会截断长行),请持续调用
Read
工具并将
offset
参数按块大小递增,直到覆盖整个文件。不要在读取第一块内容后就停止并假设已掌握要点——用户信任你能获取完整内容。
对于超过10页的PDF,使用
pages
参数按页面范围读取(每次调用最多20页),直到覆盖整个PDF。
对于URL,
WebFetch
工具会一次性返回内容——你无需分块读取,但如果响应明显被截断(例如页面内容极大),请如实告知用户,不要假装已获取全部内容。

Build a checklist before you start

开始前创建检查清单

Before reading anything, list every document you're about to load and track them with
TodoWrite
. One todo per document. Mark each one completed only after you've finished reading the entire file (all chunks, all pages). This is the mechanism that prevents you from losing track and skipping documents — without the checklist, partial reads slip through.
For folders: first list the folder contents (use
Glob
or
Bash ls
), apply the filtering rules below, then create one todo per file that survives the filter. The user should see the full list before you start reading so they can correct you if you've picked up the wrong scope.
在读取任何内容之前,列出所有即将加载的文档,并使用
TodoWrite
跟踪进度。每份文档对应一个待办事项。只有在完整读取文件(所有块、所有页面)后,才能标记该事项为已完成。这是防止你遗漏或跳过文档的机制——没有检查清单,很容易出现部分读取的情况。
对于文件夹:首先列出文件夹内容(使用
Glob
Bash ls
),应用以下过滤规则,然后为每个通过过滤的文件创建一个待办事项。在开始读取前,应让用户看到完整列表,以便他们纠正你可能选错的范围。

Folder filtering (sensible defaults)

文件夹过滤(合理默认规则)

When the user points at a folder, recursively include all files except:
  • Hidden files and directories (anything starting with
    .
    .git/
    ,
    .env
    ,
    .DS_Store
    , etc.)
  • Dependency directories:
    node_modules/
    ,
    vendor/
    ,
    venv/
    ,
    .venv/
    ,
    __pycache__/
    ,
    dist/
    ,
    build/
    ,
    target/
    ,
    out/
  • Lockfiles:
    package-lock.json
    ,
    yarn.lock
    ,
    pnpm-lock.yaml
    ,
    Cargo.lock
    ,
    poetry.lock
    ,
    Gemfile.lock
    ,
    composer.lock
    ,
    go.sum
  • Binaries and large media that aren't meaningful as documents:
    .exe
    ,
    .dll
    ,
    .so
    ,
    .dylib
    ,
    .zip
    ,
    .tar
    ,
    .gz
    ,
    .mp4
    ,
    .mov
    ,
    .mp3
    ,
    .wav
    ,
    .iso
  • Anything the user's
    .gitignore
    would exclude, when one is present and obvious
If you're unsure whether to include something, include it — better to read an extra config file than to silently skip something the user wanted.
If the filtered file count is very large (say, 50+), tell the user the count before starting and ask if they want to narrow the scope. Loading 200 files into context is rarely what someone actually wants.
当用户指向一个文件夹时,递归包含所有文件除了
  • 隐藏文件和目录(任何以
    .
    开头的内容——
    .git/
    .env
    .DS_Store
    等)
  • 依赖目录:
    node_modules/
    vendor/
    venv/
    .venv/
    __pycache__/
    dist/
    build/
    target/
    out/
  • 锁定文件:
    package-lock.json
    yarn.lock
    pnpm-lock.yaml
    Cargo.lock
    poetry.lock
    Gemfile.lock
    composer.lock
    go.sum
  • 无文档意义的二进制文件和大型媒体:
    .exe
    .dll
    .so
    .dylib
    .zip
    .tar
    .gz
    .mp4
    .mov
    .mp3
    .wav
    .iso
  • 当存在明显的
    .gitignore
    文件时,其中排除的所有内容
如果你不确定是否应包含某内容,请将其包含在内——多读一个配置文件总比悄悄跳过用户需要的内容要好。
如果过滤后的文件数量非常多(比如50+),请在开始读取前告知用户数量,并询问他们是否需要缩小范围。将200个文件加载到上下文中很少是用户的真实需求。

Reading order

读取顺序

Read in a sensible order — usually the order the user listed them, or alphabetically for folders. If there's an obvious entry point (
README.md
,
index.md
,
_index.md
), read that first so the rest has context.
按照合理顺序读取——通常是用户列出的顺序,或是文件夹中的字母顺序。如果存在明显的入口文件(
README.md
index.md
_index.md
),请先读取该文件,以便理解其余内容的上下文。

When you're done

完成后操作

Once every checklist item is complete, respond with exactly
DONE
and nothing else. No summary, no recap, no "I've loaded N documents" — just
DONE
. The user will follow up in the next turn with what they actually want to do with the content; your job here is just confirmation that the load finished.
The "single-turn" nature of this skill means: after you say DONE, don't keep applying these instructions. If the user's next message is "what was in the third doc?", just answer normally from the context you now have — you're not re-running the load workflow.
一旦所有检查清单事项都完成,只需回复
DONE
,不要附加任何其他内容。无需总结、无需回顾、无需“我已加载N份文档”——只回复
DONE
。用户会在下一轮交互中说明他们实际想要对内容执行的操作;你的任务只是确认加载已完成。
该技能的“单轮”特性意味着:在你回复DONE后,请勿继续应用这些指令。如果用户的下一条消息是“第三份文档里有什么?”,只需从你已有的上下文中正常回答即可——无需重新运行加载流程。

What to do if something fails

出现故障时的处理

  • File not found / permission denied: Note the failure in your response (instead of just "DONE") and list which files succeeded vs. failed. Don't pretend you read something you didn't.
  • URL fetch fails: Same — be honest about which URLs loaded and which didn't.
  • Binary or unreadable file you couldn't filter out: Skip it and mention it in your final message.
In any of these partial-failure cases, your final message should be the failure summary followed by
DONE
on its own line, so the user knows the skill has finished even though some items didn't load.
  • 文件未找到/权限被拒绝:在回复中说明故障情况(不要只回复“DONE”),列出成功加载和加载失败的文件。不要假装已读取未成功加载的内容。
  • URL获取失败:同上——如实告知哪些URL加载成功,哪些失败。
  • 未能过滤掉的二进制文件或不可读文件:跳过该文件,并在最终消息中提及。
在任何部分失败的情况下,你的最终消息应先说明故障摘要,然后在单独一行回复
DONE
,以便用户知道即使部分内容未加载,技能已完成运行。