package-extraction-strategy

Installation
SKILL.md

Package Extraction Strategy

Core principle: Don't extract until a second consumer exists. But always structure for extraction.

Decision Gate

Before extracting code to a shared package, all four conditions must be met:

  1. Second consumer exists — another app or service needs this exact logic today, not hypothetically.
  2. Interface is stable — the API surface has been proven through real usage in the first consumer.
  3. Zero framework coupling — the code to extract has no imports from NestJS, Prisma, React, TanStack, or any app-specific module.
  4. Clear ownership — someone will maintain the package, handle version bumps, and review PRs.

If any condition fails, do not extract. Instead, use the extraction-readiness pattern below.

Extraction-Readiness Pattern

Structure feature code so that future extraction is a file move, not a rewrite.

Related skills
Installs
1
GitHub Stars
1
First Seen
Mar 31, 2026