add-provider

$npx mdskill add ThinkInAIXYZ/deepchat/add-provider

Adds a DeepChat LLM provider through reviewed source changes.

  • Developers need to integrate a new LLM provider into DeepChat.
  • Depends on provider registry, defaults, and model catalog files.
  • Decides provider type based on API compatibility and auth requirements.
  • Generates source code changes for provider configuration and behavior.

SKILL.md

.github/skills/add-providerView on GitHub ↗
---
name: add-provider
description: Add a DeepChat LLM provider through explicit reviewed source changes. Use when a developer asks Codex to add a provider, provider profile, upstream provider config, model catalog mapping, provider auth behavior, or a special provider adapter in this repository.
---

# Add Provider

## Goal

Generate DeepChat provider integration changes against the current provider architecture. Keep
provider display data in `PublicProviderConf`, map runtime behavior to known transports, and use a
special provider implementation only when the API behavior requires one.

## Required Inputs

Collect or derive these before editing source:

- Provider ID in kebab case.
- Display name.
- API type or known transport family.
- Default base URL.
- Auth type: API key, no auth, OAuth, profile credentials, or provider-specific credential.
- Model metadata source: built-in config, provider-db, config-db, live model fetch, or custom only.
- Test model ID and check strategy.
- Official website, API key URL, docs URL, model list URL.
- Request quirks: headers, endpoint suffixes, route rewrites, streaming shape, tool-call support,
  reasoning support, image/audio/embedding endpoints, or proxy requirements.

## Supported Paths

### OpenAI-Compatible API

Use this when the provider supports OpenAI Chat Completions or Responses-compatible HTTP APIs.

Typical files:

- `src/main/provider/defaults.ts`
- `src/main/provider/providerId.ts`
- `src/main/provider/providerRegistry.ts`
- `src/shared/providerDbCatalog.ts` when models come from the public provider database
- `test/main/**` provider registry or creation tests

### Existing Native Transport

Use this when the provider maps to an existing DeepChat transport such as Anthropic, Gemini, Vertex,
Azure, Bedrock, Ollama, or ACP.

Typical files:

- `src/main/provider/defaults.ts`
- `src/main/provider/providerRegistry.ts`
- Settings components only when the existing generic form lacks required fields
- Focused tests for provider creation and connection checks

### Special Provider

Use this when auth, request shape, streaming, discovery, or error handling differs from existing
transports.

Typical files:

- `src/main/provider/providers/<providerName>Provider.ts`
- `src/main/provider/<providerName>Adapter.ts`
- `src/main/provider/managers/providerInstanceManager.ts`
- `src/shared/contracts/routes/*` and `src/renderer/api/*Client.ts` for interactive auth
- `src/renderer/settings/components/*` for provider-specific settings UI
- Main and renderer tests covering the new behavior

## Guardrails

- Do not introduce `ProviderRuntimeDefinition`, generated runtime manifests, or runtime package-name
  inference.
- Do not install provider SDK packages automatically.
- Do not execute provider logic in the renderer.
- Do not store new OAuth credentials in provider API-key fields.
- Do not add a special provider when a known transport and explicit config are sufficient.
- Reject the request when the required inputs cannot identify a safe path.

## Workflow

1. Read `docs/features/provider-runtime/spec.md` when the provider work touches the provider runtime
   scope. Also read `plan.md` and `tasks.md` if they exist for an active provider-runtime goal.
2. Inspect the current provider files before editing:
   - `src/main/provider/defaults.ts`
   - `src/main/provider/providerId.ts`
   - `src/main/provider/providerRegistry.ts`
   - `src/main/provider/aiSdk/providerFactory.ts`
   - `src/main/provider/managers/providerInstanceManager.ts`
   - `src/renderer/settings/components/ProviderApiConfig.vue`
3. Classify the request into one supported path.
4. Add the smallest explicit source changes for that path.
5. Add or update tests that prove provider creation, auth handling, and model discovery behavior.
6. Update the active SDD `tasks.md` entries as the work lands, when an active tasks file exists.
7. Run:

```bash
pnpm run format
pnpm run i18n
pnpm run lint
```

Run focused main/renderer tests for any touched provider code.

## Output Checklist

Report:

- Provider ID and API type.
- Selected path.
- Files changed.
- Runtime transport or special provider class.
- Credential storage location.
- Model metadata source.
- Check strategy and test model.
- Validation commands run.

More from ThinkInAIXYZ/deepchat

SkillDescription
algorithmic-artCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
computer-useDrive native desktop apps through DeepChat's built-in Computer Use tools. Use when the user asks to operate, inspect, automate, or perform a GUI task in a real desktop application.
cua-driverDrive a native macOS app via the cua-driver MCP server or CLI — snapshot its AX tree, click/type/scroll by element_index, verify via re-snapshot. Use when the user asks you to operate, drive, automate, or perform a GUI task in a real macOS application on the host (e.g. "open a file in TextEdit", "navigate to /Applications in Finder", "click the Save button in Numbers").
deepchat-data-importHelp developers build third-party tools that import, inspect, migrate, or analyze DeepChat data. Use when Codex needs to work with DeepChat provider configuration, model configuration, MCP/app settings, sessions, messages, legacy chat data, `agent.db`, `chat.db`, SQLCipher encrypted SQLite, Electron safeStorage wrapped passwords, Tauri importers, or native macOS/Windows/Linux data access.
deepchat-releasePrepare and publish DeepChat releases in this repository. Use when Codex needs to bump the app version, update CHANGELOG.md, keep release notes bilingual from v1.0.1 onward with English bullets first and Chinese bullets second, run release checks, create or update versioned release branches such as release/v1.0.1, continue a half-finished release, fast-forward main with the documented release flow, create or push version tags, or clean up release branches after publishing.
deepchat-sddUse before substantial DeepChat code, configuration, documentation, test, build, feature, issue, refactor, or architecture changes that need a durable spec. Skip trivial style fixes, small localized logic changes, routine docs edits, and simple bugs unless the developer asks for SDD. Classify substantial work into feature SDD, complex-bug issue spec, or architecture SDD; ask before optional GitHub issue sync unless the developer explicitly requested sync.
deepchat-sdd-cleanupUse only when a developer explicitly asks to clean, prune, tidy, or organize DeepChat SDD documentation after implementation and validation. Scans docs/features, docs/issues, and docs/architecture; prefers multi-agent review when available; removes completed issue docs tied to closed GitHub issues, drops stale plan/tasks files from completed feature or architecture goals, and deletes obsolete feature or architecture docs.
deepchat-settingsDeepChat app settings modification (DeepChat 设置/偏好) skill. Activate ONLY when the user explicitly asks to change DeepChat's own settings/preferences (e.g., theme, language, font size...). Do NOT activate for OS/system settings, editor settings, or other apps.
doc-coauthoringGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.
feishu-toolsUse the Feishu/Lark plugin MCP tools for Feishu documents, spreadsheets, knowledge content, and other matching workspace operations.