You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: agent-skills/skills/moqui-plc-designer/SKILL.md
+30-16Lines changed: 30 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,6 @@
1
1
---
2
2
name: moqui-plc-designer
3
3
description: Use when generating or refining PLC code from Moqui automation data. This skill reads devices, parameters, device requests, status flows, and related metadata, then fills reusable templates for IOFacade, DeviceFacade, DeviceManager, DeviceDiagnostics, MainStatus, Main, and MainRuleEngine.
4
-
compatibility: Requires Python 3.14+
5
-
license: ../../LICENSE.md
6
-
metadata:
7
-
author: moqui-induatrial
8
-
version: "1.0"
9
4
---
10
5
11
6
# Moqui PLC Designer
@@ -46,20 +41,30 @@ Use this skill when the task is to define or generate a data-driven automation m
46
41
47
42
## Output Layout
48
43
49
-
Generated PLC files should be written into an `output/<component-name>/` tree that mirrors the `mantle-hvac` structure in [moqui/moqui-plc](https://github.com/moqui/moqui-plc).
44
+
Generate one isolated bundle for each top-level CODESYS Application. Each bundle
45
+
contains a dedicated framework copy and one runtime component that mirrors
@@ -88,22 +93,26 @@ CODESYS device-tree objects remain external to the Moqui seed model:
88
93
-`InputSignalUpdate` and `OutputSignalUpdate` stay manual
89
94
-`DeviceManager` and `DeviceDiagnostics` are auto-generable only when every listed device is blocking for the machine
90
95
- complex redundancy, backup, standby, or non-blocking `DeviceGroup` roles are out of scope
91
-
-`Main.pou` and `MainRuleEngine.pou` intentionally remain in standby until real project test cases are available to validate the final generation rules
96
+
-`MainRuleEngine.pou` computes boolean transition requests; `Main.pou` alone consumes those requests and applies same-flow state changes
97
+
- every top-level controlled system is generated as a separate CODESYS Application with its own framework copy
98
+
- subsystem controllers execute sequentially by unique ascending `call_sequence`; `DeviceManager` executes once afterwards
99
+
- cross-flow transitions require reviewed `request_assignments` and `apply_assignments`; generation stops if either side is missing
92
100
- the repository should currently be treated as a semilavorato/base framework that each development team may further specialize
93
101
94
102
## Workflow
95
103
96
104
1. Read the seed XML and related Moqui model files.
97
105
2. Decompose the machine into subsystems and levels.
98
-
3. Identify the main orchestration FSM and the atomic devices at the last level.
106
+
3. Identify the flat orchestration FSMs owned by systems/subsystems; introduce nesting only when required.
99
107
4. Collect or derive the physical signal catalog for `IOFacade`.
100
108
5. Collect or derive the logical parameter and device catalog for `DeviceFacade`.
101
109
6. Select or derive the `StatusFlow`.
102
110
7. Run a guided survey for each FSM state to collect the output function of `Main`.
103
111
8. Run a guided survey for each `StatusFlowTransition` to collect predicates, boolean conditions, and precedence for `MainRuleEngine`.
104
-
9. Fill the PLC code templates.
105
-
10. Write the generated files into the component output tree instead of a flat scratch directory.
106
-
11. Cross-check the generated PLC artifacts back against the seed-derived catalog before treating them as reviewable output.
112
+
9. Require `outputs_reviewed: true` for every state and `code_generation_approved: true` for every FSM.
113
+
10. Generate one Application per top-level system and order its subsystem controllers by `call_sequence`.
114
+
11. Fill the PLC code templates without unresolved orchestration placeholders.
115
+
12. Cross-check the generated PLC artifacts back against the seed-derived catalog before treating them as reviewable output.
107
116
108
117
Useful helper scripts:
109
118
@@ -114,6 +123,10 @@ Useful helper scripts:
114
123
- both helpers support `--session-dir` for session-aware output and status updates
115
124
-`scripts/validate_generated_plc_against_seed.py`
116
125
- verifies that the generated PLC declarations still match the seed-derived device, parameter, request, and status-flow catalog
126
+
-`scripts/render_codesys_applications.py`
127
+
- generates all isolated CODESYS Application bundles from the reviewed session
128
+
- copies the framework unless `--no-copy-framework` is used
129
+
- validates orchestration fields and writes invocation-order traceability
117
130
118
131
Important distinction:
119
132
@@ -216,6 +229,7 @@ Read these files when generating code or collecting inputs:
default_prompt: Generate and validate one isolated CODESYS Application per top-level system, with reviewed supervisor logic and sequential subsystem FSM controllers.
0 commit comments