AI Skills AI技能 8h ago Updated 2h ago 更新于 2小时前 35

36% of Public AI Agent Skills Are Broken. Here’s How to Build One That Isn’t. 36%的公共AI代理技能存在缺陷。以下是如何构建一个可靠的AI代理。

Agent skills are markdown-based procedural knowledge files (SKILL.md) that teach AI agents domain-specific workflows, but their simplicity masks significant risks around triggering, accuracy, and security The description field acts as the primary trigger mechanism; it must explicitly state both what the skill does and when to use it, with a slight bias toward overselling to counteract model under-triggering tendencies Skills should be built from real hands-on expertise and documented gotchas rat Agent skills通过SKILL.md文件赋予AI代理特定任务的程序性知识,但设计不当会导致技能无法触发、API密钥泄露或计算错误 技能描述是触发机制的核心,需明确说明功能和使用场景,并适当"过度推销"以避免模型低估其相关性 技能内容应源自真实专家经验而非让LLM生成,重点记录环境特定的"坑点"和手动纠正记录 采用渐进式披露策略,将详细参考资料放入references/子目录,保持SKILL.md主体在500行/5000token以内 对易错步骤使用确定性脚本而非让模型即兴发挥,同时对外部技能进行安全审计以防供应链攻击

50
Hot 热度
50
Quality 质量
50
Impact 影响力

Analysis 深度分析

TL;DR

  • Agent skills are markdown-based procedural knowledge files (SKILL.md) that teach AI agents domain-specific workflows, but their simplicity masks significant risks around triggering, accuracy, and security
  • The description field acts as the primary trigger mechanism; it must explicitly state both what the skill does and when to use it, with a slight bias toward overselling to counteract model under-triggering tendencies
  • Skills should be built from real hands-on expertise and documented gotchas rather than generic LLM-generated content, with body text kept under ~500 lines/5,000 tokens using progressive disclosure via a references/ folder
  • Fragile, correctness-critical steps should be offloaded to deterministic scripts in a scripts/ directory rather than left to probabilistic model reasoning, eliminating entire classes of inference-based bugs
  • Third-party skills must be vetted before execution; Snyk's 2026 ToxicSkills audit found 36.8% of public skills had security flaws and 13.4% contained critical vulnerabilities including prompt injections and malware

Why It Matters

Agent skills represent a rapidly adopting open standard (agentskills.io) that is becoming a primary mechanism for extending AI agent capabilities, making how they're built and secured a critical concern for anyone deploying agentic systems. The gap between a skill's simplicity on paper and the real-world risks of mis-triggering, incorrect outputs, and supply chain compromise means practitioners need disciplined authoring and review processes before integrating skills into production workflows.

Technical Details

  • Skills follow the agentskills.io open standard: a SKILL.md file with a YAML frontmatter header (name max 64 chars, description max 1,024 chars) followed by a markdown body, organized in folders that may contain references/ and scripts/ subdirectories
  • At agent startup, only skill names and descriptions are loaded into context; the full body is loaded only when a skill is selected, enabling progressive disclosure of detailed reference materials on demand
  • Deterministic scripts in the scripts/ directory are excluded from the context window entirely, reducing token consumption while replacing probabilistic model reasoning with explicit code execution for fragile operations (e.g., numerical reconciliation with tolerance-based validation)
  • The Snyk ToxicSkills audit (February 2026) analyzed 3,984 public agent skills, finding 1,467 with security flaws and 534 with critical issues including prompt injection vectors and malicious payloads capable of accessing local file systems and API keys
  • The recommended skill body size ceiling is approximately 500 lines or 5,000 tokens; beyond that, content should be split into the references/ folder to avoid context window contention with other active information

Industry Insight

  • Organizations adopting agent skills should establish internal review checklists modeled on dependency scanning practices from traditional software engineering, treating third-party skills with the same scrutiny as open-source packages before deployment
  • The shift from probabilistic to deterministic execution for critical steps via scripts represents a broader pattern worth adopting across agentic systems: identify fragile operations (math, validation, state mutations) and hard-code them rather than relying on LLM reasoning
  • As the agentskills.io standard gains traction across platforms like Claude Code and OpenAI's Codex, expect a growing ecosystem of both high-quality community skills and supply chain attack vectors, making skill provenance and auditability a competitive differentiator for enterprise AI platforms

TL;DR

  • Agent skills通过SKILL.md文件赋予AI代理特定任务的程序性知识,但设计不当会导致技能无法触发、API密钥泄露或计算错误
  • 技能描述是触发机制的核心,需明确说明功能和使用场景,并适当"过度推销"以避免模型低估其相关性
  • 技能内容应源自真实专家经验而非让LLM生成,重点记录环境特定的"坑点"和手动纠正记录
  • 采用渐进式披露策略,将详细参考资料放入references/子目录,保持SKILL.md主体在500行/5000token以内
  • 对易错步骤使用确定性脚本而非让模型即兴发挥,同时对外部技能进行安全审计以防供应链攻击

为什么值得看

本文系统性地解决了AI代理技能开发中的核心痛点:触发率、准确性、安全性和成本。随着agent skills成为开放标准并被更多平台采用,掌握这些最佳实践对构建可靠、高效的AI代理系统具有直接指导价值。

技术解析

  • 技能触发机制:SKILL.md头部YAML包含name(≤64字符)和description(≤1024字符),代理启动时仅加载这些信息。描述需同时说明"做什么"和"何时使用",并适度夸大以确保触发
  • 渐进式披露架构:技能文件夹可包含SKILL.md、references/(按需加载的详细文档)和scripts/(确定性脚本),避免长文本占用上下文窗口
  • 确定性脚本模式:将易错步骤(如数学计算)硬编码为Python脚本,通过明确指令"运行此脚本"而非"参考此脚本"确保执行确定性,消除模型猜测导致的错误
  • 安全审计数据:Snyk 2026年2月发布的ToxicSkills研究显示,3984个公开技能中36.8%存在安全漏洞,13.4%有严重问题(提示注入或恶意软件)

行业启示

  • 技能开发范式转变:从"让AI生成技能"转向"专家记录经验+AI执行",领域专业知识成为技能质量的核心壁垒
  • 安全即依赖管理:agent skills作为开放标准虽便利,但需像管理npm/pip包一样建立技能供应链安全审查流程
  • 确定性优先原则:在概率性AI系统中,对关键步骤采用确定性代码而非自然语言指令,是提升可靠性的有效路径

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。