coding-patterns

Apply TypeScript contract-port architecture patterns in monorepos.

1|Updated Dec 15, 2025
One-click install
npx skills add https://github.com/Anveio/conveaux --skill coding-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: coding-patterns
Source: https://github.com/Anveio/conveaux/tree/main/.claude/skills/coding-patterns
Command: npx skills add https://github.com/Anveio/conveaux --skill coding-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the application of TypeScript monorepo patterns including contract-port architecture, dependency injection, and hermetic primitive ports automatically.

Core Features & Use Cases

  • Contract-Port Architecture: Automatically apply patterns for creating packages, designing contracts/interfaces, implementing ports, or testing with inline mocks automatically.

Quick Start

Use this Skill when creating packages, designing contracts/interfaces, implementing ports, wrapping platform primitives, or testing with inline mocks automatically.

Quick Start

Invoke this Skill when you need to apply TypeScript monorepo patterns automatically.

Quick Start

Use this Skill to automatically apply coding patterns for contract-port architecture, dependency injection, and hermetic primitive ports automatically.

Quick Start

Use this Skill to automatically apply TypeScript monorepo patterns for contract-port architecture, dependency injection, and hermetic primitive ports automatically.

Quick Start

Use this Skill to automatically apply TypeScript monorepo patterns for creating packages, designing contracts, and implementing ports automatically.

Quick Start

Use this Skill when you need to apply TypeScript monorepo patterns automatically.

Frequently Asked Questions about coding-patterns

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

FAQPage Schema
How do I design contract-port architecture in a TypeScript monorepo?

Contract-port architecture separates interface contracts from implementations through dependency injection, enabling loose coupling and testability. This pattern structures packages around strict contracts, ports that accept injected dependencies, and hermetic wrappers for platform primitives like Date and process, preventing architectural drift across monorepo packages.

What is dependency injection and why use it in TypeScript monorepos?

Dependency injection inverts control by passing dependencies into functions or classes rather than having them create their own. In TypeScript monorepos, this pattern enforces contract-only interfaces, enables swapping implementations for testing, and maintains composition-root control points that ensure all packages follow the same architectural rules.

How do I wrap platform primitives like Date and console in TypeScript?

Hermetic primitive wrapping creates contract interfaces around built-in APIs—Date, console, process—then injects implementations rather than using them directly. This decouples your code from platform dependencies, allows deterministic testing through mock implementations, and prevents implicit global state from leaking across package boundaries.

Can I prevent architectural drift across TypeScript packages?

Yes; applying consistent contract-port patterns automatically across package creation, interface design, and port implementation prevents drift. By enforcing data-vs-capability separation, composition-root control, and hermetic primitive wrapping at the point of package definition, all modules remain architecturally aligned without manual review.

How do I test TypeScript monorepos with inline mocks using contracts?

Define strict contract interfaces for all dependencies, then inject mock implementations at test time through the composition root. Since ports accept only contract-conforming objects, your mocks automatically remain compatible; hermetic primitive wrapping ensures tests control Date, console, and process without side effects.

What's the difference between contract-port and traditional layered architecture?

Contract-port architecture emphasizes interface contracts and dependency injection over layered concerns, decoupling packages entirely through ports rather than horizontal layers. This approach supports composition-root control, data-vs-capability separation, and hermetic primitive wrapping—reducing cross-package coupling and enabling deterministic testing without shared mutable state.