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

cqrs-guidelines

Load for native CQS commands, queries, immutable request/result contracts, handlers (ICommandHandler, IQueryHandler), validators, cache invalidation, idempotency, or specification-driven reads in Explore.Application; not for controller-only or repository-only edits.

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

설치 방법 보기

포함된 파일(7)

  • SKILL.md4.2 KB
  • resources/api-endpoint-design.md4.1 KB
  • resources/command-patterns.md527 B
  • resources/complete-examples.md3.2 KB
  • resources/handler-patterns.md805 B
  • resources/query-patterns.md424 B
  • resources/validation-integration.md464 B

SKILL.md(원문)

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

<!-- ABOUTME: CQS guidance for commands, queries, handlers, validators, caching, and specification usage. --> <!-- ABOUTME: Keeps Explore.Application handlers thin, entity-first, cancellation-aware, and aligned with repository and response contracts. -->

Resources

  • Record contracts — load for request/result record selection, factories, collection ownership, and trusted authority.
  • Architecture — load for Application boundaries and CQS flow.
  • API — load when result mapping or the public HTTP contract changes.
  • Quick reference — load for repository-wide CQS invariants.

Rules

  • Concrete CQS requests default to sealed records. Prefer positional records only for short stable contracts; use nominal init/required members for long, optional, attributed, or presence-sensitive contracts.
  • A request carries client intent, not current authority. HTTP or trusted adapters supply current tenant/user facts from principal, route, or tenant context; body identifiers name only independently authorized targets.
  • BaseCommandResponse<TKey> and concrete payload results are immutable valid-state records. Use named success/failure factories and the shared RFC 7807 mapper; never restore public setters or contradictory constructor states.
  • Repositories return entities. Handlers perform DTO mapping and never consume ExploreDbContext or a repository-returned IQueryable.
  • Validators are manually instantiated in the handler. Cancellation flows end to end.
  • Queries may use HybridCache read-through; commands invalidate affected keys after the owning write succeeds.
  • IQuerySpecification<T> composition remains immutable and Application-owned; Persistence applies it to EF queries.
  • Pre-Agreed Seam Discipline:
    • Application Seam: Command/Query Request ICommand<TResult> / IQuery<TResult> $\rightarrow$ Immutable Result / BaseCommandResponse<TKey>.
    • API Seam: HTTP Route $\rightarrow$ RFC 7807 ProblemDetails / HAL _links / Status code.
    • Persistence Seam: IQuerySpecification<T> $\rightarrow$ Domain Aggregate Entity.
  • Zero-Internal-Mocking Invariant: Mock only external boundaries you do not control (payment gateways, external email dispatchers, clock/randomness). Never mock internal domain entities, aggregates, or CQS handlers. Use real domain entities and in-memory/test-container database fixtures.
  • SDK-Style Interfaces for External Services: External integrations must expose strongly-typed operation methods (IStripeGateway.ChargeAsync(...)) rather than generic dispatchers (IFetcher.SendAsync(...)), ensuring mocks remain simple, type-safe, and free of internal conditional branching.

Workflow

  1. Lock request construction, result-state mapping, trusted authority, and consumed equality with focused tests.
  2. Change the request/result contract and migrate all handlers, controllers, tests, and mappers in the same slice.
  3. Replace mutable result assembly with named factories and mutable request rewrites with initialization or with.
  4. Verify CQRS conventions plus the affected handler and API mapping tests.

Verification

  • dotnet test --project tests/Event.Architecture.Tests/Event.Architecture.Tests.csproj --configuration Release --verbosity quiet -- --treenode-filter "/*/*/CqrsPatternTests/*" --minimum-expected-tests 1 --no-progress --maximum-parallel-tests 1
  • dotnet test --project tests/Event.Application.UnitTests/Event.Application.UnitTests.csproj --configuration Release --verbosity quiet
  • 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월 21일 업데이트

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월 21일 업데이트

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월 21일 업데이트

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월 21일 업데이트

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월 21일 업데이트

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월 21일 업데이트

islamu-ngo의 스킬 모두 보기

이 스킬의 문제 신고