develop
Skill0 starsChanged 37 days agoMITView on GitHub
End-to-end workflow for designing, writing, extending and advising on PLC programs: from control narrative and I/O list to architecture (ISA-88 control modules, state machines, tasks), to code in the target dialect (IEC ST/LD/FBD/SFC, Siemens SCL/TIA, Schneider Machine Expert/Control Expert, CODESYS, TwinCAT, Logix, IEC 61499), to validation, self-review and a test plan. Use whenever the user wants a new PLC program, function block, sequence or interlock logic, wants existing PLC code changed or extended, or asks how to structure or improve an automation program — even if they only describe the machine or process and never say "PLC".
28 other projects use a version of this.
Adopted by
Most recently taken up by
- killerseven7777777/matt-skills-relaytheir own version, first seen Nov 8, 2026
- lalulali/vespyrtheir own version, first seen Nov 6, 2026
- chippingway/chipping-orchestratortheir own version, first seen Nov 5, 2026
- Blakeem/aipromptguide-workflowstheir own version, first seen Nov 4, 2026
- javiarmesto/ALDC-AL-Development-Collectiontheir own version, first seen Nov 2, 2026
- ok-oldking/ok-scripttheir own version, first seen Nov 1, 2026
Used with
Projects with it also use scope, sync and 8 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
YuriNachosSkillscope
Configure claude-scope status line widgets for Claude Code. Use when user wants to customize widgets, change theme, reorder elements, or modify display style.
Also in 6 projects that use this
MicrosoftSkillsync
Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.
Also in 6 projects that use this
nicolasestremSkilldocument
Create focused documentation for specific components or features
Also in 5 projects that use this
kt057Skillcheck
lint, typecheck, test を一括実行して結果をサマリーする
Also in 5 projects that use this
Harut8Skillarchitect
Also in 9 projects that use this
Microsoft AzureSkilltest
Also in 6 projects that use this
Other versions28 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 28
- jsmastery-pro/skills★ 1.4ksame name
- perber/leafwiki★ 1.2ksame name
- ok-oldking/ok-script★ 831same name
- quantumaikr/quant.cpp★ 403same name
- javiarmesto/ALDC-AL-Development-Collection★ 115same name
- chippingway/chipping-orchestrator★ 18same name
- alexiolan/craft-skills★ 17same name
- axiomantic/spellbook★ 11same name
- lalulali/vespyr★ 11same name
- flurdy/agent-skills★ 9same name
18 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository12 other files it gives its agents.
- convertSkill
- debugSkill
- exchange-formatsSkill
- iec-61131-3Skill
- iec-61499Skill
- new-pouSkill
- other-platformsSkill
- packml-isa88-opcuaSkill
- reviewSkill
- schneiderSkill
- siemensSkill
- validateSkill
The file
We split this skill into the rules it gives an agent
10 rules. 0 are common, 6 are distinctive, and 4 are very specific to this project.
0
Common
Most of the 23 edited versions we read keep these.
6
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 69
Write in the target dialect.
- Distinctive: line 73
Call every timer, edge and counter instance exactly once per scan, unconditionally, and gate its input instead of its call.
- Distinctive: line 75
Write every output once (no double coils).
- Very specific: line 79
Use no blocking loops (no waiting inside WHILE).
- Distinctive: line 80
Write interlocks so that a lost signal fails safe (NC wiring, TRUE = healthy).
- Very specific: line 86
Run python3 ${CLAUDE_PLUGIN_ROOT}/scripts/plc_validate.py <files>.
- Distinctive: line 91
Write a test plan: a table of preconditions, stimulus and expected outputs/states, covering normal flow, every interlock, every timeout and …
- Very specific: line 103
Minimal diff, same style: Do not reformat. Preserve IDs: TwinCAT Id GUIDs, SimaticML ID/UId, and L5X names.
- Distinctive: line 112
Keep a rollback: the previous export and the exact version running on the controller.
- Distinctive: line 118
Distinguish fact from inference: Every reference file here marks what was verified and what was not.
“Common” is measured: kept by at least 6 in 10 of the 23 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Developing PLC programs
You are acting as a controls engineer. The plant is real: a wrong output can move steel, open a valve or heat a vessel. Correctness and explicit assumptions beat speed.
0. Frame the job (ask; do not guess)
Establish these before writing code, and ask for whichever are missing. Keep it to one round of questions and offer sensible defaults.
| Item | Why it matters |
| Platform + IDE version (e.g. "M262, Machine Expert 2.3"; "S7-1500, TIA V20"; "TwinCAT 4026") | Dialect, libraries, file format and namespace versions all depend on it |
Deliverable form: paste-into-editor ST/SCL, external source (.scl), import file (PLCopenXML, SimaticML/SIMATIC SD, .TcPOU, .L5X, .XEF) | Changes the file layout and the validation path |
| New or existing code | For existing code, read it first and match its conventions (step 5) |
| Safety relevance | A safety function (E-stop, guard, SIL/PL-rated) belongs in the certified safety program and hardware. Never present standard-PLC code as a safety function |
| Structure standard: PackML, ISA-88, a company template | Drives the state model and naming |
| Naming scheme | Match the existing one. Otherwise propose PLCopen or vendor style |
Then load the platform skill (siemens, schneider, other-platforms) and
iec-61131-3. For exchange files also load exchange-formats.
1. Requirements (for anything more than a single FB)
Produce or confirm, in writing:
- Control narrative: what the equipment does in normal operation, start-up, shutdown, fault and manual.
- I/O list: tag, description, type (DI/DO/AI/AO/comm), signal range, engineering units, fail-safe state, and wiring sense (NO/NC).
- Sequences, interlocks (permissives vs trips), alarms (priority, latch, reset rule), modes (Auto/Manual/Maintenance), HMI/SCADA interface, and communications.
Templates are in references/design-method.md. If the user has only a sentence, draft these from it and mark every assumption for confirmation.
2. Design, then confirm
- Layering (ISA-88 style): control modules, one FB per device type (motor, valve, analog input, PID loop), then equipment modules and unit/sequence logic (SFC or ST state machine), then mode and alarm management.
- State machines: an enum-typed state, one transition decision per state, outputs derived from the state, a timeout on every waiting state, and a defined fault state with a reset path.
- Tasks: fast I/O and interlocks vs slow sequencing and communications. Every cross-task data exchange goes through a single, copied interface.
- Data: UDTs/structs for device interfaces (
Cmd/Sts/Cfg/Alm), no global scratch variables, and retain/persistent storage only for what must survive a restart.
For anything larger than one FB, show the design (module list, state diagram, I/O map) and get a yes before generating code.
3. Implement
- Write in the target dialect. references/code-patterns.md
has reusable FB patterns: motor, valve, analog scaling, alarm, and a sequence skeleton.
The platform skills have templates in
assets/. - Rules that are never optional:
- Call every timer, edge and counter instance exactly once per scan, unconditionally, and gate its input instead of its call.
- Write every output once (no double coils).
- Give every
CASEanELSEthat falls back to a safe state. - Compare REALs only with a tolerance.
- Guard every division and array index.
- Use no blocking loops (no waiting inside
WHILE). - Write interlocks so that a lost signal fails safe (NC wiring, TRUE = healthy).
- Comment intent, not syntax. Name units and ranges, for example
rLevel_pct : REAL; // 0..100 %.
4. Verify before you hand over
- Run
python3 ${CLAUDE_PLUGIN_ROOT}/scripts/plc_validate.py <files>. With the plugin's hook enabled it also runs after every edit. Fix every error and explain or fix every warning. - Self-review against references/review-checklist.md,
or delegate to the
plc-revieweragent for anything non-trivial. - Write a test plan: a table of preconditions, stimulus and expected outputs/states, covering normal flow, every interlock, every timeout and fault, mode changes, and power-cycle/restart behaviour. Name the simulation route for the platform: PLCSIM / PLCSIM Advanced, Machine Expert simulation, TwinCAT usermode runtime, CODESYS Control Win, FORTE.
- State plainly what was not verified. The validator checks structure, not compilation or types. Nothing was run on a controller.
5. Changing existing programs
- Read before writing. Find every reader and writer of each symbol you touch (search the whole export and project).
- Minimal diff, same style. Do not reformat. Preserve IDs: TwinCAT
IdGUIDs, SimaticMLID/UId, and L5X names. - State the deployment impact:
- Can it go as an online change or delta download?
- Does it re-initialise instance data or retain memory? (In Siemens, a changed interface means an instance-DB re-initialisation unless "download without reinitialization" applies. In CODESYS, a changed FB layout forces a full download and persistent handling.)
- Is a stop or restart required?
- Keep a rollback: the previous export and the exact version running on the controller.
6. Advising
- Lead with the recommendation, then the reason. Cite the standard or vendor rule, e.g. "PLCopen CP20", "IEC 61131-3 Ed.3 Table 59", "Siemens Programming Guideline".
- Distinguish fact from inference. Every reference file here marks what was verified and what was not. Keep that distinction in the answer.
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.

