develop-clean-architecture
Clean Architecture — TypeScript
Apply Clean Architecture (Robert C. Martin), DDD tactical patterns, Hexagonal/Explicit Architecture (Herberto Graca), and Clean Code practices to TypeScript codebases. 76 rules across 11 categories.
Guardrails — never violate these
- Never import outer layers from inner layers — domain imports nothing; application imports only domain
- Never put ORM decorators or Prisma types on domain entities — use mappers in infrastructure
- Never return
nullfor domain errors — use a discriminatedResult<T, E>return. In this repo the result branch usesok: true | false; ifEis a rich error union, give each error variant an_tagfor exhaustive handling. - Never use
as anyor@ts-ignorewithout a documented justification comment - Never dispatch domain events before persistence — pull events AFTER
save(), dispatch AFTER commit - Never share one type across domain/API/DB layers — accept cross-layer duplication, each model serves a different master
- Never use barrel files (
index.tswithexport *) in application code — use direct imports - Never validate inside domain or use cases — parse at the adapter boundary with Zod, trust inside
- Always use
#private fields on entities (runtime encapsulation) — not theprivatekeyword - Always separate
Entity.create()(validates, emits events) fromEntity.reconstitute()(loads from DB, no events) - Always wire dependencies in a single composition root (
main.ts) — the only file that knows all concretions - Always use
import typefor cross-layer type imports — enableverbatimModuleSyntax: true
More from yigitkonur/skills-by-yigitkonur
run-research
Use skill if you are answering one technical research question with current web evidence, Reddit practitioner experience, and source-backed synthesis, optionally fanned out across parallel subagents.
42run-agent-browser
Use skill if you are driving the agent-browser CLI for ad hoc browser automation — @ref snapshots, sessions, forms, extraction, screenshots, headed/stealth, or provider runs.
38publish-npm-package
Use skill if you are publishing to npm via GitHub Actions release workflow with trusted publishing, NPM_TOKEN, provenance, semantic-release, changesets, release-please, or fixing npm publish CI.
35init-agent-config
Use skill if you are creating, auditing, or migrating CLAUDE.md, AGENTS.md, or REVIEW.md instruction files, folder-scoped agent guidance, or cross-agent companion entrypoints.
34build-mcp-use-server
Use skill if you are building TypeScript MCP servers with mcp-use/server — server.tool, response helpers, ctx.auth, sessions, transports, widgets, Inspector, deploy.
34build-skills
Use skill if you are creating or substantially revising a Claude skill and need workspace-first evidence, remote comparison, and repo-fit synthesis before writing SKILL.md.
32