KentBeck/SmalltalkGenie / .agents/skills/pharo-rename-method
pharo-rename-method
VerifiedRename Pharo methods safely through Genie's `rename_method` MCP refactoring tool. Use when a selector should be renamed while preserving behavior, updating senders and symbol references across the live image, including as one step in larger refactorings such as clarify API names, split responsibilities, or move behavior behind better messages.
Pharo Rename Method
Use this skill only for behavior-preserving selector renames in a live Genie image. Work through the genie MCP tools; do not edit Tonel files.
Workflow
-
Establish a green baseline with
run_testfor the narrow class or package you will touch. -
Map the impact before renaming:
search_implementorsfor the old selector.search_referencesfor the old selector.get_method_sourcefor representative implementors and callers.
-
Use
rename_method, notdefine_methodplusremove_method, when the intent is a real rename:class_name: owning class name, withoutclass.method_name: old selector string.new_method_name: new selector string.is_class_method: true for class-side methods, omit or false for instance-side methods.permutation: optional argument-position array, for example[2, 1]. Omit it for ordinary same-order renames.
-
Read back the changed methods. Confirm:
- The old selector is gone from the intended class.
- The new selector exists.
- Senders now use the new selector.
- Any symbol-literal references that should change have changed.
-
Rerun the same tests. If the rename is part of a larger refactoring, stop at the first green rename before making the next structural move.
-
Save the image only through
save_imagegated on the relevant test class or package.
Sequencing
Use rename-method early when an unclear selector is hiding the next move. For example:
- Rename a misleading public message before extracting a helper that will call it.
- Rename a collaborator-facing selector before moving behavior to that collaborator.
- Rename a protocol family one selector at a time, testing between each rename.
- Rename test fixture selectors with care: refactoring updates symbol literals. In tests that assert the old selector disappeared, write
'oldSelector' asSymbol, not#oldSelector, or the refactoring may rewrite the assertion itself.
Do not use rename_method to change arity and behavior together. First make behavior-preserving same-arity renames green. Then do signature or behavior changes under a test-first workflow.
Example
{
"class_name": "Invoice",
"method_name": "total",
"new_method_name": "totalAmount"
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |