Project-specific guidance for agents working on Template DotNet Tool - a reference implementation demonstrating best practices for DEMA Consulting .NET CLI tools.
- Requirements Agent - Develops requirements and ensures test coverage linkage
- Technical Writer - Creates accurate documentation following regulatory best practices
- Software Developer - Writes production code and self-validation tests in literate style
- Test Developer - Creates unit and integration tests following AAA pattern
- Code Quality Agent - Enforces linting, static analysis, and security standards
- Repo Consistency Agent - Ensures downstream repositories remain consistent with template patterns
- C# (latest), .NET 8.0/9.0/10.0, dotnet CLI, NuGet
requirements.yaml- All requirements with test linkage (enforced viadotnet reqstream --enforce).editorconfig- Code style (file-scoped namespaces, 4-space indent, UTF-8+BOM, LF endings).cspell.json,.markdownlint-cli2.jsonc,.yamllint.yaml- Linting configs
- All requirements MUST be linked to tests (prefer
TemplateTool_*self-validation tests) - Not all tests need to be linked to requirements (tests may exist for corner cases, design testing, failure-testing, etc.)
- Enforced in CI:
dotnet reqstream --requirements requirements.yaml --tests "test-results/**/*.trx" --enforce - When adding features: add requirement + link to test
Test links in requirements.yaml can include a source filter prefix to restrict which test results count as
evidence. This is critical for platform and framework requirements - do not remove these filters.
windows@TestName- proves the test passed on a Windows platformubuntu@TestName- proves the test passed on a Linux (Ubuntu) platformnet8.0@TestName- proves the test passed under the .NET 8 target frameworknet9.0@TestName- proves the test passed under the .NET 9 target frameworknet10.0@TestName- proves the test passed under the .NET 10 target frameworkdotnet8.x@TestName- proves the self-validation test ran on a machine with .NET 8.x runtimedotnet9.x@TestName- proves the self-validation test ran on a machine with .NET 9.x runtimedotnet10.x@TestName- proves the self-validation test ran on a machine with .NET 10.x runtime
Without the source filter, a test result from any platform/framework satisfies the requirement. Adding the filter ensures the CI evidence comes specifically from the required environment.
- Test Naming:
TemplateTool_MethodUnderTest_Scenariofor self-validation tests - Self-Validation: All tests run via
--validateflag and can output TRX/JUnit format - Test Framework: Uses DemaConsulting.TestResults library for test result generation
- XML Docs: On ALL members (public/internal/private) with spaces after
///in summaries - Errors:
ArgumentExceptionfor parsing,InvalidOperationExceptionfor runtime issues - Namespace: File-scoped namespaces only
- Using Statements: Top of file only (no nested using declarations except for IDisposable)
- String Formatting: Use interpolated strings ($"") for clarity
- Context.cs: Handles command-line argument parsing, logging, and output
- Program.cs: Main entry point with version/help/validation routing
- Validation.cs: Self-validation tests with TRX/JUnit output support
# Build the project
dotnet build --configuration Release
# Run unit tests
dotnet test --configuration Release
# Run self-validation
dotnet run --project src/DemaConsulting.TemplateDotNetTool \
--configuration Release --framework net10.0 --no-build -- --validate
# Use convenience scripts
./build.sh # Linux/macOS
build.bat # Windows- User Guide:
docs/guide/guide.md - Requirements:
requirements.yaml-> auto-generated docs - Build Notes: Auto-generated via BuildMark
- Code Quality: Auto-generated via CodeQL and SonarMark
- Trace Matrix: Auto-generated via ReqStream
- CHANGELOG.md: Not present - changes are captured in the auto-generated build notes
- AI agent markdown files (
.github/agents/*.md): Use inline links[text](url)so URLs are visible in agent context - README.md: Use absolute URLs (shipped in NuGet package)
- All other markdown files: Use reference-style links
[text][ref]with[ref]: urlat document end
- Quality Checks: Markdown lint, spell check, YAML lint
- Build: Multi-platform (Windows/Linux)
- CodeQL: Security scanning
- Integration Tests: .NET 8/9/10 on Windows/Linux
- Documentation: Auto-generated via Pandoc + Weasyprint
# Format code
dotnet format
# Run all linters
./lint.sh # Linux/macOS
lint.bat # Windows
# Pack as NuGet tool
dotnet pack --configuration ReleaseWhen agents need to write report files to communicate with each other or the user, follow these guidelines:
- Naming Convention: Use the pattern
AGENT_REPORT_xxxx.md(e.g.,AGENT_REPORT_analysis.md,AGENT_REPORT_results.md) - Purpose: These files are for temporary inter-agent communication and should not be committed
- Exclusions: Files matching
AGENT_REPORT_*.mdare automatically:- Excluded from git (via .gitignore)
- Excluded from markdown linting
- Excluded from spell checking