finding-llm-gateway-migration-candidates

द्वारा posthog

Finds and ranks callers that could move from services/llm-gateway to PostHog/ai-gateway. Use when asked what to migrate next, to find low-risk gateway…

npx skills add https://github.com/posthog/posthog --skill finding-llm-gateway-migration-candidates

Finding LLM gateway migration candidates

Use services/llm-gateway/PARITY.md as the current contract decision record. If implementation evidence contradicts it, run /auditing-llm-gateway-parity before ranking candidates.

This skill produces a point-in-time shortlist. Do not turn the parity document into a fleet-wide migration tracker.

Discover callers

Search the current default branches for Python gateway use, including:

  • LLM_GATEWAY_URL, LLM_GATEWAY_API_KEY, and product-slug URLs
  • get_llm_client, get_async_llm_client, and get_async_anthropic_gateway_client
  • direct OpenAI, Anthropic, or agent SDK clients configured with a gateway base URL
  • Python product names from services/llm-gateway/src/llm_gateway/products/config.py
  • deployment, sandbox, workflow, and secret wiring in other PostHog repositories

Trace each result to the production call site. Exclude tests, development-only tools, dead code, and callers already configured exclusively for Go. Treat shared worker configuration as evidence about availability, not proof that every call in that process uses Go.

Search open and recently merged PRs across involved repositories before proposing work. A migration may already be underway even when the default branch still uses Python.

Prove the production path

Before classifying a caller, follow it through every runtime boundary:

  1. Find the API, task, workflow, schedule, or command that invokes it.
  2. For Temporal, map the workflow and activity to the exact task queue, then map that queue to its deployed worker.
  3. Inspect every environment overlay that runs the caller. Do not borrow configuration from another worker in the same product.
  4. Resolve the configured URL by host and path. Variable names are not proof: an AI_GATEWAY_URL can still contain a Python product-slug URL.
  5. Confirm the current call can succeed. A broad exception handler with a deterministic fallback can hide missing credentials or a route that never runs.

A missing phs_ credential is deployment work, not a parity blocker. Once the intended paying team is known, create a project secret with llm_gateway:read in the PostHog dashboard and fund or configure that team wallet as part of the migration. A secret reference proves only that a credential is injected; verify ownership, scope, and funding during implementation or rollout.

Inventory each candidate

Record only the contracts that affect the migration decision:

  • user-facing use case and production entry point
  • credential source and trusted authorization policy
  • spend owner, budget enforcement, current Python billing behavior, and the team wallet that should own Go spend
  • API shape and model as one pair, provider, streaming, tools, and structured output
  • distinct ID, trace, product, team, and custom attribution
  • retry, timeout, fallback, and error behavior
  • deployment and egress changes needed to activate and roll back the route

Do not infer requirements from a product name. Read the call and its configuration.

Check model and API shape together. Python can expose an Anthropic model through OpenAI Chat Completions, while Go's native routes do not generally cross-translate shapes. A migration may need both a gateway change and an SDK-shape change.

Separate billing identity from event attribution. Go debits the credential's team. A caller-supplied team_id or ai_product property can preserve reporting context but cannot select the wallet.

Classify readiness

Match the inventory to the parity record and current Go implementation:

  • Ready: required contracts are supported and the remaining work is client, test, or deployment wiring.
  • 🔎 Verify: support probably exists, but model availability, wire behavior, billing, attribution, or deployment configuration needs a targeted check.
  • Blocked: migration would lose a required auth, policy, billing, provider, API, or attribution contract.
  • 🚧 In progress: an open or recently merged PR already owns the migration.

Name the exact evidence for every status. An existing Python helper is migration effort, not a blocker. An ai_product property is telemetry, not trusted identity or billing policy.

Python's unbilled flag is not a blocker when an internal workload should debit a PostHog-owned team wallet for spend attribution. Verify that the Go credential resolves to that team. Treat billing as blocked only when migration would charge a customer incorrectly, lose required customer budget policy, or violate a requirement to debit no wallet.

Use ✅ when the production entry point, worker or process, intended paying team, model and API pair, attribution conversion, and rollback path are supported by evidence. The token itself may still need to be created and wired. Use 🔎 when the spend owner, required policy, runtime behavior, or another migration contract is unknown.

Rank the shortlist

Prioritize candidates that:

  1. Have no ⛔ contract.
  2. Use a shared Go-capable builder or a stock SDK with a simple base URL change.
  3. Already use a Go-supported model, provider, and API shape.
  4. Need informational attribution rather than trusted product identity.
  5. Can use a customer wallet intentionally or a PostHog-owned wallet for internal spend.
  6. Have a narrow deployment boundary, explicit fallback, and cheap verification path.

Lower the rank for broad shared-process switches, unverified billing changes, cross-repository deployment work, or missing production tests. Do not rank by code size alone.

Report candidates

Return a small decision-oriented table with:

CandidateReadinessWhyRequired workEvidence gaps

List the strongest ready candidate first. Name the exact production process and deployment for each candidate. For blocked callers, state the missing Go contract and where it was verified. For in-progress work, link the existing PR instead of proposing duplicate work. For 🔎 candidates, state the one check that would promote or reject them.

Do not modify callers while running this skill. Once a candidate is selected, run /migrating-llm-gateway-callers for that caller.

posthog की और Skills

managing-experiment-lifecycle
posthog
प्रयोग स्थिति परिवर्तनों का मार्गदर्शन करता है: लॉन्च करना, रोकना, फिर से शुरू करना, समाप्त करना, वेरिएंट भेजना, संग्रहीत करना, रीसेट करना और डुप्लिकेट करना। पूर्व शर्तों को शामिल करता है,…
official
configuring-experiment-analytics
posthog
Configures the analytics side of a PostHog experiment — exposure criteria (default `$feature_flag_called` vs custom exposure events), primary and secondary…
official
error-tracking-hono
posthog
PostHog द्वारा Hono के लिए त्रुटि ट्रैकिंग
official
error-tracking-react
posthog
PostHog द्वारा React के लिए त्रुटि ट्रैकिंग
official
integration-android
posthog
Android अनुप्रयोगों के लिए PostHog एकीकरण
official
integration-ruby
posthog
किसी भी Ruby एप्लिकेशन के लिए Ruby SDK का उपयोग करते हुए PostHog एकीकरण
official
tuning-incremental-sync-config
posthog
एक सिंक का कॉन्फ़िगरेशन ExternalDataSchema पर रहता है और इसे external-data-schemas-partial-update के माध्यम से कभी भी बदला जा सकता है। अधिकांश परिवर्तन गैर-विनाशकारी होते हैं (अगले सिंक पर प्रभावी होते हैं), लेकिन कुछ (sync_type बदलना, प्राथमिक कुंजियाँ बदलना) को सिंक किए गए डेटा को दूषित होने से बचाने के लिए सावधानीपूर्वक संभालने की आवश्यकता होती है।
official
instrument-integration
posthog
इस कौशल का उपयोग किसी एप्लिकेशन में PostHog SDK जोड़ने के लिए करें। इसका उपयोग PostHog को पहली बार सेट करते समय या PRs की समीक्षा करते समय करें जिनमें PostHog इनिशियलाइज़ेशन की आवश्यकता हो। इसमें SDK इंस्टॉलेशन, प्रोवाइडर सेटअप और बुनियादी कॉन्फ़िगरेशन शामिल है। किसी भी फ्रेमवर्क या भाषा को सपोर्ट करता है।
official