Static, reasoning-based review of each collection client against the UNS data
contract in CLAUDE.md. This is a judgment task, not a script — read the
client code and the contract, then report violations with file paths, line
numbers, and required fixes.
Usage
/validate-contract — review all three clients
/validate-contract modbus — review the Modbus client only
Checklist
For each client, check every rule from CLAUDE.md:
Naming
All tag names are snake_case (no hyphens, no camelCase, no uppercase)
All tag names exist in contracts/tag_database.csv (column tag_name)
No aliases, abbreviations, or "friendly names"
Source identifiers resolve to contract tags via the client's map file
(register_map.csv / opcua_node_map.csv / mqtt_topic_map.csv)
Timestamps
Values written to tag_history.ts are timezone-aware UTC
Naive timestamp sources convert using source_timezone from
config/{client}.yaml and log: "Naive timestamp from {source}, assuming {timezone}"
Clients that stamp at read time document the clock source
No client silently assumes UTC for a naive timestamp
Write Target
Readings are validated with validate_reading() before writing
Writes go through DBWriter — no hand-rolled connections or SQL
tag_id is resolved from uns_namespace; unresolved tags go to dead_letter
Value types are consistent with the tag's metric_type (Int32, Float, Boolean)
Quality flags are GOOD, BAD, or STALE — no other values
Shared Code
Clients import Reading from shared.models — never redefine it
No duplicate validation or DB-write logic inside client code
Tests
Each client has unit tests
Tests mock the protocol client (no live server required)
Tests verify contract compliance via validate_reading()
Report Format
For each client:
## {client_name} — {PASS | FAIL}
Violations:
- {file}:{line} — {rule violated} — {what's wrong} — Fix: {what to change}
Notes:
- {observations about edge cases or fragility}
If a client passes all checks, say PASS and move on. Do not pad the report.
1---2name: validate-contract3description: Validate Contract4---56# Validate Contract78Static, reasoning-based review of each collection client against the UNS data9contract in `CLAUDE.md`. This is a judgment task, not a script — read the10client code and the contract, then report violations with file paths, line11numbers, and required fixes.1213## Usage1415- `/validate-contract` — review all three clients16- `/validate-contract modbus` — review the Modbus client only1718## Checklist1920For each client, check every rule from `CLAUDE.md`:2122### Naming23- [ ] All tag names are snake_case (no hyphens, no camelCase, no uppercase)24- [ ] All tag names exist in `contracts/tag_database.csv` (column `tag_name`)25- [ ] No aliases, abbreviations, or "friendly names"26- [ ] Source identifiers resolve to contract tags via the client's map file27 (`register_map.csv` / `opcua_node_map.csv` / `mqtt_topic_map.csv`)2829### Timestamps30- [ ] Values written to `tag_history.ts` are timezone-aware UTC31- [ ] Naive timestamp sources convert using `source_timezone` from32 `config/{client}.yaml` and log: `"Naive timestamp from {source}, assuming {timezone}"`33- [ ] Clients that stamp at read time document the clock source34- [ ] No client silently assumes UTC for a naive timestamp3536### Write Target37- [ ] Readings are validated with `validate_reading()` before writing38- [ ] Writes go through `DBWriter` — no hand-rolled connections or SQL39- [ ] `tag_id` is resolved from `uns_namespace`; unresolved tags go to `dead_letter`40- [ ] Value types are consistent with the tag's `metric_type` (`Int32`, `Float`, `Boolean`)41- [ ] Quality flags are `GOOD`, `BAD`, or `STALE` — no other values4243### Shared Code44- [ ] Clients import `Reading` from `shared.models` — never redefine it45- [ ] No duplicate validation or DB-write logic inside client code4647### Tests48- [ ] Each client has unit tests49- [ ] Tests mock the protocol client (no live server required)50- [ ] Tests verify contract compliance via `validate_reading()`5152## Report Format5354For each client:5556```57## {client_name} — {PASS | FAIL}5859Violations:60- {file}:{line} — {rule violated} — {what's wrong} — Fix: {what to change}6162Notes:63- {observations about edge cases or fragility}64```6566If a client passes all checks, say PASS and move on. Do not pad the report.
Run npx skillmds@latest add timescale/validate-contract in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
Validate Contract It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
timescale (@timescale) published this skill. Their other Agent Skills are listed on their SkillMD profile.