/tia-harness:tia-reviewfrom TIA Portal Automation Harness
Audits a connected TIA Portal project against engineering best-practices baseline: optimized access, symbolic addressing, FB/instance-DB, UDT typing, per-task language, versioned library TYPEs, PLCopen naming, and verification-ladder posture.
Ships in TIA Portal Automation Harness. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Audit a connected TIA project against the non-negotiable baseline (TIA
best-practices §0) and the naming/architecture rules (§4/§5/§8). It is a
read-only review: it enumerates the project model through the tia MCP read tools and
reports deviations — it never changes anything.
Besides the baseline findings it reports, as information only, the objects of each CLP that
nothing references (unused-object candidates, from the cross-references): a separate
Unused objects section, never a baseline rule.
tia_ping: continue only if it reports reachable:true and activated:true. activated:null with a busy detail means serve is occupied, not necessarily by an MCP job: poll tia_job_status only for a running job whose jobId is known. Without one, wait/recheck with tia_status; for connect_incomplete, follow the host-inspection handoff in tia_guide {"topic":"gui-gates"}, never retry connect. Otherwise stop, quote its detail and hint verbatim and say that nothing was changed (prerequisites: tia_guide {"topic":"gotchas"}).tia_* tool is available, the tia MCP is not connected: say so and stop. Never continue from memory and never work around it with hand-made HTTP calls (they bypass the MCP's gate checks).isError:true), quote its error and kind verbatim, relay its hint, and state what was done and what was not. Apply only the remedy the hint or this skill names, at most once; otherwise stop and ask.requires_human_action answer verbatim and wait for the human.status:"running" + jobId identifies a running job: poll tia_job_status {jobId} without repeating the original call. On kind:"busy", poll only for a running job whose jobId is known (e.g. details.jobId); without one, wait/recheck with tia_status. For connect_incomplete, follow the host-inspection handoff in tia_guide {"topic":"gui-gates"}, never retry connect. After a timeout, check the state before repeating anything.tia_crossrefs (step 5): a 409 crossrefs_unavailable answer (quote its error, kind and hint, report the Unused objects section as not done, and finish the rest of the review); a 409 cursor_stale answer, or coverage counts that differ between pages (restart the page walk from the first page, once for each); and a page that arrives with an omission marker (repeat that page with a smaller limit, at most three times). Every other tool error stops the review as above.status:"running" and kind:"busy" answers of tia_crossrefs, step 5 says which job to poll and what to do next; the bullet above applies to every other call.Unused objects section (candidates only).tia-verify, which is the
compile/consistency ladder; this is the style/architecture audit).tia_status → hasProject:true). If not, this is
a GATE: connecting is tia-handoff/tia_connect territory (G1 trust dialog) — ask the
human, do not force it.tia_status, tia_project_info, tia_project_languages — project context.tia_plcs → for each CLP: tia_plc_blocks (name, type, language, number,
isConsistent, isKnowHowProtected), tia_plc_types (UDTs), tia_plc_tags
(tables + tags, addresses), tia_plc_watchtables.tia_devices / tia_device_tree — hardware.tia_obj_get / tia_obj_items / tia_obj_services — to read attributes the typed
endpoints don't expose (e.g. a block's optimized-access attribute, a tag's symbolic
vs absolute binding).tia_crossrefs {plc, filter:"UnusedObjects", limit:200} — class R, a long operation through serve: it may
answer status:"running" + jobId or kind:"busy", which step 5 handles differently. It returns
the PLC's cross-references, here only the objects nothing references, in pages of limit sources
(cursor takes the nextCursor of the previous page), and feeds the Unused objects section
(step 5), never the baseline rules. Its coverage, read on every page, says how much of the PLC was queried. On a big
project the first whole-PLC read can take minutes. App 1.8+ reuses the cursor walk until a serve mutation,
project close/switch or cursor expiry; older serves re-read the whole PLC on every page.tia_block_render {xml} — class R, pure and offline (no serve): renders ONE SimaticML block
export as readable pseudo-SCL (LAD/FBD networks translated, SCL rebuilt, STL/GRAPH marked not
rendered, untranslatable or ambiguous parts marked). It is how this skill reads graphical logic; step 3 explains its notation. XML sources: the project's versioned
SimaticML exports in the workspace (project-as-code files) or exports the human provides. This
skill never exports: tia_export_block / tia_export_xml are M-off (they can compile an
inconsistent block), so never call them here.BASELINE.md (bundled) — the authoritative checklist: each rule's ID, what to read, the
predicate, severity, and PLCopen naming prefixes.A findings report. For each deviation: rule (ID from BASELINE.md), severity
(error = breaks baseline, warning = style), location (CLP / block / tag / device),
observed, expected, and fix (the concrete change — but as a recommendation; this
skill does not apply it). End with a per-rule pass/fail summary and an overall posture.
Then a separate Unused objects section, informational only: it is not a baseline rule, has no
severity and leaves the per-rule pass/fail summary and the posture unchanged. For each CLP it
lists the unused blocks, tags/constants and types that tia_crossrefs reports, grouped by their
type, each with its path, and states that they are candidates for a human to confirm,
never proof of dead code. It also states whether the read of that CLP was complete (a finished
page walk with coverage.complete: true on every page) or not complete and why, with the unavailable owners
when coverage lists them. When tia_crossrefs is unavailable it says the section was not done.
tia_status). If not, stop with the G1 note above.tia_plcs); for each, pull blocks, types, tags, watch tables.language from tia_plc_blocks)
whose exported SimaticML is available, call tia_block_render {xml:"<the file's content>"} and
review its text: render before reviewing a graphical block, and never review LAD/FBD from raw
XML when it can be rendered. Every unsupported entry ((* unsupported: ... *) in the text) is
logic that was not translated: read that part in the XML or report it as not reviewed. The same
holds for the markers of a duplicate UId, edge memory shared by several edge parts, a negated
operand on an S/R/P/N coil and an invalid name or UId (all listed in unsupported): that part of
the network is ambiguous, so read it in the XML or report it as not reviewed. A network
marked not rendered (STL/GRAPH or over the render budget) was not reviewed from its body. A
network where one call, system block or box writes a destination whose address (an index or the
same variable) depends on another output of the same part is marked not rendered ... output destinations overlap: read it in the XML or report it as not reviewed. Name
the file you rendered: it may be older than the project, and proving it matches is tia-verify
(tia_block_compare), not this skill. No export available: mark the body checks not done and
point to tia-verify or ask the human for the exported files. Read the notation of the text as
the network states it:
RLO_<UId> is a temporary holding one value of the network, evaluated once. Several targets of
one value are all assigned from one RLO_<UId> capture.TMP_<UId> is the output of a MOVE/arithmetic box that only runs under its IF <EN>: when EN
is false the temporary keeps its previous value, so whoever reads TMP_<UId> may see a stale
value. Check that this is intended.TMP_<UId>_<pin> is the output or return value of ONE call that has several targets or, for an
FC (a call without instance), that another part reads or that is negated: it is bound in that
call (pin => TMP_<UId>_<pin> for an Output parameter, TMP_<UId>_<pin> := call(args); for the
return value) and the targets and readers copy from it; two calls never share a value. A call
with an instance and one target is written directly or read as #inst.pin.P_TRIG/N_TRIG) is evaluated on every scan, before the IF that uses it
(RLO_<UId> := P_TRIG(...);): an edge shown before an IF is not conditional on that IF's EN.NOT on an output is a real inversion in the network (a negated instance or call output is
written as a following target := NOT ...;).TYPE#(x) means the instruction reads x as TYPE. INT, UINT, REAL and DWORD operations are
different logic: when reviewing a comparison or an arithmetic operation, check the TYPE
against the intent. In a comparator, arithmetic box or Inc/Dec every operand that is not a
constant, a boolean or already of the instruction type is shown with the instruction type,
because the export does not carry the declared type of a symbol: a variable or address, and also
a value forwarded through MOVE or produced by another box or call (INT#(RLO_40),
INT#(TMP_41)); constants and written places are never cast. An absolute operand may also be
wrapped (INT#(%MW0), REAL#(%MD0)): its own type
is shown when it is not the natural one of its size (%MW0 and %MD0 alone are Word and DWord).<U+XXXX> escapes, never as themselves.BASELINE.md rule by rule:
tia_obj_*).%I/%Q/%M) addressing in logic; tags named. Judged from
the tags and block metadata and, where a block was rendered (step 3), from its body: absolute
operands appear in the rendered text as %I…, %Q…, %M…, %DB…, possibly wrapped as TYPE#(%M…). The body check is not done
(or only partial) for a block with no available export, with unsupported entries you did not
inspect in the XML, or with networks marked not rendered: name the unreviewed networks and
point to tia-verify.BASELINE.md); consistent case.isConsistent (else compile is stale — point to tia-verify).tia_crossrefs {plc, filter:"UnusedObjects", limit:200} for the first
page, then the same call with cursor set to the nextCursor of the page just read, passed back
unchanged, until nextCursor is null. Keep plc, filter and limit the same on every page.
App 1.8+ reuses the whole-PLC walk until a serve mutation, project close/switch or cursor expiry;
older serves re-read every page, which can take minutes. Read coverage on EVERY
page, never only on the first: on older serves a later page can report less than an
earlier one. Keep coverage.complete, coverage.owners, coverage.queried and
coverage.unavailable of each page and compare them: a page with coverage.complete: false or
coverage.unavailableOwnersTruncated: true makes the whole section not complete even when earlier
pages said complete, and counts that differ between pages mean the PLC changed during the walk, so
restart it once from the first page, without cursor, like cursor_stale; if they still differ,
treat the section as not complete. Answers that are not
failures and differ: (a) status:"running" + jobId identifies this request: poll
tia_job_status {jobId} until the final result and never repeat the call; after a timeout,
check the state (tia_status) before repeating. (b) kind:"busy" means this request did not run.
Only for a running job whose jobId is known (e.g. details.jobId), wait with
tia_job_status {jobId}, do not use its result for this PLC, then repeat the same call once
with unchanged arguments; if it is busy again, stop the walk and treat the section as not
complete (or not done when no page was read), with the reason.
Without a known running job ID, stop the walk as not complete (or not done if no page was read)
and wait/recheck with tia_status; for connect_incomplete, follow the host-inspection handoff
in tia_guide {"topic":"gui-gates"}, never retry connect.
(c) 409 cursor_stale means the project changed during the walk: restart from the first page, without cursor, once; if it is
stale again, stop the walk and treat the section as not complete. (d) A page where sources is
replaced by an object with omitted:true (an omission marker) was too large and carries no
nextCursor: repeat that same call, with the same cursor (or none for the first page) and a
smaller limit, for example half of the last one, at most three times, and follow a nextCursor
only from a page that arrives without a marker; never follow a cursor from an omitted page, it
would skip what the marker replaced. If a marker remains after three repeats, stop the walk and
treat the section as not complete. Report what the pages return as candidates, grouped by
source type (the summary.byType counts give the groups: blocks, tags and constants, types),
each with its path, and say what a candidate is not: the cross-reference view lists as
unreferenced the OBs and other entry points, the objects used only from outside the PLC (HMI,
OPC UA, Modbus, other CPUs, external applications) and library TYPEs, so an entry is not dead
code. Never recommend deleting one without a human check and never call a delete tool: the
recommendation is that the human confirms each candidate and, if one is to go, hands the removal
to tia-scaffold.
Completeness. The section is complete only when the page walk reached nextCursor: null
with every page intact and coverage.complete is true on every page, with the same
coverage.owners, coverage.queried and coverage.unavailable on all of them. In every other
case it is not complete: a marker you could not clear, a walk you did not finish (busy again,
a timeout, a second cursor_stale), coverage.complete: false or
coverage.unavailableOwnersTruncated: true on any page (some owners could not be queried), or
counts that still differ after the restart. Then list the candidates you did read, say how many
owners were queried (coverage.queried of coverage.owners, the lowest coverage.queried any
page reported), list coverage.unavailableOwners with each kind, name and reason from every
page that has any (the serve holds at most 50 per page and sets coverage.unavailableOwnersTruncated
when it dropped some, which you also say), and do not say that the audit is complete or that
anything is unused beyond the objects actually queried. A complete section still lists
candidates, never deletion advice.
If the call answers 409 crossrefs_unavailable, quote error, kind and hint, report
this section as not done and continue with the rest of the review.Unused objects section.set_attributes/invoke/create.
If a fix needs a write, emit it as a recommendation for tia-scaffold/the human.tia_crossrefs is a read; its UnusedObjects list never
becomes a deletion: report it, never call a delete tool, leave the decision to the human.coverage.complete: false on any page or coverage counts that differ between
pages makes the Unused objects section not complete: it lists the candidates it read and claims
neither a complete audit nor that anything is unused beyond the objects actually queried. Only a
finished walk whose pages all report coverage.complete: true with the same counts supports saying
the PLC was audited completely, and even then its entries are candidates.safety-reviewer subagent.See BASELINE.md for the rule table, what to read for each, and the naming prefixes.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
tia-portal, plc-programming, code-review, best-practices, audit, siemens
npx claudepluginhub renanlido/tia-harness --plugin tia-harness9 skills in this plugin
/cpu-selectRecommend a Siemens S7-1500/S7-1200 CPU family + variant + order number (MLFB) from an engineering need (I/O count, scan/performance, memory, communication ports, safety, redundancy, motion). Use when the user asks "which CPU / PLC should I use", gives selection criteria instead of a model, or needs a typeIdentifier for a project-spec. Deterministic heuristic over the bundled CPU reference — NO MCP. Output: recommended CPU + justification + the OrderNumber:{MLFB}/V{fw} TypeIdentifier (flagged: confirm/resolve the concrete MLFB+firmware with tia_catalog before building). Not for validating a spec (spec-validate) or when the user already named a model./spec-planTurn 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 what scaffolding a spec would do and in what order. Class R: runs tia_spec_validate then tia_spec_plan, both PURE (no serve, no TIA Portal); with a project open it can add a read-only impact check (tia_crossrefs) for the existing objects the plan would write to. Output: the ordered M-off steps + assumptions + warnings (+ that impact); nothing is applied and no gate is crossed. Not for validating (spec-validate) or applying the build (tia-scaffold)./spec-validateValidate 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. Class R (deterministic, read-only, no serve or TIA Portal; its only tool is the pure tia_spec_validate) — rung 0 of the verification ladder, fully offline. Not for recommending a CPU (cpu-select) or planning the build (spec-plan)./tia-backupBack up a PHYSICAL CPU into a dedicated EMPTY project — save+archive the working project, create a dated backup project, station-upload (GATE G4) with human approval, verify, archive to .zap21. Use when the user asks to "back up / upload / read out the CPU" or before risky work on a live controller. Class M-off up to the gate; the upload itself is GATE G4 (+G6 if a read password is requested) and NEVER runs without an explicit human yes. Never uploads into the working project. Not for downloads to the CPU (tia-handoff)./tia-handoffPrepare a human-approval envelope for a GATED operation — download / CPU-STOP (G3), go-online (G4), network scan (G7), credentials (G6: master secret, UMAC, upload / block / certificate passwords, password policy), safety/F (G5). Use when the user wants to "download / deploy / go online / commission", or after tia-verify is clean and the next step touches the physical controller. Class GATE: this skill NEVER performs the gated action — it produces the plan + planHash + exactly what the human must approve, and the precise resume call. The AI never approves, never invents a secret, never deploys F autonomously. Not for building (tia-scaffold) or compiling (tia-verify)./tia-initInitialize or update the current project's CLAUDE.md with the TIA harness operating guide. Use when the user asks to "init / bootstrap / set up the TIA harness", "add the harness guidance to CLAUDE.md", or "update the TIA harness section / refresh the harness guide in this project". Idempotent: injects the guide between stable markers and re-running only refreshes that block, never touching the project's own content. Class R (deterministic, file-only, no serve/TIA — the only MCP call it may make is the pure, offline tia_guide). Not for building, verifying or deploying a project (tia-scaffold / tia-verify / tia-handoff).Other plugins' skills for the same job