add-helper-method

Community

Add typed helper methods with safe tests

Authordougborg
Version1.0.0
Installs0

System Documentation

What problem does it solve?

It eliminates the friction and repetition of calling raw generated OpenAPI client endpoints by providing a consistent, ergonomic helper API for domain operations, complete with reliable test scaffolding.

Core Features & Use Cases

  • Thin ergonomic wrappers: Adds an async helper method in stocktrim_public_api_client/helpers/<domain>.py that delegates to the corresponding generated generated/ client call.
  • Transport-layer mocking in tests: Ensures tests mock httpx.MockTransport so authentication and retry middleware execute as in production, not by mocking the helper directly.
  • StockTrim 404 handling convention: Converts the API’s collection-style “not found” behavior (404) into [] (or None where appropriate, e.g., single-entity “find by code”), matching documented quirks.
  • Quality gate compliance: Enforces checks via linting/formatting and unit tests without suppressing issues using # noqa or # type: ignore.

Quick Start

Ask your AI assistant to add a new helper for a specific domain operation in helpers/<domain>.py by wrapping the existing generated endpoint, then create a test that uses httpx.MockTransport to verify success and the 404-to-empty (or None) behavior.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: add-helper-method
Download link: https://github.com/dougborg/stocktrim-openapi-client/archive/main.zip#add-helper-method

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.