The AI Prompt
Copy the entire block below and paste it as your first message to the AI assistant.
You are helping to import competitors into an RRS.org sailing event via the API. Work through the following steps in order, pausing for user input when required.
---
## Step 1 — Upload the competitor file
Ask the user to upload their competitor spreadsheet or CSV file. Once you receive the file, read all rows and identify the column headers.
---
## Step 2 — Map columns to API fields
Attempt to map each column to one of the following API fields:
| API field | Description
|-----------------|------------------------------------------------------------------------------
| competitor_id | A unique identifier for each entry (required; use row number if none exists)
| sail_number | Sail number, optionally with nationality prefix (e.g. "GBR 1234", "USA 5")
| country_code | 3-letter IOC/World Sailing nationality code (e.g. GBR, USA, AUS, FRA)
| first_name | Skipper / helm first name
| last_name | Skipper / helm last name (or full name if first name is not available)
| boat_name | Name of the boat
| boat_class | Class of the boat
| division | Division or fleet name
| club_name | Club affiliation
| email | Contact email address
| phone | Contact phone number (must be in international format, e.g. +441234567890)
| mna_code | World Sailing MNA code (Standard three-letter IOC country abbreviations used during international events)
| mna_number | Competitor's MNA membership number
If any column cannot be confidently matched to a field, show the user a table listing the unmatched columns and sample values, and ask them to identify each one before continuing.
---
## Step 3 — Validate phone numbers
For each competitor that has a phone number:
1. If the number already starts with + or 00 followed by a country dialing code, it is valid — keep it as-is.
2. If not, attempt to convert it to international format using the competitor's country_code value (e.g. if country_code is GBR, add +44 and remove any leading 0).
3. If you cannot determine the correct international format, list those competitors and ask the user to supply the corrected phone numbers before you proceed.
4. Leave the phone field empty for any entry whose number you cannot resolve.
---
## Step 4 — Validate MNA codes
MNA codes should be recognised World Sailing Member National Authority abbreviations. Flag any value that looks like a full country name, a two-letter country code, or otherwise non-standard (e.g. "Great Britain", "GB", "United States"), and ask the user to confirm or correct those values before proceeding.
---
## Step 5 — Get the Event UUID
Ask the user:
"Please provide the Event UUID for this event. You will find it on the Event Panel page on RRS.org — look for the UUID field in the event details section at the top of the panel."
---
## Step 6 — Confirm before importing
Show a summary:
- Number of competitors to be imported
- Any rows with unresolved warnings (phone format, MNA codes, etc.)
- The event UUID you will use
Then ask: "Shall I proceed with importing these [N] competitors to event [UUID]?"
---
## Step 7 — Make the API call
Send a single HTTP POST request to:
POST https://www.racingrulesofsailing.org/api/competitors
Content-Type: application/json
Request body structure:
{
"uuid": "[event UUID from user]",
"source": "rrs-ai-import",
"competitors": [
{
"competitor_id": "[unique id — required]",
"sail_number": "",
"country_code": "",
"first_name": "",
"last_name": "",
"boat_name": "",
"boat_class": "",
"division": "",
"club_name": "",
"email": "",
"phone": "",
"mna_code": "",
"mna_number": ""
}
]
}
Rules:
- Use an empty string "" (not null) for any field with no value.
- competitor_id must be unique for each row. If the file has no registration ID, use the row number as a string ("1", "2", "3", ...).
- This import replaces all competitors previously imported via API for this event. Competitors entered manually in RRS.org are not affected.
---
## Step 8 — Report the result
- HTTP 200: Report success — "Successfully imported [N] competitors."
- Any other status: Show the full error response to the user and ask how they would like to proceed.
Note: Individual competitor errors (e.g. unresolvable phone numbers) are recorded by RRS.org and can be reviewed on the Event Panel. A 200 response means the overall import was accepted even if some individual records had warnings.