Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

smalltalk-debugger

БесплатноБез исполняемых скриптовНе проверен

Systematic debugging guide for Smalltalk (Pharo/Squeak) development. Provides expertise in error diagnosis (MessageNotUnderstood, KeyNotFound…

mumezот mumez★ 17 звёзд на GitHub4 установки в других каталогах

Об этом скилле

Smalltalk Debugger

Systematic debugging techniques for Smalltalk (Pharo/Squeak) development using AI editors.

Core Debugging Workflow

When tests fail or errors occur, follow this systematic approach:

1. Identify Error Location

From error message, confirm:

  • Error type (MessageNotUnderstood, KeyNotFound, etc.)
  • Stack trace - where error occurred
  • Expected vs Actual - what went wrong

2. Verify with Partial Execution

Use /st-eval tool to execute relevant code incrementally.

Basic error capture pattern:

| result |
result := Array new: 2.
[ | ret |
  ret := objA doSomething.
  result at: 1 put: ret printString.
] on: Error do: [:ex | result at: 2 put: ex description].
^ result

Interpreting results:

  • result at: 1 - Normal result (success case)
  • result at: 2 - Error description (failure case)

3. Check Intermediate Values

Inspect state at each step:

| step1 step2 |
step1 := self getData.
step2 := step1 select: [:each | each isValid].
{
    'step1 count' -> step1 size.
    'step2 count' -> step2 size.
    'step2 result' -> step2 printString
} asDictionary printString

4. Fix and Re-test

  1. Fix in Tonel file (never in the Smalltalk image)
  2. Re-import with import_package
  3. Re-test with run_class_test

When Operations Stop Responding

When an MCP call times out, follow this escalation sequence:

Step 1: Health Check

Run a quick eval to verify the Smalltalk image is still responsive:

mcp__smalltalk-interop__eval: 'Smalltalk version'

If this succeeds, the Smalltalk image is alive — a debugger window may have opened (see below).

Step 2: Try read_screen

If eval also times out, check the UI state:

mcp__smalltalk-interop__read_screen: target_type='world'

If read_screen responds, inspect the output for debugger windows (see "Detecting Hidden Debuggers" below).

Step 3: Process Hang — Ask User to Restart

If read_screen itself times out, the Smalltalk image has hung at the process level. MCP tools cannot recover from this state.

Ask the user to:

  1. Kill the Pharo/Squeak process (or Docker container) and restart it
  2. After restart, re-import all packages before continuing
  3. Re-run tests to confirm state before making further claims

Detecting Hidden Debuggers

Use the read_screen tool to capture the Smalltalk image's UI state:

mcp__smalltalk-interop__read_screen: target_type='world'

This captures all morphs including debugger windows. Look for:

  • Window titles containing "Debugger", "Error", or "Exception"
  • UI hierarchy showing debugger-related components
  • Error messages or stack traces in window content

Resolution Steps

  1. Notify the user: Inform them that a debugger window appears to be open in the Smalltalk image
  2. Request manual intervention: Ask the user to:
    • Check their Smalltalk image for open debugger windows
    • Close any debugger windows
    • Review the error shown in the debugger to understand the root cause
  3. Address root cause: Once the debugger is closed, investigate and fix the underlying error using standard debugging techniques
  4. Retry operation: Re-run the failed MCP operation

Note: The Smalltalk debugger cannot be controlled remotely through MCP tools. User intervention in the Smalltalk image is required.

For complete UI debugging guidance, see UI Debugging Reference.

Common Error Types Quick Reference

MessageNotUnderstood

Cause: Method doesn't exist or typo in method name Debug: Check spelling, search implementors

mcp__smalltalk-interop__search_implementors: 'methodName'

KeyNotFound

Cause: Accessing non-existent Dictionary key Debug: List keys, use at:ifAbsent:

dict keys printString
dict at: #key ifAbsent: ['default']

SubscriptOutOfBounds

Cause: Collection index out of range Debug: Check size, use at:ifAbsent:

collection size printString
collection at: index ifAbsent: [nil]

ZeroDivide

Cause: Division by zero Debug: Check denominator before dividing

count = 0 ifTrue: [0] ifFalse: [sum / count]

AssertionFailure (in tests)

Cause: Test expectation doesn't match actual Debug: Execute test code with /st-eval, check if package imported

For complete error patterns and solutions, see Error Patterns Reference.

Object Inspection Quick Guide

Basic Inspection

" Object class "
obj class printString

" Instance variables "
obj instVarNames

" Check method exists "
obj respondsTo: #methodName

Collection Inspection

" Size and elements "
collection size
collection printString

" Safe first/last "
collection ifEmpty: [nil] ifNotEmpty: [:col | col first]

Dictionary Inspection

" Keys and values "
dict keys
dict values

" Safe access "
dict at: #key ifAbs
Полный SKILL.md на GitHub

Установить smalltalk-debugger в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

examples/debug-scenarios.mdreferences/error-patterns.mdreferences/inspection-techniques.mdreferences/logging-techniques.mdreferences/ui-debugging.md

FAQ

Что делает скилл smalltalk-debugger?

Systematic debugging guide for Smalltalk (Pharo/Squeak) development. Provides expertise in error diagnosis (MessageNotUnderstood, KeyNotFound, SubscriptOutOfBounds, AssertionFailure), incremental code execution with eval tool, intermediate value inspection, error handling patterns (`on:do:` blocks), stack trace analysis, UI debugger window detection (read_screen for hung operations), Transcript logging (crShow:,

Как установить скилл smalltalk-debugger?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл smalltalk-debugger запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить smalltalk-debugger с