<< All versions

Skill v1.0.1

currentAutomated scan100/100
bitwisecook/tcl-lsp/tcl-refactor

+3 new

──Details
PublishedNovember 3, 2026 at 10:36 PM
Content Hashsha256:33b073bc77c6025e...
Git SHA3989241baa43
Bump Typepatch
Compare with v1.0.0
──Files
Files (1 file, 1.4 KB)
SKILL.md1.4 KBactive
SKILL.md · 33 lines · 1.4 KB

name: tcl-refactor description: "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." allowed-tools: mcp__tcl-lsp__refactor, mcp__tcl-lsp__analyze, Read, Edit metadata: version: "1.0.1"


Tcl Refactor

Steps

  1. Read the file.
  2. Call mcp__tcl-lsp__refactor with the contents as source and the

selection (start_line, start_character, end_line, end_character) covering the code of interest. On a tool error report it.

  1. Apply the refactoring the user asked for; otherwise list the available

ones and ask which.

  1. Apply each edit with Edit and say in a sentence why it is safe and what

it gains.

  1. Re-validate with mcp__tcl-lsp__analyze; revert any refactoring that

introduced an issue and say why.

Refactorings

  • Extract variable: expression → named variable
  • Inline variable: single-use set var value → substituted at the use site
  • if/elseif → switch: chain of $var eq "literal" tests → switch -exact
  • switch → dict: arms that set one variable → dict create + dict get
  • Brace expr: expr "$a + $b" → expr {$a + $b}

$ARGUMENTS

← v1.0.0All versions