clean-architecture-typescript
How to Install
Claude Code:
git clone --depth 1 https://github.com/lekman/cdn.git && cp cdn/.claude/skills/clean-architecture-typescript ~/.claude/skills/clean-architecture-typescript -r---
name: clean-architecture-typescript
description: 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.
user-invocable: false
---
# Clean Architecture in TypeScript
When implementing clean architecture patterns in TypeScript, read and follow the policy guide:
**Policy**: `docs/policies/clean-architecture-typescript.md`
## When This Applies
- Creating `*.system.ts` files wrapping Azure SDK, Cloudflare API, or other external calls
- Defining `{name}-interface.ts` contracts with `I{Name}` interfaces
- Refactoring mixed business logic and system interaction code
- Setting up dependency injection via function/constructor parameters
- Using the namespace API pattern (classes with static methods)
- Configuring `bunfig.toml` coverage exclusions for `**/*.system.ts`
- Creating module folder structures with `index.ts` barrel exports
## File Naming Convention
| File Type | Pattern | Example |
|-----------|---------|---------|
| Interface | `{domain}-interface.ts` | `blob-interface.ts` |
| System wrapper | `{domain}.system.ts` | `blob.system.ts` |
| Mock | `tests/mocks/{domain}-mock.ts` | `blob-mock.ts` |
| Business logic | `{domain}.ts` or descriptive name | `handler.ts` |
## Key Patterns
- System files: thin wrappers, no business logic, excluded from coverage
- Interfaces: `I` prefix, minimal surface area, platform-agnostic
- DI: accept deps object with interface types, provide defaults via `?.?? ??`
- Namespace API: `Secrets.parse()` instead of `parseSecretReference()`
Read the full guide for step-by-step refactoring process and examples.
Details
| Category | Coding → api |
| Source | lekman/cdn |
| SKILL.md | View on GitHub → |
| Repo Stars | N/A |
| Est. per Skill | N/A (shared across 13 skills from this repo) |
| Difficulty | Intermediate |
| Risk Level | Safe |
Related Skills
moyu
Moyu The best code is code you didn't write. The best PR is the smallest PR. When to Use Use this sk
expo-ui-jetpack-compose
name: expo-ui-jetpack-compose description: @expo/ui/jetpack-compose package lets you use Jetpack Com
dbos-typescript
DBOS TypeScript Best Practices Guide for building reliable, fault-tolerant TypeScript applications w
openapi-spec-generation
OpenAPI Spec Generation Comprehensive patterns for creating, maintaining, and validating OpenAPI 3.1
Works Well With
Skills from the same repository — often designed to work together
skill
--- name: skill description: Guidelines for creating Claude Code skill files. Use when creating new
refine
--- name: refine description: Refine early requirements into a validated PRD document. Use when you
planner
--- name: planner description: Unified planning workflow that detects context and guides you through