clean-architecture-typescript

Enforce clean-architecture patterns in TypeScript modules with DI and system wrappers.

Updated Jan 31, 2026
One-click install
npx skills add https://github.com/lekman/cdn --skill clean-architecture-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clean-architecture-typescript
Source: https://github.com/lekman/cdn/tree/main/.claude/skills/clean-architecture-typescript
Command: npx skills add https://github.com/lekman/cdn --skill clean-architecture-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript clean architecture implementation with *.system.ts convention, interface-based DI, namespace API pattern, and coverage configuration. Use when creating or refactoring TypeScript modules with external dependencies, writing system wrappers, defining interfaces for Azure SDK or Cloudflare API, or configuring coverage exclusions.

Core Features & Use Cases

  • System files: thin wrappers, no business logic, and support for DI through constructor parameters.
  • Interfaces: contracts named with I{Domain} and minimal surface area to keep platform-agnostic.
  • Dependency Injection: pass deps object and override defaults as needed.
  • Namespace API pattern: Classes with static methods to organize domain logic.
  • Coverage configuration: bunfig.toml exclusions for {domain}.*.system.ts and related files.
  • Module scaffolding: folder structures with index.ts barrel exports.

Quick Start

Create a new module following the *.system.ts convention, write interface contracts, and wire dependencies via DI.

Frequently Asked Questions about clean-architecture-typescript

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

FAQPage Schema
How do I separate domain logic from external dependencies in TypeScript?

You separate domain logic from external dependencies in TypeScript by using *.system.ts files as thin wrappers. These system files contain no business logic and support dependency injection through constructor parameters, ensuring your domain layer remains isolated and platform-agnostic.

What is the namespace API pattern for TypeScript module scaffolding?

The namespace API pattern for TypeScript module scaffolding uses classes with static methods to organize domain logic. It includes folder structures with index.ts barrel exports, providing a structured and clean way to expose module functionality without instantiating classes.

How do I configure test coverage exclusions for system wrappers in TypeScript?

You configure test coverage exclusions for system wrappers in TypeScript by adding rules to your bunfig.toml file. Specifically, you exclude patterns like {domain}.*.system.ts and related files from coverage reports to focus metrics on business logic.

Does clean architecture in TypeScript work with Azure SDK and Cloudflare APIs?

Yes, clean architecture in TypeScript works with Azure SDK and Cloudflare APIs by defining minimal interface contracts. You name these contracts with the I{Domain} convention to keep the surface area minimal and your application completely platform-agnostic.

How do I wire dependencies using dependency injection in TypeScript modules?

You wire dependencies using dependency injection in TypeScript modules by passing a dependencies object and overriding defaults as needed. This approach allows you to inject external systems seamlessly during module instantiation or refactoring.

When should I refactor TypeScript modules to use interface-based dependency injection?

You should refactor TypeScript modules to use interface-based dependency injection when creating modules with external dependencies, writing system wrappers, or needing configurable test coverage exclusions. It enforces clean-architecture patterns for scalable application growth.