agentleFS
SmailGSmailG/plc-programming/skills/new-pou/SKILL.md

new-pou

Skill0 starsChanged 37 days agoMITView on GitHub

Scaffold a new POU (PROGRAM, FUNCTION_BLOCK, FUNCTION, DUT or GVL) for a chosen platform and file format, validated before delivery.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use the project naming scheme if one exists.

    line 31
  2. Distinctive:

    Call timers and edges unconditionally.

    line 33
  3. Distinctive:

    Write each output once.

    line 34
  4. Distinctive:

    Write a header comment stating purpose, author placeholder and version.

    line 36

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Scaffold a new POU

The request is: $ARGUMENTS. It usually reads <kind> <name> [platform/format], for example fb FB_Pump m262, fb FB_Pump tia-scl, program Main twincat or fb FB_Pump plcopen.

  1. Resolve anything missing, in one question round:
    • Kind: PROGRAM, FUNCTION_BLOCK, FUNCTION, a DUT (struct or enum), or a GVL.
    • Target:
      • IEC ST text
      • Siemens SCL source (.scl) or SIMATIC SD
      • TwinCAT .TcPOU / .TcDUT / .TcGVL
      • PLCopen XML (tc6_0201, or tc6_0200 for CODESYS-family import)
      • Machine Expert or CODESYS (PLCopenXML or text)
      • Logix AOI (L5X)
      • Control Expert DFB
    • Purpose, in one sentence, plus its inputs and outputs, or "empty skeleton".
  2. Start from the closest template:
    • The other-platforms skill assets FB_Template.TcPOU and E_TemplateState.TcDUT.
    • The exchange-formats skill asset plcopen-st-pou.xml.
    • The siemens and schneider skill assets.
    • The patterns in the develop skill's references/code-patterns.md.
  3. Apply the conventions:
    • Use the project naming scheme if one exists; otherwise ask.
    • Make an explicit state enum for any sequential behaviour.
    • Call timers and edges unconditionally.
    • Write each output once.
    • Give every CASE an ELSE.
    • Write a header comment stating purpose, author placeholder and version.
  4. Generate fresh identifiers where the format needs them: TwinCAT Id GUIDs, SimaticML ID/UId numbering, PLCopen globalId as an NCName.
  5. Run python3 ${CLAUDE_PLUGIN_ROOT}/scripts/plc_validate.py <file> and fix the findings.
  6. Deliver the file, the import steps for the target IDE, and what was not verified (the file was never compiled).

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.