void-dependency-direction

Enforce @repo/* import direction rules in Turborepo monorepo workspaces.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Monorepos collapse into tangled dependency hairballs when packages freely import each other. This Skill enforces a strict import direction where only @repo/core may be depended upon, keeping packages decoupled and composition centralized in apps. ## Core Features & Use Cases - Import Direction Rules: Defines the allowed dependency graph where @repo/* packages may only import @repo/core, and apps compose everything. - Violation Patterns with Fixes: Shows concrete wrong/right TypeScript examples for common violations like cross-package service calls, shared types, and side effects in UI packages. - Ports and Adapters Guidance: Explains how to define ports in a package and wire adapters at the app level instead of importing across package boundaries. - Use Case: When adding an import in packages/billing that reaches for @repo/auth, the Skill redirects you to define a BillingPorts interface and wire the adapter in apps/web, keeping billing pure. ## Quick Start Ask the agent to review whether a new cross-package import in the Turborepo workspace follows the @repo/* dependency direction rules and fix any violation.

Frequently Asked Questions about void-dependency-direction

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

FAQPage Schema
How do I fix a forbidden cross-package import in a Turborepo monorepo?

Define a port interface in the consuming package, then wire the adapter at the app level. For example, billing declares a BillingPorts interface and apps/web injects the @repo/auth-backed implementation, so packages never import each other directly.

What import direction rules should a monorepo enforce?

This Skill enforces that @repo/* packages may only import @repo/core, which ships leaf primitives like logger, env, errors, and Result. Apps may import any @repo/* package, and all composition happens at the app level.

Can packages in a monorepo share TypeScript types?

Packages should declare their own narrowed type projections rather than importing types from sibling packages, since type imports still create coupling. If a shape is genuinely shared, factor it into @repo/core/types.

Why does the boundary-direction-check hook block my import?

The hook blocks Edit/Write operations that introduce imports violating the @repo/* direction rule, such as one feature package importing another. You can override with a // allow-boundary: comment, but the recommended fix is refactoring to ports and adapters.

When is a cross-package dependency exception acceptable?

Exceptions are rare; most needs dissolve once a port is defined. If you still believe one is required, write an ADR documenting the exception and its reversal cost before tagging the import with an allow comment.