Skip to the lesson
CivOps AI Academy · F05One Name for Everything: a Naming Standard for Every Machine, Line, Measure and Tag
0%

Chapter 1 · Session 4

The names your plant already has

Every report, alarm, screen and AI question finds plant data by its name. This session settles the names before Session 5 builds a single table, because a table is named once and then lives for years. It starts with what your plant already calls things.

25 min1 stepNo code yet

By the end of this chapter you can

  • Say why the names come before the schema, and what a name costs to change later.
  • Recognise the four kinds of name one press already has, and which one the platform uses.
  • Have Claude Code list every name your plant uses today, with duplicates and look-alikes flagged.

Why names come before tables

Session 5 turns your intent into tables, and every table, column, screen address and report is named from this session's standard. Renaming a column later means changing every screen, query, test and agent prompt that uses it; renaming a measure means rebuilding every dashboard that reads it. Settled now, a name costs a sentence. Changed after go-live, it costs a project.

The same is true across lines. If press 3 calls its tonnage P3_TONNAGE and press 4 calls it Press 4 Tonnage, every chart is built once per press, and an AI agent asked "which press ran hottest yesterday?" has to guess that the two are the same thing. It may guess wrong.

Dashboards to build, with and without a naming standardBar chart: without a standard the count grows by 5 for every line, to 30 at six lines; with a standard it stays at 5. 0102030551 line1052 lines1553 lines2054 lines2555 lines3056 linesDashboards to build and keep, 5 per line: names per line (red) versus one standard (green)
Built once, or built per line. With five dashboards per line, a plant with no standard keeps 30 dashboards by its sixth line. With one standard it keeps five, and a new line appears in them the day it starts sending data.

Four names for one press

No plant starts from nothing. Each piece of equipment already has several names, made by different teams for different jobs. The standard does not throw them away: it picks one as the platform's name and records the others against it as aliases.

One press, four namesA single press has a PLC address, an ISA-5.1 instrument tag, an ISO/IEC 81346 code and a platform path; the alias table links them. One real presspress 3, line 1,in the press shopPLC addressN7:12 (tonnage)used by the controls engineerISA-5.1 tagPT-301 on the P&IDused by the process drawingsISO/IEC 81346 code=PRS3-M1used by the electrical drawingsPlatform pathacme/cle/press-shop/line-1/press-3used by screens, reports and agentsThe alias table records all four, so each team keeps its own name and every system meets on the path.
Four names for one press. Controls, process drawings, electrical and the platform each keep their own. The platform uses the path; the alias table links the rest.
Kind of nameExampleMade forWhere it belongs
PLC or device addressN7:12, DB10.DBW4The controller's memoryOnly at the controller and the connector that reads it (Session 20); never shown above it
ISA-5.1 instrument tagPT-301, TT-2203P&IDs and instrument lists [3]Kept as an attribute of the equipment, so drawings and data can be matched
ISO/IEC 81346 designation=PRS3-M1Electrical and mechanical drawings [4]Kept as an attribute, like the instrument tag
Platform pathacme/cle/press-shop/line-1/press-3/tonnage_knEvery screen, report and AI agentThe one name the platform uses

The order comes from ISA-95

The path needs an order every plant already understands. ISA-95 (IEC 62264) gives it: enterprise, site, area, work centre (a line or cell) and work unit (a press) [1]. Session 5's tables use the same levels, so a press is a row in equipment under a line, under an area, under your site cle. Written as a path, each level is one segment joined by slashes, which is exactly how MQTT topics are built when plant data starts flowing in Session 20 [2].

ISA-95 levels become the pathSix levels, enterprise to measure, each turned into one path segment and joined with slashes: acme/cle/press-shop/line-1/press-3/flange_height_mm. EnterpriseacmeSitecleAreapress-shopLine (work centre)line-1Equipment (work unit)press-3Measureflange_height_mmJoined with /acme/cle/press-shop/line-1/press-3/flange_height_mmSame order on every line,so a screen built for line 1works on line 2 unchanged.
From hierarchy to path. The levels give the order; the path writes it down. Because every line uses the same order, anything built for line 1 works on line 2.
Step 1

List every name your plant already uses

15 minutes

Why

You cannot standardise names you have not seen. Asking Claude Code to read the tag export and the equipment list and sort them takes minutes, and it finds what people miss: the same measure under two names, names one letter apart, and values in a unit nobody wrote down. Those are the cases the standard must settle, and settling them now is free.

Do this

Export the tag list for one line from your SCADA or historian as a CSV file (name, description, unit, address), and the equipment list from the P&ID or maintenance system if you have one. Names and descriptions only: never values, and never anything with people's names in it. Save them in your repository folder under docs/names/source/. If you cannot export yet, write 20 tag names from one line into a file by hand: that is enough to start.

Terminal or PowerShell
cd ~/code/acme-platform && git switch main && git pull && git switch -c names/standard && claude
Paste into Claude Code
Read docs/INTENT.md and every file in docs/names/source/. Do not change or delete those files.

Write docs/names/INVENTORY.md, in plain English for someone who does not write code:
1. Every piece of equipment you can find, grouped by ISA-95 level: site cle (Cleveland), area, line (work centre), equipment (work unit). Mark anything whose level you had to guess.
2. Every measure, with its unit if you can tell it, and which tags carry it on which machine.
3. The same measure under different names (for example a tonnage tag named differently on two presses).
4. Names that differ by only one or two letters, or only in capitals, spaces or underscores, and whether they mean the same thing or different things.
5. Values whose unit is missing, or differs between machines (for example degrees F on one press and C on another).
6. Which measures docs/INTENT.md needs, and which tags carry them. Mark the rest "not needed yet".

End with "Questions for the area owner": anything you could not settle from the files.
Commit it on this branch (names/standard). Do not open a pull request yet.

You will see recreated screen

claude — acme-platform
⏺ Read(docs/INTENT.md)
⎿ Read 38 lines
⏺ Read(docs/names/source/line-1-tags.csv)
⎿ Read 214 lines
1
⏺ Write(docs/names/INVENTORY.md)
+## Same measure, different names
+- Tonnage: P3_TONNAGE (press 3), Press 4 Tonnage (press 4), PRS5_TON (press 5)
+## Look-alikes
+- P3_TONNAGE and P3_TONNAGES: one letter apart; the second is the shift total, not the reading
+## Units
+- Die temperature: degrees F on press 5 (DIE_TMP_F_P5), degrees C on presses 3 and 4
2
⏺ Write(docs/names/INVENTORY.md)
+## Questions for the area owner
+1. Is the coil feeder part of line 1, or its own line?
+2. Is P3_TONNAGES used by anyone, or can it be retired?
3
⏺ docs/names/INVENTORY.md lists 6 presses and 2 coil feeders on 2 lines, 38 measures, and 214 tags. 4 measures have two or more names, 3 pairs of names are one letter apart, and press 5 reports die temperature in degrees F. The intent needs 6 of the 38 measures. Two questions need the area owner.
Claude Code reads the exports and writes the inventory. The tags here are the stamping plant's; yours will be your own.
  1. It reads the files you exported. If a file is too large, export one line at a time.
  2. The findings that matter: one measure with several names, two names one letter apart, and a unit that differs.
  3. Answer these with the area owner before Step 2; the answers go into the standard.

Check it worked

docs/names/INVENTORY.md is committed on the branch names/standard, with sections for equipment, measures, duplicates, look-alikes, units and questions.

Fastest path

If the plant has several lines, export one representative line only. The standard written from one line covers the others; Step 6 shows how to add a name later.

If it goes wrong

The export holds people's names, recipes or customer data

Delete that file, export again with only tag name, description, unit and address, and tell IT what you exported. The repository is private, but only names belong in it: real records never enter the repository or the development database (Session 6).

Two tags look alike and Claude Code says they are the same

Check before you agree. On the platform we built, two folders called schedule and scheduling looked like one thing and computed different things; an agent imported the wrong one and every check still passed. Ask the area owner, and if both are real, both stay with names that are not one letter apart.

Claude Code starts renaming tags or writing code

Say: Stop. Only write docs/names/INVENTORY.md. Nothing else changes in this step.

Knowledge check

Why does the naming session come before the schema session?

Knowledge check

Which name should never appear above the connector that reads the controller?

References

  1. ISA: ISA-95 Standard, Enterprise-Control System Integration. https://www.isa.org/standards-and-publications/isa-standards/isa-95-standard
  2. OASIS: MQTT Version 5.0 (topic names, topic filters and wildcards). https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html
  3. ISA: ANSI/ISA-5.1-2024, Instrumentation and Control Symbols and Identification (announcement). https://www.isa.org/news-press-releases/2024/october/widely-used-engineering-symbols-and-drawings-stand
  4. ISO: IEC 81346 reference designation system (ISO Online Browsing Platform). https://www.iso.org/obp/ui/en/#!iso:std:75471:en

Chapter 2 · Session 4

Write the standard, with rules a machine can read

One prompt turns the inventory and your intent into a one-page standard: the path, the codes, the database names Session 5 will use, and a rules block that a script can check. Then you settle it with the area owner and map the old tags to their new names.

35 min2 stepsOne page

By the end of this chapter you can

  • Have Claude Code write docs/naming-standard.md with a machine-readable rules block, tied to your enterprise and site codes.
  • Check the standard with the area owner and record their answers.
  • Map legacy tags to standard paths as aliases, without renaming anything in the PLC or SCADA.

Six rules on one page

A standard people can remember beats a complete one nobody reads. These six cover almost every name a small or mid-size plant needs, and each exists because breaking it has caused a real problem:

Anatomy of a nameThe path acme/cle/press-shop/line-1/press-3/flange_height_mm with each segment labelled, and six rules for writing names. acmeenterprise/clesite/press-shoparea/line-1line/press-3equipment/flange_height_mmmeasureLower case onlyLine-1 and line-1 would be two different placesFixed order, no gapsevery path has all six levels, in this orderLevels joined with hyphenspress-shop, line-1, press-3Measures joined with underscoresflange_height_mm, good_countUnit at the end_mm, _c, _kn, _spm; counts and states need noneNothing elseno spaces or dots; + and # are MQTT wildcards
The anatomy of a name. Six segments in a fixed order, lower case, with the unit at the end of the measure.
RuleWhat it saysWhy
1. Fixed levelsenterprise / site / area / line / equipment / measure: all six, in that orderScreens, subscriptions and queries find data by position [1]
2. Lower caseNo capitals anywhere in a path, table or columnMQTT topic names are case sensitive, so Line-1 and line-1 would be two places [1]; Postgres folds unquoted names to lower case, so mixed case causes errors later [2]
3. JoiningHyphens inside a level (press-shop); underscores inside a measure, table or column (flange_height_mm)A measure stays one word in code, queries and spreadsheets
4. VocabularyMeasures come from a short written list; a new word is added by reviewThe same measure gets the same word on every press
5. UnitsEvery physical measure ends with its unit: _mm, _c, _kn, _spmA number without a unit is a guess; unit codes follow UCUM where one exists [3]
6. ForbiddenNo spaces, dots, +, #, or a leading $; no times or dates in a name+ and # are MQTT wildcards [1]; a time belongs in the value's own timestamp, in ISO 8601 [4]

What Claude Code will write

The prompt in Step 2 produces a file like this one, the stamping plant's, filled with your codes. The part at the end is the rules block: the same rules written as data, so the check in chapter 3 reads them from the document itself. The document and the check can then never disagree.

docs/naming-standard.md (the stamping plant's, with your codes)
# Naming standard (version 1)
Owner: pat@acme.com. Area owners approve new words for their area. Changes by pull request only.
Checked by: npm run check:names (scripts/check-names.mjs), on every pull request.

## The path: one name for every measure
enterprise/site/area/line/equipment/measure     all six levels, in this order (ISA-95)
Example: acme/cle/press-shop/line-1/press-3/flange_height_mm

## Codes
Enterprise: acme (Acme Bottling). Site: cle (Cleveland).
Areas: press-shop, tool-room, shipping. Lines: line-1, line-2.
Equipment: press-1 ... press-6, coil-feed-1, coil-feed-2.
Reserved: site codes starting with syn are made-up data only (Session 6).

## Database names (Session 5 reads this)
Tables and columns: lower case, words joined by underscores.
Measurements end with their unit: value_mm, lower_mm, tonnage_kn.
Times end in _at and carry the time zone. References end in _id.
Lot codes: L- and four or more digits (L-0412).

## Legacy names
Old tags are never renamed in the PLC or SCADA. Each one is an alias of
its standard path, listed in docs/names/aliases.csv. Session 5 creates the
tag_aliases table that holds them in the database.

## Rules block (read by scripts/check-names.mjs: change it only by pull request)
```json naming-rules
{
  "version": 1,
  "levels": ["enterprise", "site", "area", "line", "equipment", "measure"],
  "patterns": {
    "enterprise": "^[a-z][a-z0-9]{1,11}$",
    "site": "^[a-z]{2,6}$",
    "area": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
    "line": "^line-[0-9]+$",
    "equipment": "^[a-z][a-z0-9]*(-[a-z0-9]+)*$",
    "measure": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$",
    "table": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$",
    "column": "^[a-z][a-z0-9]*(_[a-z0-9]+)*$",
    "lot_code": "^L-[0-9]{4,}$",
    "instrument_tag": "^[A-Z]{1,4}-?[0-9]+[A-Z]?$"
  },
  "units": ["mm", "c", "kn", "spm", "pct", "s"],
  "vocabulary": ["state", "good_count", "reject_count", "stroke_count", "speed_spm",
                 "tonnage_kn", "flange_height_mm", "die_temp_c"],
  "reserved_site_prefix": "syn",
  "retired": [],
  "allowed_look_alikes": []
}
```
Step 2

One prompt: the standard and its rules block

10 minutes

Why

One complete prompt gets a standard that already follows ISA-95, names the database the way Session 5 needs and carries a rules block a script can check. Writing it by hand and then explaining it to Claude Code takes several rounds; this takes one, and you spend the saved time where it matters, checking it with the area owner.

Do this

Paste into Claude Code, after replacing the <...> part
Read docs/INTENT.md and docs/names/INVENTORY.md.

On the branch names/standard, write docs/naming-standard.md: one page, plain English, for operators, engineers and AI agents. It must have:
1. The path: enterprise/site/area/line/equipment/measure, all six levels in that order, following ISA-95 (line = work centre, equipment = work unit). Enterprise code acme, site code cle (Cleveland). One example path from the inventory.
2. Codes: the areas, lines and equipment from the inventory as short lower-case codes (press-3, line-1), and a note that site codes starting with "syn" are reserved for made-up data (Session 6).
3. Characters: lower case a-z and digits; hyphens inside levels; underscores inside measures; no spaces, dots, +, # or a leading $; no times or dates in any name.
4. Units: every physical measure ends with its unit; list the units used (UCUM-style, short: mm, c, kn, spm, pct, s).
5. Vocabulary: only the measures docs/INTENT.md needs, each with its unit and one line on what it means.
6. Database names, for the schema in Session 5: tables and columns lower case with underscores; measurement columns end with the unit (value_mm); times end in _at and carry the time zone; references end in _id; lot codes and any other code formats the inventory shows.
7. Legacy names: old tags are never renamed in the PLC or SCADA; each is an alias of its standard path in docs/names/aliases.csv; the tag_aliases table that holds them in the database is created by the schema in Session 5.
8. Ownership: owner pat@acme.com; an area owner approves new words for their area; changes by pull request only.
9. A rules block at the end, in a fenced code block whose info string is exactly "json naming-rules", holding: version, levels, a regular expression per level and for table, column, lot_code and instrument_tag (ISA-5.1, such as PT-301), units, vocabulary, reserved_site_prefix "syn", retired (an empty list) and allowed_look_alikes (an empty list).

Use the answers below to the inventory's questions. Then open a pull request titled "Naming standard" and show me the link.
Answers: <paste the area owner's answers, or write "none yet">

You will see recreated screen

claude — acme-platform
⏺ Read(docs/names/INVENTORY.md)
⎿ Read 92 lines
⏺ Write(docs/naming-standard.md)
+## The path: one name for every measure
+enterprise/site/area/line/equipment/measure all six, in this order
+Example: acme/cle/press-shop/line-1/press-3/flange_height_mm
1
⏺ Write(docs/naming-standard.md)
+```json naming-rules
+{ "version": 1,
+ "levels": ["enterprise", "site", "area", "line", "equipment", "measure"],
+ "vocabulary": ["state", "good_count", "stroke_count", "tonnage_kn", "flange_height_mm", "die_temp_c"],
+ "reserved_site_prefix": "syn", "retired": [], "allowed_look_alikes": [] }
2
⏺ Bash(gh pr create --title "Naming standard" …)
⎿ https://github.com/acme-ops/acme-platform/pull/9
⏺ Pull request #9 adds docs/naming-standard.md (one page) and docs/names/INVENTORY.md. The vocabulary has the 6 measures your intent needs. I used site code cle. Press 5's die temperature is in degrees F: the standard says die_temp_c, so its alias will record the conversion.
Claude Code writes the standard from your intent and inventory, ending with the rules block, and opens the pull request.
  1. Your enterprise and site codes, in the order ISA-95 gives.
  2. The rules block: the same rules as data, read by the check in chapter 3.

Check it worked

The pull request Naming standard has docs/naming-standard.md, it fits on about one page, and it ends with a json naming-rules block holding your codes, the vocabulary and the units.

If it goes wrong

The vocabulary lists all 38 measures from the inventory

Say: Keep only the measures docs/INTENT.md needs. Move the rest to a section 'Later, by review'. A long list nobody uses is a list nobody keeps.

The rules block is missing, or not valid JSON

Say: Add the rules block exactly as asked: a fenced block with info string json naming-rules, valid JSON, with every field listed in point 9. Chapter 3's check reads it; without it there is nothing to check against.

It invented area or line codes that are not in the inventory

Ask where each came from. If it guessed, replace them with the codes the area owner uses on the floor. A code the floor does not recognise will be ignored.

Step 3

Settle it with the area owner, and map the old tags

20 minutes

Why

The area owner knows what the floor calls things and which old tags anyone still reads. Their answers turn guesses into rules. Mapping the old tags to new paths as aliases means nothing in the PLC or SCADA is renamed, nobody's screen breaks, and anyone searching by an old name still finds the measure.

Do this

Sit with the area owner and read docs/naming-standard.md on GitHub together (the pull request's Files changed tab). Ask: Would you call it that on the floor? Is any code wrong? Is anything missing from the vocabulary that the decision needs? Then:

Paste into Claude Code, after replacing the <...> parts
The area owner reviewed the naming standard. Their answers and changes:
<paste their answers>

1. Update docs/naming-standard.md to match, and add a line at the top: "Checked with the <their role> on <today's date>".
2. Write docs/names/aliases.csv with one row per tag in docs/names/source/ that carries a measure in the vocabulary. Columns: legacy_name, standard_path, source_system, source_unit, conversion, note. If the source unit differs from the standard's (degrees F to C), write the conversion as a formula on the value (for example (v - 32) * 5 / 9). Tags not needed yet: leave them out and count them in the summary.
3. Push to the same pull request and tell me how many tags became aliases and how many were left out.

When the standard is right, owner two approves the pull request. Do not merge yet: chapter 3 adds the check to the same pull request, so the standard and the check arrive together.

Renaming tags to one standardFive legacy tag names, such as P3_TONNAGE and Press 4 Strokes, mapped onto standard paths ending tonnage_kn, flange_height_mm, stroke_count, speed_spm and die_temp_c. Before: what each press called itAfter: one standard (the alias keeps the old name)Press 3P3_TONNAGEacme/cle/press-shop/line-1/press-3/tonnage_knPress 3FlangeHt_P3acme/cle/press-shop/line-1/press-3/flange_height_mmPress 4Press 4 Strokesacme/cle/press-shop/line-1/press-4/stroke_countPress 4PRS4_SPMacme/cle/press-shop/line-1/press-4/speed_spmPress 5DIE_TMP_F_P5acme/cle/press-shop/line-2/press-5/die_temp_cNothing in the PLC or SCADA is renamed. The old name lives on as an alias of the standard one.
Old names, one standard. Each legacy tag gets a standard path. The old name stays in the alias file, so search by old name still works.

You will see recreated screen

github.com/acme-ops/acme-platform/pull/9/files
ConversationCommitsChecksFiles changed
docs/names/aliases.csv
1
legacy_namestandard_pathsource_unitconversion
P3_TONNAGEacme/cle/press-shop/line-1/press-3/tonnage_knkN
FlangeHt_P3acme/cle/press-shop/line-1/press-3/flange_height_mmmm
DIE_TMP_F_P5acme/cle/press-shop/line-2/press-5/die_temp_cF(v - 32) * 5 / 9
Checked with the press shop area lead on 2026-10-13Coil feeders are their own line (line-3). P3_TONNAGES retired: nobody reads it.2
docs/names/aliases.csv on GitHub, shown as a table.
  1. One row per legacy tag: the old name, its standard path, and the conversion when the unit differs.
  2. The sign-off line and the area owner's decisions, now part of the standard.

Check it worked

The standard has a Checked with line; docs/names/aliases.csv has a standard path for every tag the intent needs; every conversion is written down; owner two has approved.

Fastest path

If the area owner cannot meet this week, send them the link to the standard's Files changed tab and the questions in one email. Carry on with chapter 3: the check reads whatever the rules block says, so their answers only change the data, not the work.

If it goes wrong

The area owner wants to rename a code that already appears in other files

Do it now, before Session 5: today only this pull request uses it. Say: Rename area code to everywhere in this pull request, and list every file you changed. Step 6 shows how a rename is done once other things depend on a name.

A tag has no measure in the vocabulary but the decision needs it

Add the word, with its unit, through this same pull request and the area owner's approval. A word added on the day, by whoever is typing, is how two names for one measure start.

Knowledge check

A line lead proposes the measure name Temp for a die. What does the standard change it to?

Knowledge check

DIE_TMP_F_P5 holds a die temperature in degrees F; the standard uses Celsius. What goes in the alias file?

References

  1. OASIS: MQTT Version 5.0, section 4.7 Topic Names and Topic Filters. https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html
  2. PostgreSQL Documentation: Identifiers and Key Words. https://www.postgresql.org/docs/current/sql-syntax-lexical.html
  3. The Unified Code for Units of Measure (UCUM). https://ucum.org/
  4. ISO: ISO 8601 Date and time format. https://www.iso.org/iso-8601-date-and-time-format.html

Chapter 3 · Session 4

Make the computer keep the standard

A standard that relies on memory decays within a year, and an AI agent working at night will not remember it either. One prompt adds a check that reads the rules block and refuses any bad name on every pull request. You prove it by making it fail on purpose, and you practise the one safe way to rename.

40 min3 stepsEnds with a gate

By the end of this chapter you can

  • Have Claude Code write scripts/check-names.mjs, its tests and its step in the Session 3 CI workflow.
  • Prove the check works by showing it fail on a planted bad name.
  • Rename something the safe way: count every use first, change all of them in one pull request, and keep the old name retired.

What the check checks

The check is a short script that reads the rules block from docs/naming-standard.md and checks every name the repository holds. It runs as one more step in the CI workflow from Session 3, so a pull request with a bad name turns red and, because main is protected, cannot merge [1] [2].

The name check in CIA pull request runs the check-names step; names that match pass and the merge is allowed; bad names fail with a message naming each one, and the merge is blocked. Pull requestfrom you or an agentCI: check-namesevery name vs the rulesPass: merge allowedevery name matches the standardFail: merge blocked✗ P3_TONNAGE: capitals, not a path✗ …/press-3/tonnage: no unitfix the names, push againThe rules live in docs/naming-standard.md and a machine checks them on every change.
The name check in CI. The rules live in the standard; a machine checks them on every change and names each name that broke them.
What it checksWhereWhy it is here
Every path follows the levels and patternsdocs/names/aliases.csv, and any path in code or dataA bad path creates an island no screen finds
Every measure is in the vocabulary, with a unit from the listThe last segment of every pathTwo words for one measure is how dashboards are built twice
Every table and column name follows the database rulessupabase/migrations/*.sql, once Session 5 adds themNames are forever once screens use them
No retired name appears anywhereEvery file in the repository except the standard's retired listWe once renamed a demo company in some places and not others; three names were live at once and a page showed honest zeros for weeks
No two names are one letter apart unless listed as allowedCodes, measures, tables and foldersTwo folders, schedule and scheduling, looked like one; an agent used the wrong one and every check still passed
Site codes starting with syn hold made-up data onlyThe standard and, from Session 6, the seedMade-up rows must never pass for real ones
Step 4

One prompt: the check, its tests and its CI step

15 minutes

Why

The check is what makes the standard true tomorrow, when an agent adds forty names at 2 a.m. Writing the script, the tests that prove it refuses bad names, and the CI step in one pull request means the proof arrives with the rule. Telling Claude Code to wait for the check on GitHub and fix any failure before reporting saves a full round trip.

Do this

Paste into Claude Code
Read docs/naming-standard.md (especially the json naming-rules block), docs/names/aliases.csv and .github/workflows/ci.yml.

On the same branch (names/standard), add:
1. scripts/check-names.mjs, using Node.js only (no new packages). It reads the rules block from docs/naming-standard.md and checks:
   - every standard_path in docs/names/aliases.csv: six levels, each matching its pattern, the site code cle or a reserved "syn" code, and the last segment in the vocabulary with a unit from the units list where it is a physical measure;
   - if supabase/migrations/ exists: every table and column name created there matches the table and column patterns, and measurement columns end with a unit;
   - no name listed under "retired" appears in any tracked file (git ls-files) except docs/naming-standard.md;
   - no two codes, measures, table names or top-level folders differ by one letter, unless the pair is in allowed_look_alikes.
   It prints each failure as: file, line, the name, the rule it breaks, in plain English. It exits 1 on any failure and prints "names: N checked, all follow the standard" on success.
2. Tests (Vitest, next to the existing tests) that feed it good and bad examples: capitals, a missing level, a measure not in the vocabulary, a missing unit, a retired name, two names one letter apart. Each bad example must fail with the right message.
3. "check:names": "node scripts/check-names.mjs" in package.json, and a step "Names follow the standard" running npm run check:names in .github/workflows/ci.yml, after the tests. Do not change or remove any existing step.
4. One line in CLAUDE.md: "Name every table, column, path and file by docs/naming-standard.md; run npm run check:names before you push."

Push to pull request "Naming standard", wait for the CI check to finish (gh pr checks --watch), and tell me the result in plain words. If it fails, fix the cause, not the check, and wait again before reporting.

You will see recreated screen

claude — acme-platform
☒ Write scripts/check-names.mjs
☒ Write tests for good and bad names
☒ Add check:names to package.json and ci.yml
☐ Push and wait for CI
⏺ Write(.github/workflows/ci.yml)
  - run: npm test
+ - name: Names follow the standard
+ run: npm run check:names
1
⏺ Bash(npm run check:names)
⎿ names: 31 checked, all follow the standard
⏺ Bash(gh pr checks --watch)
⎿ CI / checks pass 1m08s
2
⏺ Pull request #9 is green. The new step checked 31 names: 28 alias paths and 3 codes. 9 tests try bad names (capitals, a missing level, no unit, a word not in the vocabulary, a retired name, two names one letter apart) and each is correctly refused. No existing step was changed.
Claude Code writes the check and its tests, adds one step to the existing workflow, and waits for GitHub before it reports.
  1. One new step after the tests. Nothing else in the workflow changes.
  2. The result on GitHub, not on Claude Code's computer: this is the one to trust.

Check it worked

Pull request Naming standard is green on GitHub; the Checks tab shows the step Names follow the standard; Claude Code's summary says how many names were checked and how many bad examples were refused.

Fastest path

"Wait for the check and fix it before reporting" in the prompt means you read one finished answer instead of relaying error messages back and forth.

If it goes wrong

Claude Code made the check pass by loosening a pattern or adding to allowed_look_alikes

Say: Undo the change to the rules block. Fix the name that broke the rule, not the rule. The rules block changes only when the area owner agrees. An agent that weakens a check to reach green has removed the check.

It reports green but the check on GitHub is red or still running

Say: Run gh pr checks and read the failed step's log. Fix it and wait for green before you report. Then look at the Checks tab yourself.

The step fails on a name in a file you did not expect, such as a folder name

Read the message: it names the file, the line and the rule. If the name is right and the rule is too strict, ask the area owner; if they agree, change the rule by pull request. Otherwise rename it now, while nothing depends on it.

CI fails on a step that has nothing to do with names

Something on main was already red. Fix that first, in its own pull request; a new check on top of a red one proves nothing.

Step 5

Prove it: plant a bad name and watch it fail

10 minutes

Why

A check you have never seen fail is a check you do not know works: it may read the wrong file, or pass everything. Planting one known bad name and watching the check name it is the cheapest proof there is. We made this a rule after finding tests on our own platform that could never fail.

Do this

Merge pull request Naming standard first (owner two approves). Then:

Paste into Claude Code
On a new branch names/prove-it, from main: add one row to docs/names/aliases.csv with legacy_name TEST and standard_path acme/cle/press-shop/line-1/Press_3/tonnage, which breaks two rules (capitals and underscore in the equipment level; no unit on the measure). Push, open a pull request titled "Do not merge: proving the name check", wait for CI, and show me the exact failure message. Do not fix it.

Read the failure on GitHub, then close the pull request without merging and delete the branch:

Open

https://github.com/acme-ops/acme-platform/pulls

Open the pull request, read the red check, then choose Close pull request and Delete branch.

You will see recreated screen

github.com/acme-ops/acme-platform/pull/10/checks
ConversationCommitsChecksFiles changed
docs/names/aliases.csv:29  Press_3  equipment level: lower case with hyphens only (press-3)
docs/names/aliases.csv:29  tonnage  measure needs a unit from the list (tonnage_kn)
names: 2 problems in 32 names
The planted name fails, and the message says which name and which rule, in plain words.
  1. Red, naming the exact name and the rule it broke.
  2. Main's protection from Session 1 refuses the merge. Close the pull request; do not merge it.

Check it worked

You saw the check fail on GitHub naming Press_3 and tonnage, and the pull request is closed, not merged.

If it goes wrong

The planted name passed

The check is not reading the file or the rules. Say: The check passed a name that breaks two rules. Find out why, fix the check, add a test with this exact name, and show me the test failing before the fix and passing after. Do not move on until a bad name fails.

The pull request was merged by mistake

Open a new pull request that removes the TEST row, and let the check go green. Then check main's protection: Session 1's ruleset should require the CI check before merging.

Renames never break anything

Sooner or later a name will be wrong: a line is renumbered, an area is split. The safe order is always the same. Count every place the old name is used. Change them all in one pull request. Add the old name to retired in the rules block, so the check refuses it if it ever comes back. For legacy tags, add an alias instead of renaming. On our platform a renamed demo company kept its old name in two places in the sign-in code; three names for one company were live at once and every page behind sign-in showed honest zeros.

Naming governance loopFive steps around the standard: propose, review by the area owner, add to the rules block, CI checks it, use. The namingstandard1 · Proposea new word or code, in a pull request2 · Reviewthe area owner approves it3 · Addto the rules block in the standard4 · CheckCI accepts the new word from now on5 · Usetables, screens and agents use it
How a name changes. Proposed in a pull request, approved by the area owner, added to the rules block, accepted by CI from then on, and used everywhere.
Step 6

Practise a rename the safe way

15 minutes

Why

A half-done rename is worse than none: some screens read the new name, some the old, and nothing errors, so nobody notices for weeks. Doing one small rename now, the safe way, with the old name retired so the check refuses it, sets the habit before Session 5 creates tables that would multiply every rename.

Do this

Paste into Claude Code
I want to rename the area code press-shop to stamping in the naming standard (the area owner prefers the name used on the floor).

1. First, change nothing: list every place either name appears in the repository (docs, scripts, tests, CSV files), grouped by folder, and say whether any place must keep the old name.
2. Then, on a new branch names/rename-area, do the rename everywhere in one change, add "press-shop" to "retired" in the rules block, and run npm run check:names.
3. Open a pull request titled "Rename area press-shop to stamping", wait for CI, and tell me the result: how many places changed, and confirm the check now refuses press-shop.

You will see recreated screen

claude — acme-platform
⏺ press-shop appears in 34 places: docs/naming-standard.md (6), docs/names/aliases.csv (27), docs/names/INVENTORY.md (1). No place must keep it: nothing outside this repository uses the paths yet.1
⏺ Write(docs/naming-standard.md)
- "retired": [],
+ "retired": ["press-shop"],
2
⏺ Bash(npm run check:names)
⎿ names: 31 checked, all follow the standard
⏺ Bash(gh pr checks --watch)
⎿ CI / checks pass 1m11s
⏺ Pull request #11 renames press-shop to stamping in 34 places across 3 files. press-shop is now retired: the check fails if it appears anywhere again.
Counting first, then one change everywhere, then the old name retired so it cannot come back.
  1. The count comes before any change. If the count includes something outside the repository (a screen, a historian), stop and plan an alias instead.
  2. The old name is retired, so a half-done rename turns the check red instead of hiding.

Check it worked

Pull request Rename area press-shop to stamping is green, changes every place the count listed, and the rules block lists press-shop under retired. Merge it, or close it if your area owner prefers the original: the practice is the point.

If it goes wrong

The count includes places outside the repository, such as SCADA screens or a historian

Do not rename those. Keep the old name as an alias in docs/names/aliases.csv and let consumers move over time: add the new name, alias the old, move consumers, then retire it.

After the rename, a page or test shows zeros instead of an error

That is the sign of a half-done rename: something still reads the old name. Say: Search the whole repository for the old name and for any value built from it, and list each one. The retired list makes the check catch the next one.

Before you go on · Session 4 is done whenTick each one

Knowledge check

An AI agent's pull request adds a measure named Press_Tonnage. What stops it reaching main?

Knowledge check

Why add an old name to the retired list after a rename?

References

  1. GitHub Docs: Workflow syntax for GitHub Actions. https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions
  2. GitHub Docs: About protected branches. https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches
  3. Vitest: Getting started. https://vitest.dev/guide/
  4. ISA: ISA-95 Standard, Enterprise-Control System Integration. https://www.isa.org/standards-and-publications/isa-standards/isa-95-standard

Chapter 4 · 12 questions · 80% passes

Final assessment

Twelve questions across the element. Score 80% (10 of 12) to pass. Your LMS records your score and each answer; you can review the chapters and try again.

15 min12 questions≈ 15 minutesRetake allowed

Choose one answer for each question, then submit. You will see the right answer and why for every question.

1. Why is the naming standard written before the schema?
2. What gives the platform's path its order of levels?
3. In the ISA-95 levels, a single press is usually:
4. Which name follows the standard for a die temperature in degrees Celsius?
5. Why must names be lower case?
6. What is the rules block in docs/naming-standard.md for?
7. A legacy tag P3_TONNAGE is mapped to the standard. What happens in the PLC and SCADA?
8. Which session creates the tag_aliases table in the database?
9. Where does the name check run on every pull request?
10. Why plant a bad name in a throwaway pull request?
11. Claude Code turns a red name check green by adding the bad name to allowed_look_alikes. What do you do?
12. After a rename, why add the old name to the retired list?