---
name: prequel-export-quickstart
description: Help the user complete the initial setup of a Prequel Export environment by constructing curl commands to add and manage resources in Prequel Export. The skill walks through the full first-time setup flow, including connecting a Source, configuring a Model, and creating a Recipient, Destination, and Transfer. Use whenever the user mentions Prequel Export setup, onboarding a new customer or recipient, sharing data to a destination, connecting a source, publishing a model, or triggering a transfer.
---

# Prequel Export Quickstart

**Execute curl commands directly using the shell.** This skill is agent-driven: you construct each curl, run it, and report the response back to the user.

**At every call, require the user to set secrets as environment variables before you run the curl.** Never request secrets from the user in-line. Reference secrets as shell variables such as `$PREQUEL_API_KEY` and instruct the user to add any required secrets to their environment before running commands.

## Sources of truth

The OpenAPI spec is authoritative for request bodies, paths, methods, enums, and field names.

The OpenAPI spec is at `https://docs.prequel.co/generated/openapi-generated-2023-12-01.json`. The docs index is at `https://docs.prequel.co/llms.txt`. The human-readable setup order, prerequisites, and walkthrough live in the quickstart guide at `https://docs.prequel.co/export/getting-started/quickstart.md`. Follow the order documented there to guide onboarding.

## Build context before starting

Fetch the human quickstart guide at `https://docs.prequel.co/export/getting-started/quickstart.md` once at the start for the canonical setup order, prerequisites, and per-step pointers. Fetch concept and per-vendor guide pages listed in `https://docs.prequel.co/llms.txt` and OpenAPI entries by `operationId` on demand per step. Do not bulk-fetch the concept pages upfront.

Note: This skill is scoped to Prequel Export only; Prequel Import is out of scope.

## Prequel Export overview

Prequel Export is a developer tool that helps software platforms share tenanted data with their customers by writing it directly into data platforms (Snowflake, BigQuery, Databricks, Redshift, S3, Postgres, etc.) owned by each customer. For example, a usage-based-billing platform may share usage events, a marketing platform may share campaign metrics, or an analytics platform may share enriched tables, each filtered to the receiving customer's own rows.

## Resource model

- **Source** is the database, warehouse, or object store Prequel reads from. **Model** declares which source table and columns are shared, how rows are filtered per tenant, and how changes are detected.
- **Recipient** is one customer; its `id_in_provider_system` is matched against each model's `organization_column` to filter rows for that customer. **Product** is a named group of models used to share a subset of data with a Recipient.
- **Destination** is where a Recipient receives data. **Transfer** is a single sync run to a Destination. **Magic Link** lets a customer self-serve their Destination credentials.

The setup order is **Source -> Model -> Recipient -> Destination -> Transfer**. For the full conceptual model, fetch the concept pages under `https://docs.prequel.co/export/concepts/`.

## Before starting

Confirm with the user that they have the prerequisites listed in the quickstart guide, namely a Prequel API key, a source whose tables each have a unique ID column and a last-modified timestamp column and can be filtered per tenant, and the Prequel static IP allowlisted on any firewalled source or destination. The same `X-API-KEY` header targets either production or staging. Which environment a request reaches is determined entirely by which key the user provides, not by a different base URL. The base URL is `https://api.prequel.co` (or `https://eu-api.prequel.co` for EU).

If the user has not yet completed the prerequisites, point them at `https://docs.prequel.co/export/getting-started/quickstart.md` and stop.

## How to drive the setup

For each resource the user creates, follow this loop:

1. Refer to the setup order documented in the quickstart guide and tell the user what the next step is and why.
2. Fetch the request schema from the OpenAPI spec by `operationId` using `curl` + `jq` (not WebFetch) to ensure output does not get truncated. The relevant operationIds are `create-source`, `create-model`, `create-recipient`, `create-destination`, and `create-transfer`.
3. Identify which required fields the user has not yet supplied. For per-vendor Source and Destination fields, point them at the matching guide under `https://docs.prequel.co/export/sources/` or `https://docs.prequel.co/export/destinations/`. Ask for missing fields in plain language and group related fields in a single question. Secrets are excluded from this list, since the user must export them as environment variables.
4. Construct the full curl command with user-supplied values inlined and secrets referenced as shell variables such as `$PREQUEL_API_KEY`.
5. Confirm the required environment variables are exported in your shell. If any are missing, stop and instruct the user to export them before continuing.
6. Run the curl using the shell. Show the user the exact command you ran and the response you received.
7. On a 2xx response, capture any returned identifiers that downstream resources will need (such as `source_id`, `recipient_id`, and `destination_id`). On a non-2xx response, surface the response verbatim, point at the relevant docs page or spec field, and propose a fix.
8. Move on to the next resource.

After creating a Source, validate connectivity with `POST /sources/{source_id}/test-connection` before configuring a Model.

## Verification

Verify the pipeline at each stage:

1. The Source test connection succeeded.
2. The Model published without validation errors (it validates against the Source unless `skip_model_validation` is set).
3. The Transfer reached a succeeded status. Poll `GET /transfers/{transfer_id}` or `GET /destinations/{destination_id}/transfers`.
4. Rows arrived in the Destination, filtered to the Recipient's `id_in_provider_system`. The `_transfer_status` table in the destination schema records each model's outcome.

If any check fails, surface the failing response and the resource ID to the user. Re-fetch the relevant spec entry and docs page before suggesting a fix. Do not propose blind retries, since they mask schema, auth, or permissions issues that will recur on the next resource.
