The main library lives in src/DevOp.Toon, with public runtime APIs such as ToonEncoder, ToonDecoder, options, and DI registration. Internal parser and encoder code is grouped under Internal/Decode, Internal/Encode, and Internal/Shared. src/DevOp.Toon.API.TestHost contains a minimal ASP.NET host used for integration and profiling scenarios. Tests live in tests/DevOp.Toon.Tests, split between ManualTests for hand-written coverage and GeneratedTests for TOON spec fixtures. Benchmark code and sample payloads live in benchmarks/DevOp.Toon.Benchmarks. Supporting docs are under Documentation/.
Run commands from the repository root:
dotnet restore DevOp.Toon.slnx
dotnet build DevOp.Toon.slnx
dotnet test DevOp.Toon.slnx
dotnet test DevOp.Toon.slnx --collect:"XPlat Code Coverage"
./specgen.shdotnet build compiles the multi-targeted library (netstandard2.0, net8.0, net9.0, net10.0). dotnet test runs the xUnit suite for the OS-supported test frameworks defined in Directory.Build.props. Use specgen.sh or specgen.ps1 after changing encoding or decoding behavior so generated tests stay aligned with the TOON specification.
Follow standard C# conventions: 4-space indentation, PascalCase for public types and members, camelCase for locals and parameters, and one type per file named after the type. Nullable reference types and implicit usings are enabled; keep new code nullable-safe and avoid dynamic unless the API requires it. Prefer small focused helpers inside the existing Internal/* folders rather than adding cross-cutting utility files.
This repository uses xUnit with coverlet.collector. Name test files with the feature under test plus Tests or Manual, for example ToonDecoderTests.cs or ArraysObjectsManual.cs. Add or update generated fixtures when behavior tracks the TOON spec, and keep manual tests for regressions, options, and service integration. Maintain high coverage; CONTRIBUTING.md sets the target at 85%+ line coverage.
Maintain documentation in Markdown inside this repository where useful, but treat the live Wiki.js site as the published documentation source of truth. Update README.md, src/DevOp.Toon/README.md, and relevant Documentation/ files when package usage, benchmarks, protocol notes, or development workflow change. Do not update Confluence as part of the workflow. Do not assume Documentation/DocMost/ is current; it is legacy reference material unless the user explicitly asks to use it.
When performing git commit, the agent must follow a structured workflow that ensures:
- accurate commit messages
- consistent
PackageReleaseNotes - alignment between code changes and published packages
When the user runs git commit, the agent must:
- Inspect staged changes (
git diff --staged) - Identify intent and impact of the change
- Detect affected packable projects (
.csprojwithPackageId) - Update
PackageReleaseNoteswhere relevant - Stage updated
.csprojfiles - Generate a high-quality commit message
- Perform the commit
If no files are staged:
- Do not guess
- Respond that there are no staged changes
A project is considered packable if:
.csprojcontains<PackageId>- OR it is clearly part of a NuGet-distributed package
Only update release notes for:
- projects affected by the staged changes
Update PackageReleaseNotes only if the change impacts consumers, including:
- New features or capabilities
- Bug fixes
- Behavior changes
- Performance improvements
- Serialization / protocol changes (important for DevOp.Toon)
- Compatibility changes (.NET targets, dependencies)
- Documentation that affects usage
Do NOT update if:
- purely internal refactoring with no external impact
- formatting, renaming, or non-functional changes
- test-only changes
PackageReleaseNotes must follow this structure:
- First line: short summary sentence
- Followed by 3–6 bullet points
- Each bullet starts with a strong verb
Adds– new functionalityImproves– enhancements or performanceFixes– bug fixesBreaking– breaking changes (must be explicit)Updates– meaningful dependency/platform updates only
- Focus on consumer impact
- Be specific (no vague phrases like
updatesorvarious fixes) - Use present tense
- Keep concise (max ~5–10 lines)
- Plain text only (NuGet-friendly)
- No marketing language or fluff
<PackageReleaseNotes>
Improves TOON protocol handling and serialization consistency.
- Adds support for updated TOON 3.0 structures
- Improves token efficiency and output formatting
- Fixes edge cases in nested object serialization
- Improves compatibility across .NET target frameworks
</PackageReleaseNotes>