client-responsibilities

Design a Client for connection lifecycle while producers handle API operations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill defines a strict separation between connection management and business API operations, ensuring clients only handle connection logic and do not implement API calls.

Core Features & Use Cases

  • Enforces a single responsibility for Client: connect, isConnected, disconnect
  • Producers implement all API operations, while the Client exposes a HTTP client instance to them
  • Use Case: In a microservice, implement a ConnectionClient that establishes and maintains the HTTP session, while resource-producer classes perform CRUD calls against the API.

Quick Start

Instantiate a ServiceClient and pass its HTTP client to a Producer to perform API operations.

Frequently Asked Questions about client-responsibilities

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

FAQPage Schema
How do I separate API operations from HTTP connection management in a microservice?

Separating API operations from connection management involves using a dedicated client to handle only connect, isConnected, and disconnect lifecycle events, while passing its HTTP instance to separate producer classes for CRUD workflows.

What is the best way to structure an OAuth client that only handles session-based authentication?

An OAuth client handling session-based authentication should strictly enforce connection-only boundaries by managing token setup and HTTP session states, delegating all list, get, create, update, and delete operations to distinct producers.

How do I enforce single responsibility for a connection client without mixing in API calls?

Enforcing single responsibility requires strict role boundaries where the client exposes a connected HTTP client instance to producers, ensuring the client itself never implements list, get, create, update, or delete API calls.

Can I use a connection-only client pattern with token-based authentication for API producers?

Yes, the connection-only client pattern is designed for token-based authentication, allowing a dedicated client to establish and maintain the HTTP session while resource-producer classes perform API calls using the exposed HTTP instance.

Why does my API client implementation break when connection logic and business operations are mixed?

Mixing connection logic with business operations breaks strict separation of concerns, causing role boundary violations that prevent the client from cleanly managing connect, isConnected, and disconnect states separately from API workflows.

Does the client-responsibilities skill require specific connection profiles or states to function?

Yes, the client-responsibilities skill requires compatibility with core connection profiles and states defined in the repository to ensure the connection-only client properly manages the HTTP setup lifecycle.