逐日AI

面试题库

共 328 题,当前筛选 1 题。

7 天 Agent Skills:把经验做成可复用能力

D2 写第一个 skill:description 的触发词怎么写、结构怎么分层、怎么装进客户端

  • skill 的正文应该写什么、不应该写什么?为什么「坑」那一段必须留在 SKILL.md 里而不是挪到引用文件?What belongs in a skill body and what does not, and why must the gotchas stay in SKILL.md rather than move to a reference file?
    国内高频海外高频进阶#agent-skills#skill-authoring

    分析过程 · 先想清楚再作答

    1. 这题考的是你有没有真写过 skill。没写过的人会答「写清楚步骤」,写过的人会先给一条判据。
    2. 判据只有一句:**不写这一条,模型会不会做错?** 不会就是废话,删掉。解释什么是 PDF、什么是数据库迁移,模型本来就知道,写进去纯粹在稀释注意力。
    3. 该写的三类是:项目特有的约定、非显然的边界情况、以及指定用哪个工具或接口。这三类的共同点是模型的通用知识里没有。
    4. 输出格式那一段要单独强调:给模板比用文字描述可靠,因为模型对具体结构做模式匹配的能力远强于读一段散文式的格式说明。
    5. 「坑」为什么不能挪走,答案是一个先后顺序问题:**模型得先知道有坑,才会去查坑**。放进引用文件就要求它在还没撞上的时候预判自己会撞上,这个前提不成立。引用文件适合放「我知道会用到,只是现在还不需要」的材料。
    6. 可预期的追问是「那什么该挪进 references」。答案是长、且用不用得上有明确判断条件的材料,并且正文里必须写出那个条件,比如「接口返回非 200 时读错误码文件」。

    How to reason about it · think before answering

    1. This separates people who have written skills from people who have read about them. The untested answer is write clear steps; the tested answer starts with a test.
    2. The test is one sentence: would the model get this wrong without this line? If not, cut it. Explaining what a PDF is only dilutes attention.
    3. Three things belong: project-specific conventions, non-obvious edge cases, and which tool or API to use. All three are absent from the model's general knowledge.
    4. Call out output format specifically: a concrete template beats prose, because models pattern-match against structures far better than they parse a described format.
    5. Gotchas cannot move because of ordering: the model must know a trap exists before it will look it up. Putting them in a reference file assumes it can predict a collision it has not hit yet.
    6. Expected follow-up: what does belong in references? Long material whose need has a clear trigger condition, and the body must state that condition, such as read the error-code file when the API returns a non-200.

    答题要点

    • 判据是「不写这一条模型会不会做错」,不会就删。
    • 该写:项目特有约定、非显然的边界、指定的工具与接口。
    • 输出格式给模板,不要用文字描述格式。
    • 坑必须留在正文,因为模型要先知道有坑才会去查坑。
    • 引用文件放长材料,且正文必须写出「什么条件下读它」。

    Key points

    • The test: would the model get this wrong without the line? If not, delete it.
    • Include project conventions, non-obvious edge cases, and the specific tool or API to use.
    • Give a template for output format instead of describing it in prose.
    • Gotchas stay in the body because the model must know a trap exists before looking it up.
    • References hold long material, and the body must state the condition for loading each one.