regenerate-sdk
Regenerate the Rust SDK from the OpenAPI spec, fix breaking changes, produce a changelog, and run validation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Regenerate the Rust SDK from the OpenAPI spec, fix breaking changes, produce a changelog, and run validation
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
| name | regenerate-sdk |
| description | Regenerate the Rust SDK from the OpenAPI spec, fix breaking changes, produce a changelog, and run validation |
Regenerates the SDK from Privy's OpenAPI spec, produces a changelog with breaking change analysis, fixes compilation errors in wrapper code, and validates the result.
Before starting, familiarize yourself with:
.mise.toml — the pull-openapi and gen-openapi task definitionsscripts/schema-patches/ — jq patches applied to the raw spec before code generationbuild.rs — orchestrates progenitor code generation and subclient extractionallowlist.yml — maps OpenAPI operationIds to Rust method namesRun the mise task to fetch the latest spec, apply patches, and regenerate:
mise run gen-openapi
This runs two sub-tasks:
pull-openapi — fetches https://api.privy.io/v1/openapi.json and pipes it through all scripts/schema-patches/*.jq files in order, outputting openapi.jsongen-openapi — runs cargo-progenitor (nightly) to regenerate crates/privy-openapi/src/lib.rsCommon failure modes:
responses field, unsupported OpenAPI features). You may need to add a new schema patch to work around it.Surface the error output to the developer and stop if you cannot resolve it.
After regeneration, analyze what changed:
Run git diff focusing on:
crates/privy-openapi/src/lib.rs — the generated types and client codeopenapi.json — the processed spec (new endpoints, changed schemas)Run git status to check for newly added or deleted files.
Create a changelog with these sections:
New types, structs, enums, enum variants, fields, endpoints, or methods.
Modified type names, field types, struct fields, enum variants, method signatures.
Deleted types, fields, endpoints, enum variants, or methods.
Flag items as BREAKING if they would cause existing code using the SDK to fail compilation:
Option<T>)Format: - **BREAKING**: Description of what changed
Append the changelog to MANUAL_CHANGELOG.md (NOT CHANGELOG.md — that is auto-generated by release-plz). Add a new date-stamped heading: ## YYYY-MM-DD — OpenAPI Regeneration. If the file doesn't exist yet, create it with the standard header comment (see existing file for format).
Output the full changelog to the developer for review.
Attempt to compile the project:
cargo clippy --all-targets --all-features -- -D warnings
Parse the compiler errors and identify which breaking changes from the changelog caused them.
Fix the hand-written wrapper code to match the new generated types. Files that typically need updates:
src/ethereum.rs — Ethereum wallet operation helpers and doc examplessrc/solana.rs — Solana wallet operation helpers and doc examplessrc/subclients/wallets.rs — Wallet CRUD wrapperssrc/subclients/policies.rs — Policy operation wrapperssrc/subclients/key_quorums.rs — Key quorum operation wrapperssrc/utils.rs — Authorization signature generationsrc/import.rs — Key import utilitiestests/ — Integration test filesexamples/ — Example filesCommon fix patterns:
field_name: None to struct literals.parse().unwrap() or .into() instead of bare string literals/// doc comments to use new typesRe-run clippy after each round of fixes. Repeat until it passes cleanly.
Proceed to Step 4.
Run the integration tests:
cargo test --verbose
Go back to Step 3 — there are remaining type mismatches in test code.
Report success. The regeneration is complete.
If hand-written wrapper code was modified during Step 3:
git diff on the non-generated files.MANUAL_CHANGELOG.md documenting:
src/ethereum.rs to use Quantity instead of removed EthereumSign7702AuthorizationRpcInputParamsChainId")crates/privy-openapi/src/lib.rs is ~7MB. Focus diff analysis on structural changes (new/removed types, changed fields) rather than line-by-line review.build.rs also generates code at compile time ($OUT_DIR/codegen.rs and $OUT_DIR/subclients.rs). If allowlist.yml references operationIds that no longer exist, compilation will fail there.CHANGELOG.md is fully managed by release-plz — do NOT edit it manually. Use MANUAL_CHANGELOG.md for detailed regeneration notes.