sw-glossary
Skill167 starsChanged 12 months agoMITView on GitHub
Build the shared language - interview the user term by term and write GLOSSARY.md with what each term means in the business, the data, the code and the UI. Use for "glossary", "ubiquitous language".
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 6 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 20
Create the file when the first term settles, never empty.
- Distinctive: line 45
Only terms specific to this domain.
- Distinctive: line 51
Harvest: Read the README, the schema or migrations, the models and types, the routes and the UI strings.
- Distinctive: line 61
Check the code: When the user says how something works, read the code.
- Distinctive: line 71
Every skill writes specs, names, commits and replies in the glossary's terms.
- Distinctive: line 85
Write GLOSSARY.md by hand in the format above.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
sw-glossary: one word for one thing, everywhere
Domain-driven design's ubiquitous language: an Order should be an Order when the
client talks about it, in the database, in the code and on the screen. When the words
drift ("purchase" table, Order type, "basket" button), agents spend tokens decoding
jargon, name new code inconsistently and build the wrong thing. A short glossary fixes
that for every session after it. Run this at a project's start, when a new domain area
arrives, or whenever one word means two things or two words mean one.
GLOSSARY.md
One file at the repository root. A repo with several bounded contexts keeps a
GLOSSARY-MAP.md at the root that links one GLOSSARY.md per context; follow it.
Create the file when the first term settles, never empty.
# Glossary
A shop that sells refurbished laptops to small businesses.
## Ordering
### Order
A customer's request to buy one or more products, placed at checkout and paid once.
- Avoid: purchase, basket, transaction
- Data: `orders` table; its lines in `order_lines`
- Code: `Order` in `src/orders/order.ts`; `POST /orders`
- UI: "Order", "My orders"
- Rules: never deleted; cancelling sets the status to cancelled- The definition says what the thing is, in the client's words, in one or two sentences. No implementation detail there.
Avoidlists the synonyms nobody should use for it. Be opinionated: one term wins.Data,CodeandUIsay where the term lives at each level. Put table, column, type and file names in backticks sospecweave glossary checkcan find them. Leave out a level the term does not have.Rules(optional) holds the invariants the business states about it.- Only terms specific to this domain. Timeouts, caches and retries are not glossary terms even if the code uses them everywhere.
- Group terms under
##headings when clusters appear; a flat list is fine.
The interview
- Harvest. Read the README, the schema or migrations, the models and types, the
routes and the UI strings. List the nouns that recur, and every mismatch: one
concept with several names (
purchasestable,Ordertype, "Basket" label) and one name with several meanings ("account" as login and as billing account). - Ask in rounds, as sw-grill-me does: a few terms per round, each question with
your recommended answer, worded so "yes" accepts it. "The table is
purchases, the type isOrder, the button says Basket. Call all three an Order?" Use your tool's structured question tool when it has one. - Sharpen with scenarios. "A customer pays for 3 items and one ships late: one Order or two?" Invent the edge case that forces a boundary.
- Check the code. When the user says how something works, read the code. If it disagrees ("the code cancels whole Orders; you said a single line can be cancelled"), say so and settle which one is right.
- Write each term as it settles, not in a batch at the end.
- Drift is work, not an edit. Where the code or data uses an avoided word, do not rename silently. List it for the user, and plan the renames as an increment (sw-increment): a table rename is a migration and the user's call.
Using it
- Every skill writes specs, names, commits and replies in the glossary's terms.
specweave glossary checklists avoided words used as identifiers in tracked files and backtickedDataorCodenames that no longer exist, withfile:line.--strictexits 1 when it finds any, for CI.--jsonfor tools.- A new term or a changed meaning comes back here, or into sw-grill-me's interview.
Configuration
specweave skills enable glossary installs this skill. A GLOSSARY.md or
GLOSSARY-MAP.md at the root installs it too, and adds a short "Shared language"
section to AGENTS.md on the next specweave update.
Manual path (no CLI)
Write GLOSSARY.md by hand in the format above. Without the check, search the code for
each avoided word yourself (git grep -n -i -w purchase) and read the hits.
Adapted from mattpocock/skills domain-modeling (MIT, Copyright (c) 2026 Matt Pocock);
see references/credits.md.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- sw-autoSkill
- sw-doneSkill
- sw-doSkill
- sw-grill-meSkill
- sw-handoffSkill
- sw-incrementSkill
- sw-jevSkill
- sw-projectSkill
- sw-reviewSkill
- sw-syncSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

