Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
manaflow-ai avatar

Cmux Backend

  • 2.5k installs
  • 25.6k repo stars
  • Updated August 5, 2026
  • manaflow-ai/cmux

cmux-backend is a cmux repository agent skill that enforces Effect TypeScript, Postgres-backed Cloud VM lifecycle, and Stack Auth pricing gates for developers editing cmux web/app/api and provider integrations.

About

cmux-backend is a manaflow-ai/cmux agent skill that codifies backend TypeScript rules for the cmux agent terminal platform. It defaults Effect under web/app/api and web/services for provider, database, auth, retry, and telemetry code; keeps Next.js route handlers thin with one Effect program per request; and stores Cloud VM lifecycle, active VM limits, idempotency, and usage events in Postgres rather than Rivet actors. Production and staging use CMUX_DB_DRIVER=aws-rds-iam with bun db:migrate:aws-rds-iam, while local dev uses Docker Postgres from bun dev. Provider secrets load from ~/.secrets/cmux.env including E2B_API_KEY and FREESTYLE_API_KEY. Reach for cmux-backend when editing Cloud VM create routes, Effect service boundaries, Stack Auth payment-item pricing gates, or AWS Aurora migration scripts in the cmux monorepo.

  • Implements session and pane lifecycle management
  • Routes agent commands to terminal processes
  • Exposes APIs for CLI and automation clients
  • Handles persistence and reconnection semantics
  • Integrates logging, auth hooks, and process supervision

Cmux Backend by the numbers

  • 2,504 all-time installs (skills.sh)
  • +304 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #217 of 4,347 Backend & APIs skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/manaflow-ai/cmux --skill cmux-backend

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2.5k
repo stars25.6k
Last updatedAugust 5, 2026
Repositorymanaflow-ai/cmux

How do you implement cmux Cloud VM backend logic?

Implement cmux server logic for spawning panes, routing agent commands, persisting sessions, and exposing APIs the terminal client depends on.

Who is it for?

Developers contributing to manaflow-ai/cmux backend routes, Cloud VM control plane, Effect services, or Postgres migrations for the agent terminal platform.

Skip if: Skip cmux-backend when working on unrelated repositories, cmux Ghostty submodule builds, or frontend-only React changes without backend or Cloud VM touchpoints.

When should I use this skill?

User edits web/app/api, web/services, Cloud VM lifecycle, provider integrations, Postgres schema, or bun db:migrate:aws-rds-iam in cmux.

What you get

Effect-typed route handlers, Postgres-backed VM lifecycle records, AWS RDS IAM migration runs, and pricing-gated Cloud VM create flows aligned with cmux conventions.

  • Effect route handler patterns
  • Postgres migration commands
  • Cloud VM lifecycle service rules

By the numbers

  • Includes 2 detailed reference guides: effect-boundaries.md and cloud-vm-control-plane.md
  • Documents 4 AWS RDS IAM runtime env vars: AWS_ROLE_ARN, AWS_REGION, PGHOST, PGUSER
  • Names 2 provider secrets: E2B_API_KEY and FREESTYLE_API_KEY

Files

SKILL.mdMarkdownGitHub ↗

cmux Backend

Use this skill for backend TypeScript, Cloud VM, provider, database, auth, rate-limit, retry, timeout, or telemetry work.

Core rules

  • Default backend TypeScript to Effect under web/app/api/**, web/services/**, and backend scripts that touch providers, databases, auth, rate limits, retries, timeouts, or telemetry.
  • Keep Next route handlers thin: parse the request, run one Effect program at the boundary, map typed errors to HTTP responses, and treat unexpected defects separately.
  • Use plain TypeScript only for trivial data shapes, constants, config files, frontend React code, or small glue where Effect would add ceremony without improving failure handling.
  • Cloud VM backend logic must stay in Vercel route handlers and Effect services backed by Postgres.
  • Do not reintroduce Rivet or a raw actor protocol for Cloud VM unless a later architecture doc explicitly changes the control plane.
  • Production and staging Cloud VM Postgres use the Vercel Marketplace AWS Aurora PostgreSQL OIDC/RDS IAM path.
  • Runtime env names are CMUX_DB_DRIVER=aws-rds-iam, AWS_ROLE_ARN, AWS_REGION, PGHOST, PGPORT, PGUSER, and PGDATABASE.
  • Run production/staging migrations with bun db:migrate:aws-rds-iam; never run Drizzle migrations from Vercel build or route startup.
  • Local development keeps using the CMUX_PORT-derived Docker Postgres path from bun dev.
  • Cloud VM create pricing gates should use Stack Auth team payment items when enabled.
  • Postgres remains the source of truth for VM lifecycle, active VM limits, idempotency, and usage events.

Secrets

Cloud VM build, test, and local dev scripts use provider secrets from ~/.secrets/cmux.env.

  • E2B_API_KEY
  • FREESTYLE_API_KEY
  • R2 upload vars used by web/scripts/build-cloud-vm-images.ts when creating Freestyle snapshots

Load them with:

set -a
source ~/.secrets/cmux.env
set +a

~/.secrets/cmuxterm-dev.env is for local Stack/web env and does not contain the provider build keys. bun dev sources ~/.secrets/cmux.env first when present, then ~/.secrets/cmuxterm-dev.env so cmuxterm-specific Stack settings override broader cmux secrets. The web dev loader still accepts the legacy ~/.secret/cmuxterm.env and ~/.secrets/cmuxterm.env paths while machines migrate.

Detailed references

  • Read references/effect-boundaries.md when shaping route handlers, services, typed errors, retries, or dependency injection.
  • Read references/cloud-vm-control-plane.md when touching VM lifecycle, migrations, Postgres, provider idempotency, or pricing gates.

Related skills

How it compares

Use cmux-backend over generic Effect or Next.js skills when contributing specifically to manaflow-ai/cmux Cloud VM control-plane and Postgres conventions.

FAQ

When should cmux backend code use Effect?

cmux-backend defaults to Effect for web/app/api, web/services, and scripts touching providers, databases, auth, rate limits, retries, timeouts, or telemetry, reserving plain TypeScript for trivial shapes, constants, and frontend React glue.

How does cmux-backend handle production database migrations?

cmux-backend requires bun db:migrate:aws-rds-iam for production and staging with CMUX_DB_DRIVER=aws-rds-iam and AWS RDS IAM env vars, explicitly forbidding Drizzle migrations from Vercel build or route startup.

Where does cmux-backend load provider API keys?

cmux-backend loads E2B_API_KEY, FREESTYLE_API_KEY, and R2 upload variables from ~/.secrets/cmux.env via set -a source, with bun dev sourcing cmux.env before cmuxterm-dev.env for local overrides.

Backend & APIsbackendintegrationsdevops

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.