reuse-before-implementing

Evaluates existing language, package, and ecosystem capabilities before implementing new code or dependencies.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developers often write new helpers, classes, or add dependencies for functionality that already exists in the language, standard library, current package, or ecosystem, creating unnecessary duplication and maintenance burden. This Skill enforces a deliberate reuse check before any new implementation. ## Core Features & Use Cases - Structured Reuse Hierarchy: Guides investigation through language/standard library, current package, existing dependencies, domain ecosystem, and upstream implementations before writing new code. - Reuse Decision Procedure: Provides a five-step process covering behavior definition, domain-vs-integration separation, capability search, conceptual cost comparison, and narrowest-interface selection. - Public API Enforcement: Prohibits reliance on private APIs, undocumented internals, and hidden slots, with an ordered fallback plan when only private interfaces exist. - Use Case: Before adding a constrained ordination feature to an R package, the Skill directs you to extract and align matrices locally, then delegate the statistical computation to an established package like vegan and return its standard result class. ## Quick Start Before implementing the new feature, apply the reuse-before-implementing checklist to document existing capabilities in the language, package, dependencies, and ecosystem, then state whether to reuse, adapt, or implement locally.

Frequently Asked Questions about reuse-before-implementing

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

FAQPage Schema
How do I decide whether to reuse existing code or write new code?▼

Define the required behavior without naming an implementation, then search the reuse hierarchy: language and standard library first, then current package, existing dependencies, domain ecosystem, and upstream sources. Compare the conceptual cost of reuse versus local implementation before deciding.

When should I add a new dependency to my package?▼

Add a dependency only when it provides substantial behavior such as complex statistics, specialized algorithms, or difficult parsers. Avoid new dependencies for trivial string operations, single convenience helpers, or simple matrix transformations that the language already expresses clearly.

Is it acceptable to use a package's private or internal API?▼

No, private APIs can change without notice and transfer another package's instability into yours. Prefer public documented interfaces; if only a private API exists, look for a public alternative, implement the minimal operation locally, or request an upstream API.

When is local implementation better than reusing existing code?▼

Local implementation is appropriate when the operation is small and explicit, existing options add disproportionate dependency weight, public APIs lack the needed behavior, or local semantics differ materially. Document why reuse was unsuitable when implementing locally.

Should I create a new class or generic for my package?▼

Only when existing representations, result classes, or generics demonstrably cannot express the needed information. New classes and generics increase conceptual and dispatch surface, so require a concrete current need rather than speculative future requirements.