/tia-harness:tia-handofffrom TIA Portal Automation Harness
Prepares a human-approval envelope for gated operations (download, go-online, network scan, credentials, safety) on a TIA controller. Produces the plan, planHash, and resume call for human sign-off. Never performs the action autonomously.
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.
None: SKILL.md is the whole skill.
The harness is an assistant up to the gate, never an autonomous commissioner. Anything
that touches the physical controller, the network, secrets, or safety stops here: this
skill assembles the approval envelope (requires_human_action) — what can be done, what
the human must do, the plan + hash, and the exact resume call — and then stops.
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-verify is clean and the user wants to download / deploy / go online / scan / commission.| Gate | Action | Tool | What the human must approve |
|---|---|---|---|
| G1 | open/connect project (1st time) | tia_connect (+ tia_show_ui) | confirm the TIA trust dialog on the serve host |
| G3 | download (CPU STOP → possible program delete → overwrite → restart) | tia_download | the verified plan + software fingerprint + EVERY loadPreview.willConfirm entry: StopAll, ResetModule = DeleteAll (a different program on the CPU is deleted), OverwriteSystemData, ConsistentDownload of blocks and alarm text libraries, StartModule, and UpgradeTargetDevice (only if opted in; without it a CPU that needs it refuses the load) |
| G4 | go online (connect to live CPU) | tia_online | it is safe to connect to the target machine |
| G4 | station upload (read CPU into project) | tia_upload | it is safe to connect to the target machine AND the open project is a dedicated backup project (the upload adds a new station — skill tia-backup) |
| G7 | network scan (accessible devices) | tia_accessible_devices | probing the local network via the PG/PC NIC |
| G6 | credentials: master secret / UMAC / upload read password / block know-how password / certificate password / password policy / local-session logon dialog | tia_mastersecret_set ({plc, password}), tia_mastersecret_reset, tia_connect (umacUser/umacPassword), tia_upload (password), tia_block_protect, tia_certificate_import, tia_password_policy_set, tia_local_session_open (a UMAC-protected session may wait on a Siemens logon dialog on the serve host) | supply the secret / decide the policy / answer the logon dialog (human/credential vault); a reset only on the human's explicit request |
| G5 | safety/F author·modify·download | — | never autonomous; F deploy is a human, gated action |
Two classes of human interaction. The table above is approval gates — a human approves an action that touches the controller, network, secrets, or safety. There is a second class: GUI-config handoffs — fresh 1214C PUT/GET, OPC UA license selection and HR mapping need an owner-prepared source;
tia_device_from_mastercopycan inherit them into a NEW station, not grant entitlement or set an arbitrary existing CPU. G1 trust confirmation remains human-only. During scaffold/verify, do not blindly retry a missing license/interface; give the exact steps intia_guide {"topic":"gui-gates"}(the harness guide's "Human interaction points (GUI gates)").
tia_compile is clean (errors:0) via
tia-verify. Never prepare a download for an inconsistent project.tia_pg_interfaces (reads what TIA
already knows about the CPU's DownloadProvider, plus each adapter's OS status; performs
no network scan). Only reach for tia_accessible_devices (GATE G7, a real scan) when
tia_pg_interfaces doesn't resolve the interface you need.tia_download { dryRun:true } asks serve for a verified
plan: a fresh compile, the connection resolved, and the software fingerprint (content
hash of blocks/UDTs/tag tables — NOT hardware, system block groups or technology objects;
falls back to modification dates when a block has no fingerprint provider). Only a ready
plan returns a planHash — a single-use token that expires (TIA_PLAN_TTL_MS,
default 15 min) and lives only in this MCP process — and a loadPreview.willConfirm list: every
selection serve will make during the load. Nothing is sent to the CPU.requires_human_action):
canDo — e.g. "download to PLC_1".youMustDo — the concrete physical consequence + confirm it is safe on the target line.loadPreview — reproduce every loadPreview.willConfirm entry of the dry-run answer, none dropped
or squeezed into "STOP → overwrite → restart": the CPU STOPS (StopAll); ResetModule = DeleteAll
deletes a DIFFERENT program already on the CPU; system data is overwritten; blocks and alarm text
libraries download consistently; the CPU restarts (StartModule); UpgradeTargetDevice is confirmed
only with allowUpgradeTargetDevice:true, otherwise a CPU that needs it refuses the load and may
already have been stopped; any other dialog serve does not recognise is left untouched and can abort
the load.plan + planHash + fingerprint — show the human both: the hash binds the approval
to this exact plan AND this exact software content — NOT the hardware configuration. Re-plan
(new dryRun) + fresh human approval only if the hardware configuration changed AFTER the dryRun
that produced the token — the fingerprint cannot detect that change, so confirm with the human
that nothing hardware-side moved; never reuse the old token for changed hardware.resume — the precise call a human runs after approving: tia_download { approved:true, planHash:"<the hash>", ... } (the SAME parameters as the dry-run).tia_download with approved:true yourself. A human approves
out-of-band and runs the resume call (or explicitly instructs you to, with the hash).approved:true, serve re-checks the fingerprint inside the download call (no
window between check and load) and answers 409 plan_stale if the software changed
since the plan — start over with a new dry-run and a new approval. allowUpgradeTargetDevice: true (TIA's "upgrade the target device" confirmation, #31) is part of the approved plan;
never add it without the human's yes — without it, a CPU that requires it refuses the load
with 409 upgrade_target_device_required (check the CPU state before retrying: earlier
confirmations in the same pass, like StopAll, cannot be undone).tia_online / tia_accessible_devices
once WITHOUT confirm — it returns the requires_human_action handoff and touches nothing;
relay it verbatim and STOP. Only after the human's explicit yes, repeat the same call with
confirm:true (there is no token: the human's yes is the approval). For tia_online that call
must repeat the SAME connectionMode, pcInterfaceName, pcInterfaceNumber and targetInterfaceName as the
handoff's plan: without connectionMode or pcInterfaceName it is refused (connection_fields_required) and
nothing is sent. G6: tia_mastersecret_set
and the umac* fields of tia_connect take only a secret the human typed; so do the passwords of
tia_block_protect and tia_certificate_import, and tia_password_policy_set takes only values
the human decided.
A station upload (G4) is the tia-backup skill.A client that supports elicitation shows its own confirmation dialog before a gated call goes
through: tia_download with approved:true, and tia_upload, tia_online and
tia_accessible_devices with confirm:true. A client without it behaves as before.
planHash
still applies in full: the dialog only checks the human's answer, and serve's approval token
stays the authority. Passwords (G6) are never asked there.declined_by_human / cancelled_by_human (a result, not an
error) means the human refused: nothing was sent and the plan stays valid until its TTL
(the token was not consumed). STOP; do not retry unless the human asks you to.elicitation_failed (isError:true) means the dialog could not be shown or answered:
nothing was sent. Relay it and STOP.reasonCode on a download_approval handoff)A successful dry-run is NOT a handoff — it returns status:"plan_ok" with the planHash.
reasonCode:"not_approved" appears only when calling the real download without approved:true.
reasonCode | Meaning | What to do |
|---|---|---|
not_approved | Called without approved:true (no token presented) | Re-run the dry-run, get human approval, call with approved:true + the planHash |
unknown | This planHash was not issued by this MCP process (or it restarted) | Get a fresh dry-run |
expired | The token's TTL passed | Get a fresh dry-run |
consumed | This token was already used (single-use) | Check the CPU / tia_job_status before anything else |
plan_mismatch | The parameters differ from the approved plan | Re-review with the ACTUAL parameters |
outcome_unknown | The download call itself failed AFTER the token was consumed (network/timeout/serve error) | The token is SPENT and cannot be reused — check the CPU state directly and tia_status/tia_job_status BEFORE requesting a new plan; do NOT retry the same call |
serve_too_old is NOT a reasonCode: a serve without POST /plcs/{plc}/download/plan (< app v1.6.0)
fails the dry-run with an ordinary isError:true result with kind:"serve_too_old" — update the app,
never fall back to the unverified path.
approved:true + a matching planHash only ever
come from an explicit human decision..mcp.json. Password-policy values (tia_password_policy_set) are the
site's security decision: the human decides them, the AI never picks them.safety-reviewer is read-only.planHash from the dry-run
— a changed plan invalidates the approval (re-review). serve re-verifies the fingerprint
again inside the real download — the token is never trusted blindly.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 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).npx claudepluginhub renanlido/tia-harness --plugin tia-harnessOther plugins' skills for the same job