Operate pharo-dev-spaces (`pds`) at $PDS_HOME, which gives each coding-agent session its own Pharo image ("slot") — build/rebuild the base image (plain + dev-base), register projects in st-projects.json (local repos or cloned GitHub URLs), build/rebuild snapshots, reset/start (headless or GUI)/stop slots, launch claude / cursor-agent / opencode in a slot to do work there (fix a bug, run all tests, ...), and answer or troubleshoot anything about these (running slots, port conflicts, base Pharo...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Pharo Dev Spaces?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/mumez-pharo-dev-spaces)
---
name: pharo-dev-spaces
description: Operate pharo-dev-spaces (`pds`) at $PDS_HOME, which gives each coding-agent session its own Pharo image ("slot") — build/rebuild the base image (plain + dev-base), register projects in st-projects.json (local repos or cloned GitHub URLs), build/rebuild snapshots, reset/start (headless or GUI)/stop slots, launch claude / cursor-agent / opencode in a slot to do work there (fix a bug, run all tests, ...), and answer or troubleshoot anything about these (running slots, port conflicts, base Pharo version, snapshot contents). Use whenever the user mentions pds, slots, snapshots, the base image / dev-base, or st-projects.json, e.g. "clone <URL> and add it to the projects", "create a snapshot", "build the base image with Pharo 14", "reset slot 2 and start working", "review RepoA feature/xxx in a free slot", "run the tests in a free slot", "which slots are running?". Not for work inside an image you are already connected to (eval, import, test) or for BaselineOf dependencies.
---
# pharo-dev-spaces (pds)
`pds` gives each AI coding agent session its own disposable Pharo image ("slot").
Images build on each other:
| Image | Directory (under `$PDS_HOME`) | Built by |
|---|---|---|
| plain | `plain-pharo/` (VM + image; **every image shares this VM**) | `pds setup-plain --version 140` |
| dev-base | `dev-base/` (plain + SIS + AgenticBrowser) | `pds prepare-dev-base` |
| snapshot | `snapshots/current/` (+ `snapshots/<date>.json` manifests) | `pds build-snapshot [--full]` |
| slot N (1–5) | `slots/slotN/` (copy of snapshot, or dev-base if none) | `pds slot N reset` |
Slot N listens on SIS port `8086+N` (Ripple `9086+N`) unless `PDS_SLOT_START_PORT` (slot 1's SIS port) or `slots/slotN/ports.json` overrides it. `PDS_DEV_BASE_PORT` (default 8086) and `PDS_BUILD_PORT` (default 8096) set the standalone and build ports.
`$PDS_HOME/README.md` is the authoritative reference; read it when something here is unclear.
## Running pds
- `$PDS_HOME` points at the pharo-dev-spaces checkout. Check it once (`echo "$PDS_HOME"`); if it is
empty or the directory has no `pyproject.toml`, ask the user for the path rather than guessing.
- Run every command as `pds <command>` from the cwd if `pds` is on `PATH` (`command -v pds`), so the
nearest `pds.json` of the repository you are in applies. Otherwise use
`uv run --project "$PDS_HOME" pds <command>`, which also works from any cwd (below abbreviated `pds`).
- The pds root is `$PDS_HOME` unless a `pds.json` (`directory`) says otherwise. When
unsure, run `pds config` (JSON: `root`, `configFile`, `ports`, each with its `source`). If the root
differs from `$PDS_HOME`, mention it to the user and use that root wherever this skill says `$PDS_HOME/`
for generated files (`st-projects.json`, `slots/`, `snapshots/`, `logs/`, `repos/`).
- A `pds-locations.json` in the root (`plainPharoPds` / `devBasePds`: roots of other pds) makes it use
`plain-pharo/` / `dev-base/` of that other pds; `pds config` shows them under `locations`. Then
`setup-plain` / `prepare-dev-base` for a referenced directory fail even with `--force` — run them in
the referenced pds (after confirming with the user, since other pds roots share it).
- Start with the state, not assumptions: `pds list-slots` (JSON per slot: `running`, `hasImage`,
`port`, `origin`, `savedRefs`, `tests`), and `ls "$PDS_HOME"` / `cat "$PDS_HOME/st-projects.json"` for the rest.
The Pharo version shows in the `Pharo<ver>-*.sources` file name in `plain-pharo/` and
`dev-base/`; what a snapshot contains is in `snapshots/<date>.json`.
- `prepare-dev-base`, `build-snapshot`, and `slot N reset` with `--ref` or `--load` usually finish
within a few minutes, but pds allows them up to 30, 60, and 60 minutes. Prefer running them in the
background with output going to `$PDS_HOME/logs/<command>-<YYYYMMDD-HHMM>.log` (`mkdir -p` it
first; e.g. `slot2-reset-20261105-0930.log`), and record the exit code in the log:
`pds <command> > "$LOG" 2>&1; echo "exit=$?" >> "$LOG"`. Read the log when the command finishes.
The foreground is also fine for a small overlay, such as one `--ref`, if the call's timeout leaves
enough room.
## Base image — "build the base image with Pharo 14"
Pharo version → `--version`: Pharo 14 → `140`, Pharo 13 → `130` (digits only).
```bash
pds setup-plain --version 140 # plain-pharo/
pds prepare-dev-base # dev-base/ (loads pds/st/libs/*.st: SIS + AgenticBrowser, plus user libs)
```
- Extra packages for dev-base: add a load script `$PDS_HOME/pds/st/libs/NNN_<name>.st` with `NNN` from `002`
to `999` (e.g. `002_neo_json.st`). Scripts run in plain file name order, so this prefix keeps them after
`001_agentic_browser.st`. They only load; `load_libs.st` saves the image. The first failing script stops
the build, and the error names it.
- If `plain-pharo/` or `dev-base/` already exists, the command refuses. Replacing needs `--force`,
which deletes the old one — confirm with the user first, and say which Pharo version is there now
(`ls $PDS_HOME/plain-pharo`, or the image's version if visible).
- Before `setup-plain --force`, check `pds list-slots`: running slots use the shared VM, so stop
them (or ask) first.
- A new dev-base invalidates the existing snapshot and slots (they were built on the old base).
Afterwards, suggest `pds build-snapshot --full` and resetting slots.
## Registering projects — "add <repo> to the pds projects"
`st-projects.json` lists repositories loaded into snapshots, in load order.
1. Get a local repository path:
- Local path (e.g. `~/git/MyApp`): use it as is (absolute path).
- Git URL: clone into `$PDS_HOME/repos/<name>`, where `<name>` is the last URL segment without
`.git` (`git clone <url> "$PDS_HOME/repos/<name>"`).
If that directory already exists, don't overwrite it — check whether it is the same remote and
reuse it, otherwise ask.
2. Choose the branch. `build-snapshot` loads **`origin/<branch>`**, and `<branch>` is `develop`
unless the entry has `"branch"`. Pick the first case that applies:
- The user named a branch: pass it as `--branch`, without a leading `origin/` (`add-project`
stores the value as written). Check it with `git -C <repo> ls-remote --heads origin <branch>`.
If it is missing, still register it and warn that snapshot builds will fail until it exists.
- `git -C <repo> ls-remote --heads origin develop` finds `develop`: pass no `--branch`.
- `origin` exists without `develop`: use its default branch from
`git -C <repo> ls-remote --symref origin HEAD` (otherwise `main` or `master` if present) as
`--branch`, and tell the user.
- No `origin`, or no branch to choose: register without `--branch` and tell the user that
snapshot builds will fail until `origin/develop` exists, or until they push another branch
and set `"branch"`. A branch that exists only locally does not count.
Do not create or push branches on the remote yourself.
3. Register:
```bash
pds add-project <repo-path> --write # groups default to "default"
pds add-project <repo-path> --groups Core,Tests --write # when the user names groups
pds add-project <repo-path> --branch main --write # repos without origin/develop
```
It reads the `BaselineOf*` name and `srcDirectory` (from `.project`; `src` if absent). "no
BaselineOf* package" means it is not a Tonel/Metacello project — report that.
"already in st-projects.json" means it changed nothing, even with `--write`. If the entry
already matches the request, there is nothing to do. To change the branch or groups of an
existing entry, edit only that field in `st-projects.json` (the branch is the `branch` key,
and removing it means `develop`), after the same `ls-remote` check as in step 2.
4. Show the resulting entry as read from `st-projects.json`, and mention that the change reaches
slots only after the next `pds build-snapshot` and a slot reset.
## Snapshots — "create a snapshot"
```bash
pds build-snapshot # incremental: starts from snapshots/current (daily use)
pds build-snapshot --full # starts from dev-base
```
Choose `--full` when `snapshots/current/` doesn't exist yet, after dev-base was rebuilt, or when
the user says packages/classes were removed or renamed (incremental builds can't drop them).
Otherwise use incremental. Requires `dev-base/` and a non-empty `st-projects.json`.
The build fetches `origin/<branch>` of each project (`develop` unless the entry sets `branch`;
working trees untouched), loads baselines,
runs their tests, and promotes the image only if every test passes. It prints the manifest JSON
(date, mode, base, repositories + SHAs, `tests`) to stdout, also when tests fail. On success report
the new `snapshots/<date>.json` (repositories + SHAs, test counts) from that output. On failure `snapshots/current` is
unchanged — report the failing tests or git error from the output; don't retry blindly.
Running slots keep their old image; a slot only picks up the new snapshot on `reset`.
## Slots and starting work
### Choosing the slot
- Named slot ("slot 2"): use it.
- "A free / available slot": `pds list-slots` and take the lowest-numbered slot with
`"running": false` and no `origin.refs` (a slot with `origin.refs` holds a branch under review).
`savedRefs` alone does not make a slot taken. If all 5 are running, tell the user and stop. If
the only stopped slots have `origin.refs`, ask which one to replace. If `pds slot N up` later
fails because a port is in use by another program, move on to the next free slot.
### Preparing it
- The user asked to reset, or the slot has no image (`hasImage: false`): `pds slot N reset`. Reset refuses
while running, with or without `--ref`; `pds slot N down` first only if the user asked to reset that specific slot
(a running slot may be another agent's session — never stop one you merely picked as "free").
- A free slot is stale when its `origin.builtAt` is older than the `builtAt` in the newest
`snapshots/<date>.json` (compare times, not dates — a snapshot can be rebuilt on the same day),
or when `origin` is `null` / from dev-base while a snapshot exists. Reset it too, and say so.
If `origin.refs` is present, the slot is reviewing those branches: do not reset it unless the
user asked. Tell them the base snapshot is newer and that `pds slot N reset --load` rebuilds
the overlay on it. Skip this check when you are about to run `reset --ref`, which always copies
the current snapshot.
- Start it: `pds slot N up` (headless) or `pds slot N gui` if the user wants the Pharo GUI.
Then wait until the SIS port listens (`ss -ltn | grep ":<port> "`, a few seconds);
`slots/slotN/pharo.log` shows startup errors.
### Reviewing a remote branch
When the user wants a slot to run a remote branch (for example RepoA `feature/xxx`), check these
before running `down` or `reset`:
- `snapshots/current/` exists. An overlay does not fall back to dev-base. If it is missing, stop
and offer `pds build-snapshot --full` followed by this overlay; build only if the user agrees.
- The repository is in `st-projects.json`. If it is not, stop and offer to register it. A newly
registered repository named in `--ref` does not need a snapshot rebuild first.
```bash
pds slot N reset --ref RepoA:feature/xxx
pds slot N up
```
`NAME` in `--ref NAME:BRANCH` is a baseline, a repository directory name, or the absolute path in
`st-projects.json`. A leading `origin/` on `BRANCH` is ignored. Repeat `--ref` in one command for
several repositories, because each command replaces the saved set. This copies `snapshots/current`,
fetches and Metacello-loads only those repositories at `origin/<branch>`, and runs the same project
tests as `build-snapshot`. `--no-test` skips the tests. `pds slot N reset --load` repeats the
branches saved in `slots/slotN/refs.json` (that file survives reset; `--clear-refs` drops it).
Unnamed repositories stay as they were in the snapshot.
The command prints one JSON document:
- Exit code 0: the load succeeded and tests passed or were skipped.
- Exit code 1 with `loaded: true`: tests failed and the image was kept. Start it if the user asked
for that or wants to inspect it, and report the failing tests from `tests`. Do not diagnose them
or retry with `--no-test` unless the user asks.
- Exit code 1 with `loaded: false`: the slot's previous image (if any) and `refs.json` were left in
place. Report `error`.
- Exit code 1 with no JSON (unknown `NAME`, slot running): only a `pds: ...` line on stderr, and
nothing changed.
`origin.refs` is what this image contains (baseline, ref, sha). `savedRefs` is what the next
`--load` uses.
Unless the user asked an agent to do the work ("review it and report", not "so I can review it"),
stop after the slot is listening and give them the session command from "No task given". The overlay
does not change the checkout at `--workdir`, so tell them it may be on another branch.
Changed methods, and packages or dependencies added by the baseline, are loaded. Removed or renamed
packages and classes stay in the image, and a package removed on the branch is not tested. Say so
when the user expected them to disappear, and point at `pds build-snapshot --full`.
### Which agent
Launch the same kind of agent you are: Claude Code → `claude`, Cursor Agent → `cursor-agent`,
opencode → `opencode`. If you are something else, or the user named one, follow the user; if
unsupported, ask which of the three to use.
The working directory (`--workdir`) should be a Smalltalk project repository, because that is where
the child agent edits Tonel files. Pick the first that applies and pass it as an absolute path:
1. The repo the user named (or the matching `repository` in `st-projects.json`). If they named
several, show the command with the first and list the others.
2. The cwd pds was invoked from, if it is a project repo (not `$PDS_HOME` itself).
3. Otherwise a repository from `st-projects.json` (e.g. `$PDS_HOME/repos/<name>`): use it if there
is only one; if there are several, show the command with one of them and list the others.
`$PDS_HOME` itself is never a good workdir — it holds the pds tool, not Smalltalk code.
If the task needs a project that is not in the newest `snapshots/<date>.json`, the slot image does
not have it loaded. Tell the user and propose registering it and running `pds build-snapshot`
(then resetting the slot) before launching the agent.
### Starting work
This depends on whether the user gave a concrete task.
**Task given** (e.g. "fix the Stick bug in slot 2") → run the agent non-interactively yourself:
```bash
pds slot N claude --workdir <dir> -- -p "<task>" --permission-mode acceptEdits
pds slot N cursor-agent --workdir <dir> -- -p "<task>"
pds slot N opencode --workdir <dir> -- run "<task>"
```
Everything after `--` goes to the agent. Write the task as a self-contained prompt (the child
agent has none of your context). Run it in the background with output to
`$PDS_HOME/slots/slotN/agent.log`, and when it finishes, summarise what it did. Don't add
permission-bypassing flags (e.g. `--dangerously-skip-permissions`, `--approve-mcps`) unless the user
asked; if the log shows permission denials, report them and let the user decide.
**No task given** (e.g. "start working in slot 2", "reset slot 2 and work in it") → an interactive session can't be opened from
inside your session (pds `exec`s the agent, and your own MCP connection stays on its original
port). Prepare and start the slot, then give the user the command to run in their terminal:
```bash
uv run --project "$PDS_HOME" pds slot N claude --workdir <dir>
```
### Other slot commands
`pds slot N status` (JSON), `pds slot N down` (stop). When you started a slot only to run a
non-interactive task, leave it running unless the user asked to stop it — they may want to
inspect the image.
## Reporting
End with a short summary: what was run, the resulting state (e.g. slot number, SIS port,
snapshot date, registered entry), and anything the user must do next (e.g. "set `branch` in
st-projects.json", "run this command to start the session").