add-helper-method
CommunityAdd 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
asynchelper method instocktrim_public_api_client/helpers/<domain>.pythat delegates to the corresponding generatedgenerated/client call. - Transport-layer mocking in tests: Ensures tests mock
httpx.MockTransportso 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
[](orNonewhere 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
# noqaor# 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 requiredComponents
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.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.