impl-wrapper

Define an Impl-Client wrapper pattern with Impl as a delegating façade.

6|Updated Feb 20, 2025
One-click install
npx skills add https://github.com/zerobias-org/module --skill impl-wrapper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: impl-wrapper
Source: https://github.com/zerobias-org/module/tree/main/.claude/skills/impl-wrapper
Command: npx skills add https://github.com/zerobias-org/module --skill impl-wrapper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Defines a disciplined Impl-Client pattern where the Impl acts as a pure delegating wrapper around the underlying Client, ensuring no business logic or HTTP calls exist in the Impl layer.

Core Features & Use Cases

  • Enforces a two-class pattern with separate Impl.ts and Client.ts implementations to promote clean separation of concerns.
  • Implements lazy, wrapped Producer APIs to cache and decorate producers without moving logic into the Impl.
  • Standardizes framework methods like metadata() and isSupported() as placeholders for platform-driven behavior, ensuring consistent contracts.
  • Centralizes error handling and HTTP communication in the Client, with the Impl serving as a pass-through.
  • Real-world use: apply across multiple services in a monorepo to maintain uniform architecture and reduce boilerplate.

Quick Start

Create the Impl and connect a Client so all business logic remains in the Client and the Impl remains a delegating façade.

Frequently Asked Questions about impl-wrapper

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

FAQPage Schema
How do I separate business logic from HTTP calls in a TypeScript wrapper class?

To separate business logic from HTTP calls in a TypeScript wrapper, implement an Impl-Client pattern where the Impl acts as a pure delegating façade. Centralize all HTTP communication and error handling in a separate Client.ts file.

What is the Impl-Client design pattern for separating concerns in TypeScript?

The Impl-Client design pattern separates concerns by keeping Impl.ts as a pure delegating wrapper around Client.ts. This ensures no business logic exists in the Impl layer, while standardizing framework methods like metadata() and isSupported() as platform placeholders.

How do I set up lazy producer wrappers in a TypeScript delegating façade?

Set up lazy producer wrappers by implementing wrapped Producer APIs that cache and decorate producers without moving logic into the Impl. This keeps the Impl layer pure while managing producer lifecycle separately across modules.

Does the Impl-Client wrapper pattern work for a monorepo with multiple services?

Yes, the Impl-Client wrapper pattern works for monorepos with multiple services. Applying this pattern across services maintains uniform architecture, reduces boilerplate, and enforces consistent separation of concerns between Impl, Client, and Producer layers.

When should I avoid using a pure delegating façade for my TypeScript architecture?

Avoid using a pure delegating façade when your project cannot enforce a strict two-class structure with separate Impl.ts and Client.ts files. The pattern requires platform-driven placeholder methods and falls apart if business logic cannot be fully centralized in the Client.