## Summary - Move build/env/DB setup out of the GitHub Actions workflow into an on-demand script (`packages/twenty-utils/setup-dev-env.sh`) that Claude invokes only when needed - Add Nx/build cache restore/save steps to speed up repeated runs - Add `allowed_tools` so Claude can run the setup script and common dev commands (nx, jest, yarn) - Add `PG_DATABASE_URL` env var via `settings` for the postgres MCP server - Remove unnecessary `actions: read` permission grant - Document the lazy setup pattern in CLAUDE.md This makes read-only tasks (code review, architecture questions, docs) fast by skipping the ~2min build/setup overhead, while still letting Claude run tests and builds when it needs to. ## Test plan - [ ] Comment `@claude what is the architecture of the backend?` — should answer fast without running setup - [ ] Comment `@claude run the twenty-server unit tests` — should call setup script first, then run tests - [ ] Verify cross-repo dispatch still works 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
13 lines
392 B
Bash
Executable File
13 lines
392 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
echo "Setting up dev environment..."
|
|
|
|
npx nx reset:env twenty-front
|
|
npx nx reset:env twenty-server
|
|
|
|
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "default";' 2>/dev/null || true
|
|
PGPASSWORD=postgres psql -h localhost -p 5432 -U postgres -d postgres -c 'CREATE DATABASE "test";' 2>/dev/null || true
|
|
|
|
echo "Dev environment ready."
|