Skip to content

bikeindex/bike_index / .claude/skills/sandbox-test-setup

sandbox-test-setup

Verified

Bike 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.

FileKindSize
SKILL.mdskill md4.7 KB
assets/web_sandbox_setup.shexecutablescript12.2 KB
references/local-macos.mdmarkdown1.7 KB
references/web-sandbox.mdmarkdown7.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.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 323kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 323kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 323kUpdated Claude CodeCodexVerifiedInstall
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: 198kUpdated Claude CodeCodexVerifiedInstall