Coding agents (Agent Skill)
A coding agent works best on PotaLab Base when it has three things:
- the MCP server, to read your project;
- the Agent Skill, so it knows the rules;
- the project URL and key, in your app.
The dashboard shows all three under API → Connect an AI agent.
Install the skill
Section titled “Install the skill”npx -y -p @potalab/base-cli potalab base skill install # Claude Code, Cursor and Codexnpx -y -p @potalab/base-cli potalab base skill install --agent claude| Agent | File |
|---|---|
| Claude Code | .claude/skills/potalab-base/SKILL.md |
| Cursor | .cursor/rules/potalab-base.mdc |
| Codex | a managed block in AGENTS.md (the rest of the file is kept) |
A copy you edited is never overwritten without --force. potalab base skill show prints the skill.
The skill tells the agent to:
- add RLS and at least one policy in the same migration as every new table;
- check before applying, with
db push --dry-run --policy-gate errorandpotalab base test rls; - leave destructive actions to you;
- keep secret keys out of the app;
- treat database content as untrusted.
Connect your app
Section titled “Connect your app”npx -y -p @potalab/base-cli potalab base initIn a folder with a package.json, init writes the local URL and the publishable key into .env.local:
- The variable prefix follows the framework:
NEXT_PUBLIC_,VITE_orEXPO_PUBLIC_. - It adds
.env.localto.gitignore. - Existing values are kept.
- It never writes a secret key. Use
--no-app-envto skip this step.
Guardrails
Section titled “Guardrails”- Permission gate:
- When an agent, CI or a script runs
db push, it refuses migrations that expose data, such as a public table without RLS. - The MCP tools
apply_migrationandexecute_sqlwrites do the same. - An explicit
--policy-gateor[db] policy_gatesetting changes this, and the change is reported. See the CLI and MCP pages.
- When an agent, CI or a script runs
- Acknowledgements: an agent cannot acknowledge a risky change on its own unless the MCP operator allows it (
--allow-policy-ack). - Confirmations:
- MCP deletions need
confirmset to the exact name, and everyexecute_sqlwrite needs it set to the project ref. db reset,db restoreandfunctions deleteask you to type the name, or need--yes --confirm <name>.
- MCP deletions need
- RLS tests (optional): with
require_rls_tests = true, migrations are applied only when the RLS probes pass. - Read-only SQL: read-only queries run in a server-side
READ ONLYtransaction.
The CLI does not create temporary projects for agents.