vsa-implementation-guard

Enforce anti-mistake rules during C# code generation for Blazor VSA implementations.

1|Updated Oct 28, 2025
One-click install
npx skills add https://github.com/akiramei/blazor-enterprise-architecture-poc --skill vsa-implementation-guard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: vsa-implementation-guard
Source: https://github.com/akiramei/blazor-enterprise-architecture-poc/tree/main/catalog/skills/vsa-implementation-guard
Command: npx skills add https://github.com/akiramei/blazor-enterprise-architecture-poc --skill vsa-implementation-guard

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Blazor VSA アプリケーション開発において、Handler/Validator/BoundaryService/Entity などの実装で生じがちなミスを自動的に抑制します。SaveChangesAsync の禁止、BoundaryService での業務ロジックの回避、Result<T> の適切な利用、Value Object の比較ルールなどをガードします。

Core Features & Use Cases

  • Handler での SaveChangesAsync 禁止の自動適用
  • BoundaryService への業務ロジック記述を排除して Entity.CanXxx() へ委譲
  • 例外の過剰伝播を Avoid、Result<T> でのエラーハンドリングを推奨
  • Value Object の正しい比較方法の強制
  • Validator の範囲を形式検証のみへ制限

Quick Start

具体的なサンプルのハンドラ・ BoundaryService・Validator を用意して、生成・修正時にこのガードを適用するようAI に指示します。業務ロジックを Entity に移譲するパターンを中心に適用します。

Frequently Asked Questions about vsa-implementation-guard

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

FAQPage Schema
How do I prevent SaveChangesAsync calls in MediatR handlers?

This Skill automatically forbids SaveChangesAsync in handlers during code generation, enforcing delegation to TransactionBehavior instead. It validates handler implementations to ensure database commits occur only through the configured transaction layer, eliminating accidental duplicate or misplaced saves.

How do I enforce business logic delegation to entities in Blazor VSA?

The Skill detects business logic written directly in BoundaryService and redirects it to Entity methods like CanXxx(). During code modification, it validates that services remain thin, delegating authorization and state validation to domain entities, keeping concerns properly separated.

What's the correct way to handle errors in MediatR handlers with Result<T>?

This Skill enforces Result<T> usage for error handling in handlers and validators, preventing exception propagation. It applies rules during generation to ensure handlers return structured results, catching validation and business logic failures without throwing unchecked exceptions.

How do I implement Value Object comparisons correctly?

The Skill validates Value Object equality implementations during code generation, enforcing proper comparison logic. It prevents common mistakes like reference equality, ensuring Value Objects use value-based comparison as domain-driven design requires.

Can I use FluentValidation for business logic in validators?

No. This Skill restricts FluentValidation validators to format-only checks during code analysis, preventing business rule enforcement in validators. It directs complex validations to entities or handlers, maintaining clean separation between format validation and domain logic.

Why should BoundaryService avoid direct business logic?

BoundaryService acts as a service boundary in VSA. The Skill enforces this by preventing business logic there, ensuring entities own authorization checks and state transitions. This keeps domain logic centralized and testable, preventing scattered business rules across the application layer.