Add api

From glowingkitty/OpenMates · View interactive version

Add api is an AI agent skill from the GitHub repository glowingkitty/OpenMates. Integrate a new external API provider (research, wrapper, test script, docs)

How to use this skill

Skill file

Arguments

Parse $ARGUMENTS as the provider name (e.g., openweathermap, spotify, yelp).

If missing, ask the user what API they want to integrate.

Instructions

You are integrating a new external API provider. This is a research-first workflow — never rely on training data for API details.

Step 0: Confirm an Official API

Follow the provider-specific data integration policy in .claude/rules/provider-integrations.md. Use only:

Confirm the official documentation supports the intended use. If that is

unclear, report the gap; do not contact the provider without user instruction

or implement an unsupported fallback.

Record the API documentation URL and review date, the endpoints used, and their

usage, attribution, privacy and rate-limit conditions. Never use a website's own

browser/mobile endpoints, a reseller of another platform's data, browser

automation or platform-specific scraping, and do not bypass access controls.

General on-demand public-page reading follows the separate web.read boundary

in .claude/rules/provider-integrations.md and the guide: honor applicable crawler exclusions, use no proxy

or access-control bypass, and preserve complete extracted text in saved embeds.

That boundary does not authorize a provider-specific connector or hidden API.

Step 0b: Load the Full Guide

python3 scripts/sessions.py context --doc api

Read the guide output carefully — it contains the official-API policy, test script template, and documentation template.

Step 1: Research

Before writing any code:

  1. Search for official API docs — use web search, never assume from training data
  2. Check existing work — look in docs/architecture/, docs/apis/, and backend/shared/providers/
  3. Identify key details:
  1. Present findings to the user and wait for confirmation before proceeding to code.

Step 1b: Create Provider Contract Spec

Before writing provider code, run create-plan or create an inline Plan according

to docs/contributing/guides/spec-driven-development.md.

New provider integrations normally require a full spec because they affect

privacy, contracts, rate limits, cost, error handling, and downstream skills.

The spec must include:

When the provider powers a user-facing feature, app skill, focus mode, embed, or

memory behavior, the spec or inline contract must also define this phase gate:

  1. Implement and test the provider wrapper and the OpenMates CLI behavior against

the dev server first. Mocked OpenMates API calls, mocked SDK clients, stubbed

servers, direct function calls, and fixture replay do not satisfy this gate.

  1. Implement and test npm SDK and pip SDK parity locally against the dev server

for the same provider-backed behavior when it is exposed programmatically.

After local CLI and SDK evidence is green, reproduce or wire the same coverage

into GitHub Actions for CI/daily tests.

  1. Implement web UI, embeds, or Playwright coverage only after CLI and required

SDK evidence are green.

  1. Run deployed Playwright visual smoke for larger web/UI surfaces in both laptop

and mobile viewports, fixing and redeploying any objective rendering, error,

loading, or responsiveness issue, then ask the user to confirm the deployed dev

web behavior works and looks correct before starting Apple parity. Use

Firecrawl only as a recorded fallback when Playwright is impractical or

blocked. *.spec.ts evidence alone is not enough.

  1. Start Apple parity only after CLI, SDK, web, and user-confirmation evidence are

complete, or after an explicit waiver/blocker is recorded. This applies to

Apple UI parity; Apple client logic comes from the Rust core and is not

sequenced behind web.

  1. A new provider is done only with a result video in the final reply: a real

request on the deployed commit answered with this provider's data, recorded

in the web app or, without UI, as a CLI terminal recording ("Mandatory

result video" in .claude/rules/testing.md). Test output alone is not enough.

Step 2: Read Reference Implementation

Read an existing provider as template:

backend/shared/providers/brave/brave_search.py

Key patterns to follow:

Step 3: Create Provider Directory

Create backend/shared/providers/{provider_name}/:

| File | Purpose |

|------|---------|

| __init__.py | Export main functions/classes |

| client.py | Pure API wrapper — NO skill-specific logic |

| models.py | Pydantic request/response schemas |

client.py must include:

Step 4: Create Test Script

Create scripts/api_tests/test_{provider_name}_api.py:

Required features:

Use the template from the guide loaded above.

Step 5: Create API Documentation

Create docs/apis/{provider_name}.md with:

Step 6: Check Privacy & Legal

Read .claude/rules/privacy.md and check if updates are needed:

Ask the user if privacy policy updates are needed for this provider.

Step 7: When No Official API Exists

Report the capability gap and suggest an official API alternative. Do not

reverse-engineer consumer website/mobile interfaces or replace the missing

interface with a scraper, proxy, browser workflow or platform-specific agent

instructions.

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.