/fsh:om-test-drivefrom fsh
Boot a change on a throwaway instance, prove login actually works, seed the data the change needs to be visible, then hand over a click-by-click route through it. Use when you want to see a change working before merging — "boot this PR so I can click through it", "set me up to review X by hand", "let me try this". Knows Open Mercato's ephemeral command; degrades to any repo's documented boot. Args: nothing (current worktree), or a PR number/URL to check out first.
Ships in fsh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You are running the om-test-drive skill. Goal: put a running instance of the change in the user's hands, with working credentials, the data that makes the change visible, and a route through it — so they can form their own opinion by clicking, not by reading a diff.
This is not explain (which explains a change — or any other target — in plain words without running anything) and not an automated-QA skill (which drives a browser and posts pass/fail evidence to a pipeline). You do not drive the UI. You boot, you prove auth, you seed, you write the route — the human does the clicking.
Scope: Open Mercato first, and honestly so. The boot step degrades to any repo that documents a disposable environment, but the auth and seeding phases are written around Open Mercato's routes. On another stack this skill boots and then needs its profile to supply the auth contract — without that, stop and say so rather than half-driving an app you can't log into.
A URL handed over without a completed login round-trip is a failure of this skill, not a success — and so is one whose click route names nothing to look at, whenever the environment could have carried such a record. The single exception is an honest empty state: under --no-seed, or where the change genuinely has no record to point at, say so in as many words. "It's running on port 5001" is setup, not a test drive.
This skill is repo-agnostic, with Open Mercato as its known case. Gather the concrete details from the repository you're running in:
AGENTS.md / CLAUDE.md / package.json scripts, or its ## Skill profile section (the curated source) under the Throwaway instance knob.POST /api/auth/login → {token}; a repo that authenticates differently will boot and then fail every later phase, so if its profile doesn't document the auth contract, stop and ask rather than guessing at a login route.If a needed value isn't documented and you can't infer it, ask the user rather than guessing.
gh pr checkout <N> first, and only into a clean tree. A dirty tree is a stop, not a stash: say what's uncommitted and let the user decide.--fresh — never attach to an already-running instance; always build a new one.--no-seed — don't create anything; drive what's already there. Read-only, not verification-free: you still have to find an existing record that exercises the change and name it in the click route. If no such record exists, say so plainly and hand over a route that ends at an empty state — never an unqualified "go and look".--no-seed and say what that costs, or stop. Seeding into someone's dev database is not recoverable by apologising.startedAt, a port and a database URL, but no source SHA or build digest, so a timestamp newer than your checkout is not evidence: a process can start after the checkout and still serve stale build output. Treat provenance as unprovable and force a fresh instance after any branch switch or PR checkout. See the reuse trap in Phase 2 — it is the most likely way this skill lies to the user.yarn install rewrites node_modules, yarn generate writes the generated registry, build:packages fills dist/. That is expected and unavoidable — the instance is built from this tree — but it is a real mutation of the user's checkout, so tell them in the handover what was installed, generated or rebuilt, and which branch the checkout is left on. The two genuine exceptions to read-only are gh pr checkout with an explicit PR argument, and that bootstrap. Never edit tracked configuration to make a boot work: an .env that blocks startup is fixed with environment overrides for the run, not by rewriting the user's file.gh pr checkout <N> --repo <owner/name>. Pass --repo explicitly: a checkout with several remotes (a fork alongside its upstream) usually has no default repo set, and bare gh pr checkout just errors out. Take the change surface from gh pr diff <N> --repo <owner/name> — scope that call too, or an unqualified number can resolve a PR in the other repo of a fork/upstream pair.git fetch origin <default> then git diff origin/<default>...HEAD. Derive the default via gh repo view --json defaultBranchRef or git symbolic-ref refs/remotes/origin/HEAD, and use that same origin/<default> ref again in Phase 4. Fetching updates origin/<default>, not your local <default> branch — diffing the local one is how you get the stale surface even though you just fetched. A local base ref is only as fresh as your last fetch, and a stale one silently turns a 15-file change into a 4,000-file diff — every conclusion drawn after that is wrong. Include everything the build will see — the instance is compiled from the working tree, so the surface must cover git diff, git diff --staged, and untracked source (git status --porcelain rows starting ??). Untracked files are the trap: a brand-new route or component is invisible to every git diff form, so the handover would claim the change has no such surface while that surface is live in the app. If untracked source is present, fold it in or stop and say why.State the target and the HEAD sha + subject in one line before doing anything expensive, so the user can stop you if you picked the wrong thing. You'll need that sha again in Phase 2 and in the handover.
A documented profile wins over sniffing. If the repo's ## Skill profile carries a Throwaway instance entry, use it and skip the ladder — the rungs below key on script names that a non-Mercato repo can define too, and losing that race means applying Open Mercato's bootstrap, auth and route assumptions to a stack that shares nothing but a script name. Only when no profile is documented should you infer the stack from the ladder.
Resolve the boot command before checking anything. The preconditions and the bootstrap below are Open Mercato's, and applying them to a repo that boots some other way would reject a perfectly good environment for lacking Node or Docker. Run the discovery ladder first; only if it lands on the Mercato rungs do the rest of this phase's specifics apply.
Then check the preconditions, reporting each failure with its fix rather than a stack trace:
node -v → Open Mercato's ephemeral runner requires Node 24 or newer, and says so with a fix; check it yourself so the user hears it before the build starts, not after.docker info → must succeed. A non-standard runtime (Colima and friends) is auto-detected from the active Docker context; a dead daemon is not.Warn about the cost before starting, not after. A cold boot runs the full initialize + production build pipeline: several minutes and RAM-heavy. Tell the user what they're waiting for.
Bootstrap the tree before you run the ephemeral command. It is not a from-zero installer — it assumes a repo that has already been installed and built once, and it runs initialize before its own codegen and build steps. On a freshly-installed tree, or after a checkout that changed the lockfile, it fails on missing artifacts with errors that name the symptom and not the cause.
Which bootstrap depends on the layout, not on the script name. Decide with jq -e '.scripts["build:packages"]' package.json:
Monorepo (build:packages at the root, packages/cli in-tree). yarn mercato is packages/cli/dist/bin.js, so the CLI that orchestrates the build must itself be built first — hence the doubled step, exactly as the root build script encodes it:
yarn install # after any checkout that touches yarn.lock
yarn build:packages # bootstraps the CLI binary itself
yarn generate # writes the generated entity registry
yarn build:packages # rebuild so the generated files land in dist/
Standalone scaffold (flat create-mercato-app layout, no build:packages, mercato resolved from node_modules/.bin). There is no chicken-and-egg — the CLI ships built as a dependency — so the sequence is just:
yarn install
yarn generate # `mercato generate`
Running the monorepo's sequence here fails on a build:packages script that doesn't exist, which is why the layout check comes first.
Map the error you get back to the rung you skipped:
| Error | Missing rung |
|---|---|
Couldn't find the node_modules state file | yarn install |
Cannot find module '.../packages/cli/dist/bin.js' | yarn build:packages |
Cannot find module '.../packages/core/dist/generated/entities.ids.generated.js' while "Bootstrapping application" | yarn generate, then yarn build:packages again |
Note the trap in the third: initialize applies every migration successfully and then dies, so a codegen problem presents as a database one. Don't reach for --verbose on any of these — it adds log volume, not the missing artifact.
A throwaway instance runs in production mode, so dev-safe placeholders become hard failures. The app .env — apps/mercato/.env in the monorepo, the root .env on a flat scaffold — ships JWT_SECRET=change-me-dev-secret straight out of .env.example, and the app's own production guard refuses to start on a known placeholder secret. The build succeeds, the server starts, and then it exits — the boot reports only Application process exited before readiness check, with the actual refusal buried in the app's stderr where you'll only see it under --verbose. Supply real secrets for the run instead:
JWT_SECRET=$(openssl rand -hex 32) AUTH_SECRET=$(openssl rand -hex 32) \
<the boot command the ladder selected>
Prefix whichever command the ladder actually chose — on a scaffold that's yarn test:integration:ephemeral:start or the yarn --cwd apps/mercato exec … form, not the monorepo's yarn mercato.
Pass them in the environment; do not edit the repo's .env — it's the user's file and this skill is read-only on the tree (Hard rule 6). Read the error before applying this. Application process exited before readiness check is the harness's generic symptom, and a startup crash introduced by the change under test produces exactly the same line — that one is a finding, not an obstacle. So re-run with --verbose (or read the app's stderr) and apply the secret override only when the refusal is actually printed. Retrying with fresh credentials on reflex costs another cold boot and, worse, hides the bug you were sent to look at.
Resolve the boot command — first hit wins, and the last rung is a real probe rather than an assumption:
package.json has test:integration:ephemeral:start → yarn test:integration:ephemeral:start. Both the monorepo and a current create-mercato-app scaffold define this, so the script's presence tells you nothing about which one you're in — see the layout check below before bootstrapping.yarn mercato test:ephemeral (equivalently yarn mercato test ephemeral).apps/mercato with no root script — probe first, then use it: yarn --cwd apps/mercato exec mercato --help, then yarn --cwd apps/mercato exec mercato test:ephemeral.## Skill profile → Throwaway instance, or AGENTS.md / CLAUDE.md). If that resolves to a long-lived shared dev stack rather than a disposable one, say so and drop to --no-seed for the rest of the run — do not ask for permission to write into it (Hard rule 3).Useful flags: --verbose (full bootstrap/build logs — worth a re-run once the tree is bootstrapped and a boot still fails silently), --no-reuse-env (always a brand-new instance on an isolated port), --no-screenshots (irrelevant here; this skill doesn't drive a browser).
Run it backgrounded. The command holds the terminal until Ctrl+C — that's by design, it's what keeps the instance alive for the user.
The reuse trap. The ephemeral command silently attaches to an already-running instance recorded in .ai/qa/ephemeral-env.json when source mtimes and a build-cache TTL say it's still valid. After a branch switch or a gh pr checkout, that can hand you a running build of different code while everything looks fine.
You cannot verify your way out of this: the state file carries startedAt, a port and a database URL, but no source SHA or build digest, and a process that started after your checkout may still be serving output built before it. So don't try to reason from the timestamp — after any branch switch or PR checkout, always pass --no-reuse-env (--fresh does it for you). Reuse is only safe when you booted the instance yourself, in this run, from this tree.
One caveat on the escape hatch: --no-reuse-env takes the runner's setup lock and will not build a second instance while another ephemeral process holds it. If it blocks, report the lock owner and let the user stop it — don't promise a fresh instance you can't get.
Capture the base URL from the ready line, which is authoritative:
[ephemeral] Ready for QA exploration at http://127.0.0.1:<port>
[ephemeral] Default credentials: [email protected] / secret
.ai/qa/ephemeral-env.json (baseUrl, port, databaseUrl, startedAt) is a useful bonus, but it lives at the project root — which differs between the monorepo and a scaffold. Find it; don't assume the path. The backend UI is at <baseUrl>/backend.
curl -s -X POST "$BASE_URL/api/auth/login" \
-H 'content-type: application/x-www-form-urlencoded' \
--data-urlencode '[email protected]' --data-urlencode 'password=secret'
Capture the token and fail loudly if it isn't there — a probe that prints the response and moves on can send Bearer to the next call and still look like it passed:
TOKEN=$(curl -s -X POST "$BASE_URL/api/auth/login" \
-H 'content-type: application/x-www-form-urlencoded' \
--data-urlencode '[email protected]' --data-urlencode 'password=secret' \
| node -pe 'JSON.parse(require("fs").readFileSync(0,"utf8")).token || ""')
[ -n "$TOKEN" ] || { echo "login failed"; exit 1; }
Then use the token on a stable, always-present collection endpoint — not a route the change touches. Route discovery is Phase 4 and hasn't run yet, and a UI-only change may add no API route at all:
CODE=$(curl -s -o /dev/null -w '%{http_code}' -H "Authorization: Bearer $TOKEN" "$BASE_URL/api/<a known collection>")
case "$CODE" in 2*) ;; *) echo "authorization failed: $CODE"; exit 1;; esac
Check the status, don't just print it: a 401 or 403 that scrolls past is how a run reaches the handover claiming login was proven when it wasn't.
A login that mints a token while every subsequent call returns 401 is exactly what this catches, and it's a failure the user would otherwise hit on their first click. Re-check the changed surfaces once Phase 4 has identified them, and accept whatever success status each one actually returns — a create is a 201, a delete often a 204, and demanding 200 everywhere would fail a working drive.
Fetching pages, not just the API. An authenticated page needs the login cookie, not the bearer token — grab a jar on login and reuse it:
JAR=$(mktemp); trap 'rm -f "$JAR"' EXIT # a live session credential — never in the worktree
curl -s -c "$JAR" -X POST "$BASE_URL/api/auth/login" \
-H 'content-type: application/x-www-form-urlencoded' \
--data-urlencode '[email protected]' --data-urlencode 'password=secret' -o /dev/null
CODE=$(curl -s -b "$JAR" -o /dev/null -w '%{http_code}' "$BASE_URL/backend/<path>")
case "$CODE" in 2*) ;; *) echo "page probe failed: $CODE"; exit 1;; esac
Fail on this one exactly as on the API probe. A 307 here means the cookie didn't take and a 404 means the route doesn't exist — either would otherwise walk straight into a handover whose click route Hard rule 1 claims was resolved.
The jar holds a working session for the whole drive. Put it in mktemp and delete it on exit — written into the repo it is one git add -A away from being published. (The cookies come back flagged Secure even on http://127.0.0.1; curl sends them anyway because it treats loopback as a secure context, so no HTTPS workaround is needed. If a future curl tightens that, the symptom is a 307 with the jar — not a silent pass.)
Read the status codes correctly, or you'll report working things as broken and broken things as fine:
307/302 on an anonymous /backend fetch is correct — that's the login redirect, not a failure.
200 with the cookie means the route exists and you're authenticated. It does not mean the change rendered. The backend is a client-rendered app: the detail page returns over a megabyte of shell HTML and fetches its data afterwards, so grepping that HTML for your seeded values finds nothing even when everything works. Prove the data at the API layer and be explicit in the handover that rendering is the user's job to confirm.
Credentials the ephemeral env guarantees: [email protected], [email protected], [email protected], all with password secret (it pins the init passwords). The guarantee is ephemeral-only — in a normal environment the companion account passwords are randomly generated, so never present these as universal.
The login route is rate-limited (a handful of attempts per minute per email). A 429 means back off, not bad credentials — do not loop on it.
Keep the token for Phase 5. Never put it in the handover.
Enough to say what it does in product terms — and, more importantly, to name the user-visible surfaces it touches. That list is what the click route is built from.
gh pr diff <N> --name-only (or a freshly-fetched base), then map each file to a route with the repo's convention. In Open Mercato a module's backend/<path>/page.tsx is /backend/<path>, and detail pages re-export each other — sales/orders/[id] renders the sales/documents/[id] component, so one changed component surfaces under several routes.For a full merge-decision writeup — scenarios, what's tested, residual risk — that's explain. This is the short version that feeds the route.
Skip if --no-seed.
api/ directory rather than guessing it, then POST with the bearer token and Content-Type: application/json.GET. Trusting the create response is how you hand over a record that isn't really there — or one the app can't find because an index never updated.For each seeded record, note its human-visible identifier (name, number, title) and the backend URL where the user will find it. That pairing is what makes the handover clickable rather than a description.
The deliverable. Inline in your final message:
# Test drive: <change in one line>
## Instance
- URL: <baseUrl>/<app path> — port <n>, built from <sha> "<subject>"
<on a dirty tree: + uncommitted work — N modified, M untracked; HEAD alone does not identify what's running>
- Login: <the credentials the booted profile guarantees; Open Mercato's ephemeral env pins [email protected] / secret>
Verified: <method> <auth route> → <status>; <method> <checked route> → <status>
- Stop it: <exact command>. <If this run booted the instance: destroys the container and everything
seeded below. If it attached to one already running: Ctrl+C only detaches — the runtime and the
seeded data stay up for its owner.>
- Left in your checkout: <branch now checked out; what bootstrap installed / generated / rebuilt>
## What the change does
<2–4 sentences in product terms — the situation it addresses and what's different now>
## Click route
1. <URL> → <what you should see, naming the seeded record> — <what to check>
2. <URL> → <...>
- Worth poking at: <the edge the diff makes interesting>
## Seeded for this drive
| Record | Where to find it | Created via |
|---|---|---|
| <identifier> | <URL> | <POST /api/...> |
## What this drive can't show
- Rendering is unverified — this drive proved the route resolves, and <for API seeds: that the
data persisted, read back through the API | for UI-form seeds: nothing about the record beyond
the form accepting it>. Not that the component paints it. That's the first thing to check.
- <the booted environment's own switched-off surfaces. Open Mercato's ephemeral env: no outbound
email (delivery disabled); scheduled jobs won't fire (scheduler off, though queue workers run,
so job-backed flows do work); enterprise modules off; CRUD API caching on>
- <anything specific to this change you couldn't set up>
Writing rules:
Leave the instance running — that's the point of the skill. Give the exact way to stop it, and describe stopping as it will actually behave: if this run booted the instance, stopping destroys the container and everything seeded; if it attached to one already running, Ctrl+C merely detaches and the runtime survives for whoever owns it. Telling a user their data was destroyed when it is still live — or the reverse — is a small lie with real consequences.
Say what the run changed in their checkout, too: the branch it left them on, and whatever the bootstrap installed, generated or rebuilt (Hard rule 6).
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub fullstackhouse/skills --plugin fshOther plugins' skills for the same job
35 skills in this plugin
/blacksmithMigrate a repository's GitHub Actions workflows to Blacksmith runners — inventory every job, move the ones that build, run or test the app (image builds get the sticky-disk Docker actions, a size-capped cache and a Dockerfile audit for cache killers), leave glue, deploy and credential-bound jobs on GitHub, capture a per-step timing baseline, hand off to `deliver --no-merge` with the decision table in the PR, and measure real rebuilds on that PR when the existing runs can't settle it. Use when asked to "move CI to Blacksmith", "cut GitHub Actions spend", "make the image build faster", or right after the Blacksmith app was installed on an org. Args: a repo path (default: the current repo), plus `--audit-only` to print the decision table and write nothing./brainstormDivergent conversation before any artifact exists — question the idea, weigh alternatives including building nothing, then converge on one routed next step (drop it, park it as a ticket, kick off implementation, or bug-hunt) with a handoff brief. Use when the user says "should we build this", "I have an idea", "let's think this through", or "is this worth doing". Read-only until the routing is confirmed./broRestate the last message in plain human language, with no jargon.