跪拜 Guibai
← All articles
Frontend · GitHub

Agent Skills Are Not Prompts: A Complete Engineering Guide to Writing, Evaluating, and Operating Them

By OpenTiny社区 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

As agentic coding tools become standard, the difference between a productive agent and an unreliable one is the quality of its Skills. Poorly written Skills don't fail loudly; they silently increase token costs, grab the wrong tasks, and output outdated code, eroding trust in the entire system.

Summary

Cramming team knowledge into a single, massive Skill file creates context bloat and trigger chaos. A proper Skill uses a three-layer architecture—metadata for routing, instructions for process contracts, and scripts for deterministic actions—to load only what a task needs. The highest-yield Skills target high-frequency, easily botched tasks, acting as fault-tolerance patches that close the gap between a model's frozen training data and current best practices.

Five core design patterns cover most business flows: Tool Wrappers isolate SDK context, Generators enforce output structure via templates, Reviewers decouple checks from execution with modular scoring, Inversion forces agents to collect requirements instead of guessing, and Pipelines enforce sequential workflows with hard checkpoints. Writing a Skill is only the start; an 8-step closed-loop process from scenario selection to evaluation is the minimum for industrial-grade reliability.

Evaluation must break the black box. A four-layer framework—trigger, execution, outcome, and system—is needed to pinpoint failures, and A/B testing against a no-Skill baseline is mandatory. Without ongoing governance, a Skill ecosystem decays: directories become noisy, valuable Skills get buried, and old Skills that should be retired or downgraded to static scripts continue to pollute context and routing.

Takeaways
Skills are on-demand routing mechanisms, not static knowledge dumps; a three-layer architecture of metadata, instructions, and resources/scripts prevents context bloat.
The description field is a routing trigger for the AI, not a human-readable summary; writing it too broadly causes false triggers that degrade overall performance.
High-value Skills come from patching high-frequency, well-defined tasks that models repeatedly get wrong, not from documenting everything a team knows.
Volatile information like SDK versions and API parameters must be externalized into reference files; hardcoding them guarantees the Skill will soon output stale practices.
Deterministic logic should be moved into executable scripts (Python/Bash) rather than left to the model's improvisation.
Five design patterns—Tool Wrapper, Generator, Reviewer, Inversion, and Pipeline—provide optimal structures for different business flows, and they can be composed.
Skill evaluation requires a four-layer framework (trigger, execution, outcome, system) and mandatory A/B testing against a no-Skill baseline; judging by final answer quality alone is useless.
A Skill ecosystem needs explicit listing thresholds, directory categorization, and continuous governance; Skills whose core value is stable execution should be downgraded to static tools or scripts.
Conclusions

The most common Skill failure mode is not a crash, but a silent, steady drift toward outputting old SDK patterns and grabbing the wrong tasks—a degradation invisible without layered evaluation.

Google's Gemini API developer skill improved task success from 28.2% to 96.6% not by being encyclopedic, but by providing a capability overview, current SDK info, and links to docs; the Skill's role is to route the agent to the right approach, not replace documentation.

Anthropic and OpenAI both converge on the same principle: maximize a single agent's capability before introducing multi-agent complexity, and treat high-risk actions with human-in-the-loop checkpoints.

The boundary between a Skill and a Tool is defined by stability of execution; when a Skill's core value becomes reliably running a deterministic process, it should be retired from the prompt context and reimplemented as a script or MCP tool to reduce cost and evaluation burden.

Skill ecosystem decay follows a predictable pattern: directories grow without categorization, valuable Skills are buried in noise, and old Skills are never retired, making the system increasingly untrustworthy. The fix is product-management discipline, not more authoring guides.

Concepts & terms
Skill Three-Layer Architecture
A design pattern for agent Skills consisting of Metadata (lightweight routing trigger), Instructions (process contract and boundaries, loaded on trigger), and Resources/Scripts (deterministic actions and reference files, loaded on demand). This prevents context bloat by only loading what a task actually needs.
Trace Grading
An evaluation method that scores an agent's execution by examining the full chain of steps (traces) and intermediate outputs (artifacts), rather than just the final answer. It allows pinpointing whether a failure occurred at the trigger, execution, or outcome layer.
Skill Design Patterns (Tool Wrapper, Generator, Reviewer, Inversion, Pipeline)
Five structural templates for agent Skills. Tool Wrapper isolates SDK/CLI context; Generator enforces output structure via templates; Reviewer decouples checking logic from execution with modular scoring; Inversion forces the agent to interview the user instead of guessing; Pipeline enforces sequential workflows with hard validation gates.
Progressive Disclosure
A Skill architecture technique where a main instruction file acts as a guide, directing the agent to read detailed reference files or execute scripts only when needed, rather than loading all information into the context upfront.
Skill Ecosystem Governance
The operational practice of managing a collection of agent Skills as internal products, including directory categorization, listing thresholds, reuse metrics, conflict testing, and lifecycle management (retain, split, upgrade to tool, or retire).
Source: juejin.cn ↗ Google Translate ↗ Backup ↗