| name | tcl-validate |
| description | 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. |
| allowed-tools | Bash, Read |
Tcl Validate
Run full validation on a Tcl file and produce a categorised diagnostic report.
Steps
- Read the domain knowledge from
ai/prompts/tcl_system.md
- Read the Tcl file to validate
- Run the categorised validation:
uv run --no-dev python ai/claude/tcl_ai.py validate $FILE
- If the tool fails (e.g. file not found or parse error), report the error clearly and suggest fixes
- Present the results as a structured report:
- Group by category (errors, security, style, optimiser)
- For each issue, explain what it means and how to fix it using the diagnostic code reference
- Provide a summary with total counts per category
- If the file is clean, confirm it passes all checks
Diagnostic codes reference
See docs/generated/diagnostic_codes.md for the full auto-generated table of all diagnostic codes with descriptions and defaults.
Output format
Use headings for each category. For each diagnostic, show:
- The diagnostic code and severity
- The line number and message
- A brief explanation of how to fix it
Example structure:
### Errors (1)
- **E001** (line 12): Missing subcommand — add the required subcommand after `string`
### Style (1)
- **W100** (line 5): Unbraced expression — wrap in braces for bytecode compilation
### Summary
- Errors: 1, Style: 1, Total: 2
$ARGUMENTS