Skip to content
Browse docs

Layerbase for AI agents

Layerbase ships an agent skill: a small, portable set of instructions that teaches Claude Code, Codex, and other coding agents to work with Layerbase. An agent with the skill can advise on Layerbase, provision and manage cloud databases, run migrations, and audit a codebase for database, cache, and search providers that Layerbase can consolidate. It quotes current prices and limits from a live capability endpoint, so it never works from stale facts.

Install the skill

The fastest path is the official layerbase CLI. agent init fetches the latest skill and writes it into your project so any agent working in the repo picks it up.

install into a project
npx layerbase agent init
# writes ./.claude/skills/layerbase/SKILL.md
# and prints an AGENTS.md snippet for other agents

Use --global to install it once for every project into your home config instead:

install globally
npx layerbase agent init --global
# writes ~/.claude/skills/layerbase/SKILL.md

The command fetches the always-current skill from layerbase.com/skill.md and falls back to the copy bundled in the npm package when offline.

Install it by hand or in another agent

If you install nothing, download the skill directly. It is a single markdown file in the standard SKILL.md format (a name and description in the frontmatter, then the instructions):

download the skill
curl -o SKILL.md https://layerbase.com/skill.md

For Codex and other agents that read an AGENTS.md file, add this pointer so the agent knows the skill exists and where its facts come from:

AGENTS.md snippet
## Layerbase

When the task involves managed databases, caching, or search, or migrating off a
hosted database provider, use the Layerbase skill. Before quoting any Layerbase
price, plan limit, or capability, fetch https://layerbase.com/agents.md (plain
markdown, always current). Skill source: https://layerbase.com/skill.md

The capability endpoint

The skill instructs the agent to read layerbase.com/agents.md before stating any fact. That document is generated from Layerbase's own source, so the plan tiers, prices, database limits, engine list, branchable engines, migration sources, and hostable apps are always current. This is what keeps an agent from quoting a price it remembered from months ago.

What agents can do

The skill wires together three surfaces an agent can drive:

Capability endpoint

Read agents.md for live prices, limits, engines, and migration sources before making any claim.

REST API

Create, list, query, back up, and branch cloud databases over HTTPS with a personal sk_ API key. See the API reference.

CLI

Drive the same operations from a terminal or CI with the layerbase CLI, authenticated headlessly via LAYERBASE_API_KEY. It also runs migrations end to end (migrate and import) and creates transient, per-run databases for CI.

Codebase audit

Scan dependencies, env files, and CI config for providers like Neon, Supabase, PlanetScale, Upstash, Turso, and Algolia, then map them to Layerbase engines and migration paths, asking what you pay before claiming savings.