Skip to main content
Challenge

PLC Structured Text Code Reformatter with Claude Agents SDK

Legacy IEC 61131-3 Structured Text code often lacks consistent formatting, variable scope annotations, and safe bounds comments. In this challenge, developers will use Anthropic's Claude Agents SDK to construct an automated PLC logic formatting and auditing utility.

EngineeringHosted by Vera
Challenge brief

What you are building

The core problem, expected build, and operating context for this challenge.

Build an automated PLC Structured Text reformatter and auditor using Claude Agents SDK.

Delivery guide

How work is evaluated

Evaluation

Evaluates formatting cleanliness and unhandled branch detection on sample Structured Text logic.

Datasets

Challenge datasets

Public datasets, plus the private datasets you have access to.

Evaluation rubric

How submissions are scored

These dimensions define what the evaluator checks and which criteria separate a passable run from a strong one.

Dimensions
2 scoring checks
Binary
2 pass or fail dimensions
Ordinal
0 scaled dimensions
Dimension 1

Missing Else Detection

Single IF block without ELSE must trigger missing_else_warning

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Dimension 2

Code Cleanliness Score

Formatting adherence check against IEC 61131-3 standards • target: 1 • range: 0-1

Binary check

This dimension contributes its full weight only when the submission satisfies the requirement. Partial credit is not awarded.

Learning goals

What you should walk away with

  • Initialize a Claude Agents SDK client for code refactoring tasks

  • Format messy IEC 61131-3 Structured Text logic blocks

  • Add inline comments explaining state transition logic

  • Detect unhandled `ELSE` branches and variable overflow risks

Resources and assets

Reference links and supporting material

Dataset notes

Unformatted Structured Text logic snippets representing pump interlocks and valve controls.

Challenge setup

Evaluates formatting cleanliness and unhandled branch detection on sample Structured Text logic.

Challenge input

Unformatted ST code string

Claude Agents SDK

Assigned framework

Evaluated output

JSON with formatted_code, missing_else_warning (boolean)

Evaluation checks
  • Single IF block without ELSE must trigger missing_else_warning
  • Formatting adherence check against IEC 61131-3 standards • target: 1 • range: 0-1
Configured evaluation evidence
  • Benchmark: Code Refactoring Verification Benchmark
  • Code Cleanliness Score target: 1
  • 1 public reference case
Configured runtime
  • Python execution harness
  • Python sandbox (unavailable on Versalist)

Summary shows the first task, up to three tools, and up to three evidence items. Open the technical recipe to view all configured items.

View technical recipe

Configured tools

Action Space
  • Claude Code · Required
  • Anthropic · Optional
Observation
  • Claude Code · Required
Policy Serving
  • Claude 4.1 Opus · Optional

Evaluation contract

  • Missing Else Detection · Weight 1
  • Code Cleanliness Score · Weight 1

Metrics

  • Code Cleanliness Score · Target 1

Benchmarks

  • Code Refactoring Verification Benchmark
  • general

Reference cases

  • 1 public reference case

Workflow tasks

  1. Task 1

    Input: Unformatted ST code string

    Output: JSON with formatted_code, missing_else_warning (boolean)

    Execution harness: Python

Evaluation tools

  • Claude Agents SDK · Code analysis SDK

Recipe freeze marker

No recipe freeze time is recorded.

Frequently Asked Questions about PLC Structured Text Code Reformatter with Claude Agents SDK