festo-codesys-mcp: Command for Claude Code

.claude/commands/audit-naming.md

audit-naming is a command for Claude Code from efranceschetti/festo-codesys-mcp. It costs 58 tokens per session (1,145 once invoked), scanned A, original, MIT.

An audit command for Structured Text files, the PLC programming files used in industrial control systems, that checks naming and code structure.

In plain words
What is it for?
It reviews .st files for Hungarian and PascalCase naming, approved abbreviations, one program organization unit per file, isolated function blocks, and related PLC rules.
Why use it?
It finds inconsistent names and architectural problems that a naming-only check or simulator may miss.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

This is efranceschetti/festo-codesys-mcp's own configuration. It tells Claude Code how to work on festo-codesys-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything festo-codesys-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to efranceschetti/festo-codesys-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/efranceschetti/festo-codesys-mcp/main/.claude/commands/audit-naming.md
Clone the repo
git clone --depth 1 https://github.com/efranceschetti/festo-codesys-mcp

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for audit-naming

README.md
[![agentmods](https://agentmods.dev/badge/commands/efranceschetti/festo-codesys-mcp/audit-naming/github.svg)](https://agentmods.dev/commands/efranceschetti/festo-codesys-mcp/audit-naming)
Your own site
<a href="https://agentmods.dev/commands/efranceschetti/festo-codesys-mcp/audit-naming"><img src="https://agentmods.dev/badge/commands/efranceschetti/festo-codesys-mcp/audit-naming/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for audit-naming

Your own site · 80×15
<a href="https://agentmods.dev/commands/efranceschetti/festo-codesys-mcp/audit-naming"><img src="https://agentmods.dev/badge/commands/efranceschetti/festo-codesys-mcp/audit-naming.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,145 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01145
Opus 5 $0.00029 $0.00573
Sonnet 5 $0.00012 $0.00229
Haiku 4.5 $0.00006 $0.00114

Measured 8d ago against content hash 345f0cd7312b, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

audit-naming scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/audit-naming.md · 55 lines

What it actually says

Audit naming in $ARGUMENTS. Default: src/pou/ if empty.

Sequence

  1. List targetsGlob on $ARGUMENTS/**/*.st. If zero files, stop and report.

  2. Reference loadingplc_knowledge topic conventions (once only, not in a loop).

  3. Per-file review — for each file:

    • Read
    • review_st_code with the content
    • Collect violations
  4. Batch validationplc_validate action=batch with a list of naming checks derived from the declarations found.

  5. Cross-check abbreviations — for each variable name that has a word suffix (e.g. bSensorState → "Sensor", "State"), verify it is in the canonical list. Use plc_lookup action=list_standard if you need the reference.

  6. Architectural lint (beyond naming) — naming is only half of a clean project. Run these structural checks with Grep/Read across the same fileset (they catch classes of bug a Python twin or a naming-only pass misses — several are CODESYS compile errors invisible to a simulator). Each is a rule + the "why":

    • [fb-isolation] An FB must not reference a GVL directly. No GVL_ token in any FB_*.st (ignore comments). An FB that reads/writes globals is coupled and not unit-testable — data enters through its interface (VAR_INPUT/OUTPUT/IN_OUT); only PROGRAMs touch GVLs.
    • [no-cross-prg-edge] No R_TRIG/F_TRIG edge used as a handshake between PROGRAMs. An edge/pulse is a 1-scan event — invisible to a PROGRAM running on a different task rate. Cross-PRG coordination must use a level (set/reset) signal on the bus, not an edge. Flag R_TRIG/F_TRIG in station/coordination PRGs.
    • [single-writer-bus] One writer per bus signal. A given GVL_Handshake.<sig> := (or your status-bus GVL) is assigned in exactly one file. Two writers = silent clobber (the last POU to run in the scan wins).
    • [single-writer-output] One writer per physical output. A given GVL_IO.q<X> := is assigned in exactly one POU. Two writers = coil clobber. Multiple assignments in the same file (a mode MUX: Manual > Auto) count as one writer and are fine.
    • [one-pou-per-file] One POU per file, filename == POU name. Each .st declares exactly one PROGRAM/FUNCTION_BLOCK/FUNCTION and the filename equals the POU name. Multi-POU files or a name mismatch break the CODESYS project tree / ObjectId mapping on PLCopen import.
    • [at-percent-one-file] AT % addressing lives in exactly one file. Only the physical-I/O GVL (GVL_IO) carries AT % addresses. An AT % in any station/FB/type pierces the remappable symbolic-I/O layer and forks the machine by physical address.
    • [fb-call-params-exist] FB call parameters must exist. Every param := in a call to an FB instance is a real VAR_INPUT/OUTPUT/IN_OUT of that FB. A stray or renamed parameter is a CODESYS compile error (C0037) that a Python twin/sim silently accepts (it takes the kwarg and moves on).
  7. Produce a report — format:

# Naming & Architecture Audit — <folder>

## Summary
- Files analyzed: N
- Hungarian violations: X
- POU prefix violations: Y
- Snake_case: Z
- Non-standard abbreviations: W
- Architectural violations: A (fb-isolation, single-writer-bus/output, one-pou-per-file, at-percent-one-file, no-cross-prg-edge, fb-call-params-exist)

## Per file

### <file1.st>
- [hungarian] line L: ...
- [snake_case] line L: ...
- [fb-isolation] line L: FB references GVL_X directly
- [single-writer-bus] GVL_Handshake.bY_Z written in file1.st AND file2.st

## Recommendation
<approved | redo naming before PR | fix architecture before PR>

Output ONLY markdown, no extra chat.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 55 lines · 58 tokens per session scan A 345f0cd7312b

Subscribe to this mod's changes

audit-naming is a command published in the GitHub repository efranceschetti/festo-codesys-mcp (1 stars, last pushed 3d ago), licensed MIT. It adds 58 tokens to every session and 1,145 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.