Encapsulates infrastructure SDKs behind minimal domain-aligned interfaces. Use when accessing any external infrastructure to keep SDK usage contained, testing simple, and changes easy.
75%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/thin-wrappers/SKILL.mdSTARTER_CHARACTER = 🏗️
Minimize the API surface area: expose only what you use today, in your domain's language. The wrapper should be significantly smaller than the SDK it wraps.
Apply thin wrappers when:
Skip when:
Analyze existing SDK usage across the codebase:
Create an interface exposing only what's needed:
Anti-pattern: Exposing entire SDK "just in case"
Example transformation:
cache.set(key, value, ex=ttl, nx=True)cache.set_if_not_exists(key, value, ttl)Two-layer approach (most common):
Use when business logic needs to be separated from infrastructure.
Single-class approach:
Use when wrapper logic is minimal and business logic is simple.
Align method names and parameters with domain concepts:
publish_order_created(order_id, customer_id) not publish(topic, message)fetch_user_profile(user_id) not get(bucket, key)store_uploaded_file(file_id, content) not put_object(params)Migrate existing code incrementally:
Each step should be independently committable and testable.
Thin wrappers naturally map to the adapter layer in hexagonal/clean architecture, implementing domain-defined ports.
Thin wrappers enable simple test doubles — no mocking libraries needed. See examples for test double implementations.
Exposing SDK Types: Don't let SDK classes or enums leak through the wrapper boundary. Transform them into domain types.
Premature Abstraction: Don't create wrappers for single-use SDKs. Wait until usage patterns emerge.
Over-Engineering: Don't add configuration, features, or flexibility beyond current needs. Simple is better.
Generic Wrappers: Don't create DatabaseWrapper or QueueWrapper with every possible method. Expose only what the application uses.
Pass-Through Methods: Don't just rename SDK methods without adding domain meaning. Each wrapper method should represent a domain operation.
See reference implementations for common infrastructure types:
These illustrate the principles. Consider what fits your context.
saski/arnesto
752f690
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.