Synthlabs setup

From mkurman/zorai · View interactive version

Synthlabs setup is an AI agent skill from the GitHub repository mkurman/zorai. Use when you need to locate, start, and verify a local SynthLabs backend before API-dependent work.

How to use this skill

Skill file

SynthLabs Setup

Overview

Use this skill to locate a real SynthLabs checkout, start the documented local services, and prove the backend is healthy before doing anything else.

When to Use

Use this skill when:

Do not use this skill when:

Key Requirements

Find the Checkout

Look for a repository root that contains all of these anchors:

If the checkout location is not already known, verify the candidate repo before running commands there.

If no local checkout exists yet, clone the public repository first:

git clone https://github.com/mkurman/synthlabs.git
cd synthlabs

After cloning, re-check the repo anchors before continuing with install or startup work.

Check Available Launch Paths

Confirm which package manager, runtime, and container tooling are installed before choosing commands:

command -v node
command -v npm
command -v bun
command -v docker
docker compose version
test -x ./mc.sh

Install Dependencies

From the SynthLabs checkout:

# npm path
npm install

# bun path
bun install

Use the package manager that is actually available. Do not invent lockfile or package-manager switches that the repo does not document.

Prepare Local Environment

Check whether .env.local already exists before copying anything:

test -f .env.local
cp .env.example .env.local

Populate only the variables required for the chosen workflow:

If you are using the Docker Compose path, check whether .env exists before starting ./mc.sh:

test -f .env
cp .env.example .env

Do not add placeholder secrets or fake values.

Start the Documented Scripts

From the SynthLabs checkout, use the documented scripts that match the task:

# frontend + backend together
npm run dev

# frontend only
npm run dev:client

# backend only
npm run dev:server

# bun frontend dev flow
bun run bun:dev

# Docker Compose manager
./mc.sh up

# Docker Compose backend only
./mc.sh up backend

# Docker Compose status and logs
./mc.sh status
./mc.sh logs backend

Readiness Contract

The real backend port behavior comes from server/index.js:

The Docker Compose path is different from the normal local dev path:

When finding the selected port, check in this order:

  1. A port explicitly set through PORT
  2. Docker Compose backend 8900 when the repo was started through ./mc.sh
  3. Development default 8787 unless the task is clearly using production mode
  4. Production default 8900 only when the environment is explicitly production
  5. Higher ports opened by the backend because PORT_RANGE allowed auto-increment

Verify readiness with the health route before any other API call:

curl -fsS http://localhost:8787/health

For the Docker Compose path, verify the published backend directly:

curl -fsS http://localhost:8900/health

Healthy output must decode to JSON equivalent to:

{"ok":true,"service":"synthlabs-rg"}

If the expected port does not answer, probe the configured or incremented range until /health returns the required payload.

Common Mistakes

If No Healthy Instance Is Found

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.