add-a-thin-adapter

Design thin adapters that delegate to established upstream implementations.

1|Updated Aug 11, 2026
One-click install
npx skills add https://github.com/0xMuluh/package-development-skills --skill add-a-thin-adapter-0xmuluh
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: add-a-thin-adapter
Source: https://github.com/0xMuluh/package-development-skills/tree/main/add-a-thin-adapter
Command: npx skills add https://github.com/0xMuluh/package-development-skills --skill add-a-thin-adapter-0xmuluh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When adding package functionality that connects existing data structures to an established external implementation, developers often over-engineer by reimplementing algorithms, building wrapper frameworks, or hiding preprocessing pipelines. This Skill guides you to build thin domain-specific adapters that keep integration code small while delegating the algorithm to the upstream implementation. ## Core Features & Use Cases - Adapter Design Discipline: Enforces the pattern of selecting data, validating method-specific requirements, aligning samples, delegating to the upstream function, and returning the established result type. - Explicit Contracts: Requires documented alignment, missing-data, argument-forwarding, and result contracts so integration behavior is predictable and testable. - Anti-Pattern Detection: Flags reimplemented algorithms, hidden preprocessing pipelines, unnecessary result wrappers, generic frameworks for single methods, and private upstream calls. - Use Case: You want to run constrained ordination between two assays in a MultiAssayExperiment. The Skill guides you to select the assays, align samples explicitly, transpose at the boundary, call vegan::rda(), and return the standard rda object rather than inventing a new result class. ## Quick Start Ask the AI to design a thin adapter that connects your package's standard container to a specific upstream function, following the prepare-delegate-return pattern.

Frequently Asked Questions about add-a-thin-adapter

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

FAQPage Schema
How do I integrate an external R package method into my package?▼

Build a thin adapter that selects the relevant data from your standard container, validates method-specific requirements, aligns samples explicitly, and calls the upstream function directly. Return the established result class rather than wrapping it in a new package-specific type.

What is a thin adapter versus a wrapper framework?▼

A thin adapter owns only integration logic such as data selection, alignment, and orientation conversion, while delegating the algorithm to the upstream implementation. A wrapper framework introduces registries, runners, and result classes, which is usually unnecessary for a single method.

Should I reimplement an upstream algorithm in my package?▼

No, delegate to the established implementation unless the upstream API lacks required functionality, performance demands specialization, or your package's contribution is a genuinely new method. Duplicating formulas or algorithm steps is a warning sign to reassess.

How do I handle sample alignment between multiple input containers?▼

Make the alignment rule explicit, such as intersecting sample identifiers or requiring an exact match, and document ordering and duplicate handling. Never rely on accidental positional alignment, and test with inputs whose identifiers appear in different orders.

When is a thin adapter not enough for package integration?▼

A larger implementation is justified when the package contributes a new algorithm, existing implementations lack required semantics, performance demands specialized code, or a stable cross-backend abstraction is already required by multiple implementations. Introduce only the architecture proven necessary.