bikeindex/bike_index / .claude/skills/sandbox-test-setup
sandbox-test-setup
VerifiedBike Index Ruby + RSpec environment setup for each place this repo runs: a local macOS Conductor workspace, a spawned `.claude/worktrees/…` git worktree, and Claude Code's Linux web sandbox — getting `ruby`, `bundle`, `bin/lint`, a database, seeds, a dev server and a browser working there. **Read it before the first command in a spawned worktree**, which starts with `bin/workspace_setup` (without it `bin/env` hands back the main checkout's port, database and Redis). Read it whenever a session runs RSpec, `bundle` or `bin/lint`, needs a dev server or seeded data, or hits: a missing `.workspace_id` or `node_modules`, a `$BASE_URL` serving another branch, `Could not find 'bundler' (4.0.x)`, `command not found: rspec`, `uninitialized constant Pathname` or `undefined method 'intersect?' for Array` from a `bin/` script, `Sprockets::Rails::Helper::AssetNotFound`, `tailwind.css is not present`, `LoadError: Could not open library 'vips.so.42'`, `executable not found: "identify"`, or a Playwright browser-not-found, build-number mismatch, `Playwright::Error: timeout: expected float, got undefined` or `Running as root without --no-sandbox is not supported`. The fix is almost never a reinstall or a Gemfile edit — it's a PATH, an env var, or a service that isn't running.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 4.7 KB |
| assets/web_sandbox_setup.shexecutable | script | 12.2 KB |
| references/local-macos.md | markdown | 1.7 KB |
| references/web-sandbox.md | markdown | 7.5 KB |
references/local-macos.md
View on GitHub# Local macOS (Conductor workspace or spawned worktree)
In a `.claude/worktrees/…` checkout, `bin/workspace_setup --without_seeds` comes first
(SKILL.md).
Ruby comes from [mise](https://mise.jdx.dev/). macOS's `path_helper` puts `/usr/bin` ahead
of its shims in every non-interactive shell, so the `mise-shims.sh` SessionStart hook
re-prepends them for each Bash command, subagents' included. A shell that rebuilds PATH
still gets `/usr/bin/ruby` (2.6).
**Ruby is installed; PATH is wrong** — don't reinstall or edit the Gemfile. It shows up as:
- `Could not find 'bundler' (4.0.x)` from `bundle`, or from a `bin/` script that boots Rails
- `uninitialized constant Pathname` or `undefined method 'intersect?' for Array` from a
`bin/` script (`bin/rspec`, `bin/lint`)
- a `syntax error` from bare `ruby -c`/`ruby -e` on an endless `def` or `{x:}` shorthand
```bash
ruby -v # not the .tool-versions pin? then:
export PATH="$HOME/.local/share/mise/shims:$PATH"
```
Use the shims (they follow `.tool-versions`), not `mise exec`, which can still resolve
to 2.6 here. Then `bundle exec rspec …` and `bin/lint` work normally.
No `eval "$(ruby bin/env --export)"` needed for Ruby commands — `config/boot.rb` loads
`bin/env` itself. Export it only when the shell reads the values (`curl "$BASE_URL"`).
A pending-migration abort from `rails_helper` → `bundle exec rails db:create db:migrate`.
Every `:js` example raising `Playwright::Error: timeout: expected float, got undefined` →
a merge bumped `playwright-ruby-client` past the workspace's `node_modules/playwright`.
`npm install`.
Postgres, redis and the network are your local environment's, so the only other thing
that bites here is the CSS build in SKILL.md.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 323k | Updated | Claude CodeCodex | Verified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |