From twincat-mcp-agent
Use this skill ALWAYS before generating or modifying the names of any variables, Function Blocks (FB), Data Types (DUT), Functions, Methods, Properties, or Interfaces. It contains the mandatory Beckhoff Hungarian notation rules, prefixes (b, n, f, st, fb, etc.), and shading/name resolution rules to avoid conflicts.
How this skill is triggered — by the user, by Claude, or both
Slash command
/twincat-mcp-agent:tc-naming-conventionsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Strictly follow Hungarian notation prefixes and PascalCase for identifiers to maintain code standard compliance.
Strictly follow Hungarian notation prefixes and PascalCase for identifiers to maintain code standard compliance.
| Object Type | Prefix | Example Definition | Example Instance | Call Example |
|---|---|---|---|---|
| Function Block | FB_ | FUNCTION_BLOCK FB_AxisControl | fbAxisControl | fbAxisControl(); |
| Structure | ST_ | TYPE ST_MachineStatus : STRUCT | stMachineStatus | stMachineStatus.nCounter := 5; |
| Enum | E_ | TYPE E_OperationMode : ( | eOpMode | eOpMode := E_STOP; |
| Program | P_ | PROGRAM P_Main | - | - |
| Function | F_ | FUNCTION F_Calculate : REAL | - | - |
| Interface | I_ | INTERFACE I_Observable | iObservable | - |
| Global Variable List | GVL_ | VAR_GLOBAL GVL_IO | - | - |
| Alias Type | T_ | TYPE T_Nibble : ... | Nibble | Nibble := 1; |
| Type | Prefix | Description | Example |
|---|---|---|---|
| BOOL | b | bit | bStart, bReady, bSwitch |
| INT, UINT, WORD, SINT, USINT, DINT, UDINT, BYTE, DWORD, LWORD | n or i | numeric / integer | nCount, nIndex, iErrorID |
| REAL, LREAL | f | float | fTemperature, fPosition, fValue |
| STRING, WSTRING | s | string | sMessage, sSerialNumber, sName |
| TIME | t | time | tDelayTime, tDelay |
| DATE | d | date | dMonday |
| DATE_AND_TIME (DT) | dt | date and time | dtTimestamp, dtNewYear |
| TIME_OF_DAY (TOD) | tod | time of day | todAlarm |
| ARRAY | a or arr | arrays | aDataBuffer, arrMessages |
| POINTER | p | pointer | pConfig, pData |
| REFERENCE | ref | reference | refAxis |
| ENUM | e | enum instance | eState |
| Count of bytes | cb | byte count | cbLength |
| Count of words | cw | word count | cwRead |
_ as separator (e.g., FB_GetData).fbGetData, stBufferEntry).0...9, A...Z, a...z, _.Position, IsReady, Execute, Reset)._ prefix. Example: for a property Name : STRING, the backing field is sName, not _sName.Each library must contain a version function readable at runtime:
FUNCTION F_GetVersionMyLib : UINT
VAR_INPUT
nVersionElement : INT;
END_VAR
CASE nVersionElement OF
1: (* major *) F_GetVersionMyLib := 1;
2: (* minor *) F_GetVersionMyLib := 0;
3: (* revision *) F_GetVersionMyLib := 0;
ELSE
F_GetVersionMyLib := 16#FFFF;
END_CASE
When the same identifier is used for different elements, the compiler searches in this order:
qualified_only) → (b) library GVLs{attribute 'qualified_only'} on GVLs and enumerations.Tc2_System.ADSLOGSTR(...).THIS^.varName to access a shadowed FB variable from a method.0-9, A-Z, a-z, _. No spaces, no special characters, no umlauts.bMyVar and bmyvar collide), but always write them in PascalCase to keep readability.__ (double underscore) are reserved for internal compiler use.tc-syntax-control-flow).Tc (e.g., Tc2_System, Tc3_Module).MyCorp_Motion).F_GetVersion<LibName> returning UINT so the runtime version is queryable.| Construct | Where Allowed | Use |
|---|---|---|
THIS^ | FB body, methods, properties | Access own FB instance, disambiguate shadowed locals |
SUPER^ | Derived FB body, methods, properties | Call base FB body or base method |
SUPER^.FB_init | Forbidden in explicit FB_init | Base init runs implicitly |
SUPER^.FB_reinit | Required in derived FB_reinit | Must be called explicitly |
npx claudepluginhub techindustryx/twincat-agent --plugin twincatProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.