ai/claude/skills/irule-optimise/SKILL.md
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.
npx skillsauth add bitwisecook/tcl-lsp irule-optimiseInstall 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.
Apply LSP optimiser suggestions to iRule files with safety explanations for each transformation.
ai/prompts/irules_system.mduv run --no-dev python ai/claude/tcl_ai.py optimize $FILE
uv run --no-dev python ai/claude/tcl_ai.py diagnostics $FILE
See docs/generated/optimisation_codes.md for the full auto-generated table of O100+ codes.
Key categories:
The optimiser automatically groups causally-linked passes. When constant
propagation/folding (O100/O101/O102/O103/O105) makes a variable definition
dead, the resulting dead store elimination (O109) is grouped with the
propagation as one logical optimisation. The tool output shows these as a
single item with sub-entries. When explaining grouped optimisations, treat
them as one transformation (e.g. "propagated constant $x = 5 into the
expression and removed the now-unnecessary set x 5").
$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
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.
development
Apply refactorings to Tcl code: extract/inline variables, convert if/elseif chains to switch, convert switch to dict lookup, and brace unbraced expr arguments. Uses the LSP refactoring engine for safe, mechanical transformations. Use when refactoring Tcl scripts, restructuring .tcl code, simplifying Tcl control flow, or applying automated Tcl code transformations.