Agent skill
smalltalk-implementation-finder
Method implementation finder and analyzer for Pharo Smalltalk. Provides expertise in discovering implementors across class hierarchies (search_implementors), analyzing implementation patterns, learning coding idioms from existing implementations, assessing refactoring impact (counting implementors and references), finding duplicate code for consolidation, understanding abstract method implementations (subclassResponsibility), and tracing method overrides through inheritance chains. Use when analyzing method implementations across classes, learning implementation idioms, assessing refactoring risk before changes, finding duplicate implementations for consolidation, understanding how abstract methods are implemented in concrete classes, or tracing which classes override specific methods.
Install this agent skill to your Project
npx add-skill https://github.com/mumez/smalltalk-dev-plugin/tree/develop/skills/smalltalk-implementation-finder
SKILL.md
Smalltalk Implementation Finder
Find and analyze method implementations across class hierarchies to understand abstract methods, implementation patterns, and assess refactoring opportunities.
Purpose
Use this skill to:
- Learn implementation idioms by studying existing code
- Assess refactoring impact before making changes
- Discover implementation patterns across class hierarchies
- Find duplicate implementations that could be consolidated
- Understand subclass responsibilities for abstract methods
Core Workflow
1. Find implementors → search_implementors(method_name)
2. Get source code → get_method_source(class, method)
3. Analyze patterns → Compare implementations
4. Apply learnings → Use discovered idioms in your code
Primary Use Cases
1. Learning Implementation Idioms
When to use: Implementing a method for the first time and want to follow conventions.
Quick workflow:
1. search_implementors("methodName")
2. Sample 5-10 well-known classes
3. get_method_source for each
4. Identify common pattern
5. Apply to your implementation
Common idioms:
hash→ Combine fields withbitXor:initialize→ Callsuper initializefirst=→ Check class equality, then compare fieldsprintOn:→ Use class identifier + element printing
Example: Learning hash implementation
Point>>hash → "^ x hash bitXor: y hash"
Association>>hash → "^ key hash bitXor: value hash"
Pattern: field1 hash bitXor: field2 hash
2. Assessing Refactoring Impact
When to use: Planning to change a method signature or refactor implementations.
Quick workflow:
1. Count implementors: search_implementors(method)
2. Count references: search_references(method)
3. Assess impact: Low (<5 impl, <20 refs) / Medium (5-20, 20-100) / High (20+, 100+)
4. Decide: Proceed / Add new method / Don't change
Example: Changing at:put:
Implementors: 50+ classes
References: 500+ call sites
Impact: VERY HIGH
Decision: Don't change. Add new method instead.
3. Finding Duplicate Code
When to use: Suspect multiple classes have identical implementations.
Quick workflow:
1. Find implementors in same hierarchy
2. Get source for each
3. Compare for duplicates
4. Refactor identical code to superclass
Example: Consolidating isEmpty
Array>>isEmpty → "^ self size = 0"
Set>>isEmpty → "^ self size = 0"
OrderedCollection>>isEmpty → "^ self size = 0"
Action: Pull up to Collection superclass
4. Understanding Abstract Methods
When to use: Encountering self subclassResponsibility and need to see concrete implementations.
Quick workflow:
1. Check abstract definition in superclass
2. Find all implementors
3. Study 3-5 concrete implementations
4. Understand expected behavior
Example: Understanding Collection>>do:
Collection>>do: → "self subclassResponsibility"
Array>>do: → "1 to: self size do: [:i | aBlock value: (self at: i)]"
LinkedList>>do: → "[node notNil] whileTrue: [aBlock value: node value. ...]"
Understanding: Each uses its own iteration strategy
5. Narrowing Usage Search
When to use: Finding references to a specific class's implementation, not all implementations.
Quick workflow:
1. Find implementors
2. Find all references
3. Filter by receiver type/context
4. Focus on relevant usage
Example: Finding Collection>>select: usage (not Dictionary>>select:)
Implementors: [Collection, Dictionary, Interval, ...]
References: 1000+ call sites
Filter by variable context:
"myArray select: [...]" → Collection implementation
"myDict select: [...]" → Dictionary implementation
MCP Tools
search_implementors
mcp__smalltalk-interop__search_implementors: 'methodName'
Returns all classes implementing the method.
get_method_source
mcp__smalltalk-interop__get_method_source: class: 'ClassName' method: 'methodName'
Gets source code for a specific implementation.
eval (for hierarchy exploration)
mcp__smalltalk-interop__eval: 'Collection allSubclasses'
Useful for scoping analysis to specific hierarchies.
search_references
mcp__smalltalk-interop__search_references: 'methodName'
Finds all senders (combines well with implementor analysis).
Quick Reference
| Goal | Tools | Pattern |
|---|---|---|
| Learn idiom | search_implementors → get_method_source | Sample 5-10, identify pattern |
| Assess impact | search_implementors + search_references | Count both, assess risk |
| Find duplicates | search_implementors → get_method_source | Compare, find identical |
| Narrow usage | search_implementors → search_references | Filter by receiver type |
Best Practices
✅ Do
- Scope by hierarchy: Focus on relevant class hierarchies using
eval("ClassA allSubclasses") - Sample wisely: Choose well-known, well-implemented classes (Array, Dictionary, Point)
- Count first: Get overview before analyzing 500+ implementations
- Check super: Understand inherited behavior
❌ Don't
- Analyze all implementors without filtering
- Use obscure classes as examples
- Ignore superclass implementations
- Assume same method name = same behavior
Common Workflows
Workflow: Implement Abstract Method
Problem: Need to implement printOn: in new class
1. search_implementors("printOn:")
2. Filter to similar classes
3. get_method_source for 3-5 examples
4. Identify pattern
5. Apply to your class
Workflow: Assess Refactoring
Problem: Want to change at:put: signature
1. search_implementors("at:put:") → Count implementations
2. search_references("at:put:") → Count call sites
3. Assess impact (High/Medium/Low)
4. Decide: Change / Add new / Don't change
Workflow: Find Duplication
Problem: Suspect duplicate isEmpty implementations
1. search_implementors("isEmpty")
2. Focus on Collection hierarchy
3. get_method_source for subclasses
4. Compare for identical code
5. Refactor to superclass if identical
Detailed Resources
For comprehensive analysis techniques and real-world scenarios, see:
- Implementation Analysis Reference - Detailed techniques for analyzing implementations, MCP tools reference, advanced patterns, and performance considerations
- Implementation Scenarios - Real-world examples including implementing abstract methods, assessing refactoring impact, finding duplicate code, learning idioms, and understanding template method patterns
Summary
Key principle: Implementations across a hierarchy reveal design patterns and idioms. Use them to write better, more idiomatic code.
Primary workflow: Find implementors → Get source → Analyze patterns → Apply learnings
Remember: Always scope your analysis to relevant hierarchies and representative classes to avoid information overload.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
smalltalk-developer
Comprehensive Pharo Smalltalk development workflow guide with AI-driven Tonel editing. Provides expertise in Tonel file format syntax (class definitions with name, superclass, instVars, category, method categories, class comment placement), package structure (package.st placement, directory organization, BaselineOf dependencies), development workflow (Edit → Import → Test cycle with absolute paths, re-import timing, test execution), and Pharo best practices (CRC format documentation, method categorization conventions). Use when working with Pharo Smalltalk projects, creating or editing Tonel .st files, organizing packages and dependencies, resolving import order issues, writing class comments, implementing standard Pharo development patterns (Singleton, Settings, etc.), or troubleshooting Tonel syntax.
smalltalk-usage-finder
Class and method usage analyzer for Pharo Smalltalk. Provides expertise in understanding class responsibilities through class comments (get_class_comment), discovering usage patterns via references (search_references_to_class), finding example methods (exampleXXX patterns), analyzing method usage in context (search_references with polymorphism handling), generating package overviews (list_classes with comment analysis), and resolving ambiguous names (search_classes_like, search_methods_like). Use when understanding what a class does, finding usage examples for classes or methods, discovering how to use an API, analyzing package structure and purpose, resolving unclear class or method names, or learning usage patterns from real-world code.
smalltalk-commenter
Generates CRC-style class comments for Smalltalk classes. Use after creating or modifying Tonel files to add or improve class documentation.
smalltalk-debugger
Systematic debugging guide for Pharo Smalltalk 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), and debug-fix-reimport workflow. Use when encountering Pharo test failures, Smalltalk exceptions, unexpected behavior, timeout or non-responsive operations, need to verify intermediate values, execute code incrementally for diagnosis, or troubleshoot Tonel import errors.
verl-rl-training
Provides guidance for training LLMs with reinforcement learning using verl (Volcano Engine RL). Use when implementing RLHF, GRPO, PPO, or other RL algorithms for LLM post-training at scale with flexible infrastructure backends.
openrlhf-training
High-performance RLHF framework with Ray+vLLM acceleration. Use for PPO, GRPO, RLOO, DPO training of large models (7B-70B+). Built on Ray, vLLM, ZeRO-3. 2× faster than DeepSpeedChat with distributed architecture and GPU resource sharing.
Didn't find tool you were looking for?