Loading...
Loading...
Configure a Rails project to work with Conductor (parallel coding agents)
npx skill4agent add shpigford/skills conductor-setupconductor.json{
"scripts": {
"setup": "bin/conductor-setup",
"run": "script/server"
}
}bin/conductor-setup#!/bin/bash
set -e
# Symlink .env from repo root (where secrets live, outside worktrees)
[ -f "$CONDUCTOR_ROOT_PATH/.env" ] && ln -sf "$CONDUCTOR_ROOT_PATH/.env" .env
# Symlink Rails master key
[ -f "$CONDUCTOR_ROOT_PATH/config/master.key" ] && ln -sf "$CONDUCTOR_ROOT_PATH/config/master.key" config/master.key
# Install dependencies
bundle install
npm installchmod +x bin/conductor-setupscriptscript/server#!/bin/bash
# === Port Configuration ===
export PORT=${CONDUCTOR_PORT:-3000}
export VITE_RUBY_PORT=$((PORT + 1000))
# === Redis Isolation ===
if [ -n "$CONDUCTOR_WORKSPACE_NAME" ]; then
HASH=$(printf '%s' "$CONDUCTOR_WORKSPACE_NAME" | cksum | cut -d' ' -f1)
REDIS_DB=$((HASH % 16))
export REDIS_URL="redis://localhost:6379/${REDIS_DB}"
fi
exec bin/devchmod +x script/serverENV.fetch('REDIS_URL', ...)ENV['REDIS_URL']redis_url = ENV.fetch('REDIS_URL', 'redis://localhost:6379/0')development:
adapter: redis
url: <%= ENV.fetch('REDIS_URL', 'redis://localhost:6379/1') %>config.cache_store = :redis_cache_store, { url: ENV.fetch('REDIS_URL', 'redis://localhost:6379/0') }Rack::Attack.cache.store = ActiveSupport::Cache::RedisCacheStore.new(url: ENV.fetch('REDIS_URL', 'redis://localhost:6379/0'))script/script/serverENV['REDIS_URL']ENV.fetch('REDIS_URL', ...)