void-package-extraction

Decides whether code in a monorepo app should be extracted into a shared workspace package.

Updated May 29, 2026
One-click install
npx skills add https://github.com/voidcorp-core/void-harness --skill void-package-extraction-voidcorp-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: void-package-extraction
Source: https://github.com/voidcorp-core/void-harness/tree/main/packages/cli/core-assets/packs/pack-monorepo/skills/void-package-extraction
Command: npx skills add https://github.com/voidcorp-core/void-harness --skill void-package-extraction-voidcorp-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? In a monorepo, developers constantly face the temptation to move code from apps/<app>/ into a new packages/<name>/ workspace, but roughly 80% of these extractions are premature and create coupling, boundary thrashing, and build complexity without real reuse. This Skill provides a strict decision gate so you only extract when the trade-off is genuinely justified. ## Core Features & Use Cases - 3-Question Decision Gate: Extract only if there are at least 2 distinct consumers right now, inlining would cost more than 30 minutes of duplication discipline per change, and the code owns a concept rather than a scattered helper function. - Explicit Anti-Patterns: Lists concrete cases where extraction is wrong, such as single-app helpers, thin library wrappers, one-app React components, and types-only sharing. - Reverse Extraction Guidance: Recommends inlining a package back into its consumer app when it has had only one consumer for 6+ months. - Use Case: You notice the same validation logic in apps/web and apps/mobile and consider creating @repo/validation. Run the gate: if the copies keep diverging or the code is a 5-line helper, keep it inline; if it is a stable shared concept, proceed to the creation workflow. ## Quick Start Ask the agent to evaluate whether the duplicated logic in apps/web and apps/mobile should be extracted into a new packages/ workspace using the 3-question gate.

Frequently Asked Questions about void-package-extraction

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

FAQPage Schema
How do I decide when to extract code into a shared monorepo package?

Extract only when all three conditions hold: at least 2 distinct apps consume the code right now, inlining it in both apps costs more than 30 minutes of duplication discipline per change, and the code owns a concept rather than being a scattered helper. Otherwise keep the code inline in each app.

When should I not extract code into a packages/ workspace?

Do not extract code used by only one app in case it is needed later, thin wrappers around a single library call, React components used in one app, route-handler-specific server logic, or types-only sharing. Duplication is cheaper than a wrong boundary.

What are the risks of premature package extraction in a monorepo?

Premature extraction causes boundary thrashing as the package API changes weekly, wrong abstractions that overfit the first consumer, import-direction violations between packages, and extra build complexity from additional tsconfig and package.json targets.

Can I reverse a package extraction and inline the code back?

Yes. A package with only one consumer for 6 or more months should be inlined back into that consumer app. Reverse-extraction is a valid pull request, such as merging @repo/billing back into apps/web/src/services/billing.

Where should shared types live in a monorepo?

Types should live next to their use. When types are genuinely shared across apps, place them in a single contracts package such as @repo/api-types rather than creating one package per concept.