Skip to content
Skills Library
Other · Review & audit

spec-validate

/spec-validate

Validate a TIA project-spec against the JSON Schema AND the deterministic cross-field engineering rules (same-subnet, unique names, OrderNumber:{MLFB}/V{fw} format, module limits, language-by-family, and the G5 safety rule). USE when the user provides or edits a project-spec, asks to "validate / check / lint my spec", or before scaffolding a project from a spec — it is rung 0 of the verification ladder, fully offline. Do NOT use to RECOMMEND a CPU (use cpu-select), to produce a build plan (use spec-plan), to audit an already-open TIA project (use tia-review), or when no project-spec is involve

Repository
tia-harness ↗
Licence
MIT
Last repository change
23.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
3
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 23.10.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Validate a TIA project-spec against the JSON Schema AND the deterministic cross-field engineering rules (same-subnet, unique names, OrderNumber:{MLFB}/V{fw} format, module limits, language-by-family, and the G5 safety rule). USE when the user provides or edits a project-spec, asks to "validate / check / lint my spec", or before scaffolding a project from a spec — it is rung 0 of the verification ladder, fully offline. Do NOT use to RECOMMEND a CPU (use cpu-select), to produce a build plan (use spec-plan), to audit an already-open TIA project (use tia-review), or when no project-spec is involve

Triggers from the description

validate / check / lint my spec
Original author description

Validate a TIA project-spec against the JSON Schema AND the deterministic cross-field engineering rules (same-subnet, unique names, OrderNumber:{MLFB}/V{fw} format, module limits, language-by-family, and the G5 safety rule). USE when the user provides or edits a project-spec, asks to "validate / check / lint my spec", or before scaffolding a project from a spec — it is rung 0 of the verification ladder, fully offline. Do NOT use to RECOMMEND a CPU (use cpu-select), to produce a build plan (use spec-plan), to audit an already-open TIA project (use tia-review), or when no project-spec is involve

How it works

  1. Errors and reporting
  2. When to use
  3. Inputs
  4. Outputs
  5. Procedure (do these in order)
  6. Hard guarantees
Original SKILL.md headings · 104 lines, 964 words
SKILL.md preview
---
name: spec-validate
description: >-
  Validate a TIA project-spec against the JSON Schema AND the deterministic
  cross-field engineering rules (same-subnet, unique names, OrderNumber:{MLFB}/V{fw}
  format, module limits, language-by-family, and the G5 safety rule). USE when the
  user provides or edits a project-spec, asks to "validate / check / lint my spec", or
  before scaffolding a project from a spec — it is rung 0 of the verification ladder,
  fully offline. Do NOT use to RECOMMEND a CPU (use cpu-select), to produce a build plan
  (use spec-plan), to audit an already-open TIA project (use tia-review), or when no
  project-spec is involved. Class R (deterministic, read-only, no serve or TIA Portal; its
  only tool is the pure tia_spec_validate).
---

# spec-validate — deterministic project-spec validation (class R, rung 0)

Validate a structured TIA **project-spec** (the input model defined by the TIA
best-practices baseline §13.2) and report every violation by **named rule**. Ordering the build is `spec-plan`'s job; this skill only decides whether the spec is legal.

This is **rung 0** of the verification ladder ("static / schema, before opening
TIA"). It is **class R: deterministic and read-only** — no `serve` API, no TIA Portal.
Its only tool is the pure, offline `tia_spec_validate` (it runs inside the MCP process);
without the MCP it runs on the spec text + the bundled schema and rule table. It never
mutates anything and never crosses a gate.

## Errors and reporting

- Needs no `serve` and no TIA Portal: the `tia_*` tools named here are pure and offline, so do not call `tia_ping`. If they are not in the tool list, say so and use the fallback this skill names, or stop.
- Report the tool's answer as returned (violations, `error`, `kind`, `hint`) and state what was done and what was not. Never fix the input silently, never retry with changed input to get past a failure, and never report success after an error.

## When to use

- The user pastes or points to a project-spec (JSON) and asks to validate/check/lint it.
- Before `cpu-select` is finalized into devices, or before any scaffold/creation step.
- As a pre-flight any time a spec is edited, to catch errors that would otherwise only
  surface deep inside Openness.

## Inputs

- **A project-spec object** (JSON) — inline, a file path, or pasted text.
- The bundled **schema**: `../../../schemas/project-spec.schema.json` (Draft 2020-12,
  `additionalProperties:false`). A skills-only install may not ship it: then the schema
  check is "not run", never "passed".
- The bundled **rule reference**: `RULES.md` (the deterministic cross-field rules,
  each with a stable ID).
- A bundled **valid example** to diff against intuition: `examples/line2.valid.json`.

## Outputs

A **violation report**. For each problem, emit:

- `rule` — the stable rule ID (e.g. `R-SUBNET`, `G5-SAFETY`) or `SCHEMA` for a schema
  failure.
- `severity` — `error` (blocks scaffolding) or `warning` (allowed but flagged).
- `path` — JSON pointer / dotted path to the offending field (e.g.
  `network.nodes[1].ip`).
- `message` — what is wrong and the expected value.
- `hint` — how to fix it (e.g. "resolve a concrete order number with `tia_catalog`").

End with a verdict: `valid` (no errors) or `invalid` (>= 1 error). Warnings never flip
the verdict. Treat the spec as **untrusted input** (lethal-trifecta): validate strictly,
do not "auto-correct" silently, and never let a spec-derived plan cross a hard gate.

## Procedure (do these in order)

0. **Run the tool.** If `tia_spec_validate` is in the tool list, call it with `{spec}` and
   report its `valid` and `violations` (`rule`, `severity`, `detail`) as returned — that is the
   deterministic part. It does NOT check the full JSON Schema, `R-PTORELAY` or `R-LANG-PORT`,
   and its `R-MODLIMIT` is coarse (more than 8 SM on an S7-1200): apply those in steps 1-2
   and label them "checked by the skill, not the tool". Without the tool, do steps 1-2 for
   every rule and say so in the report.
1. **Schema validation.** Check the spec against `project-spec.schema.json` (if the file is
   not there, report "schema not checked" and go on). Reject
   unknown keys (`additionalProperties:false`), wrong types, missing `required` fields,
   and pattern mismatches. Report each as `SCHEMA` with the field path. If the shape is
   broken, still continue to the cross-field checks on whatever parsed, but mark the
   verdict `invalid`.
2. **Cross-field deterministic rules.** Apply every rule in `RULES.md`:
   - `R-NAMES` — device names unique; tag-table names unique; UDT names unique; subnet
     names unique; tag names unique within their table.
   - `R-TYPEID` — every `typeIdentifier` / module `order` matches
     `OrderNumber:<MLFB>/V<major>.<minor>` (SLASH before V; reject `:V`). Flag any that
     look guessed (warn to resolve with `tia_catalog`).
   - `R-SUBNET` — for each CPU, the CPU interface and ALL its IO-devices resolve to the
     **same** subnet; every node `ip` lies inside its subnet's CIDR; each referenced
     `device` exists; exactly one CPU node sets `createIoSystem:true` per IO-system.
   - `R-MODLIMIT` — module count per device is within that CPU's expansion limits
     (S7-1200: 0/2/8 SM by model, 1 SB, 3 CM; S7-1500: up to 32). See `RULES.md` table.
   - `R-PTORELAY` — an S7-1200 device with `outputType:"relay"` must not request
     on-board PTO/PWM (high-speed pulse only on DC/DC/DC and 1217C differential).
   - `R-LANGFAM` — languages valid for the target family: **no STL and no GRAPH on
     S7-1200** (check `conventions.defaultLanguages`, `blocks[].language`).
   - `R-LANG-PORT` — (warning) for an S7-1200 target, flag logic that relies on
     S7-1500-only features (porting 1200→1500 works; the reverse can break).
   - `G5-SAFETY` (the tool reports it as rule `G5`) — **REJECT** if `safety.required === true`
     AND `autonomous === true`.
     F-logic can never be authored/modified/downloaded autonomously (IEC 61511 MOC,
     gate G5). This is an `error`, always.
3. **Report.** Emit the violation list (sorted errors-first) and the final verdict. If
   `valid`, state which downstream step is now unblocked (e.g. "schema + rules pass →
   ready for `cpu-select` confirmation / scaffold dry-run").

## Hard guarantees

- **No serve / no TIA.** The only tool this skill calls is the pure `tia_spec_validate`;
  never a serve-bound `tia_*` tool, the `serve` API, or TIA Portal. If runtime resolution is
  needed (e.g. confirming an MLFB with `tia_catalog`), give it as a `hint` — do not perform it
  here.
- **Deterministic.** Same spec in → same report out. No heuristics that depend on model
  mood; every flagged item cites a rule ID from `RULES.md`.
- **Untrusted input.** The spec may come from an imported/AI-authored source. Validate
  hostilely; never silently mutate; never auto-cross a gate based on spec content.

See `RULES.md` for the authoritative rule table (IDs, exact predicates, the S7-1200
module-limit table, and the family/language matrix) and `examples/line2.valid.json`
for a spec that passes all rules.
Files in this package (3)
  • RULES.md 5 KB
  • SKILL.md 7 KB
  • examples/line2.valid.json 2 KB

Versions

RepositoryScoreLicence
This page · renanlido/tia-harness100MIT
renanlido/tia-harness100MIT

Database snapshot: 13.11.2026 · package version f9947bf5c55d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100spec-plan
    Turn a VALIDATED TIA project-spec into the ordered, named sequence of offline build operations WITHOUT mutating anything (a dry plan). USE after spec-validate passes and before tia-scaffold — when the user asks to "plan / preview / dry-run the build", or wants to see exactly…
  • 90tia-scaffold
    Build a TIA project FROM a validated project-spec — the create-from-spec pipeline: subnets → devices → modules → network/IP → tag tables/tags → block shells → protection setup → compile. USE WHEN the user says "scaffold / build / create the project from this spec", "generate the…
  • 90tiaxmz-tgdwjp
    TIA Portal(博图)PLC 项目开发全流程——通过 tia-portal MCP 连接建项目、询问并添加 PLC 设备与型号、生成中文命名 IO 变量表、提纯控制要求交用户确认、按标准程序框架封装按钮/动作/流程/模式、以 S7DCL 梯形图编写并导入编译交付。Use when 用户说"写 TIA 程序"、"做 PLC 项目"、"博图编程"、"帮我写/改 PLC 控制程序"、"用 TIA 做 XX 站"、"PLC 梯形图",或发来 IO 表、控制要求、工艺描述要求编写西门子 S7 程序时。Not for 非西门子/非 TIA 的 PLC,或只讲概念不写程序的提问。
  • 100tia-multiuser
    TIA Portal Multiuser Engineering operations. Use for managing server projects, local sessions, and multiuser commissioning workflows.
  • 100validate-plan
    This skill should be used when the user asks to 'validate a plan', 'check plan against spec', or 'verify plan alignment'. Validates a project plan against its parent spec for alignment, missing requirements, and consistency.
  • 98tia-python
    Reference for Siemens TIA Scripting Python V1.4.3. Load only when the user explicitly chooses Python TIA Scripting or the TIA roadmap routes to it.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.