Use this skill when user says "with smalltalk-debugger", "test failed", "debug this error", "MessageNotUnderstood", "MNU", "why is this failing?", "run partial code", "not responding", "timeout", or encounters Pharo Smalltalk exceptions, stack traces, or unexpected behavior. Provides systematic debugging approach with step-by-step investigation using eval tool and UI debugging for detecting debugger windows.
/plugin marketplace add mumez/smalltalk-dev-plugin/plugin install smalltalk-dev@smalltalk-dev-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
examples/debug-scenarios.mdreferences/error-patterns.mdreferences/inspection-techniques.mdreferences/ui-debugging.mdSystematic debugging techniques for Pharo Smalltalk development using AI editors.
When tests fail or errors occur, follow this systematic approach:
From error message, confirm:
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)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
import_packagerun_class_testIf MCP tool calls hang or timeout with no response, a debugger window may have opened in the Pharo image. Since the debugger is invisible from the AI editor, operations will appear stuck.
Use the read_screen tool to capture the Pharo UI state:
mcp__smalltalk-interop__read_screen: target_type='world'
This captures all morphs including debugger windows. Look for:
Note: The Pharo debugger cannot be controlled remotely through MCP tools. User intervention in the Pharo image is required.
For complete UI debugging guidance, see UI Debugging Reference.
Safely test code that might fail:
| result |
result := Array new: 2.
[
| obj |
obj := MyClass new name: 'Test'.
result at: 1 put: obj process printString.
] on: Error do: [:ex |
result at: 2 put: ex description
].
^ result
Check what object contains:
{
'class' -> obj class name.
'value' -> obj printString.
'size' -> obj size.
'isEmpty' -> obj isEmpty
} asDictionary printString
Track data flow through transformations:
| items filtered mapped |
items := self getItems.
filtered := items select: [:each | each isValid].
mapped := filtered collect: [:each | each name].
{
'items size' -> items size.
'filtered size' -> filtered size.
'mapped' -> mapped printString
} asDictionary printString
Cause: Method doesn't exist or typo in method name Debug: Check spelling, search implementors
mcp__smalltalk-interop__search_implementors: 'methodName'
Cause: Accessing non-existent Dictionary key Debug: List keys, use at:ifAbsent:
dict keys printString
dict at: #key ifAbsent: ['default']
Cause: Collection index out of range Debug: Check size, use at:ifAbsent:
collection size printString
collection at: index ifAbsent: [nil]
Cause: Division by zero Debug: Check denominator before dividing
count = 0 ifTrue: [0] ifFalse: [sum / count]
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 class "
obj class printString
" Instance variables "
obj instVarNames
" Check method exists "
obj respondsTo: #methodName
" Size and elements "
collection size
collection printString
" Safe first/last "
collection ifEmpty: [nil] ifNotEmpty: [:col | col first]
" Keys and values "
dict keys
dict values
" Safe access "
dict at: #key ifAbsent: ['default']
For comprehensive inspection techniques, see Inspection Techniques Reference.
Break problems into incremental steps and verify each:
" Step 1: Verify object creation "
obj := MyClass new.
obj printString
" Step 2: Verify method call "
result := obj doSomething.
result printString
When returning objects via JSON/MCP:
✅ obj printString
✅ collection printString
✅ dict printString
❌ obj " Don't return raw objects "
Never assume - verify at each step:
intermediate := obj step1.
" Check here "
result := intermediate step2.
" Check here too "
Always capture errors with on:do::
[
risky operation
] on: Error do: [:ex |
" Handle or log error "
ex description
]
.st file → Import → Test/st:evalExecute any Smalltalk code for testing and verification:
mcp__smalltalk-interop__eval: 'Smalltalk version'
mcp__smalltalk-interop__eval: '1 + 1'
mcp__smalltalk-interop__eval: 'MyClass new doSomething printString'
mcp__smalltalk-interop__get_class_source: 'ClassName'
mcp__smalltalk-interop__get_method_source: class: 'ClassName' method: 'methodName'
mcp__smalltalk-interop__search_implementors: 'methodName'
mcp__smalltalk-interop__search_references: 'methodName'
Error: Expected 'John Doe' but got 'John nil'
Debug process:
/st:eval^ self in setterError: KeyNotFound: key #age not found
Debug process:
dict keysdict includesKey: #agedict at: #age ifAbsent: [0]For complete debugging scenarios with step-by-step solutions, see Debug Scenarios Examples.
When debugging, systematically check:
/st:eval to test incrementallyThis skill provides focused debugging guidance. For comprehensive information:
Core debugging cycle:
Error occurs
↓
Identify error type
↓
Use /st:eval to test incrementally
↓
Inspect intermediate values
↓
Identify root cause
↓
Fix in Tonel file
↓
Re-import
↓
Re-test → Success or repeat
Remember: Systematic approach, incremental testing, fix in Tonel, always re-import.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.