Skip to content
cccskills
FreePublished on GitHub

sandbox-test-setup

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.

The English summary is being prepared. Showing the original description.

bikeindex/bike_index308 stars(GitHub 308 + cccskills 0)
Works withRedisPlaywright

Run score Not tested

See how to install

Files included (4)

  • SKILL.md4.7 KB
  • assets/web_sandbox_setup.sh12.1 KB
  • references/local-macos.md1.5 KB
  • references/web-sandbox.md7.3 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Running Ruby + RSpec for Bike Index

Read the reference for the path you're in; the others don't apply.

PathEnvironmentRead
/Users/…/conductor/workspaces/…local macOS Conductor workspacereferences/local-macos.md
…/.claude/worktrees/…spawned git worktree — set it up first, belowreferences/local-macos.md
/home/user/bike_index ($CLAUDE_CODE_REMOTE=true)Claude Code web sandboxreferences/web-sandbox.md

A spawned worktree sets itself up first

Before the first rspec, bundle, bin/lint, bin/env or dev server:

bin/workspace_setup --without_seeds

The SessionStart hook .claude/hooks/worktree-setup.sh runs this on a worktree's first session, so a .workspace_id is usually already there. When it isn't, the hook's output went to tmp/workspace_setup.log; read that, then run the command by hand. When Claude Code removes the worktree, .claude/hooks/worktree-teardown.sh runs bin/workspace_teardown to drop its databases, then git worktree remove. One with uncommitted changes stays, databases and all.

It allocates an ID from the dev_workspaces registry, writes .workspace_id, and runs bin/setup, which creates this workspace's databases and builds the CSS. Run bundle exec rails db:seed when you need records. node_modules starts as a clone of the root checkout's, so npm install only fetches what this branch changed.

Never write .workspace_id yourself — bin/workspace_setup then skips allocation, leaving an ID the registry never handed out. And skipping setup entirely silently falls back to DEV_PORT=3042 and Redis db 0: the main checkout's port, database and cache — and a bin/setup from there loads the schema over the main checkout's database.

Build the CSS (every environment)

AssetNotFound from any spec that renders the layout (an html request spec, any :js spec) means app/assets/builds/tailwind.css is missing — a checkout where neither bin/setup nor bin/dev has run. It isn't pre-existing; build it. The asset "email.css" is not present (anything rendering an email, including db:seed) is the SCSS half:

bundle exec rails tailwindcss:build dartsass:build

A stale public/assets shadows your JavaScript

Any bin/turbo_tests or assets:precompile run leaves public/assets/.sprockets-manifest.json, and the test environment serves controllers/**/*.js from it. So a :js spec runs the old Stimulus controller and fails as if your change were wrong, while bin/dev works. Confirm, then rm -rf public/assets (gitignored, no need to ask):

grep -o "controllers/[a-z_/]*controller[^\"]*" public/assets/.sprockets-manifest.json | head

Every :js spec failing in Playwright setup means node_modules lags the gem

playwright-ruby-client drives the playwright npm package, and a merge from main bumps both together. Until npm install catches up, every :js example fails in spec/support/capybara.rb with Playwright::Error: timeout: expected float, got undefined, which names neither version. Compare node -e 'console.log(require("playwright/package.json").version)' with package.json's pin, then npm install && npx playwright install chromium.

Who starts bin/dev

Where a human works — a Conductor workspace, the main checkout — ask (AGENTS.md). In a spawned worktree or the web sandbox, the checkout is yours: start it yourself.

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

Read live production data from Bike Index through the admin OAuth token — Sidekiq and PgHero status, and the user-submitted bug reports — the same data as the cookie-gated dashboards, but agent-friendly JSON. Trigger when the user asks about production queue depth, job backlog, retries/dead jobs, running Sidekiq processes, or Postgres health (slow/blocked queries, index usage, unused/invalid indexes, connection counts, table/db sizes, vacuum/transaction-id danger) — and wants the *live* answer from production rather than logs or Honeybadger. Also trigger for anything about bug reports users have emailed in: what's been reported, searching/filtering them by status, tag or membership, or tagging one / linking it to the PR that fixes it. Also trigger when a request returns 401/expired and the AdminData token needs refreshing/re-authorizing. Not for reading log files (use production-log-inspection) or aggregated exception triage (bin/binx_hb).

The English summary is being prepared. Showing the original description.

bikeindex/bike_index308Updated Oct 29, 2026

How to fix a test that fails intermittently in Bike Index — one that passes locally but fails on CI, fails on one shard, passes on re-run, or is already tagged `:flaky`. **Read this before touching any spec that is failing intermittently, and before adding, raising, or relying on a `flaky:` tag or a `wait:` bump.** Trigger on a CI failure the user calls flaky, unreliable, intermittent, "green locally", "passes on retry", "fix CI", or a pasted `gh run`/Actions URL whose failure isn't reproducible; also whenever you catch yourself about to delete, skip, loosen, or retry an assertion to make a red build go green. **Equally: any spec that fails intermittently while you verify your own work** — deciding whether your change caused a flake, or whether to ship past one, is this skill's problem too, and it arrives with no CI run, no `:flaky` tag, and nobody but you calling it flaky.

The English summary is being prepared. Showing the original description.

bikeindex/bike_index308Updated Oct 29, 2026

Bike Index's frontend conventions — Tailwind class prefixing (`tw:`), the standard `twinput`/`twlabel`/`twlink` form/link classes, the `number_display` helper for numbers, `Counts` for site-wide figures (bikes registered, recoveries, organizations), the UI component library rule (every button is `UI::Button`/`UI::ButtonLink`, every typeahead/autocomplete is `UI::Forms::Combobox`, every FAQ is `UI::Accordion`, never hand-rolled markup), that **helpers are deprecated — render a view component taking full keyword arguments instead of adding or extending one**, ViewComponent rules (when to write a partial instead, keyword arguments, instance variables, `helpers.` prefix in templates), and `UI::Time::Component` for every date/time. Trigger when adding or modifying views (`.html.erb`), view components, Stimulus controllers, Tailwind classes, image or icon files under `app/assets/images` (which usually already exist), or any frontend code that touches styling or interactivity — including admin screens, whose unlayered legacy CSS inverts several of these rules. Stimulus.js is the JavaScript framework; SCSS and CoffeeScript files exist but are deprecated.

The English summary is being prepared. Showing the original description.

bikeindex/bike_index308Updated Oct 29, 2026

Capture desktop+mobile screenshots of Bike Index pages from the local `bin/dev` server via Playwright MCP, with a seeded-user identity gate that keeps PII out of uploaded images. Use whenever a task needs screenshots of local pages — PR documentation, bug repros, before/after comparisons across branches, design review, demos — including mid-interaction states like an open dropdown, a modal showing, a form mid-fill, or a hover. Use it even when the user just says "grab a screenshot" or "show me what this looks like" without naming Playwright. For a component that only renders under an env var / feature flag / hard-to-reach state (e.g. the review-app banner), screenshot its ViewComponent/Lookbook preview URL instead of a full page. **Also read the filename rule here before any `mcp__playwright__browser_take_screenshot` call**, including a one-off capture of some other site — it's what keeps PNGs out of the working tree.

The English summary is being prepared. Showing the original description.

bikeindex/bike_index308Updated Oct 29, 2026

Embed a local image file into an existing GitHub PR — either in the PR body or as a comment. Trigger when a request pairs a local image (screenshot, .png/.jpg, CleanShot capture, before/after) with an existing PR (by #number, URL, branch name, or "the open PR"), regardless of verb — attach, embed, add, put, post, drop, show, document. Also covers visually documenting test runs, bug repros, UI states, or CI failures on an existing PR. Uploads through `gh`'s `--attach` flag — except in the Claude Code web sandbox, which has no `gh` and hosts images through the PR branch's history instead. It also owns the PR's one `## Screenshots` comment — finding, creating, editing and verifying it — so other workflows (the `pr` skill's screenshot phase) hand it a composed body that references local image paths, and it posts it.

The English summary is being prepared. Showing the original description.

bikeindex/bike_index308Updated Oct 29, 2026

Investigate and fix a specific Honeybadger exception in the Bike Index app — pull the fault, read its backtrace, find the offending code, write the fix. Trigger whenever a request names one Honeybadger error: a pasted fault URL (`app.honeybadger.io/projects/…/faults/…`), a fault ID, an error class plus "in production" (`Vips::Error`, `NoMethodError in AfterStolenRecordSaveJob`), or phrasings like "fix this Honeybadger error", "why is this erroring in prod", "what's causing this exception", "look at this HB fault". Use `bin/binx_hb` for fault and notice detail; it is the only Honeybadger reader this repo uses. Not for a broad production health sweep across many sources, and not for reading raw log files (that's production-log-inspection).

The English summary is being prepared. Showing the original description.

bikeindex/bike_index308Updated Oct 29, 2026

See all skills by bikeindex

Report a problem with this skill