ai/claude/skills/irule-migrate/SKILL.md
Convert nginx, Apache, or HAProxy configuration to an F5 BIG-IP iRule. Detects the source format and applies appropriate construct mappings. Use when migrating load balancer config to iRules, converting nginx rules to F5, translating Apache RewriteRule to iRules, or converting HAProxy ACLs to iRule logic.
npx skillsauth add bitwisecook/tcl-lsp irule-migrateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Convert load balancer configuration from nginx, Apache, or HAProxy to an iRule.
Read the domain knowledge from ai/prompts/irules_system.md (includes migration patterns)
Read the source configuration file
Detect the format and apply these mappings:
nginx:
location -> switch -glob [HTTP::path] or class matchproxy_pass -> pool <pool_name>rewrite -> HTTP::uri / HTTP::redirectadd_header -> HTTP::header insertreturn 301/302 -> HTTP::redirectif ($host) -> string match or class match on [HTTP::host]Apache:
RewriteRule -> HTTP::uri / HTTP::redirectRewriteCond -> if/switch conditionsProxyPass -> pool <pool_name>Header set -> HTTP::header insert/replace<VirtualHost> -> switch on [HTTP::host]<Location> -> switch on [HTTP::path]HAProxy:
acl -> if conditions or class matchuse_backend -> pool <pool_name>http-request redirect -> HTTP::redirecthttp-request set-header -> HTTP::header replacehttp-request add-header -> HTTP::header insertfrontend bind -> handled by virtual server (note in comments)Generate the iRule following security best practices
Write to a file and validate:
uv run --no-dev python ai/claude/tcl_ai.py diagnostics $FILE
If the tool fails (e.g. parse error), report the error and adjust the generated code
Fix any issues and re-validate (up to 5 iterations)
If issues persist after 5 iterations, report what was migrated and what remains
Add comments explaining the mapping from the original config
Note anything that cannot be directly translated (e.g., backend health checks, rate limiting)
$ARGUMENTS
development
Apply LSP optimiser suggestions to a Tcl file and explain why each optimisation is safe and beneficial. Covers constant folding, propagation, dead code elimination, strength reduction, and expression canonicalisation. Use when optimising Tcl code, improving .tcl file performance, refactoring Tcl scripts for efficiency, or applying language server optimisation suggestions.
development
Apply LSP optimiser suggestions to an F5 iRule and explain why each optimisation is safe and beneficial. Covers constant folding, propagation, dead code elimination, strength reduction, and expression canonicalisation. Use when optimising iRule code, improving iRule performance, applying F5 iRule optimisations, or refactoring iRules for efficiency.
development
Create Tk GUI code from a description with proper widget hierarchy. Generates the code, validates with the LSP analyser (including TK-specific checks), and iterates until clean. Use when creating Tk GUIs, generating Tcl/Tk code from descriptions, building Tk widget layouts, or scaffolding Tk applications.
development
Run full LSP validation on a Tcl file and produce a categorised report of all issues: errors, security, style, and optimiser suggestions. Use when validating Tcl code, linting .tcl files, checking Tcl script quality, or running static analysis on Tcl scripts.