/twincat-mcp-agent:tc-naming-conventionsfrom twincat-mcp-agent
Enforces Beckhoff TwinCAT Hungarian notation rules for naming variables, function blocks, data types, and interfaces. Use before any code generation or modification.
Ships in twincat-mcp-agent. 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.
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 |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/tc-advanced-patternsUse this skill when implementing advanced TwinCAT 3 (ExST) features. It covers Properties (GET/SET), Methods, initialization lifecycles (FB_init, FB_reinit, FB_exit), State Machine patterns, pragmas (attributes, conditional compiling, regions, message output), and PlcTaskSystemInfo access./tc-datatypes-memoryUse this skill when the user asks about data types, arrays, structures (STRUCT), enumerations (ENUM), pointers (POINTER), references (REFERENCE), or dynamic memory allocation (NEW/DELETE). It also contains critical rules for memory alignment (pack_mode) to minimize padding bytes./tc-syntax-control-flowUse this skill to correctly format ST (Structured Text) logic, operators, and control flow statements. It includes precedence rules, IF/CASE/FOR/WHILE loops syntax, mathematical/bitwise operator rules (MOD, SHL, ADR, BITADR), and the list of reserved IEC keywords.npx claudepluginhub techindustryx/twincat-agent --plugin twincatOther plugins' skills for the same job