npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

gxw2-skill

v1.6.0

Published

Pi skill: generates Structured Text (ST) code and CSV variable import files for Mitsubishi Electric FX series PLCs (FX3U, FX3G, FX3S, FX5U) in GX Works 2.

Downloads

397

Readme

GXW2-ST — Pi Package (Extension)

A package for the Pi Coding Agent that makes the agent an expert in writing Structured Text (ST) code for Mitsubishi Electric FX series PLCs (FX3U, FX3G, FX3S, FX5U) in GX Works 2.

What This Skill Does

  • Generates correct ST code compatible with GX Works 2 FX series compiler
  • Generates CSV variable files for the GX Works 2 Label Editor (UTF-16 LE, tab-separated)
  • Creates function blocks (FB), functions (FUN), and structured programs with proper 2-file pattern (.st + .csv)
  • Knows every GX Works 2 FX-specific constraint:
    • Forbidden constructs (CONTINUE, LREAL, SR/RS, named CASE, VAR_IN_OUT)
    • Correct Mitsubishi function names (RND not ROUND, MAXIMUM not MAX, LIMITATION not LIMIT)
    • Postfix variants (_E triggered, P pulse, D prefix 32-bit)
    • := for ALL FB parameters including outputs
    • MEP/MEF preferred over R_TRIG/F_TRIG
    • K/H/E/T# literal prefix notation
  • Provides state machine patterns (Init→Reset→Idle) and 3-program structure (INIT/MAIN/PROCESS)

Versions & Compatibility

| Target Environment | Support | |--------------------|---------| | GX Works 2 | ✅ Primary | | FX3U | ✅ Full (STRING, all FBs) | | FX3G | ✅ (no STRING) | | FX3S | ✅ (no STRING, limited I/O) | | FX5U | ✅ (use GX Works 3 for primary tooling) |

Installation

This repository is a Pi package. It installs with one command and is auto-discovered by the Pi Coding Agent as the gxw2-st skill.

From GitHub (recommended)

pi install git:github.com/Serhioromano/gxw2-skill

From npm

pi install npm:gxw2-skill

From a local checkout (development)

pi install /path/to/gxw2-skill

Project-local install

Install for a specific project instead of globally; Pi installs missing packages automatically on startup after the project is trusted:

pi install -l git:github.com/Serhioromano/gxw2-skill

Verify

pi list      # the package appears in the list
pi config    # the gxw2-st skill is enabled

Load the skill on demand with /skill:gxw2-st, or just describe your task — the agent auto-activates the skill on topics like "GX Works 2", "FX3U", "Mitsubishi ST", or device addresses (X, Y, M, D).

Update

pi update git:github.com/Serhioromano/gxw2-skill

Remove

pi remove git:github.com/Serhioromano/gxw2-skill

Usage

Once installed, the agent activates on triggers like "GX Works 2", "FX3U", "Mitsubishi ST", or device addresses (X, Y, M, D). It always produces both ST code and CSV variable files.

Example prompts:

  • "Write a motor control function block with feedback monitoring for FX3U"
  • "Create a state machine for a pump station in ST for GX Works 2"
  • "Generate IO.csv and GVL.csv for a 5-pump cascade system"
  • "Show me how to use TON/TOF timers in Mitsubishi ST"
  • "How do I cast INT to REAL in GX Works 2 ST?"

Development

  • The skill lives in skills/gxw2-st/; all its internal links are relative to that directory, so moving/installing the folder keeps them valid.
  • The package manifest (pi.skills) points at ./skills; pi discovers SKILL.md recursively there.
  • Version numbers in package.json and skills/gxw2-st/SKILL.md frontmatter must stay in sync.

Key Design Decisions

CSV-First Variable Management

GX Works 2 uses the Label Editor for variables, not inline VAR...END_VAR blocks. This skill always generates paired .st code files and .csv label files in UTF-16 LE with BOM, tab-separated, all values quoted — exactly the format GX Works 2 expects for CSV import.

FX Series Only

No Q-series, L-series, or iQ-R constructs. The skill targets the FX compiler's specific limitations: no CONTINUE, no LREAL, no SR/RS FBs, no VAR_IN_OUT, no named CASE labels, and no trigonometric functions (SIN, COS, TAN, etc.).

Three Programs Per Project

Every project follows the INIT → MAIN → PROCESS structure:

  • PRG_INIT — one-time startup actions; registered in program/task settings with execution condition M8002 so the PLC runs it once — no M8002 guard in code
  • PRG_MAIN — runs every scan with all business logic
  • PRG_PROCESS — runs every scan; non-business actions: error checks, alarm handling, data transfer, HMI/comm refresh

State Machine Convention

All state machines start with states 0 (Init), 10 (Reset), 20 (Idle). Integer values only, no CONSTANT declarations for state names.

Author

Serhioromano

License

MIT