Communityコーディング&開発github.com

akka-net-aspire-configuration

Akka.NET を .NET Aspire と統合し、ローカル開発から本番環境までのアクターシステム構築を支援します。クラスタリング、永続化、管理、調整機能をカバーします。

akka-net-aspire-configuration とは?

このスキルは、Akka.NET プロジェクトを .NET Aspire で構成・運用するための包括的なガイドを提供します。開発者は、Akka.Cluster、Akka.Persistence、Akka.Management などの主要コンポーネントを Aspire のオーケストレーションパターンと組み合わせて設定できます。スキルでは、Microsoft.Extensions.Configuration を用いた強く型付けされた設定クラス、DI のための Akka.Hosting ライブラリ、HEALTH CHECKS パターン、そして設定ミスを早期に発見するための検証戦略を重視しています。具体的には、SQL Server を用いた永続化構成、Kubernetes や Azure テーブルストレージを使用したクラスター ブートストラップと自動ディスカバリー、TLS を用いたセキュアなリモート通信を扱います。最終的には、Aspire を活用して、開発、テスト、本番環境全体で一貫性のある Akka.NET アプリケーションのデプロイと管理が可能になります。

対応~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/Aaronontheweb/dotnet-skills/tree/main/skills/akka-aspire-configuration

Installed? Explore more コーディング&開発 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

お気に入りのAIに質問する

このエージェントスキルを事前に読み込んだ状態で新しいチャットを開きます。

ドキュメント

Akka.NET と .NET Aspire の構成

このスキルを使用するタイミング

以下の場合にこのスキルを使用します:

  • .NET Aspire オーケストレーションを使用した新しい Akka.NET プロジェクトのセットアップ
  • クラスターブートストラップとディスカバリーを使用した Akka.Cluster の構成
  • SQL Server を使用した Akka.Persistence の統合
  • クラスター管理のための Akka.Management のセットアップ
  • ローカル開発におけるマルチレプリカアクターシステムの構成
  • Aspire を使用した Kubernetes への Akka.NET アプリケーションのデプロイ

関連スキル

  • akka-net-management - Akka.Management、Cluster Bootstrap、およびディスカバリープロバイダー(Kubernetes、Azure、Config)の詳細
  • microsoft-extensions-configuration - 構成検証のための IValidateOptions パターン
  • akka-net-best-practices - テスト可能なアクターシステムのためのクラスター/ローカルモードの抽象化
  • aspire-integration-testing - 実際のインフラストラクチャを使用した Aspire アプリケーションのテスト

基本原則

  1. Microsoft.Extensions.Configuration による設定 - appsettings.json からバインドされた強く型付けされた設定クラスを使用します(microsoft-extensions-configuration スキルを参照)
  2. DI 統合のための Akka.Hosting - シームレスな ASP.NET Core 統合のために Akka.Hosting ライブラリを使用します
  3. オーケストレーションのための Aspire - Aspire にサービス依存関係、ネットワーキング、環境構成を管理させます
  4. ヘルスチェック - クラスタリング、永続化、準備状態に対して常にヘルスチェックを構成します
  5. 関心事の分離 - アクター定義、構成、および Aspire オーケストレーションを別々のレイヤーに保持します
  6. 起動時に構成を検証 - IValidateOptions<T> と .ValidateOnStart() を使用して、構成ミスを早期に検出します

プロジェクト構造

YourSolution/
├── src/
│   ├── YourApp.Actors/              # アクター定義とビジネスロジック
│   │   ├── YourActor.cs
│   │   └── YourApp.Actors.csproj
│   ├── YourApp/                     # ASP.NET Core Web アプリケーション
│   │   ├── Config/
│   │   │   ├── AkkaConfiguration.cs  # Akka セットアップ拡張メソッド
│   │   │   └── AkkaSettings.cs       # 構成モデル
│   │   ├── Program.cs
│   │   ├── appsettings.json
│   │   └── YourApp.csproj
│   └── YourApp.AppHost/             # Aspire オーケストレーション
│       ├── Program.cs
│       ├── AkkaManagementExtensions.cs
│       └── YourApp.AppHost.csproj

必要な NuGet パッケージ

アクタープロジェクト用 (YourApp.Actors.csproj)

<ItemGroup>
  <PackageReference Include="Akka.Cluster.Hosting" />
  <PackageReference Include="Akka.Streams" />
</ItemGroup>

Web アプリケーション用 (YourApp.csproj)

<ItemGroup>
  <PackageReference Include="Akka.Hosting" />
  <PackageReference Include="Akka.Cluster.Hosting" />
  <PackageReference Include="Akka.Persistence.Sql.Hosting" />
  <PackageReference Include="Akka.Management" />
  <PackageReference Include="Akka.Management.Cluster.Bootstrap" />
  <PackageReference Include="Akka.Discovery.KubernetesApi" />
  <PackageReference Include="Akka.Discovery.Azure" />
  <PackageReference Include="Akka.Discovery.Config.Hosting" />
  <PackageReference Include="Petabridge.Cmd.Host" />
  <PackageReference Include="Petabridge.Cmd.Cluster" />
</ItemGroup>

AppHost 用 (YourApp.AppHost.csproj)

<Sdk Name="Aspire.AppHost.Sdk" Version="$(AspireVersion)" />

<ItemGroup>
  <PackageReference Include="Aspire.Hosting.AppHost" />
  <PackageReference Include="Aspire.Hosting.Azure.Storage" />
  <PackageReference Include="Aspire.Hosting.SqlServer" />
</ItemGroup>

構成モデル (AkkaSettings.cs)

強く型付けされた構成クラスを作成します:

using System.Net;
using System.Security.Cryptography.X509Certificates;
using Akka.Cluster.Hosting;
using Akka.Remote.Hosting;
using Petabridge.Cmd.Host;

namespace YourApp.Config;

public class AkkaSettings
{
    public string ActorSystemName { get; set; } = "YourSystem";

    public bool LogConfigOnStart { get; set; } = false;

    public RemoteOptions RemoteOptions { get; set; } = new()
    {
        PublicHostName = Dns.GetHostName(),
        HostName = "0.0.0.0",
        Port = 8081
    };

    public ClusterOptions ClusterOptions { get; set; } = new()
    {
        SeedNodes = [$

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

akka-hosting-actor-patterns

Patterns for building entity actors with Akka.Hosting - GenericChildPerEntityParent, message extractors, cluster sharding abstraction, akka-reminders, and ITimeProvider. Supports both local testing and clustered production modes.

akka-net-best-practices

Critical Akka.NET best practices including EventStream vs DistributedPubSub, supervision strategies, error handling, Props vs DependencyResolver, work distribution patterns, and cluster/local mode abstractions for testability.

akka-net-management

Akka.Management for cluster bootstrapping, service discovery (Kubernetes, Azure, Config), health checks, and dynamic cluster formation without static seed nodes.

akka-net-testing-patterns

Write unit and integration tests for Akka.NET actors using modern Akka.Hosting.TestKit patterns. Covers dependency injection, TestProbes, persistence testing, and actor interaction verification. Includes guidance on when to use traditional TestKit.

api-design

Design stable, compatible public APIs using extend-only design principles. Manage API compatibility, wire compatibility, and versioning for NuGet packages and distributed systems.

aspire-configuration

Configure Aspire AppHost to emit explicit app config via environment variables; keep app code free of Aspire clients and service discovery.

aspire-integration-testing

Write integration tests using .NET Aspire

aspire-service-defaults

Create a shared ServiceDefaults project for Aspire applications. Centralizes OpenTelemetry, health checks, resilience, and service discovery configuration across all services.

crap-analysis

Analyze code coverage and CRAP (Change Risk Anti-Patterns) scores to identify high-risk code. Use OpenCover format with ReportGenerator for Risk Hotspots showing cyclomatic complexity and untested code paths.

csharp-concurrency-patterns

Choosing the right concurrency abstraction in .NET - from async/await for I/O to Channels for producer/consumer to Akka.NET for stateful entity management. Avoid locks and manual synchronization unless absolutely necessary.

database-performance

Database access patterns for performance. Separate read/write models, avoid N+1 queries, use AsNoTracking, apply row limits, and never do application-side joins. Works with EF Core and Dapper.

dependency-injection-patterns

Organize DI registrations using IServiceCollection extension methods. Group related services into composable Add* methods for clean Program.cs and reusable configuration in tests.

dotnet-devcert-trust

Diagnose and fix .NET HTTPS dev certificate trust issues on Linux. Covers the full certificate lifecycle from generation to system CA bundle inclusion, with distro-specific guidance for Ubuntu, Fedora, Arch, and WSL2.

dotnet-local-tools

Managing local .NET tools with dotnet-tools.json for consistent tooling across development environments and CI/CD pipelines.

dotnet-project-structure

Modern .NET project structure including .slnx solution format, Directory.Build.props, central package management, SourceLink, version management with RELEASE_NOTES.md, and SDK pinning with global.json.

dotnet-slopwatch

Use Slopwatch to detect LLM reward hacking in .NET code changes. Run after every code modification to catch disabled tests, suppressed warnings, empty catch blocks, and other shortcuts that mask real problems.

efcore-patterns

Entity Framework Core best practices including NoTracking by default, query splitting for navigation collections, migration management, dedicated migration services, and common pitfalls to avoid.

ilspy-decompile

Understand implementation details of .NET code by decompiling assemblies. Use when you want to see how a .NET API works internally, inspect NuGet package source, view framework implementation, or understand compiled .NET binaries.

mailpit-integration

Test email sending locally using Mailpit with .NET Aspire. Captures all outgoing emails without sending them. View rendered HTML, inspect headers, and verify delivery in integration tests.

marketplace-publishing

Workflow for publishing skills and agents to the dotnet-skills Claude Code marketplace. Covers adding new content, updating plugin.json, validation, and release tagging.

関連スキル