TurboMqtt is a high-performance, streaming-first MQTT client library for .NET built on Akka.NET and Akka.Streams. The goal is to be the fastest MQTT client in the .NET ecosystem.
See PROJECT_CONTEXT.md for architecture, roadmap, and current state. See TOOLING.md for build, test, benchmark, and CI/CD instructions.
Before acting, identify the work mode:
| Mode | Signals | Outputs |
|---|---|---|
| Engineering | Code in src/, tests/, benchmarks/, samples/; bugs; features; performance |
Code + tests; benchmarks for perf work |
| Release | Version bumps, RELEASE_NOTES.md, tags, publishing | Updated version, release notes, tag |
# Build
dotnet build -c Release
# Test (unit + integration, no Docker)
dotnet test tests/TurboMqtt.Tests/ -c Release
# Test (E2E with real broker, requires Docker)
dotnet test tests/TurboMqtt.Container.Tests/ -c Release
# Pack
dotnet pack -c ReleaseAll code must compile with zero warnings (TreatWarningsAsErrors is on).
- Tests pass on both Linux and Windows
- No new compiler warnings
- Property-based tests (FsCheck) for any codec or protocol logic
- Akka.Hosting.TestKit for actor behavior tests
- Run relevant BenchmarkDotNet benchmarks before and after
- No throughput regressions on the MQTT 3.1.1 pipeline
- Prefer zero-allocation patterns:
ReadOnlyMemory<byte>,Span<T>,MemoryPool<byte>,IMemoryOwner<byte> - Use
System.Threading.Channelsover locks for concurrency - Batch operations where possible (see
BatchWeightedin encoding flows)
- Validate against real brokers via container tests (EMQX)
- Cover all three QoS levels (0, 1, 2)
- Test partial frame handling and packet boundary edge cases
- File-scoped namespaces, implicit usings, nullable reference types enabled
- C# latest language version
- Central Package Management: use
dotnet add package(never edit csproj/props XML directly) - Akka.NET actors use
ReceiveActororUntypedActorpatterns; hosting viaAkka.Hosting - Internal types exposed to test projects via
InternalsVisibleToinProperties/Friends.cs
- NEVER
git addthe.ralph/directory or anything inside it. Flight recorder logs are ephemeral and local-only. They must not appear in any commit.
- Akka.NET is the concurrency model. Do not introduce raw
Task.Run,Thread, or manual synchronization unless there is no actor-based alternative. - Akka.Streams is the data pipeline. Encode, decode, and receive flows are stream stages. Do not bypass streams for packet processing.
- Channels bridge actors to user code.
System.Threading.Channelsis the public-facing async interface; actors and streams are internal. - Memory is pooled. Use
MemoryPool<byte>for buffers. DisposeIMemoryOwner<byte>when done. Never copy payload bytes unnecessarily.
- Version is in
Directory.Build.props(VersionPrefix) - Release notes go in
RELEASE_NOTES.mdusing#### VERSION DATE ####format build.ps1extracts version + notes and patches Directory.Build.props- Releases are triggered by pushing a git tag; GitHub Actions handles signing and publishing (migration from Azure DevOps tracked in #326)
Use these skills by name when the task matches. Invoke with /skill-name.
Skills prefixed with dotnet-skills: come from the Aaronontheweb/dotnet-skills marketplace. If a skill is not installed, add it via Claude Code's /install-skill or the dotnet-skills README.
akka-best-practices actors, supervision, error handling, work distribution
akka-testing-patterns Akka.Hosting.TestKit, TestProbes, persistence testing
analyze-racy-test flaky tests, race conditions, timing-dependent failures
csharp-coding-standards records, pattern matching, Span/Memory, async/await
csharp-concurrency-patterns Channels, async, choosing concurrency abstractions
csharp-api-design public API compat, versioning, extend-only design
csharp-type-design-performance sealed classes, readonly structs, collection choices
create-benchmark design new BenchmarkDotNet benchmarks
run-benchmark execute benchmarks and capture results
analyze-performance analyze benchmark results, profiler data, regressions
benchmark-workflow coordinated run + analyze workflow
testcontainers E2E tests with real brokers in Docker
crap-analysis code coverage + CRAP score risk hotspots
slopwatch detect reward hacking in code changes
project-structure Directory.Build.props, CPM, SourceLink, versioning
package-management NuGet CPM, dotnet add/remove/list
check-api-breaking API breaking change detection
review-pr comprehensive pull request review
create-release release notes, git tags, publish workflow
- If a workflow is repeated 3+ times, extract it into a repo skill or script
- Volatile project knowledge belongs in
PROJECT_CONTEXT.mdorTOOLING.md, not here - This file should remain compact and stable; update only for governance changes