This repository showcases a project created by smalltalk-dev-plugin — a Claude Code extension for Pharo Smalltalk development.
This is a slightly more advanced example. From a single prompt with basic class hints, Claude Code designed a detailed implementation plan and generated working source code — including Dijkstra's shortest-path algorithm, complete with tests.
You can watch the actual development process in the video below.
The following prompt was given to /st:buddy:
/st:buddy I want to create GrNode and GrArc to represent directed graphs
and solve shortest path problems. Nodes have a name, arcs have a score.
Let's start this as a GraphGear project.
The source code is in the src directory. Three packages were generated:
| Package | Description |
|---|---|
| BaselineOfGraphGear | Metacello baseline configuration |
| GraphGear | Core classes — GrNode, GrArc, GrGraph |
| GraphGear-Tests | SUnit tests — GrNodeTest, GrArcTest, GrGraphTest |
- GrNode — A named node (vertex) in a directed graph. Maintains outgoing arcs.
- GrArc — A weighted, directed arc (edge) connecting two nodes.
- GrGraph — A directed weighted graph with Dijkstra's shortest-path algorithm.
If you would like to try the generated source code in a live Pharo environment, you can load the GraphGear project using Metacello:
Metacello new
baseline: 'GraphGear';
repository: 'github://mumez/smalltalk-dev-plugin-graph-example:main/src';
load.Once loaded, verify that all tests pass:
GrGraphTest suite run. "print it"Here is a usage example — building a graph and finding the shortest path with Dijkstra's algorithm:
graph := GrGraph new.
graph addNodeNamed: 'A'.
graph addNodeNamed: 'B'.
graph addNodeNamed: 'C'.
graph addNodeNamed: 'D'.
graph addArcFrom: 'A' to: 'B' score: 1.
graph addArcFrom: 'A' to: 'C' score: 4.
graph addArcFrom: 'B' to: 'D' score: 3.
graph addArcFrom: 'C' to: 'D' score: 1.
graph shortestDistanceFrom: 'A' to: 'D'. "=> 4"
(graph shortestPathFrom: 'A' to: 'D') collect: #name. "=> #('A' 'B' 'D')" A ---1--- B
| |
4 3
| |
C ---1--- D
Shortest path A to D: A -> B -> D (cost 4)
Not: A -> C -> D (cost 5)
You can browse the GrNode, GrArc, and GrGraph classes in the System Browser. You will notice that CRC-style class comments were also generated along with the source code.
