flowlayer
// Examples + AI Prompt Builder

Examples

Browse copy-ready examples and generate a high-quality AI prompt that helps your coding agent produce a real flowlayer.jsonc for your project. Paste your repo paths, copy the prompt, send it to Claude, ChatGPT, or Copilot.

Need the full configuration reference? → Configuration

1 Enter paths 2 Copy prompt 3 Send to your agent 4 Get flowlayer.jsonc
folder_open

Project Roots

One path per line

Quick add:
  • check_circle Paste repo roots, service dirs, or monorepo packages
  • check_circle Works with any language, framework, or stack
  • check_circle Prompt prevents service and port hallucination
smart_toy

Generated Prompt

Ready to paste into any coding agent

edit_note

Enter at least one path
to generate your prompt

Tested with Claude 3.5+, GPT-4o, and GitHub Copilot. For best results, give the agent read access to your file system.

Common runtime situations

Reusable FlowLayer snippets for common runtime situations.

settings_ethernet

TCP Probe

Wait for a TCP port to accept connections before starting dependents. Use for databases and any non-HTTP service.

ready.type: "tcp"
{
  "services": {
    "db": {
      "cmd": "docker compose up db",
      "stopCmd": "docker compose down db",
      "port": 5432,
      "ready": { "type": "tcp", "port": 5432 }
    }
  }
}
health_and_safety

HTTP Health

Poll an HTTP endpoint until it returns a 2xx response. Use for API services that expose a health route.

ready.type: "http"
{
  "services": {
    "api": {
      "cmd": "node dist/server.js",
      "port": 3001,
      "ready": { "type": "http", "url": "http://localhost:3001/health" }
    }
  }
}
bolt

One-shot

Run a command once and exit — migrations, seed steps, or build tasks. Dependents wait for it to complete successfully.

kind: "oneshot" dependsOn
{
  "services": {
    "db": {
      "cmd": "docker compose up db",
      "stopCmd": "docker compose down db",
      "ready": { "type": "tcp", "port": 5432 }
    },
    "migrate": {
      "kind": "oneshot",
      "cmd": "npx prisma migrate deploy",
      "dependsOn": ["db"]
    }
  }
}
sync

Watch Mode

Long-running dev process with file watching. Use your project's real dev script when available — this snippet shows the pattern. --preserveWatchOutput keeps NestJS logs readable across recompiles.

NestJS --watch
{
  "services": {
    "api": {
      "cmd": "npx nest start --watch --preserveWatchOutput",
      "port": 3000
    }
  }
}
manufacturing

Workers

Background queue worker that starts after its dependency. No readiness probe — workers don't expose a port.

no ready
{
  "services": {
    "worker": {
      "cmd": "python -m celery -A app.tasks worker --loglevel=info",
      "dependsOn": ["broker"]
    }
  }
}
deployed_code

Docker

Manage a Docker service with cmd and stopCmd. The live-logs form streams output so FlowLayer captures it.

stopCmd docker compose logs -f
{
  "services": {
    "redis": {
      // Start detached, then stream logs so FlowLayer captures output
      "cmd": ["sh", "-c", "docker compose up redis -d && docker compose logs -f redis"],
      "stopCmd": "docker compose down redis",
      "port": 6379,
      "ready": { "type": "tcp", "port": 6379 }
    }
  }
}
terminal

Shell

Use ["sh", "-c", "..."] for lightweight portability — cd, && chaining, no surprises. Use ["bash", "-lc", "..."] when you need login-shell behavior: sourcing .nvm, version managers, or your full dev environment.

sh -c bash -lc

sh -c — portable

{
  "services": {
    "api": {
      "cmd": ["sh", "-c", "cd packages/api && pnpm dev"],
      "port": 3001
    }
  }
}

bash -lc — login shell / nvm

{
  "services": {
    "frontend": {
      "cmd": ["bash", "-lc", "source ~/.nvm/nvm.sh && nvm use 22 >/dev/null && pnpm dev"],
      "port": 5173
    }
  }
}
account_tree

Dependencies

Chain services so each waits for the previous. Here: database → migration → API.

dependsOn
{
  "services": {
    "db": {
      "cmd": "docker compose up db",
      "stopCmd": "docker compose down db",
      "ready": { "type": "tcp", "port": 5432 }
    },
    "migrate": {
      "kind": "oneshot",
      "cmd": "npx prisma migrate deploy",
      "dependsOn": ["db"]
    },
    "api": {
      "cmd": "node dist/server.js",
      "port": 3001,
      "dependsOn": ["migrate"],
      "ready": { "type": "http", "url": "http://localhost:3001/health" }
    }
  }
}
key

Environment

Inject service-specific variables with env. Ideal for local URLs, feature flags, credentials, and runtime toggles. Values are available to both cmd and stopCmd.

env
{
  "services": {
    "web": {
      "cmd": "pnpm dev",
      "port": 5173,
      "env": {
        "VITE_API_URL": "http://localhost:3001",
        "FEATURE_BETA": "true"
      }
    },
    "worker": {
      "cmd": "python -m worker",
      "env": {
        "DATABASE_URL": "postgresql://localhost:5432/mydb",
        "WORKER_CONCURRENCY": "4"
      }
    }
  }
}
hub

Event Stack

Bring up Kafka first, then start producers and consumers that wait on real infra readiness. This models a local event-driven stack with explicit boot ordering.

kafka dependsOn env
{
    "services": {
        "kafka": {
            "cmd": "docker compose up kafka",
            "stopCmd": "docker compose down kafka",
            "ready": { "type": "tcp", "port": 9092 }
        },
        "api": {
            "cmd": "pnpm --dir ./apps/api dev",
            "port": 3001,
            "dependsOn": ["kafka"],
            "env": {
                "KAFKA_BROKERS": "localhost:9092"
            }
        },
        "worker": {
            "cmd": "go run ./cmd/worker",
            "dependsOn": ["kafka"],
            "env": {
                "KAFKA_BROKERS": "localhost:9092"
            }
        }
    }
}
package_2

Ephemeral Job

Run disposable tooling in a container before booting the app. A reproducible one-shot gate keeps local workflows clean and consistent.

docker run --rm kind: "oneshot" Go
{
    "services": {
        "go-test": {
            "kind": "oneshot",
            "cmd": [
                "docker", "run", "--rm",
                "-v", "./:/workspace",
                "-w", "/workspace",
                "golang:1.24",
                "go", "test", "./..."
            ]
        },
        "api": {
            "cmd": "go run ./cmd/api",
            "dependsOn": ["go-test"],
            "port": 8080,
            "ready": {
                "type": "http",
                "url": "http://localhost:8080/healthz"
            }
        }
    }
}
build

Build Steps

Build a shared package before starting dependent services. Use kind: "oneshot" and dependsOn so services wait for the build to complete — a natural fit for monorepos.

kind: "oneshot" monorepo
{
  "services": {
    "build-shared": {
      "kind": "oneshot",
      "cmd": "pnpm --filter @myapp/shared build"
    },
    "api": {
      "cmd": "pnpm --dir ./apps/api dev",
      "port": 3001,
      "dependsOn": ["build-shared"]
    },
    "web": {
      "cmd": "pnpm --dir ./apps/web dev",
      "port": 5173,
      "dependsOn": ["build-shared"]
    }
  }
}
receipt_long

Python Logs

Python buffers stdout by default — output won't appear in FlowLayer until the buffer flushes. Pass -u or set PYTHONUNBUFFERED=1 to stream logs in real time.

python -u PYTHONUNBUFFERED

Via flag

{
  "services": {
    "worker": {
      "cmd": "python -u worker.py"
    }
  }
}

Via env

{
  "services": {
    "worker": {
      "cmd": "python worker.py",
      "env": { "PYTHONUNBUFFERED": "1" }
    }
  }
}
folder_copy

Monorepo

Run a service from a subdirectory without a shell wrapper when your tooling supports --prefix or --dir. Direct commands are more reliable than cd && ....

--prefix --dir
{
  "services": {
    "web": {
      // npm supports --prefix — no shell wrapper needed
      "cmd": ["npm", "--prefix", "./apps/web", "run", "dev"],
      "port": 3000
    },
    "api": {
      // pnpm supports --dir
      "cmd": ["pnpm", "--dir", "./apps/api", "dev"],
      "port": 3001
    }
  }
}
hourglass_empty

Port Wait

Wait for a dependency that lives outside FlowLayer — a shared database, a remote queue, or a service on another machine. A shell wrapper probes the TCP port in a loop, then hands off.

advanced external dep
{
  "services": {
    "api": {
      // Polls port 5432 until the external DB accepts connections, then starts
      "cmd": [
        "sh", "-c",
        "until nc -z localhost 5432; do sleep 1; done && node dist/server.js"
      ],
      "port": 3001
    }
  }
}

Don't have FlowLayer yet?

Install it in seconds and run your first configuration.

download Download FlowLayer