This document provides guidance for AI agents working in this repository.
Codebelt.SharedKernel is a foundational .NET library providing domain-driven design building blocks for time, correlation, tokens, and security concerns. The solution targets .NET 10.0, .NET 9.0, and .NET 8.0. It includes:
- Codebelt.SharedKernel — Core types for temporal operations (ClockSkew, CoordinatedUniversalTime, TimeToLive), correlation tracking (CorrelationId), token management (Token, TokenOptions), and security (AccessKey, Secret).
- Text encoding: UTF-8 for text files (enforced via
.editorconfig) - Template rewrites: Preserve UTF-8 explicitly when scripts or tools rewrite text files; avoid locale-dependent encoding defaults
- Namespaces: File-scoped namespaces are required (enforced via
.editorconfig) - Top-level statements: Not allowed (enforced via
.editorconfig) - Language version: Always use the latest C# features (
LangVersion=latest) - Nullable: Enable nullable reference types in all new code
- XML documentation: All public APIs must have XML documentation comments
- Testing: Use xUnit v3 with Codebelt.Extensions.Xunit base classes
src/— Production source codeCodebelt.SharedKernel/— Core domain types and building blocks- Temporal operations (ClockSkew.cs, CoordinatedUniversalTime.cs, TimeToLive.cs)
- Correlation tracking (CorrelationId.cs)
- Token management (Token.cs, TokenOptions.cs)
- Security types (Security/AccessKey.cs, Security/Secret.cs)
- Value objects (ComparableValueObject.cs)
test/— Unit and integration tests (project names end withTests)Codebelt.SharedKernel.Tests/— Unit tests for all core types
.nuget/— Per-package NuGet metadata (icon, README, release notes).docfx/— DocFX documentation configuration.github/— CI/CD workflows, contributing guidelines, Copilot instructions
- Test project names must end with
Tests(e.g.,{PROJECT_NAME}.Tests) - Test classes should inherit from the
Testbase class inCodebelt.Extensions.Xunit - Use
Microsoft.Testing.Platformas the test runner (UseMicrosoftTestingPlatformRunner=true) - All tests are executable (
OutputType=Exe) - Test namespaces must match the SUT namespace (System Under Test), without
.Testssuffix - See
.github/copilot-instructions.mdfor detailed test writing guidelines
- Centralized package versions via
Directory.Packages.props - Resolve new or updated
Directory.Packages.propsversions from NuGet.org and keep them on the latest stable listed releases - Centralized build configuration via
Directory.Build.props - MinVer for semantic versioning from Git tags
- Strong-name signing is enabled in CI environments (
CI=true) - Keep
.github/dependabot.ymlenabled at the repo root so central NuGet package management stays current
If a .bot/ folder exists at the root, it contains confidential, local-only working material for AI agents — product requirement documents (PRDs), design proposals, agentic loop state, and brainstorming outputs. This folder is gitignored and never committed.
When starting creative or design work (new features, architecture decisions, PRD drafts), use the brainstorming skill and save outputs to .bot/. Only move finalized, non-confidential instructions into AGENTS.md or .github/copilot-instructions.md.
Agents must never automatically commit code changes or push to remote repositories. Both actions require explicit user approval:
- Commits: Always request confirmation from the user before staging and committing code. Present a clear summary of the changes and wait for approval before executing the commit.
- Remote Operations: Do not push, pull, fetch, or interact with
originor any remote repository without explicit user instruction. These operations modify repository history and can cause data loss if performed unexpectedly.
Rationale: Automatic commits can clutter history with incomplete work, temporary debugging code, or unintended changes. Unexpected remote operations risk overwriting or losing commits on shared branches. Always require explicit user approval before performing these actions.
- Public API conventions belong in
.docfx/api/namespaces/and should be treated as the official documentation source for library behavior and naming vocabulary. - When adding or renaming public APIs, update the relevant namespace page in
.docfx/api/namespaces/if the change introduces or clarifies a convention. - Keep internal reasoning, exploratory notes, and agent discussion out of DocFX pages; summarize only stable public guidance.