tia-backup
Skill12 starsChanged 28 days agoMITView on GitHub
Back 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).
In this repository10 other files it gives its agents.
- codex/AGENTS.mdAGENTS.md
- .claude-plugin/CLAUDE.mdCLAUDE.md
- cpu-selectSkill
- spec-planSkill
- spec-validateSkill
- tia-handoffSkill
- tia-initSkill
- tia-reviewSkill
- tia-scaffoldSkill
- tia-verifySkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 3 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 22
If no tia_* tool is available, the tia MCP is not connected: say so and stop.
- Very specific: line 24
Never report success after an error, never retry a refused call with changed arguments, and never cross a human gate: relay a …
- Very specific: line 43
Protect the working project: If tia_status shows a project: tia_project_save, then tia_project_archive { directory:"<an-existing-folder>", …
- Very specific: line 55
If it answers unsaved_changes, the working project changed after the save in step 0: STOP and report details.projects.
- Very specific: line 56
STOP and report details.projects.
- Distinctive: line 85
Not covered: this is an engineering backup, not a memory-card backup — no retentive/actual values, recipes or data logs.
- Distinctive: line 100
G6 passwords come from a human only: Never invented, guessed or reused.
- Distinctive: line 101
F is only reported (G5): Never authored, modified or deployed.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
tia-backup — read a physical CPU into a restorable archive (M-off up to G4)
The upload adds a new station to the open project — so the backup always goes into a
dedicated, dated, EMPTY project, never the working project. The .zap21 archive is
the restorable artifact.
Errors and reporting
- First call
tia_ping: continue only if it reportsreachable:trueandactivated:true.activated:nullwith a busydetailmeans serve is occupied, not necessarily by an MCP job: polltia_job_statusonly for a running job whosejobIdis known. Without one, wait/recheck withtia_status; forconnect_incomplete, follow the host-inspection handoff intia_guide {"topic":"gui-gates"}, never retry connect. Otherwise stop, quote itsdetailandhintverbatim and say that nothing was changed (prerequisites:tia_guide {"topic":"gotchas"}). - If no
tia_*tool is available, thetiaMCP 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). - On a tool error (
isError:true), quote itserrorandkindverbatim, relay itshint, 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. - Never report success after an error, never retry a refused call with changed arguments, and never cross a human gate: relay a
requires_human_actionanswer verbatim and wait for the human. status:"running"+jobIdidentifies a running job: polltia_job_status {jobId}without repeating the original call. Onkind:"busy", poll only for a running job whosejobIdis known (e.g.details.jobId); without one, wait/recheck withtia_status. Forconnect_incomplete, follow the host-inspection handoff intia_guide {"topic":"gui-gates"}, never retry connect. After atimeout, check the state before repeating anything.
Preconditions
- The serve is running and G1 (trust dialog) is done.
- The license has the
deployscope (tia_upload, the G4 step, is deploy-class). - The CPU's IP is known.
- The PG/PC adapter/mode names: discover them with
tia_pg_interfaceson the working project's PLC before switching projects (the adapter list is host-wide), or calltia_uploadwithout confirm. Without aconnectionModethe plan staysplan_blocked(connection_unresolved) and, when serve reports any, lists inconnectionCandidatesthe{connectionMode, pcInterfaceName, pcInterfaceNumber}of each available mode (up to 8 modes, 32 candidates; #192). An emptyconnection.pcInterface.availablethere does NOT mean the host has no adapter. Repeattia_uploadwithout confirm with one candidate's exact fields, then relay the G4 handoff. WithoutconnectionCandidates, repeat it without confirm with aconnectionModefromconnection.mode.available.
Procedure (in order)
- Protect the working project. If
tia_statusshows a project:tia_project_save, thentia_project_archive { directory:"<an-existing-folder>", name:"<working-project>_<YYYYMMDD-HHmm>.zap21" }(the directory must already exist; the name carries the.zap21extension — a missing or extension-less name fails). Report the resulting<directory>/<name>path. Tell the human the next step closes it:tia_project_createreplaces the open project, andserverefuses it withunsaved_changeswhile that project has unsaved work — which is why the save comes first. If the save or the archive fails, STOP and report it: never create the backup project over unsaved work. - Create a dedicated EMPTY backup project.
tia_project_createin a folder the human picks, namedPLC_backup_<station-or-ip>_<YYYYMMDD-HHmm>. Create no device in it. The first connect of a new TIA process may raise G1. If it answersunsaved_changes, the working project changed after the save in step 0: STOP and reportdetails.projects. Never retry withsaveUnsavedChangesordiscardUnsavedChanges(a flag would save or lose work the step-0 archive does not contain). tia_uploadwithout confirm. Relay the handoff verbatim. STOP if the project path isn't the new backup project ordevicesisn't empty.- After an explicit human yes: re-call
tia_uploadwith the SAMEip,connectionMode,pcInterfaceNameandpcInterfaceNumbershown in the approved plan, plusconfirm:trueand thatplanHash(+passwordonly if the human typed it — G6, never invented). Changed connection fields invalidate the approval (plan_mismatch);ipis required on every call.running→ polltia_job_status.upload_password→ ask the human for the password (G6), then get a fresh confirmation.outcome_unknown→ checktia_devicesfirst; never repeat the call.
- Verify.
createdDevices/tia_devicesshow the one new station. Optionallytia_plc_blockson it andtia_compile(M-off; a GUI-gated license message is not a backup failure). - Archive.
tia_project_save+tia_project_archive { directory:"<an-existing-folder>", name:"PLC_backup_<station-or-ip>_<YYYYMMDD-HHmm>.zap21" }. The.zapis the backup. Report its<directory>/<name>path, what it contains (expected) and what it doesn't. - Optional: reopen the working project with
tia_connect(the human decides). It closes the backup project, which step 5 saved; if it answersunsaved_changes, STOP and report it, and never passdiscardUnsavedChanges.
What it captures / does not
- Captures (observed 2026-09-26, S7-1200 1214C): the hardware configuration plus the full program — 41 blocks (FB 11, FC 4, OB 1, GlobalDB 8, InstanceDB 17), 4 UDTs, and tags (1 tag table with 32 tags; the bench project copy holds 2 tag tables, so tag-table structure may differ). The uploaded station compiled with 0 errors (1 hardware warning).
- Not covered: this is an engineering backup, not a memory-card backup — no retentive/actual values, recipes or data logs; know-how-protected content cannot be read back (stated as scope, not hardware-tested). An F-program is only reported (G5).
Runtime status
Runtime status: validated 2026-09-26 on S7-1200 1214C (bench): upload added the station,
CPU stayed in RUN, archive .zap21 1.6 MB; G6 password path not hardware-verified.
Hard guarantees
- Never the working project. The tool binds the token to the project shown in the handoff; the skill checks path + 0 devices before confirming.
- G4 needs a human yes. The upload goes online to the physical CPU — explicit approval every time.
- G6 passwords come from a human only. Never invented, guessed or reused.
- F is only reported (G5). Never authored, modified or deployed.
- Never repeat after an unknown outcome. Token spent → check
tia_devicesfirst. - Never download as part of a backup. A backup reads; it never writes or stops the CPU.
- Never discard.
discardUnsavedChangesis never passed in a backup: anunsaved_changesrefusal is reported to the human, never worked around.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

