Tcl refactor

From bitwisecook/tcl-lsp · View interactive version

Tcl refactor is an AI agent skill from the GitHub repository bitwisecook/tcl-lsp. 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

How to use this skill

Skill file

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

$ARGUMENTS

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.