面试题库
共 328 题,当前筛选 2 题。
课程全部30 天从前端工程师到 Agent 工程师5 天提示词工程零基础Claude 高效使用:从对话到 Claude CodeCodex 与 OpenAI Agents SDK 高效使用7 天 MCP:把工具接进任何 Agent7 天 Agent Skills:把经验做成可复用能力5 天上下文工程14 天 RAG:从检索到可信回答14 天用 Agent 搭一条 AI 短剧生产线
7 天 Agent Skills:把经验做成可复用能力
D1 Skills 是什么:SKILL.md 规范、目录结构与三阶段渐进式加载
渐进式加载的三个阶段分别加载什么?为什么不能一次性把所有 skill 全加载进去?What does each of the three progressive disclosure stages load, and why not just load every skill up front?
国内高频海外高频进阶#agent-skills#progressive-disclosure分析过程 · 先想清楚再作答
- 这题在考你对机制的记忆精度,同时也在考工程感。只背出三个阶段的名字拿不到分,要说出每一阶段加载的**是哪些字段、哪些文件**。
- 拆法很简单,按加载的粒度从粗到细数:阶段一只加载 name 与 description,量级是每个 skill 五十到一百个 token;阶段二加载整份 SKILL.md 正文,建议不超过五千 token 与五百行;阶段三按文件粒度加载脚本、引用与资源。
- 回答「为什么不全加载」时给一个具体的数:二十个 skill 各三千 token 的正文加上引用文件,全量是十几万 token,超过很多模型的窗口,而且每一轮都要重发。渐进式加载后总量落在一万上下。
- 补一条更本质的理由:省下来的不只是钱,是窗口位置。腾出来的空间要留给真正在做的这件事的代码和数据,这就是上下文工程的核心取舍。
- 可预期的追问是「阶段三怎么触发」。答案是正文里必须写明读取条件——写「细节见 references 目录」等于没写,写「接口返回非 200 时读 references 里的错误码文件」才真正把时机交给了模型。
How to reason about it · think before answering
- This tests both recall precision and engineering sense. Naming the three stages is not enough; say which fields and which files each stage pulls in.
- Order them by granularity: stage one loads only name and description, roughly fifty to a hundred tokens per skill; stage two loads the full SKILL.md body, recommended under five thousand tokens and five hundred lines; stage three loads individual scripts, references and assets.
- Answer the why with a number: twenty skills at three thousand tokens of body plus reference files is well over a hundred thousand tokens, past many context windows, and resent every turn. Progressive loading lands around ten thousand.
- Add the deeper reason: what you save is window space, not just money, and that space belongs to the actual task.
- Expected follow-up: how does stage three fire? The body must state the loading condition. See the references folder is useless; read the error-code reference when the API returns a non-200 hands the timing to the model.
答题要点
- 阶段一发现:只加载 name 与 description,每个 skill 约五十到一百 token。
- 阶段二激活:读入完整 SKILL.md 正文,建议不超过五千 token 与五百行。
- 阶段三执行:按需读取 scripts、references、assets 里的单个文件,不是整目录倒进来。
- 全量加载会撑爆窗口且每轮重发,渐进式加载能把量级压到十分之一左右。
- 阶段三能不能被触发,取决于正文有没有写清「什么条件下读哪个文件」。
Key points
- Discovery: only name and description, about fifty to a hundred tokens per skill.
- Activation: the full SKILL.md body, ideally under five thousand tokens and five hundred lines.
- Execution: individual files from scripts, references or assets, loaded one at a time on demand.
- Loading everything up front blows the window and is resent every turn; progressive loading cuts it to roughly a tenth.
- Stage three only fires if the body spells out which file to read under which condition.
D5 手写一个 skill 运行时:扫描、frontmatter 解析、注入系统提示、按需读取正文
如果让你自己给一个 Agent 实现 skill 支持,发现阶段和激活阶段各要做什么?为什么要分成两步?If you implemented skill support in your own agent, what happens in the discovery stage versus the activation stage, and why split them?
国内高频海外高频进阶#agent-skills#runtime#progressive-disclosure分析过程 · 先想清楚再作答
- 这题在考你有没有把渐进式加载当成一个可实现的机制,而不是一句口号。只复述「发现、激活、执行」三个词是不够的,要落到每一步读了什么、写进了哪里。
- 发现:扫描约定目录,把所有含 SKILL.md 的文件夹找出来,解析出名字与描述,拼成一份清单注入系统提示。**这一步正文一个字都不进来**,清单里只有名字、描述、位置三样。
- 激活:模型判断当前任务命中了某条描述,才去读那一份完整的 SKILL.md,把正文放进上下文,同时告诉它技能目录在哪、附带哪些资源文件。
- 分两步的理由是成本结构不对称,这是本题的核心句:**披露的成本每一轮都要付,激活的成本只付一次。** 系统提示随每次请求重发,清单每多一个字都要乘会话轮数;正文只在被激活的那一轮进上下文,之后作为历史消息留着。
- 由这条不对称性可以顺手解释规范里的硬约束:为什么描述有长度上限而正文没有,为什么描述必须写触发条件而不是使用说明——描述是每轮都在花钱的那一段。
- 可预期的追问是「位置这一项能不能省」。不能:模型要靠它知道去读哪个文件,而且它的父目录是正文里所有相对路径的解析基准。
How to reason about it · think before answering
- This tests whether progressive disclosure is a mechanism you could build, not a slogan. Repeating the three stage names is not enough; say what each stage reads and where it writes.
- Discovery: scan the conventional directories, find every folder containing SKILL.md, parse out name and description, and assemble a catalog injected into the system prompt. No body text enters here; each entry carries only name, description and location.
- Activation: once the model judges that a task matches a description, read that full SKILL.md into context, along with the skill directory path and a list of bundled resource files.
- The reason for the split is an asymmetry in cost: disclosure is paid every turn, activation is paid once. The system prompt is resent with every request, so each extra character in the catalog is multiplied by the number of turns.
- That asymmetry also explains the spec's hard limits: descriptions are capped and bodies are not, and descriptions must state trigger conditions rather than usage instructions, because the description is the part that keeps costing money.
- Expected follow-up: can the location field be dropped? No. The model needs it to know which file to read, and its parent directory is the base for every relative path in the body.
答题要点
- 发现阶段扫描目录、解析名字与描述、拼成清单注入系统提示,正文不进来。
- 激活阶段才读完整 SKILL.md,并附上技能目录与资源文件名清单。
- 分两步的根据是披露每轮付费、激活只付一次这条不对称性。
- 这条不对称性解释了描述为什么有长度上限、为什么要写触发条件而不是使用说明。
- 清单里位置字段不能省,它既是读取目标也是相对路径的解析基准。
Key points
- Discovery scans directories, parses name and description, and injects a catalog into the system prompt with no body text.
- Activation reads the full SKILL.md and adds the skill directory plus a list of bundled resource filenames.
- The split exists because disclosure is paid every turn while activation is paid once.
- That asymmetry explains why descriptions are length-capped and must state triggers rather than usage.
- The location field is required: it is both the read target and the base for relative paths.