/oagen:verify-compatfrom oagen
Verifies generated SDK code preserves backwards compatibility with a live SDK by extracting public API surfaces, generating code with compatibility overlays, and diffing against baselines to detect breaking changes, regressions, or API surface drift.
Ships in oagen. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Verify that generated SDK code preserves backwards compatibility with a live SDK's public API surface.
The compat verification workflow extracts the public API surface from a live SDK, generates code with a compatibility overlay that preserves existing names, and then diffs the result against the baseline. Any regressions (renamed methods, changed signatures, missing exports) are reported as violations.
This is the middle tier of the three-tier testing pyramid:
Extractor interface, ApiSurface type, Language Hints referencesrc/compat/language-hints.ts (nodeHints, resolveHints)src/compat/extractors/node.tssrc/compat/overlay.tssrc/compat/differ.tsCheck for node_modules/@workos/oagen/, or src/engine/types.ts in the current directory, otherwise ask.
<language> (run /generate-emitter first)--sdk-path — must be the real, published SDK<language> (run /generate-extractor first), with hints: LanguageHints properly configured for the target languagedocs/sdk-architecture/{language}.md) exists and documents the real SDK's patternsAll artifacts (surface files, generated output) live inside the emitter project — never in /tmp or other throwaway locations. This ensures they persist across sessions and are available to convenience scripts.
Determine required paths:
project): from argument, or detect from CWD (look for src/plugin.ts or oagen.config.ts), or use AskUserQuestionspec): from argument, or use AskUserQuestionsdk_path): from argument, or use AskUserQuestion{project}/sdk-{language}-surface.json — always in the emitter project root{project}/sdk/ — a subdirectory of the emitter projectValidation: The sdk_path MUST NOT be the same as or inside the output directory. If it is, reject it and ask again.
oagen extract --sdk-path {sdk_path} --lang <language> --output {project}/sdk-{language}-surface.json
This produces sdk-{language}-surface.json in the emitter project root — the baseline snapshot of the live SDK's public API.
Gitignore it — it's a derived artifact:
grep -q 'sdk-\*-surface.json' {project}/.gitignore 2>/dev/null || echo 'sdk-*-surface.json' >> {project}/.gitignore
Verify the output via subagent: Use the Agent tool with subagent_type: Explore to spot-check the extraction. This keeps the SDK's source out of the main context:
Explore the SDK at
{sdk_path}. List all public classes and their public method names. Only report what you actually find — no assumptions.
Compare the subagent's findings against <output-path>/sdk-{language}-surface.json. If the surface looks empty or incomplete, the extractor may need fixes — run /generate-extractor to debug.
Scope to API-relevant symbols: The live SDK may export hand-written classes and interfaces that are not derivable from the OpenAPI spec (e.g., CookieSession, PKCE, Webhooks, signature verification utilities, HTTP client abstractions). These are out of scope for compat verification — the emitter isn't expected to generate them.
After extraction, cross-reference the baseline surface against the OpenAPI spec's operations. Symbols that have no corresponding OpenAPI operation should be noted but excluded from the compat score. Report them separately so the user knows what's excluded:
Out of scope (not in OpenAPI spec): CookieSession, PKCE, Webhooks, ...
In scope (API-derived): 280 classes, 1200 interfaces, ...
This prevents the compat score from being diluted by symbols the emitter can't possibly generate. The goal is to measure how well the emitter preserves the API surface, not how completely it replicates hand-written SDK features.
oagen generate --spec {spec} --lang <language> --output {project}/sdk --api-surface {project}/sdk-{language}-surface.json
The emitter receives the overlay via EmitterContext and uses it to preserve existing method names, class names, and type names where possible. The generated output goes to {project}/sdk/, not a temp directory.
IMPORTANT: Always include --spec so the comparison is scoped to spec-derivable symbols only. Without it, the score includes hand-written SDK features (webhooks, PKCE, etc.) that the emitter can't generate, producing a misleadingly low compat score. Run it with the same config generate used (--config, or oagen.config.ts in the project root): the scope follows the config's mountRules, operationHints and operationNaming, so the classes and methods compared are the ones generate writes — under mountRules: { Pets: 'Animals' } the Animals class, not Pets.
oagen verify --spec {spec} --lang <language> --output {project}/sdk --api-surface {project}/sdk-{language}-surface.json
| Category | Meaning |
|---|---|
public-api | A public class, method, or type was renamed or removed |
signature | A method's parameter list or return type changed |
export-structure | A barrel export is missing or reorganized |
behavioral | A behavioral contract changed (e.g., async to sync) |
| Severity | Action |
|---|---|
breaking | Must fix before shipping — this will break consumers |
warning | Review carefully — may be intentional but could surprise consumers |
For each violation:
symbolPath to locate the affected symbolbaseline vs candidate to understand the changeWhen violations can't be auto-fixed: Some violations indicate structural emitter issues (wrong method signature shape, missing exports). These require changing emitter code directly — the overlay loop can only fix naming mismatches, not structural problems. Read the violation details to determine whether this is an overlay issue or an emitter issue.
Repeat Steps 2 and 3 until violations are resolved:
oagen generate --spec {spec} --lang <language> --output {project}/sdk --api-surface {project}/sdk-{language}-surface.json
oagen verify --spec {spec} --lang <language> --output {project}/sdk --api-surface {project}/sdk-{language}-surface.json
Continue until either all violations are resolved (exit 0) or no further improvement is possible (fix the emitter manually).
For languages where backwards compatibility isn't relevant (full rewrites, new SDKs), skip compat verification:
oagen generate --spec <spec> --lang <language> --output <path> --no-compat-check
{project}/sdk-{language}-surface.json — extracted API surface baseline{project}/sdk/ with compat overlay appliedWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (workos/oagen) — no native marketplace selected
npx claudepluginhub p/workos-oagen9 skills in this plugin
/check-emitter-parityAudit an emitter's coverage of IR fields and produce a structured gap analysis. Use when checking if an emitter handles all IR types, after updating oagen, or verifying emitter completeness. Also triggers for "IR coverage", "emitter audit", "field coverage", "parity check"./generate-emitterScaffold a new language emitter for oagen, implementing the Emitter interface with idiomatic target-language code generation. Use this skill whenever the user wants to add a new target language, generate SDKs for a new language, add Go/Python/Kotlin/Java/etc. support, create an emitter, or asks about code generation for a language — even if they don't use the word "emitter" explicitly. Also triggers when the user mentions "add language support" or "new SDK target"./generate-extractorScaffold a new language extractor for oagen's compat system, implementing the Extractor interface to extract a live SDK's public API surface. Use when the user wants to add backwards-compatibility support, build an extractor, check for breaking changes or regressions, or asks about extracting an API surface for any language — even if they don't use the word "extractor" explicitly. Also triggers for "compat support", "API surface analysis", or "public surface extraction"./generate-sdkOrchestrate generating an SDK for a target language end-to-end. Determines the right scenario (backwards-compatible or fresh) and guides through the correct sequence of sub-skills. Use when the user wants to generate an SDK, add a new language, create SDK bindings, start a new language target, or asks "how do I add X support". Also triggers for "new SDK", "language support", or "scaffold SDK"./generate-smoke-testCreate a smoke test script for a new SDK language that verifies wire-level HTTP parity against the OpenAPI spec and live API baseline. Use when adding smoke tests for a new language, verifying a generated SDK against the real API, or checking HTTP request/response correctness. Also triggers for "integration test", "wire-level test", "HTTP parity", or "end-to-end SDK test"./integrateIntegrate generated SDK code into a live SDK by running `oagen generate --target`. Required for every Scenario A generation cycle — initial setup and ongoing spec updates. Use when the user wants to merge generated code into an existing SDK or integrate emitter output into a live codebase.Other plugins' skills for the same job