thomwebb/gac/adding-provider
Claude Code and agent skill by thomwebb/gac
- community
Checking that the SKILL.md file is still in the repository.
Use when adding a new AI provider to the GAC project (e.g. a new OpenAI-compatible inference service, Anthropic-compatible endpoint, or OAuth-based provider). Lists every file that must be created or edited and the exact registration steps required for the provider to appear in the registry, the `uvx gac init` flow, the README, and the test suite.
Install
npx vskill@latest install thomwebb/gac/adding-providerSKILL.md
Adding a Provider to GAC
Overview
GAC supports 35+ providers via a registry pattern. Adding one means creating a provider class, registering it, listing it in the interactive setup CLI, advertising it in the README, and adding standardized tests. Skipping any step leaves the provider partially wired (e.g. selectable in uvx gac init but not in the registry, or callable but not advertised).
Core principle: every provider lives in five places. Touch all five.
When to Use
Use when:
- A user asks to "add X as a provider"
- You need to support a new OpenAI-compatible inference service (cheapest case — extend
OpenAICompatibleProvider) - You need to support an Anthropic-compatible or custom-protocol provider
Do NOT use for:
- Modifying behavior of an existing provider (just edit its file)
- Adding a new model to an existing provider (no code change needed; users set
GAC_MODEL)
The Five Touch Points
| # | Path | Purpose | |
|---|---|---|---|
| 1 | src/gac/providers/<key>.py | Provider class (NEW file) | |
| 2 | src/gac/providers/__init__.py | Import + register_provider("<key>", Cls) | |
| 3 | src/gac/model_cli.py | Add to providers list in _configure_model; add alias mapping if display name → key derivation doesn't match | |
| 4 | README.md | Add to "Supported Providers" bullet list | |
| 5 | tests/providers/test_<key>.py + tests/test_ai.py + tests/test_model_cli_providers.py | Tests (NEW + edits) |
Step-by-Step
1. Research the API
Before writing any code:
- Find base URL and auth scheme (Bearer token, OAuth, custom header)
- Confirm whether it's OpenAI-compatible (Bearer +
/v1/chat/completions), Anthropic-compatible, or custom - Get one known-good model ID for the default in
model_cli.pyand tests - Get the env var convention used by other tools (e.g.
FOO_API_KEY)
If OpenAI-compatible, you can almost always extend OpenAICompatibleProvider. Check chutes.py, together.py, fireworks.py for templates.
2. Choose the registry key
The registry key is short and lowercase: crof, chutes, groq. It becomes the prefix in GAC_MODEL=<key>:<model>.
The display name in model_cli.py is derived to a key via:
So "Crof.ai" → "crofai". If that doesn't match your registry key, add an alias (see step 5).
3. Create the provider class
For OpenAI-compatible providers, mirror chutes.py:
For Anthropic-compatible: mirror custom_anthropic.py. For OAuth: mirror chatgpt_oauth.py (much more involved — has its own token storage in ~/.gac/oauth/).
4. Register in src/gac/providers/__init__.py
Two edits, both alphabetically ordered with neighbors:
5. Wire into uvx gac init (src/gac/model_cli.py)
Add a tuple (display_name, default_model) to the providers list inside _configure_model. Keep alphabetical.
If the derived key doesn't match the registry key, add a mapping:
If the provider needs extra config (custom base URL, endpoint ID, OAuth flow), branch on is_<name> like Streamlake/Azure/Custom.
6. Update README.md
Add the display name (with .ai/.io suffix if applicable) to the "Supported Providers" bullet list. Keep alphabetical within its line.
7. Add tests
Create `tests/providers/test_<key>.py` — copy tests/providers/test_chutes.py and replace identifiers. The file MUST contain four classes:
Test<Name>Imports— module import + registry membershipTest<Name>APIKeyValidation— missing API key raisesAIErrorTest<Name>ProviderMocked(BaseProviderTest)— inherits the 9 standard HTTP-mocked tests via fixturesTest<Name>EdgeCases— at minimum, null content returns errorTest<Name>Integration— real API call gated by@pytest.mark.integrationand env var
Edit `tests/test_ai.py` — add the registry key to expected_providers in test_provider_registry_complete.
Edit `tests/test_model_cli_providers.py` — add a test_configure_model_<key>_success mirroring test_configure_model_chutes_success.
8. Verify
All of these must pass before claiming done.
Quick Reference Checklist
Common Mistakes
| Mistake | Symptom | Fix | |
|---|---|---|---|
Forgot register_provider call | KeyError: '<key>' from PROVIDER_REGISTRY[<key>] | Add the registration in __init__.py | |
| Display name → key mismatch, no alias | uvx gac init selects provider but GAC_MODEL prefix is wrong (e.g. crofai: not crof:) | Add elif provider_key == "..." mapping in _configure_model | |
Missed tests/test_ai.py update | test_provider_registry_complete fails | Add key to expected_providers set | |
Used pip install instead of uv pip install | AGENTS.md violation | Always use uv pip install | |
Tried to manually bump __version__.py or edit CHANGELOG.md | AGENTS.md violation | Don't — these are auto-managed | |
| Hardcoded base URL instead of env-overridable | Users on enterprise gateways can't redirect | Read <KEY>_BASE_URL env var with fallback default |
Provider Type Cheat Sheet
| API Style | Base Class | Template File | |
|---|---|---|---|
OpenAI-compatible (Bearer + /v1/chat/completions) | OpenAICompatibleProvider | chutes.py, together.py, fireworks.py | |
| OpenAI-compatible with custom auth header | OpenAICompatibleProvider (override _get_headers) | copilot.py | |
| Anthropic-compatible | BaseConfiguredProvider | anthropic.py, custom_anthropic.py | |
| OAuth-based | Custom | chatgpt_oauth.py, claude_code.py, copilot.py | |
| Local/no-auth | OpenAICompatibleProvider (no API key) | ollama.py, lmstudio.py |
Why Each Touch Point Matters
- Provider class: actually implements the API call.
- `__init__.py` registration: makes it callable via
PROVIDER_REGISTRY[key]. Without this, the class exists but is unreachable. - `model_cli.py`: makes it discoverable via
uvx gac init. Without this, users must hand-edit~/.gac.env. - README: marketing/discoverability. Without this, users don't know the provider exists.
- Tests: prevents regressions; the
BaseProviderTestinheritance enforces standard behavior across all providers.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.skills/adding-provider/SKILL.md
Popularity
- Repository stars
- 318
- Repository forks
- 18
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/thomwebb/gac/adding-provider)