- Home
- Skills
- Andrelandgraf
- Fullstackrecipes
- Neon Test Branches
neon-test-branches_skill
- TypeScript
8
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill andrelandgraf/fullstackrecipes --skill neon-test-branches- SKILL.md551 B
Overview
This skill creates isolated Neon database branches for running tests and ephemeral environments. It provisions schema-only branches with automatic cleanup using a TTL, manages environment variables, and coordinates test server lifecycle. Designed for fast, repeatable test runs and CI workflows that need disposable database state.
How this skill works
The skill uses Neon branches that contain only schema, not data, so tests start from a known structure. Each branch gets a TTL after which it is auto-deleted to avoid resource buildup. It also orchestrates a short-lived test server and injects the correct environment variables so test suites connect to the matching branch. Integrations can be triggered from CI or local test runners.
When to use it
- Running integration tests that require a clean database schema per run.
- Creating ephemeral environments for feature previews or QA sessions.
- CI pipelines that need parallel isolated databases to avoid conflicts.
- Local development when you want a disposable database state without manual cleanup.
- Automated end-to-end tests that require predictable schema migrations.
Best practices
- Use short TTLs appropriate to your test duration to minimize orphaned branches.
- Provision schema-only branches to avoid copying production data and reduce costs.
- Rotate environment variables or secrets per branch to prevent accidental cross-use.
- Integrate branch creation and cleanup into CI jobs to ensure deterministic runs.
- Monitor branch counts and TTL expirations to catch configuration issues early.
Example use cases
- CI job creates a Neon branch, runs migrations, spins up a test server, executes tests, and lets TTL auto-clean the branch.
- A pull request preview site uses a branch-per-PR so QA can test against the exact schema for that change.
- Parallel test matrix where each worker receives its own Neon branch to avoid contention.
- Local developer script that creates a short-lived branch for manual testing of DB migrations.
FAQ
No. Branches are schema-only by default to avoid copying production data and to speed up creation.
How are branches cleaned up?
Each branch is created with a TTL. After the TTL expires the branch is automatically deleted to prevent orphaned resources.
Can this be used in CI?
Yes. It is designed for CI workflows and supports orchestration of test servers and environment variable injection for automated jobs.