Pharo rename method

From KentBeck/SmalltalkGenie · View interactive version

Pharo rename method is an AI agent skill from the GitHub repository KentBeck/SmalltalkGenie. Rename 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 responsibilit

How to use this skill

Skill file

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

  1. Establish a green baseline with run_test for the narrow class or package you will touch.
  1. Map the impact before renaming:
  1. Use rename_method, not define_method plus remove_method, when the intent is a real rename:
  1. Read back the changed methods. Confirm:
  1. 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.
  1. Save the image only through save_image gated on the relevant test class or package.

Sequencing

Use rename-method early when an unclear selector is hiding the next move. For example:

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"
}
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.