Guide for agents working on MCServerLauncher-Future.
- Read
PROJECT_PLAN.mdfor product direction, architecture, scope, vocabulary, and fixed invariants. - Read
RULES.md; declare touched areas before code, runnable configuration, or project-rule changes. - Read
EXECUTE_PLAN.mdwhen changing phase work, backlog, or task priority. - Use
CLAUDE.mdas the compact index when context is tight. - Use
skills/mcsl-future/SKILL.mdfor daemon protocol, instance lifecycle, file/path handling, installer, serialization, WPF create-instance submission, or event-semantics work. - Read
harness.mdfor agent runtime workflow requirements (e.g. verify againstmicrosoft-docsskills/MCP before writing any .NET / Microsoft code).
Common touched areas: docs, agent-docs, frontend, backend, protocol, serialization, installer, storage, tests, benchmarks, workflow, and integrations.
MCServerLauncher-Future is a C#/.NET application suite for managing Minecraft servers and general console applications. It contains a Windows WPF client, a daemon service, a daemon client library, shared protocol contracts, source generators, protocol tests, and benchmarks.
- Repository:
MCServerLauncher-Future - Language/runtime: C# 14, .NET 10.0
- UI framework: WPF with
iNKORE.UI.WPF.Modern - Architecture: WPF client uses the daemon client remote application implementation over the sole
/api/v2TouchSocket WebSocket JSON-RPC endpoint plus versioned binary frames - License: Apache-2.0
- Team: MCSLTeam
- Copyright: 2022-2026 MCSLTeam
PROJECT_PLAN.md: product purpose, audience, scope, architecture, vocabulary, and invariants.RULES.md: activation-scoped implementation rules.EXECUTE_PLAN.md: phases, exit criteria, cross-phase dependencies, and near-term backlog.harness.md: agent-agnostic runtime workflow requirements (verify againstmicrosoft-docsbefore writing .NET/Microsoft code, etc.).src/MCServerLauncher.Daemon/.Resources/Docs/: daemon-facing protocol and manual documentation.README.mdandREADME_ZH.md: public-facing introduction; verify claims against project files before carrying them into governance docs.
Use /m:1 for WPF and other build checks when the task does not require full parallelism.
# Build the full solution
dotnet build MCServerLauncher.slnx /m:1
# Build major projects
dotnet build src/MCServerLauncher.WPF/MCServerLauncher.WPF.csproj /m:1
dotnet build src/MCServerLauncher.Daemon/MCServerLauncher.Daemon.csproj /m:1
dotnet build src/MCServerLauncher.Daemon.API/MCServerLauncher.Daemon.API.csproj /m:1
dotnet build src/MCServerLauncher.DaemonClient/MCServerLauncher.DaemonClient.csproj /m:1
# Run protocol tests
dotnet test tests/MCServerLauncher.ProtocolTests/MCServerLauncher.ProtocolTests.csproj /m:1
# Run benchmarks
dotnet run --project benchmarks/MCServerLauncher.Benchmarks/MCServerLauncher.Benchmarks.csproj -c Release
# Run apps
dotnet run --project src/MCServerLauncher.WPF/MCServerLauncher.WPF.csproj
dotnet run --project src/MCServerLauncher.Daemon/MCServerLauncher.Daemon.csproj
# Publish
dotnet publish src/MCServerLauncher.Daemon/MCServerLauncher.Daemon.csproj -c Release -r win-x64 --self-contained
dotnet publish src/MCServerLauncher.WPF/MCServerLauncher.WPF.csproj -c Release -r win-x64 --self-containedMCServerLauncher-Future/
├── src/MCServerLauncher.Common/ # Shared models, utilities, protocol contracts
├── src/MCServerLauncher.Daemon.API/ # Transport-neutral application and plugin contracts
├── src/MCServerLauncher.Daemon/ # Background daemon managing instances
├── generators/MCServerLauncher.Daemon.Plugin.Generators/ # Plugin manifest/adapter source generator, packed into the SDK
├── src/MCServerLauncher.DaemonClient/ # .NET daemon client library
├── src/MCServerLauncher.WPF/ # Windows WPF client
├── tests/MCServerLauncher.ProtocolTests/ # Protocol and integration tests
├── tests/MCServerLauncher.PluginIntegrationTests/ # Published-host plugin tests
├── tools/MCServerLauncher.ProtocolDocs/ # Catalog-derived OpenRPC/Apifox tooling
├── benchmarks/MCServerLauncher.Benchmarks/ # BenchmarkDotNet performance baselines
└── Sign/ # Code signing utilities
- Target:
net10.0-windows10.0.18362.0. Translations/:.resxresources for six-language i18n. UseLang.Tr[...]or established resource lookup helpers for user-facing strings.Modules/: initializer, language, settings, and app-level WPF logic.View/: pages, dialogs, and XAML components.ViewModels/: presentation state and command coordination.InstanceConsole/: console management for instances.Resources/: icons, fonts such as Montserrat and SegoeIcons, syntax highlighting resources.- Key dependencies:
iNKORE.UI.WPF.Modern, AvalonEdit, Serilog, Downloader.
- Target:
net10.0; the plugin-enabled product is an untrimmed JIT single-file host with sidecar plugins. Keep trim analysis enabled, but do not claim Native AOT or trimmed plugin-host support. Application/: the sole local implementation of transport-neutral instance, file, system, and event-rule behavior.Remote/Rpc/: JSON-RPC V2 parsing, dispatch, connection-owned outbound queues, typed remote events, and binary sessions.Plugins/: startup-only trusted plugin discovery, validation, lifecycle, and ownership cleanup.Storage/: file management, Java scanning, contained files.Management/: instance lifecycle, factories, Minecraft support, installers, process communication.Management/Factory/: instance factories such asMCUniversalFactoryandMCForgeFactoryusing[InstanceFactory].Management/Installer/: Minecraft Forge-family installer logic.Remote/Action/: RPC action handlers and generated registry execution.Remote/Event/: event triggering and fan-out.Console/: daemon CLI commands through Brigadier.NET.Utils/: status helpers and memory/system utilities.Contained/: embedded resources such asserver.jar.- Key dependencies: TouchSocket, Serilog, Brigadier.NET, RustyOptions, JWT libraries.
- Target:
net10.0. - Implements the same application contracts as the local daemon over JSON-RPC V2.
- Owns connection readiness, typed RPC calls, typed subscriptions, immutable instance-catalog mirroring, reconnect/resync behavior, and binary transfer sessions.
- Do not expose
ActionType,EventType, legacy packets, raw method strings, or fallback envelope parsing.
- Target:
net10.0; packable NuGet boundary. - Owns application interfaces, typed errors, published-state abstractions, typed RPC/event definitions, and the minimal startup plugin SDK.
- May depend only on Common, RustyOptions, BCL, and logging abstractions.
- Must not expose daemon implementation types, TouchSocket, MessagePipe, Serilog, root DI, mutable collections, or disposable resource handles.
- Target:
net10.0. ProtoType/: shared wire contracts, data structures, and enums.- Use
System.Text.Jsonexclusively for shared serialization assumptions. - Keep serialized contracts source-generation friendly and free of logging/runtime implementation dependencies.
generators/MCServerLauncher.Daemon.Plugin.Generatorsproduces plugin manifest and adapter code and is packed into the SDK package underanalyzers/dotnet/cs. It is current, not transitional.- The transitional V1 action generator it is sometimes confused with is already deleted.
tools/VerifyNoV1Runtime.ps1asserts it stays deleted, and that gate passes — do not go looking for a V1 generator to remove. - Every project reaching the generator must leave
TargetFrameworkundefined for it. The generator is single-targeted, so the SDK builds it with that property removed, and the solution builds it as a member the same way; a reach path that adds the property produces a second MSBuild project instance writing the sameobj/andbin/, which fails intermittently asCS0006,CS2012,MSB3713orMSB3030. Do not addSetTargetFrameworkto aProjectReferencepointing at it, and do not passTargetFrameworkfrom an<MSBuild>task.ProjectConfigurationTests.PluginGenerator_IsReachedWithTheSameGlobalPropertiesFromEveryProjectfails if either appears.
tests/MCServerLauncher.ProtocolTests/: integration and protocol behavior tests.benchmarks/MCServerLauncher.Benchmarks/: BenchmarkDotNet baselines for allocation, transport, and serialization-sensitive work.
- Docs or governance only: use
docs,agent-docs, orworkflow; inspect Markdown, terminology,git diff --check, andgit status --short. - WPF UI or workflow: use
frontend; checkRULES.mdWPF rules and build with/m:1. - Daemon behavior: use
backend; public application boundaries useTask<Result<T, DaemonError>>, while legacy managerErrorremains internal-only during migration. Preserve cancellation, daemon-side authority, and path validation. - Wire contracts or serializers: use
protocolandserialization; start with serialized DTOs in Common and typed application/catalog definitions in Daemon API, then update daemon, daemon client, WPF, docs tooling, tests, and benchmarks. - Application-core changes: use
backend; all non-implementation entrypoints must delegate tosrc/MCServerLauncher.Daemon/Application. - Plugin-host changes: use
backend,protocol,serialization,tests, andintegrations; preserve the startup-only three-capability boundary. - Installer changes: use
installerplusbackendorstorage; keep mirror behavior explicit and preserve Forge-family installer differences. - File/path changes: use
storage; validate trust boundaries daemon-side. - Tests or performance work: use
testsorbenchmarks; keep coverage proportional to behavioral risk. - External services or ecosystem docs: use
integrations; keep WebSocket, TouchSocket, Weblate, and related launcher references precise.
- Prefer existing project patterns and helpers over new abstractions.
- Keep edits scoped to the requested behavior and touched areas.
- Do not revert user or teammate changes without explicit instruction.
- When the work changes behavior, update docs and tests in the same task.
- Do not create or update plan history files, plan checklists, or plan changelogs under
docs/planordocs/superpowers/plansunless the user explicitly asks for a durable plan. - Before every commit, run
dotnet test tests/MCServerLauncher.ProtocolTests/MCServerLauncher.ProtocolTests.csproj /m:1and confirm the full protocol test suite passes. - Commit messages use
type(scope): subject.
- Do not preserve backward compatibility. Remove obsolete paths instead of adding compatibility layers, fallbacks, or migrations.
- Choose the simplest implementation that fully meets the current requirements. Avoid speculative abstractions, configuration, and indirection.
- Grow the system in layers. Start from the smallest version that works end to end, and add each new capability on top of a product that already works. Never trade a working product for unfinished complexity.
- Keep components modular and concerns clearly separated.
- Prefer established, well-maintained libraries when they reduce overall complexity or improve reliability. Do not reimplement common functionality without a clear reason.
- Lean on the dependencies already in the project before writing your own implementation or adding packages. Do not assume a library lacks a capability without checking its documentation and types.
- Make architectural decisions for the long term. Do not accept a stopgap that only works for now and is meant to be replaced later.
- Study how established products solve the problem before designing a solution. Adopt their proven patterns and conventions rather than inventing an approach from scratch.
- When testing is needed, run only the tests that cover the changed scope.
- Use PascalCase for classes, methods, properties, and events.
- Use camelCase for local variables and parameters.
- Use
_camelCasefor private fields. - Interfaces start with
I, for exampleIInstance,IInstanceManager, andIInstanceFactory. - Nullable reference types are enabled; address CS8618 with
required, nullable annotations, or initialization. - Use implicit usings where the project enables them.
- Attribute usage omits the
Attributesuffix, for example[InstanceFactory].
Use these terms consistently:
daemon: background service inMCServerLauncher.Daemon.WPF client: desktop UI inMCServerLauncher.WPF.daemon client: library inMCServerLauncher.DaemonClient.instance: managed server or console process with persisted config and lifecycle state.RPCandevent: V2 protocol concepts over WebSocket. Useactiononly for the retiring V1 runtime or migration inventory.metaandpayload: event/action data concepts.factory,installer,relay, andnotification: project terms with established meaning.Minecraft Java,Forge,Fabric,NeoForge,Quilt,Bedrock,Terraria, andUniversal: instance family terms.Universal(the code enum's generic fallback) is the correct name for the generic console-process family; there is noOtherExecutableinstance type in code.
Avoid replacing daemon with generic backend, server, or service when describing architecture. Do not call the WPF client the daemon.
- C# uses nullable reference types; keep changed projects warning-clean.
- Shared serialization uses
System.Text.Json; do not introduce Newtonsoft.Json. - Plugin-enabled daemon publish paths are untrimmed JIT single-file plus sidecars. Keep trim analysis and source-generated JSON, but do not reintroduce a Native AOT/trimmed plugin-host target.
- Protocol/plugin DTO metadata must be explicit
JsonTypeInfo; do not use reflection fallback or assembly scanning. - WPF user-facing strings must use
Lang.Tr[...]and resource keys. - WPF builds should use
/m:1to avoid transient generated-XAML issues. - Instance type support remains factory-driven through
IInstanceFactoryand[InstanceFactory]. - Protocol field or semantic changes need protocol tests.
- Performance-sensitive transport or serialization changes need a benchmark update or a clear reason existing benchmarks are sufficient.
- Client-daemon communication uses the sole
/api/v2JSON-RPC endpoint plus versioned binary frames over WebSocket. - Shared serialized wire contracts live in
src/MCServerLauncher.Common; application/plugin contracts live insrc/MCServerLauncher.Daemon.API. - Daemon behavior has one application implementation; transport, console, event rules, WPF, and plugins are entrypoints.
- The frozen typed catalog is the only source for dispatch, daemon-client metadata, runtime OpenRPC, and generated checked-in Apifox.
- Daemon-side validation is authoritative for security, lifecycle, and path safety.
- Meta-bearing events must preserve documented missing/null metadata semantics.
- Instance lifecycle paths should preserve cancellation support where the surrounding API exposes it.
- Installer code should validate cached or downloaded libraries with checksums when data provides them.
- WPF validation may prevent bad submissions, but it must not be the only safety check.
- Recent work focuses on byte-oriented transport paths and reducing avoidable string conversion.
- Serialization uses explicit source-generated
System.Text.Jsonmetadata for every protocol and plugin DTO. - Event fan-out should avoid duplicate serialization when semantics allow.
- Benchmarks should remain tied to meaningful protocol, transport, and serialization behavior.
- Performance logs may use
[PERF]markers when the surrounding code already does so. - Object pooling exists through
Microsoft.Extensions.ObjectPool; use it only where it removes measured allocation pressure.
If daemon startup fails with JSON parsing errors after model changes, outdated local config may need removal:
./config.json./daemon/instances/<uuid>/daemon_instance.json
Do not delete user config unless the user asks or the task explicitly authorizes cleanup.
RS2008 analyzer release-tracking warnings are non-critical unless the task touches generator packaging or diagnostics. Fix new generator warnings introduced by changed code.
Common nullable-warning locations include daemon installer JSON models and daemon action execution paths. Fix nullable warnings in changed code rather than broadly suppressing them.
CS8524 warnings indicate enum cases may be missing in switch expressions. Add explicit cases or a deliberate fallback.
Choose the smallest relevant set:
- Docs-only: inspect Markdown, run terminology search when vocabulary changes, then
git diff --check. - WPF:
dotnet build src/MCServerLauncher.WPF/MCServerLauncher.WPF.csproj /m:1 - Daemon:
dotnet build src/MCServerLauncher.Daemon/MCServerLauncher.Daemon.csproj /m:1 - Daemon API:
dotnet build src/MCServerLauncher.Daemon.API/MCServerLauncher.Daemon.API.csproj /m:1 - Daemon client:
dotnet build src/MCServerLauncher.DaemonClient/MCServerLauncher.DaemonClient.csproj /m:1 - Protocol:
dotnet test tests/MCServerLauncher.ProtocolTests/MCServerLauncher.ProtocolTests.csproj /m:1 - Generated docs:
dotnet run --project tools/MCServerLauncher.ProtocolDocs/MCServerLauncher.ProtocolDocs.csproj -- --check - V1 deletion:
pwsh -File tools/VerifyNoV1Runtime.ps1 - Plugin integration: publish daemon and fixtures, set
MCSL_PUBLISHED_DAEMON, then rundotnet test tests/MCServerLauncher.PluginIntegrationTests/MCServerLauncher.PluginIntegrationTests.csproj -c Release /m:1 - Benchmarks:
dotnet run --project benchmarks/MCServerLauncher.Benchmarks/MCServerLauncher.Benchmarks.csproj -c Release - Full solution:
dotnet build MCServerLauncher.slnx /m:1 - Final hygiene:
git diff --checkandgit status --short --branch
- Daemon machine-readable docs live under
src/MCServerLauncher.Daemon/.Resources/Docs/, primarilyapifox.jsonand embeddedprotocol/topics/*.mdresources. - WPF docs live under
src/MCServerLauncher.WPF/.Resources/Docs/. - Public READMEs exist in English and Chinese.
- Internationalization is managed through Weblate.
- Related projects include the Rust daemon experiment, the cross-platform Tauri launcher, and the browser web panel. Treat those as external unless the task explicitly crosses repo boundaries.
- Main branch is
master. - Keep commits concise and conventional:
type(scope): subject. - Check build warnings, especially nullable warnings, for touched projects.
- Before every commit, ensure the full
MCServerLauncher.ProtocolTestssuite passes. - Report known existing warnings separately from warnings introduced by the task.
- Do not stage or commit unrelated user-owned changes unless explicitly instructed.
- Do not restore, delete, or reformat unrelated user-owned changes.
- Do not move shared protocol types out of
src/MCServerLauncher.Common. - Do not make frontend-only checks authoritative for daemon security or path safety.
- Do not add reflection fallback or assembly-scanned DTO discovery to protocol/plugin paths.
- Do not expose daemon internals, TouchSocket, MessagePipe, Serilog, root DI, mutable runtime collections, or disposable handles through Daemon API.
- Do not add V1 fallback, dual dispatch, compatibility switches, plugin hot unload, hooks, factory/store/control/filesystem capabilities, or plugin dependencies to the first milestone.
- Do not rename protocol vocabulary casually.
- Do not add broad refactors to narrow fixes.
- Do not commit secrets, local credentials, generated build output, or private data.
TASKS.mdmay be absent in the current working tree; treat that as user-owned state unless instructed otherwise.- Local skills under
skills/may include user-provided untracked files. Do not clean them up without explicit instruction.