Documentation as Code: Versioning and Testing Skills
How LVD keeps skill documents honest: versioned beside the code, linked to tool schemas, validated in the build and tested through their example conversations.
Give a new support hire a login to the order system and nothing else. They can see every button, yet they do not know which one to press first, what to say when a card is declined, or when to call a supervisor. An AI agent holding a list of tools is in exactly that position. The Skills layer exists to close the gap.
Layer 7 of LVD, with a volatility coefficient of 0.95, is unusual. It is the only layer whose main artefacts are documents rather than executable code. A skill is a Markdown file that records procedural knowledge: how to get one particular job done with the tools the lower layers expose.
The book is clear that "documentation" does not mean loose notes. Skill files are rigorously structured, kept under version control and open to automated testing. A tool's schema tells an agent what shape of input it will accept. A skill tells the agent when that tool is the right choice, what must be true beforehand, and what to do afterwards.
Every skill follows the same template of eight parts: a purpose, the conditions that should trigger it, prerequisites, parameters, ordered steps, error handling, chaining to follow-on skills, and example conversations. The uniformity is not bureaucracy. It lets a machine check that nothing was forgotten, and it lets an agent find the part it needs without wading through free-form prose.
Here is a skill of my own for a library lending system, trimmed to its bones (purpose, prerequisites and examples are left out for space):
# Renew Loan
## When to use
- Patron wants more time on a borrowed item
## Parameters
- loanId (string, required)
## Steps
1. `get-loan`: read the due date and renewals used
2. `renew-loan` with loanId
3. Tell the patron the new due date
## Error handling
- Reserved by someone else: say so, offer `place-hold` on another branch's copy
- Renewal limit reached: explain the limit, suggest returning the item
## Chaining
- After a refusal, `place-hold`
Notice how little of it is about the happy path. Three numbered steps cover the success case. The rest is about when to act, how to call, and what to do when the answer is no.
Anyone can write down the happy path. The book's workflow documentation goes further and treats recovery as a first-class part of every step: not only what to do when a call works, but what to do for each way it can fail. That is what separates a skill from a numbered checklist.
Multi-tool jobs make the point sharply. Real operations branch. If the item is reserved, go one way. If the patron has unpaid fines, go another. Some lookups are independent and can run side by side. The book captures these forks as structured decision trees inside the document, so the agent sees the branches in advance rather than discovering them halfway through a conversation.
Why does this matter so much? An agent with no guidance for a failure will improvise, and improvisation is the behaviour you can least predict and least review. A documented branch is different. A domain expert can read it, challenge it and correct it in a pull request. Writing the failure path down turns a model's guess into a decision somebody owns.
Skills sit near the top of the volatility scale because they track things that move constantly. New tools arrive and need new skills. Existing tool interfaces evolve and force edits to parameters and steps. Real conversations reveal gaps in the error handling that nobody anticipated. A layer this exposed to change needs the same discipline as code, and that discipline is the subject of documentation as code and testing skills.
There is also a dependency story. A skill refers to tool names, parameter definitions and error codes from below, but it never imports or runs them. The agent that follows the skill sits one layer higher; see why agents sit above skills for how that ordering is justified.
A tool without a skill is an API nobody has explained. Keep the template identical across skills, spend your effort on the branches where things go wrong, and treat the file as part of the system rather than an afterthought. If you want to see how the tools underneath are meant to be shaped, start with the anatomy of a tool.