跳到正文
cccskills
免费在 GitHub 公开

pharo-tdd

Drive a Genie change test-first through the genie MCP tools, working entirely from the live image (no files). Use when adding behavior or fixing a bug in the image — anything where a test should lead.

中文简介正在准备中。当前显示原文说明。

查看安装方法

包含的文件(1)

  • SKILL.md2.2 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Pharo TDD loop (live image, via the genie MCP tools)

All work goes through the genie MCP tools — there are no files. Read with the read tools, change only via define_class / define_method / eval. Confirm every change by reading it back. Never assume a class/selector exists — look it up first.

Loop

  1. Locate. Find the class and its test class: list_classes (package) → list_methods → get_method_source. Find the matching ...Test (TestCase subclass). If none exists, create it via define_class (superclass TestCase).

  2. Red. Write or adjust ONE failing test with define_method (protocol tests). Run it: run_test with class_name. Expect failure. If it passes immediately, the test isn't exercising the new behavior — fix the test before writing code.

  3. Green. Implement the smallest method that could pass, via define_method. Run run_test again → expect green. Read the method back with get_method_source to confirm what's installed.

  4. Regression check. Run run_test for the whole package_name. A green class test with a red package is not done.

  5. Refactor. Clean up while green, re-running run_test after each step. (For larger cleanups, switch to the pharo-refactor skill.)

  6. Done. Persist with save_image gated on tests — pass test_package so it runs them and saves the image only if green. Summarize what changed (class >> selector list).

Debugging a red test

Genie returns full stack traces: failing block source, receiver, and its variables. Read them. Reproduce the failure with a minimal eval first, fix the smallest thing the trace implicates, then re-run the test. Don't guess.

Rules

  • One test, one reason to fail, at a time.
  • Modern class API only (ShiftClassInstaller / define_class), never the deprecated subclass:instanceVariableNames:classVariableNames:package:.
  • Tests are methods too — install them with define_method, protocol tests.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Use when modifying a Genie-backed Pharo project through the live MCP server on localhost:8087; includes project ownership, image read/change/test/save workflow, and first steps for new user projects.

中文简介正在准备中。当前显示原文说明。

KentBeck/SmalltalkGenie202026年7月20日 更新

Refactor messy Pharo code safely through the genie MCP tools, working from the live image (no files). Use for renames, method extraction, moving behavior, or general cleanup of existing code.

中文简介正在准备中。当前显示原文说明。

KentBeck/SmalltalkGenie202026年7月20日 更新

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 responsibilities, or move behavior behind better messages.

中文简介正在准备中。当前显示原文说明。

KentBeck/SmalltalkGenie202026年7月20日 更新

Use when reviewing or refactoring code that pulls apart another object's private representation, such as raw limb/byte/slot access, slice constructors, or helper methods that expose internal storage. Guides agents to find representation envy and suggest moving behavior onto the object that owns the representation, using live-image Genie tools when working in Pharo.

中文简介正在准备中。当前显示原文说明。

KentBeck/SmalltalkGenie202026年7月20日 更新

查看 KentBeck 的全部技能

报告此技能的问题