Use Ashlar with Rehearse
At the end of this guide, Rehearse runs your features' reach scripts as flows, and knows which of them a change reaches through Ashlar's import graph.
Rehearse tries changes: it brings the product up, runs scenarios on the base and on your work, and compares them. It never needs Ashlar. When a project uses Ashlar, Ashlar fills two of its blocks:
| Rehearse needs | Ashlar gives it |
|---|---|
| Flows: steps by accessible name | each feature's reach script, as it is |
What a change reaches, for rehearse list --affected |
ashlar dependents, from the import graph |
Reach scripts stay Ashlar's data. Rehearse runs them.
-
Print the blocks Ashlar fills:
Terminal window $ pnpm exec ashlar rehearse# Ashlar fills these blocks of rehearse.yaml: each feature’s reach script is a flow, and it# covers its feature’s folder. rehearse list --affected asks `ashlar dependents` for the rest.scenarios:flows:- path: 'desktop/electron-renderer/features/board/reach.ts'covers: ['desktop/electron-renderer/features/board/**']Each feature with a reach script becomes a flow, and it covers its feature's folder: a change anywhere in that folder reaches the flow.
--jsonprints the same block in Rehearse's manifest schema, with each flow as Rehearse reads it. -
Copy the block into
rehearse.yaml, beside what your project already declares there. -
Ask what a change reaches. Rehearse runs this itself when it finds
ashlar.config.tsand anashlarbinary:Terminal window $ pnpm exec ashlar dependents desktop/electron-renderer/client/ideas.ts --json{"v": 1,"dependents": {"desktop/electron-renderer/client/ideas.ts": ["desktop/electron-renderer/features/board/Board.test.tsx","desktop/electron-renderer/features/board/Board.tsx","desktop/electron-renderer/features/board/reach.ts"]},"unknown": []}Each file lists every file that reaches it through imports, directly or not, and the reach script of each feature those files sit in. A reach script imports only types, so the graph alone would never lead to it. A file the graph doesn't hold, such as
README.md, goes inunknown. The shape is Rehearse's own contract,vits version. -
See which features a change reaches.
ashlar affected --jsonlists them beside the tests, each with the reach script Rehearse runs as its flow:"features": [{"folder": "desktop/electron-renderer/features/board","reach": "desktop/electron-renderer/features/board/reach.ts"}] -
Walk a feature. With a
rehearse.yamland nodriveinashlar.config.ts,ashlar drive <feature>walks its reach throughrehearse drive: it stops anything left driven, starts the flows' service withrehearse drive start, takes each step, then stops again. Adrivein the config wins: a project keeps its own drive command until it chooses Rehearse's. Rehearse's own browser shows the light colour scheme whatever--schemeasks; a service that names its own driver getsDRIVE_SCHEMEand can honour it.
Gotchas Rehearse guards
Section titled “Gotchas Rehearse guards”A gotcha can be a rule in .claude/rules/, or a Rehearse scenario that tries it on every change. Name the
scenario file *.guard.flow.yaml or *.guard.rehearse.yaml, and ashlar onboard lists it as a gotcha of its
folder, with its name and describe:
name: A Toronto order at 16:59 still ships todaydescribe: The 17:00 cutoff once acted at noon.Guards are found anywhere in the repository but the ignored folders, and onboard.guards in the config names
other patterns. A rule in .claude/rules/ can point at its guard too, with guard: <scenario file> in its
frontmatter; the guide and briefs then say "Guarded by" that file. Rehearse itself has no notion of a guard:
the name is Ashlar's convention, and the scenario is an ordinary Rehearse scenario.