Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

provider-onboarding

БесплатноБез исполняемых скриптовНе проверен

Rules, checklist, credential selection machinery, multi-source handover, delegated refresh contract, and test discipline for onboarding new quota providers or…

kunchenguidот kunchenguid★ 182 звезды на GitHub

Об этом скилле

Provider Onboarding & Credential Architecture

This document defines the requirements, shared machinery, and safety invariants for onboarding new quota providers or modifying existing adapters in quota-axi.

Clean-Room & Dependency Policy

  • Clean-room implementation: Adapter behavior (retry-after handling, snake/camel field tolerance, window parsing) must be an original implementation derived solely from the vendor's own HTTP/OAuth behavior. quota-axi carries no vendored third-party adapter code. The Z.AI adapter is the single attribution exception (derived from opencode-glm-quota, MIT) credited in src/providers/zai.ts.
  • HTTP & proxy handling: Remote HTTP requests must route through src/lib/http.ts (providerFetch) so standard HTTP_PROXY, HTTPS_PROXY, and NO_PROXY policies apply consistently without leaking proxy credentials in logs. Do not use global fetch directly.
    • Node 26 compatibility: src/lib/http.ts pairs the installed undici build's ProxyAgent with that same build's fetch because Node's built-in global fetch only accepts dispatchers from its bundled undici, and Node 26 rejects external ProxyAgent instances with InvalidArgumentError: invalid onError method.
  • Process table reads: Any process-table inspection (e.g. Antigravity loopback detection or Claude process checks) must route through currentUserProcessListArgs in src/lib/process.ts to handle platform flag differences portably (Linux procps rejects BSD -x alongside -u).

Provider Onboarding Checklist

When adding a new provider or migrating an existing adapter:

  1. Enumerate every source in ownership-stability order:

    • Declare source priority via a named constant (e.g. COPILOT_SOURCE_ORDER).
    • Distinguish absent, structurally_invalid, unsupported, read_error, and resolved (stored-valid or stored-expired) at the typed local resolution boundary.
    • Route Pi agent entries through classifyPiAuthEntry in src/lib/pi-auth-store.ts.
    • Derive credentialPresent once from local resolution rather than ad hoc at call sites.
  2. Separate local resolution from the bounded read-only liveness probe:

    • Enroll stored-expired credentials instead of skipping them.
    • Never infer liveness from presence alone.
    • Classify probe outcomes as usable, live_no_quota, definitively_rejected, or transient.
    • Only a first-party HTTP 401 or 403 is an authentication verdict. Server errors, rate limits, network timeouts, or schema mismatches are request failures, not auth verdicts.
  3. Handover only after definitive credential failure:

    • An absent source is never marked degraded.
    • A present-but-broken source superseded by a working sibling is marked degraded on fresh readings only (state.degradedSources).
    • Stale means last-known cache.
    • Never exchange a refresh token, and never retain, log, render, cache, or send its value. Delegated refresh checks presence only; Pi brokers may read a stored refresh value only to classify it as a usable literal, then discard it.
  4. Add comprehensive adapter regression tests:

    • Test cases: primary healthy, stored-expired plus live sibling, structurally invalid present, absent source, all rejected, refreshable expired, and transient failure stops handover.
    • Extend the cross-provider invariant table in test/credential-contract.test.ts.

Credential Selection Machinery

Credential selection is shared in src/providers/credential-selection.ts:

  • Advisory stored expiry: Stored expiresAt or expired fields are advisory only within a source, never a verdict or a reason to reorder declared sources.
  • Empirical testing: Stored-expired credentials are tested in that source's fixed priority position before any sign-in or expired verdict. An empirically live credential always wins.
  • Transient failures: Network errors, 5xx responses, or timeouts must never switch candidates within one source or become auth verdicts.
  • Adapters using selection: Grok, Codex, Kimi, Command Code, Copilot, OpenCode Go, Devin, and Muse route through selectCredential. Codex, Kimi, Copilot, and Devin call it once per source so each provider's ownership-stability order remains authoritative.
  • Probe token safety: A broker's expired resolution carries the stored token for probe use only; it must never be logged, cached, or rendered.
  • Profile-only mode: --profile-only is the fail-closed single-account quota probe for Claude and Codex: it requires CLAUDE_CONFIG_DIR or CODEX_HOME, reads only that profile's native credential file, and bypasses alternate sources, delegated refresh, and quota cache access (full JSON keeps non-secret account/source/attempt evidence; ordinary output stays redacted). Omitting the flag must preserve legacy discovery and cache behavior. Contract: README Profile-only quota reads.

Multi-Source Handover & Degrade

Полный SKILL.md на GitHub

Установить provider-onboarding в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл provider-onboarding?

Rules, checklist, credential selection machinery, multi-source handover, delegated refresh contract, and test discipline for onboarding new quota providers or modifying existing provider adapters in quota-axi.

Как установить скилл provider-onboarding?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл provider-onboarding запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить provider-onboarding с