💡 摘要
该技能使用户能够使用自然语言提示在EcoStruxure自动化专家中创建和修改IEC 61499功能块。
🎯 适合人群
🤖 AI 吐槽: “看起来很能打,但别让配置把人劝退。”
风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);文件读写范围与路径穿越风险。以最小权限运行,并在生产环境启用前审计代码与依赖。
EAE Claude Skills
Claude Code skills for EcoStruxure Automation Expert (EAE) development.
These skills help you create and modify IEC 61499 function blocks using natural language prompts with Claude Code.
Quick Start
Installation
Install using the skills.sh CLI:
npx skills add eae-acc/eae-claude-skills
This installs all EAE skills to your Claude Code environment.
Verify Installation
In Claude Code, type /eae-skill-router - if the skill loads, installation was successful.
Usage
Invoke skills using slash commands or natural language:
/eae-skill-router # Router - shows what skill to use
/eae-cat # Create CAT block with HMI
/eae-basic-fb # Create Basic FB with algorithms
/eae-composite-fb # Create Composite FB
/eae-datatype # Create DataType (struct/enum/array)
/eae-adapter # Create Adapter interface
/eae-fork # Fork block from SE library to custom library
Or just describe what you need:
User: Create a Basic FB called MotorController that controls speed
Claude: [Invokes eae-basic-fb, generates .fbt with ECC + algorithms]
User: Create an enumeration for machine states
Claude: [Invokes eae-datatype, generates .dt in DataType/ folder]
Available Skills
Creation Skills
| Skill | Command | Description |
|-------|---------|-------------|
| eae-skill-router | /eae-skill-router | Router - guides you to the right skill |
| eae-cat | /eae-cat | CAT blocks with HMI, OPC-UA, persistence |
| eae-basic-fb | /eae-basic-fb | Basic FB with ECC state machine + ST algorithms |
| eae-composite-fb | /eae-composite-fb | Composite FB with FBNetwork layout |
| eae-datatype | /eae-datatype | DataTypes: structures, enums, arrays, subranges |
| eae-adapter | /eae-adapter | Adapter types for socket/plug interfaces |
| eae-fork | /eae-fork | Fork blocks from SE libraries with namespace migration |
Validation Skills
| Skill | Command | Description |
|-------|---------|-------------|
| eae-naming-validator | /eae-naming-validator | Enforce SE ADG naming conventions (14+ rules) |
| eae-performance-analyzer | /eae-performance-analyzer | Prevent event storms before deployment (4D analysis) |
Reference Skills
| Skill | Command | Description |
|-------|---------|-------------|
| eae-runtime-base | /eae-runtime-base | Find standard Runtime.Base blocks (~100 blocks) |
| eae-se-process | /eae-se-process | Find SE process blocks (motors, valves, PID, etc.) |
Decision Tree
What are you doing?
│
├── Forking block from SE library? → /eae-fork
│
├── Creating a NEW block from scratch?
│ ├── Full block with HMI visualization? → /eae-cat (most common)
│ ├── State machine with algorithms? → /eae-basic-fb
│ ├── Network of existing FBs? → /eae-composite-fb
│ ├── Custom data type (enum, struct)? → /eae-datatype
│ └── Reusable interface pattern? → /eae-adapter
│
└── Looking up existing blocks? → /eae-runtime-base, /eae-se-process
Features
- Correct XML structure - Generates valid EAE XML with proper DOCTYPE, IDs, and attributes
- dfbproj registration - Automatically registers blocks in the library project file
- FBNetwork layout - Smart positioning guidelines for clean, readable composite blocks
- All block types - CAT, Basic, Composite, DataType, Adapter
- Templates included - XML templates for all block types
Project Structure
.claude/skills/
├── eae-skill-router/ # Router + shared resources
│ ├── SKILL.md
│ ├── references/
│ │ └── common-rules.md # Shared rules (IDs, registration)
│ └── assets/templates/ # XML templates for all block types
│
├── eae-cat/ # CAT blocks
├── eae-basic-fb/ # Basic function blocks
├── eae-composite-fb/ # Composite function blocks
├── eae-datatype/ # Data types
├── eae-adapter/ # Adapter interfaces
├── eae-fork/ # Fork blocks from SE libraries
│ ├── SKILL.md
│ ├── scripts/ # Python automation scripts
│ └── references/ # Namespace migration rules
├── eae-runtime-base/ # Runtime.Base library reference
└── eae-se-process/ # SE process blocks reference
Requirements
- Claude Code CLI or VS Code extension
- EcoStruxure Automation Expert (for testing generated blocks)
Examples
Create a Basic FB
User: Create a Basic FB called Calculator in MyLib namespace that adds two REAL values
Claude: I'll create a Basic FB with:
- Inputs: Value1 (REAL), Value2 (REAL)
- Output: Result (REAL)
- Algorithm: Result := Value1 + Value2
[Generates Calculator.fbt, Calculator.doc.xml, Calculator.meta.xml]
[Registers in MyLib.dfbproj]
Create a Composite FB
User: Create a Composite FB that chains two Calculator blocks
Claude: I'll create a Composite FB with:
- Two Calculator instances wired together
- First result feeds into second input
- Proper FBNetwork layout
[Generates ChainedCalc.fbt with FBNetwork]
Create an Enumeration
User: Create an enum for MachineState with Idle, Running, Error
Claude: I'll create a DataType enumeration:
[Generates IEC61499/DataType/MachineState.dt]
Validate Naming Conventions
User: Validate my EAE application naming
Claude: [Invokes eae-naming-validator]
python scripts/validate_names.py --app-dir IEC61499/MyLibrary
✅ AnalogInput (CAT) - PascalCase compliant
❌ motorController (CAT) - Should be PascalCase: MotorController
✅ scaleLogic (Basic FB) - camelCase compliant
❌ MotorInterface (Adapter) - Missing 'I' prefix: Should be IMotorInterface
Analyze Performance
User: Check my application for event storms
Claude: [Invokes eae-performance-analyzer]
python scripts/analyze_event_flow.py --app-dir IEC61499/MyApp
⚠️ Event multiplication detected: 15.2x (threshold: 10x)
❌ CRITICAL: Tight event loop detected in ControllerBlock
FB1 → FB2 → FB1 (2-hop cycle)
Recommendation: Add state guard (RS flip-flop)
SE ADG Compliance
All skills enforce compliance with Schneider Electric Application Design Guidelines EIO0000004686.06.
Naming Conventions (Section 1.5)
| Artifact | Convention | Example | Validated By |
|----------|------------|---------|--------------|
| CAT | PascalCase | MotorController | eae-naming-validator |
| Basic FB | camelCase | scaleLogic | eae-naming-validator |
| Composite FB | camelCase | dataProcessor | eae-naming-validator |
| Adapter | IPascalCase | IMotorControl | eae-naming-validator |
| Interface Variables | PascalCase | PermitOn, Value | eae-naming-validator |
| Internal Variables | camelCase | error, timerActive | eae-naming-validator |
| Events | SNAKE_CASE | START_MOTOR, INIT | eae-naming-validator |
| Structures | strPascalCase | strMotorData | eae-naming-validator |
| Enumerations | ePascalCase | eProductType | eae-naming-validator |
Enforcement: Run eae-naming-validator before committing code.
Performance Thresholds
| Metric | Safe | Moderate | Critical | Validated By | |--------|------|----------|----------|--------------| | Event Multiplication | <10x | 10-20x | >20x | eae-performance-analyzer | | CPU Load | <70% | 70-90% | >90% | eae-performance-analyzer | | Queue Depth | <100 | 100-500 | >500 | eae-performance-analyzer | | Timer Frequency (HMI) | ≥500ms | 100-500ms | <100ms | eae-performance-analyzer |
Best Practice: Run eae-performance-analyzer during design reviews.
Integration Patterns
Pattern 1: Creation → Validation Pipeline
Recommended workflow for creating and validating artifacts:
# 1. Create artifact /eae-cat MotorController # 2. Validate naming python .claude/skills/eae-naming-validator/scripts/validate_names.py \ --app-dir IEC61499/MyLibrary # 3. Validate performance (if has FBNetwork) python .claude/skills/eae-performance-analyzer/scripts/analyze_event_flow.py \ --app-dir IEC61499/MyLibrary # 4. Run artifact-specific validation python .claude/skills/eae-cat/scripts/validate_cat.py IEC61499/MotorController
Pattern 2: CAT with Process Blocks
Build a CAT block using SE process library blocks:
1. /eae-cat → Create CAT block
2. /eae-se-process → Find Motor block from SE.App2CommonProcess
3. Add Motor instance to CAT FBNetwork
4. /eae-runtime-base → Find E_CYCLE for periodic HMI updates (500ms)
5. /eae-performance-analyzer → Validate no event storms
Pattern 3: Composite with Timing
Create a composite FB with periodic execution:
1. /eae-composite-fb → Create composite
2. /eae-runtime-base → Find E_CYCLE for 100ms periodic trigger
3. Add E_CYCLE to FBNetwork
4. Validate layout: python scripts/validate_layout.py
5. Check event multiplication: /eae-performance-analyzer
CI/CD Integration
Pre-Commit Hook
Create .git/hooks/pre-commit:
#!/bin/bash # Validate naming conventions python .claude/skills/eae-naming-validator/scripts/validate_names.py \ --app-dir IEC61499/MyLibrary \ --json if [ $? -ne 0 ]; then echo "❌ Naming validation failed" exit 1 fi # Detect critical event storm patterns python .claude/skills/eae-performance-analyzer/scripts/detect_storm_patterns.py \ --app-dir IEC61499/MyLibrary \ --json if [ $? -eq 11 ]; then echo "❌ Critical anti-patterns detected" exit 1 fi echo "✅ All validations pas
优点
- 通过自然语言促进快速开发
- 强制执行命名规范
- 自动生成有效的XML结构
- 包括性能和命名的验证工具
缺点
- 需要熟悉EcoStruxure自动化专家
- 依赖于Claude Code环境
- 新用户可能需要学习曲线
- 仅限于IEC 61499功能块
相关技能
免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。
版权归原作者所有 sapiencezk.
