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
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.
Avoid it for prompt or output-schema design, or on projects that don't use this AI SDK integration.
Security analysis
SafeThe 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.
- •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.
Examples
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 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 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
- 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.
- Model list: edit
AI_MODELSinapp/types/ai.ts(label,value, one-linedescription). The first model for a provider is its default: it's selected when the user switches providers, andresolveAiModelsubstitutes it for a saved ID that's no longer listed, so retiring a model never strands users.DEFAULT_AI_SETTINGS.modelmust stay equal to the first OpenAI model (a unit test checks this). Prefer stable models over previews, which providers retire with little notice. - New provider (rare): add it to
AI_PROVIDERSandAI_PROVIDER_OPTIONS, and toAI_PROVIDER_IDSandcreateProviderModelinserver/utils/aiGenerate.ts(the route's zod enum usesAI_PROVIDER_IDS). Install the@ai-sdk/<provider>package withpnpm add. Map provider-specific errors inserver/utils/aiErrorHandler.ts, and extend the "listed models" test with the provider's request shape. - Structured output:
server/utils/aiGenerate.tscallsgenerateTextwithOutput.object({ schema })(AI SDK 7), and the system prompt goes ininstructions. System messages insidemessagesare rejected. The "listed models" test intests/unit/server/utils/aiGenerate.test.tssends every listed model through its real provider (withfetchstubbed, 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. - Tests: update
tests/unit/composables/useAiSettings.test.tsand any tests that assert on model lists, then runpnpm vitest run tests/unit/composables/useAiSettings.test.ts tests/unit/server. - 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 filesThis 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.mdFrom 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 installationopenskills 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 syncManual 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.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.