auditing-llm-gateway-parity
Skill727 starsChanged yesterdayMITView on GitHub
Audits services/llm-gateway against PostHog/ai-gateway and updates services/llm-gateway/PARITY.md from current implementation evidence. Use when either gateway changes auth, attribution, billing, endpoints, providers, models, routing, or metadata; when reviewing a Python gateway change; or when asked to refresh, verify, or report gateway parity. This skill updates the parity record but does not migrate callers.
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 15
Read the current PostHog/ai-gateway main SHA with gh api repos/PostHog/ai-gateway/commits/main and record it as the Go baseline.
- Distinctive: line 16
If the audit is for an in-flight Go change, inspect that PR branch or working tree relative to main.
- Distinctive: line 42
Check both request and response behavior.
- Very specific: line 50
Do not treat caller-supplied telemetry as trusted policy.
- Very specific: line 58
Update services/llm-gateway/PARITY.md with the evidence:
- Distinctive: line 61
Add or remove migration-relevant contracts in the parity map.
- Distinctive: line 62
Update the source SHAs and verification date.
- Very specific: line 63
Keep detailed Go design in PostHog/ai-gateway.
- Very specific: line 65
When a gap closes, name obvious caller classes that are newly eligible to migrate.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Auditing LLM gateway parity
Compare the current implementations of both gateways and update services/llm-gateway/PARITY.md. Keep this audit separate from caller migration.
Record source revisions
- Fetch
origin/masterand record its SHA as the PostHog baseline. - Audit the current working tree, including committed and uncommitted changes relative to that baseline. Do not ignore an in-flight gateway change because it is not on
masteryet. - Read the current
PostHog/ai-gatewaymain SHA withgh api repos/PostHog/ai-gateway/commits/mainand record it as the Go baseline. - If the audit is for an in-flight Go change, inspect that PR branch or working tree relative to
main. Treat its contracts as pending until the change merges; do not record them as currently supported. - Otherwise, inspect an authenticated checkout of
PostHog/ai-gatewayatmain.
Audit implementation code. README files and the existing parity table are starting points, not proof.
Inspect each contract
For the Python gateway, inspect:
services/llm-gateway/src/llm_gateway/api/for routes and wire behaviorservices/llm-gateway/src/llm_gateway/auth/for accepted credentialsservices/llm-gateway/src/llm_gateway/db/required_tables.pyfor the tables the gateway may read; a change adding a table read needs its posthog-cloud-infra SELECT grant landed in every environment firstservices/llm-gateway/src/llm_gateway/products/config.pyfor trusted product policy, models, and billingservices/llm-gateway/src/llm_gateway/rate_limiting/for budgets and limitsservices/llm-gateway/src/llm_gateway/callbacks/for event attributionposthog/llm/gateway_client.pyand real call sites for required contracts
For the Go gateway, inspect:
internal/httpapi/routes.goand dispatch packages for API shapesinternal/auth/andinternal/principal/for credential and identity policyinternal/httpapi/admission.go,internal/ledger/, andinternal/quota/for billing and limitsinternal/catalog/,internal/router/, andinternal/dispatch/for models, providers, translation, and failoverinternal/emitter/and request parsing for attribution and metadatadocs/product.mdfor intended and deferred contracts, verified against code
Check both request and response behavior. Matching route names do not prove parity for headers, streaming, errors, timeouts, retries, billing, or emitted events.
Classify the evidence
- ✅ Supported: the Go gateway satisfies the contract.
- ⛔ Blocking: an active use case would lose auth, trusted attribution, billing policy, API, provider, or wire behavior.
- 🔎 Verify: support exists, but a caller must confirm configuration or behavior.
Do not treat caller-supplied telemetry as trusted policy. An ai_product event property does not replace product authentication, authorization, or billing.
Do not treat Python's unbilled flag as an automatic blocker. An internal workload can move to Go with a PostHog-owned team credential when debiting that wallet is the intended way to attribute PostHog spend. It is blocked only when it must preserve customer-specific billing policy or must debit no wallet.
For each difference, identify at least one affected use-case class. Remove details that do not change a migration decision.
Update the parity record
Update services/llm-gateway/PARITY.md with the evidence:
- Move use cases between supported, blocked, and verify sections.
- Add or remove migration-relevant contracts in the parity map.
- Update the source SHAs and verification date.
- Keep detailed Go design in
PostHog/ai-gateway.
When a gap closes, name obvious caller classes that are newly eligible to migrate. Do not modify those callers unless the user also asks for migration work. Use /migrating-llm-gateway-callers for that separate job.
Validate
Run:
pnpm exec oxfmt services/llm-gateway/PARITY.md .agents/skills/auditing-llm-gateway-parity/SKILL.md
pnpm exec markdownlint-cli2 --config .config/.markdownlint-cli2.jsonc services/llm-gateway/PARITY.md .agents/skills/auditing-llm-gateway-parity/SKILL.md
git diff --checkOther versions1 project uses a version of this.
Word for word · 1
- PostHog/posthog★ 40k100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository124 other files it gives its agents.
- AGENTS.mdAGENTS.md
- common/AGENTS.mdAGENTS.md
- hog/AGENTS.mdAGENTS.md
- proto/AGENTS.mdAGENTS.md
- rust/AGENTS.mdAGENTS.md
- .cursor/rules/django-python.mdcCursor rule
- .cursor/rules/react-typescript.mdcCursor rule
- .cursor/rules/rust.mdcCursor rule
- adding-activity-loggingSkill
- adding-api-scopesSkill
- adding-inbound-webhooksSkill
- adding-inbox-sourcesSkill
- adding-ingestion-warningsSkill
- adding-mcp-store-serversSkill
- adding-personhog-rpcSkill
- adding-product-alertingSkill
- adding-project-secret-api-key-authSkill
- adding-today-highlightsSkill
- adopting-generated-api-typesSkill
- analyzing-experiment-precompute-canarySkill
- analyzing-experiment-query-performanceSkill
- analyzing-insights-across-teamsSkill
- announcing-behavior-changesSkill
- auditing-warehouse-source-coverageSkill
- authenticating-to-clickhouseSkill
- authoring-ci-workflowsSkill
- building-product-empty-statesSkill
- building-the-toolbarSkill
- clickhouse-migrationsSkill
- debugging-ci-failuresSkill
- debugging-local-replaySkill
- debugging-local-task-agent-runsSkill
- debugging-mcp-analyticsSkill
- debugging-signals-pipelineSkill
- debugging-table-access-deniedSkill
- depot-ciSkill
- depot-container-buildsSkill
- depot-github-runnersSkill
- developing-subscriptionsSkill
- django-migrationsSkill
- django-startup-timeSkill
- documenting-warehouse-sourcesSkill
- editing-agents-mdSkill
- establishing-code-ownershipSkill
- extending-hobby-smoke-testsSkill
- extending-personhog-test-harnessSkill
- finding-llm-gateway-migration-candidatesSkill
- fixing-flaky-testsSkill
- formatting-slack-messagesSkill
- gating-production-deploysSkill
- gating-sensitive-actionsSkill
- generating-clickhouse-query-performance-reportsSkill
- hogliSkill
- implementing-mcp-toolsSkill
- implementing-mcp-ui-appsSkill
- implementing-warehouse-sourcesSkill
- improving-drf-endpointsSkill
- improving-mcp-toolsSkill
- ingestion-pipeline-doctor-nodejsSkill
- instrumenting-first-party-metricsSkill
- The first 60 shown.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

