Add or Update AI Provider Models

VerifiedSafe

Add, update, or retire AI provider model options (OpenAI, Anthropic, Google) in a BYOK app and verify native structured output support.

Sby Skills Guide Bot
DevelopmentAdvanced
10/20/2026
Claude CodeCursor
#ai-models#structured-output#provider-integration#byok#unit-tests

Recommended for

Automated summary

A step-by-step guide for adding, updating, or retiring an AI provider model (OpenAI, Anthropic, Google) in a BYOK theme generator, while verifying that each model requests native structured output.

Strengths

  • Concrete checklist spanning type definitions, default model, unit tests, and e2e caveats
  • Flags that model IDs are passed straight through to the provider and only fail at request time, so docs must be checked
  • Documents the default-model fallback that keeps users from being stranded when a model is retired
  • Names the exact test that runs every listed model through its real provider with a stubbed fetch and asserts JSON-schema output

Limitations

  • Hard-wired to one repository layout (app/types/ai.ts, server/utils/aiGenerate.ts), so the paths are not portable
  • Assumes a specific AI SDK version and file structure that may drift over time
  • Skips real generation coverage because the e2e specs mock /api/ai/generate
When to use it

Use it when a provider retires a model, the model list has gone stale, or a new model or provider must be added to the selector.

When not to use it

Avoid it for prompt or output-schema design, or on projects that don't use this AI SDK integration.

Security analysis

Safe
Quality score82/100

The skill is a project-specific maintenance guide: it directs edits to named TypeScript files, runs unit tests via pnpm, and optionally installs a provider SDK. There are no destructive commands, no obfuscated or base64 payloads, no network exfiltration of secrets or tokens, and no attempts to disable safety controls. The only execution-adjacent actions (pnpm add, pnpm vitest) are ordinary development operations with legitimate purpose, so it is low risk.

Findings
  • •Step 3 instructs `pnpm add @ai-sdk/<provider>`, which fetches and installs third-party packages from the npm registry — legitimate for the task but introduces normal supply-chain exposure; the package name is supplied via user argument, so it should be verified before install.
  • •Step 6 references a real API key entered through the app UI and correctly warns it must never be committed; no key value is handled or transmitted by the skill itself.
How this analysis is made

Examples

Add an Anthropic model
Add claude-sonnet-4-5 to the Anthropic model list in app/types/ai.ts with a short description, then run the useAiSettings and server unit tests.
Retire a stale model
Retire gpt-4o from AI_MODELS, make sure DEFAULT_AI_SETTINGS.model still matches the first OpenAI entry, and update any tests that assert on the model list.
Add a new provider
Add Mistral as a new provider: extend AI_PROVIDERS, AI_PROVIDER_OPTIONS, AI_PROVIDER_IDS and createProviderModel, install the SDK package, map its errors, and extend the listed-models test.

name: add-ai-model description: Add, update, or retire an AI provider model option for the BYOK theme generator (OpenAI, Anthropic, Google) and verify the provider requests native structured output for it. Use when model lists go stale or a new provider/model is requested. argument-hint: "<provider> <model-id> [label]"

Add or update an AI model: $ARGUMENTS

  1. Verify the model ID against the provider's current documentation. Model IDs change and retire; don't guess. The server passes the string straight to the provider, so a bad ID only fails at request time.
  2. Model list: edit AI_MODELS in app/types/ai.ts (label, value, one-line description). The first model for a provider is its default: it's selected when the user switches providers, and resolveAiModel substitutes it for a saved ID that's no longer listed, so retiring a model never strands users. DEFAULT_AI_SETTINGS.model must stay equal to the first OpenAI model (a unit test checks this). Prefer stable models over previews, which providers retire with little notice.
  3. New provider (rare): add it to AI_PROVIDERS and AI_PROVIDER_OPTIONS, and to AI_PROVIDER_IDS and createProviderModel in server/utils/aiGenerate.ts (the route's zod enum uses AI_PROVIDER_IDS). Install the @ai-sdk/<provider> package with pnpm add. Map provider-specific errors in server/utils/aiErrorHandler.ts, and extend the "listed models" test with the provider's request shape.
  4. Structured output: server/utils/aiGenerate.ts calls generateText with Output.object({ schema }) (AI SDK 7), and the system prompt goes in instructions. System messages inside messages are rejected. The "listed models" test in tests/unit/server/utils/aiGenerate.test.ts sends every listed model through its real provider (with fetch stubbed, no key needed) and asserts it requests native JSON-schema output. Reasoning models (GPT-6, Claude Opus 5.5) reject the forced tool call older SDK paths use, so a model that fails this test won't work in production.
  5. Tests: update tests/unit/composables/useAiSettings.test.ts and any tests that assert on model lists, then run pnpm vitest run tests/unit/composables/useAiSettings.test.ts tests/unit/server.
  6. E2E: AI e2e specs mock /api/ai/generate, so they only cover the settings UI. A real end-to-end check needs a key in the app UI via /run-app, and must never be committed.

From the file to a first result

The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.

View the source and supporting files

This download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.

1. Download the file

Download SKILL.md

From the root of a test project, save the file as .skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.

Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.

mkdir -p '.skill-downloads/add-or-update-ai-provider-models-mvda86vx' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/add-or-update-ai-provider-models-mvda86vx/download' --output '.skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md.part' && mv '.skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md.part' '.skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md'

2. Check prerequisites

Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.

No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.

The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.

3. Load the skill

After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.

Claude Code
test -f '.skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md' && test -s '.skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/add-ai-model' && cp -R '.skill-downloads/add-or-update-ai-provider-models-mvda86vx' '.claude/skills/add-ai-model'

Cursor
test -f '.skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md' && test -s '.skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/add-ai-model' && cp -R '.skill-downloads/add-or-update-ai-provider-models-mvda86vx' '.cursor/skills/add-ai-model'

OpenSkills

OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.

Official OpenSkills installation
openskills install './.skill-downloads/add-or-update-ai-provider-models-mvda86vx'

openskills read 'add-or-update-ai-provider-models-mvda86vx'

Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.

For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.

openskills sync

Manual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.

4. Try a first task

Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:

Read .skill-downloads/add-or-update-ai-provider-models-mvda86vx/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.

Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.

Related skills