본문으로 건너뛰기
cccskills
무료GitHub에 공개

clean-architecture-rules

Load for cross-layer refactors, record/class or value-object migrations, new services/interfaces/repositories, project references, dependency-direction failures, or deciding whether code belongs in Domain, Application, Persistence/Infrastructure, API, or Blazor; not for a local edit wholly inside an established layer pattern.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(5)

  • SKILL.md4.1 KB
  • resources/dependency-rules.md660 B
  • resources/fix-patterns.md741 B
  • resources/layer-responsibilities.md747 B
  • resources/violation-examples.md2.8 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

<!-- ABOUTME: Clean Architecture dependency guardrail for Explore.Domain, Explore.Application, and layer-boundary work. --> <!-- ABOUTME: Blocks upward dependencies, misplaced validation, and layer leakage that would violate the repository contract. -->

Resources

  • Architecture — load for project/layer ownership and runtime composition.
  • Record contracts — load for record/class selection, immutable collections, semantic values, persistence leaves, or generated-client ownership.
  • Codebase structure — load when the destination project or folder is unresolved.
  • Quick reference — load for global repository invariants.

Rules

  • Domain has no external framework dependency. Entities and lifecycle objects remain classes; small self-contained values may use readonly record struct, and reference-bearing immutable value data may use sealed records.
  • Application references Domain only. Concrete native CQS requests default to sealed records, while valid-state command results use their existing named factories.
  • Persistence maps Domain entities and semantic values without making Domain depend on EF Core. Repositories return entities, never DTOs or IQueryable.
  • API and Blazor own transport, HTTP, rendering, and composition. HTTP adapters introduce trusted tenant/user authority; request bodies do not become current authority.
  • Generated browser contract shape remains generator-owned. Do not move generated records into handwritten mirrors or let generated DTO concerns flow into Domain.
  • Validators remain manually instantiated, specifications remain Application-owned, and HATEOAS policies/assemblers remain API-owned.
  • Deep Modules over Shallow Pass-Throughs: Design deep modules (large amount of behavior hidden behind a simple interface). Avoid shallow services that merely forward calls to repositories or DbSets without enforcing business invariants.
  • The Deletion Test: When evaluating an intermediate service or wrapper class, imagine deleting it. If complexity vanishes, it was an unnecessary pass-through (delete it). If complexity scatters across N callers, it was earning its keep as a deep module (preserve and deepen it).
  • Leverage and Locality:
    • Leverage: Callers gain maximum capability per method/parameter learned.
    • Locality: Invariants, state transitions, validation, and error handling concentrate in the owning domain aggregate or handler, ensuring fixes occur in one place.

Workflow

  1. Trace the contract from Domain ownership through Application, Persistence, API/OpenAPI, and generated-client consumers.
  2. Choose class, record class, or readonly record struct from identity and behavior, not from a layer-wide conversion rule.
  3. Change the innermost owning layer first, then migrate outward callers without compatibility shims.
  4. Verify dependency direction and the behavior-specific architecture ratchet.

Verification

  • dotnet test --project tests/Event.Architecture.Tests/Event.Architecture.Tests.csproj --configuration Release --verbosity quiet -- --treenode-filter "/*/*/CleanArchitectureTests/*" --minimum-expected-tests 1 --no-progress --maximum-parallel-tests 1
  • dotnet test --project tests/Event.Architecture.Tests/Event.Architecture.Tests.csproj --configuration Release --verbosity quiet -- --treenode-filter "/*/*/NamingConventionTests/*" --minimum-expected-tests 1 --no-progress --maximum-parallel-tests 1
  • dotnet build --configuration Release --verbosity quiet

Related

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Load for Blazor/MudBlazor UI changes involving forms, dialogs, focus, keyboard navigation, landmarks, ARIA, color contrast, RTL-safe styling, or WCAG 2.2 AA tests; not for backend-only changes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

islamu-ngo/Event82026년 10월 20일 업데이트

Load when a task asks to research, verify, compare, or look up framework/package behavior, release notes, standards, RFCs, CVEs, or unfamiliar APIs; use repository evidence first, then official docs, and not for codebase navigation alone.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

islamu-ngo/Event82026년 10월 20일 업데이트

aspire

무료

Load for Aspire AppHost work: start/stop/wait resources, inspect dashboard/logs/traces, add integrations/resources, rebuild a service, run isolated worktrees, or diagnose Aspire orchestration; not for plain dotnet apps, container-only deployments, or cloud deployment.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

islamu-ngo/Event82026년 10월 20일 업데이트

Load for authentication or authorization changes involving BFF cookies/tokens, JWT validation, claims/user ID extraction, policies, handler access checks, impersonation, or 401/403 bugs; not for UI affordance gating alone.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

islamu-ngo/Event82026년 10월 20일 업데이트

Load for Blazor BFF server work involving YARP proxy routes, cookie sessions, access-token forwarding/refresh, downstream API calls, BFF handlers, or browser-to-API auth failures; not for client component rendering or API JWT validation alone.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

islamu-ngo/Event82026년 10월 20일 업데이트

Load when editing Blazor `.razor.css`, scoped selectors, `::deep`, BEM class names, RTL/logical CSS properties, or styling nested MudBlazor components; not for global design tokens or non-Blazor CSS.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

islamu-ngo/Event82026년 10월 20일 업데이트

islamu-ngo의 스킬 모두 보기

이 스킬의 문제 신고