Tutorial: three steps
Tip
In five commands you get a
spec.toml, a document that governs a code path, and a passingspec check. Install first: Install.
The steps
- Write.
spec initwrites a starterspec.toml;spec newstores a document with the owner of the code it governs. - Link.
--governsrecords the code path.spec contextnow lists the document for any file under it. - Check.
spec checkruns the rules.spec agentsprints the lines for an agent’s instruction file.
Run it
$ spec init --owner 'services/*={1}' --write
$ spec new sot --governs services/shop/src/cart --title "Cart totals"
$ spec context services/shop/src/cart/total.rs
$ spec check
$ spec agents --for claude
What happened
The --owner pattern makes every directory under services/ an owner, so the document lands in
services/shop/.spec/sot/. Its id, sot:shop/cart-totals, comes from that place.
spec context answers the question an agent or reviewer asks first: which documents must I read
before changing this file?
Next
- Document types: what to write besides a
sot. - Lifecycle: how a document becomes
active. - Editing documents: change documents without hand-editing front matter.