Skip to content

Latest commit

 

History

History
63 lines (43 loc) · 4.29 KB

File metadata and controls

63 lines (43 loc) · 4.29 KB

Agent Instructions for Codebelt.Unitify

This document provides guidance for AI agents working in this repository.

Project Overview

Codebelt.Unitify is an open-source MIT-licensed .NET library that simplifies unit management with comprehensive metric and binary support for prefixes, multiples, and submultiples. It provides types for working with units of measure including SI units (meter, kilogram, second, ampere, kelvin, mole, candela), prefixes (kilo, mega, milli, micro, etc.), and binary prefixes (kibi, mebi, gibi, etc.). The solution targets .NET 10.0 and .NET 9.0.

Coding Standards

  • 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.App base classes

Project Structure

  • src/ — Production source code
  • test/ — Unit and integration tests (project names end with Tests)
  • .nuget/ — Per-package NuGet metadata (icon, README, release notes)
  • .docfx/ — DocFX documentation configuration
  • .github/ — CI/CD workflows, contributing guidelines, Copilot instructions

Test Conventions

  • Test project names must end with Tests (e.g. {PROJECT_NAME}.Tests)
  • Test classes should inherit from the appropriate base class in Codebelt.Extensions.Xunit
  • Use Microsoft.Testing.Platform as the test runner (UseMicrosoftTestingPlatformRunner=true)
  • All tests are executable (OutputType=Exe)

Build & CI

  • Centralized package versions via Directory.Packages.props
  • Resolve new or updated Directory.Packages.props versions 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.yml enabled at the repo root so central NuGet package management stays current

.bot/ Folder

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.

Git Operations Safeguards

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 origin or 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.

Official Documentation

  • 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.