regenerate-client

Regenerate the StockTrim OpenAPI client from its live Swagger spec with validation checks.

Updated Jul 18, 2025
One-click install
npx skills add https://github.com/dougborg/stocktrim-openapi-client --skill regenerate-client
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: regenerate-client
Source: https://github.com/dougborg/stocktrim-openapi-client/tree/main/.claude/skills/regenerate-client
Command: npx skills add https://github.com/dougborg/stocktrim-openapi-client --skill regenerate-client

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

It solves the problem of keeping an OpenAPI-generated client in sync with a changing live StockTrim API specification, without introducing drift or brittle manual edits.

Core Features & Use Cases

  • Full regeneration pipeline: Regenerates the entire client from the live Swagger spec rather than doing partial, file-by-file updates.
  • Validation and quality gates: Runs spec validation and project checks (including ruff-based fixes) before anything is committed.
  • Safe override mechanism for nullable fields: Applies NULLABLE_FIELDS fixes via scripts/regenerate_client.py instead of editing generated code.
  • Git workflow guardrails: Enforces feature-branch usage and commits only after tests/checks pass, supporting downstream helper/service updates after renames.

Quick Start

Tell your AI to regenerate the StockTrim OpenAPI client by running the full pipeline and committing the validated result on a feature branch.

Frequently Asked Questions about regenerate-client

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I regenerate an OpenAPI client to match a live Swagger spec?

You regenerate the entire client from the live Swagger spec rather than doing partial file-by-file updates, ensuring generated artifacts match upstream changes without manual edits.

How do I handle nullable fields in generated OpenAPI client code without manual edits?

Handle nullable fields by applying NULLABLE_FIELDS fixes through the regenerate_client.py script override mechanism, avoiding brittle manual edits to generated code that would drift on the next regeneration.

What is the best way to keep a generated API client in sync with evolving endpoints?

The best way is running a complete regeneration pipeline that validates outputs with repo quality checks, including ruff-based fixes, before committing only after all checks pass on a non-main branch.

Can I commit regenerated OpenAPI client code directly to the main branch?

No, committing regenerated code requires feature-branch usage enforced by git workflow guardrails, ensuring all tests and quality checks pass before any changes are merged away from main.

Why does my generated OpenAPI client drift behind upstream API spec changes?

Generated clients drift when partial file-by-file updates are applied instead of full regeneration, or when manual edits bypass the script override mechanism for nullable fields and model updates.

Do I need to run spec validation before regenerating an OpenAPI client?

Yes, spec validation and project checks must run before committing regenerated code, ensuring the generated client matches the live API specification and passes all repo quality gates.