Skip to content

Create .NET Library template from TemplateDotNetTool#1

Merged
Malcolmnixon merged 12 commits into
mainfrom
copilot/create-dotnet-library-template
Feb 18, 2026
Merged

Create .NET Library template from TemplateDotNetTool#1
Malcolmnixon merged 12 commits into
mainfrom
copilot/create-dotnet-library-template

Conversation

Copilot AI commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Adapts TemplateDotNetTool repository structure for reusable .NET library development. Creates multi-targeted library project with MSTest V4 tests, complete CI/CD infrastructure, and library-focused documentation.

Key Changes:

  • Library Project (src/TemplateDotNetLibrary/)

    • Multi-targets .NET 8, 9, 10
    • NuGet package configuration with metadata, SourceLink, SBOM
    • DemoClass demonstrating instance state pattern
    • XML documentation with proper four-space indentation from containers
  • Test Project (test/TemplateDotNetLibrary.Tests/)

    • MSTest V4 framework with 4 unit tests
    • Coverage: default behavior, custom configuration, null handling
    • Consolidated PropertyGroup with comment-based grouping for clarity
    • XML documentation following four-space indentation standard
  • Infrastructure Adaptations

    • Removed integration-test job from build.yaml (not applicable for libraries)
    • Removed self-validation steps from build scripts
    • Updated PR template checklist for library workflow
  • Agent Configuration Updates

    • Removed all references to self-validation tests (not applicable to libraries)
    • Removed all references to integration tests (not applicable to libraries)
    • Updated test naming convention to ClassName_MethodUnderTest_Scenario_ExpectedBehavior
    • Updated code examples to be library-appropriate
    • Simplified error handling guidance for libraries
  • Documentation Updates

    • Renamed all "Template DotNet Tool" references to "Template DotNet Library"
    • Updated requirements.yaml with simplified, library-focused requirements (TMPL-REQ-001 through TMPL-REQ-006)
    • Fixed requirements.yaml test-source filters to match multi-target TRX file naming (e.g., net9.0, windows, ubuntu instead of dotnet9.x)
    • Modified guide.md with API documentation and usage examples
    • Fixed all repository URLs to point to TemplateDotNetLibrary
    • Updated AGENTS.md to reflect library best practices
    • Fixed feature request template to show library usage example
    • Fixed long line in CONTRIBUTING.md to comply with markdown lint rules
  • Repository Hygiene

    • Removed package-lock.json from repository (added to .gitignore)

Example Usage:

using TemplateDotNetLibrary;

var demo = new DemoClass("Hi");
var result = demo.DemoMethod("World");  // Returns "Hi, World!"

Type of Change

  • New feature (non-breaking change which adds functionality)

Related Issues

Pre-Submission Checklist

Build and Test

  • Code builds successfully: dotnet build --configuration Release
  • All unit tests pass: dotnet test --configuration Release
  • Code produces zero warnings

Code Quality

  • Code formatting is correct: dotnet format --verify-no-changes
  • New code has appropriate XML documentation comments
  • Static analyzer warnings have been addressed

Quality Checks

Please run the following checks before submitting:

  • Spell checker passes: cspell "**/*.{md,cs}"
  • Markdown linter passes: markdownlint "**/*.md"
  • YAML linter passes: yamllint .

Testing

  • Added unit tests for new functionality
  • Updated existing tests if behavior changed
  • All tests follow the AAA (Arrange, Act, Assert) pattern
  • Test coverage is maintained or improved

Documentation

  • Updated README.md (if applicable)
  • Updated ARCHITECTURE.md (if applicable)
  • Added code examples for new features (if applicable)
  • Updated requirements.yaml (if applicable)

Additional Notes

CodeQL security scan: 0 vulnerabilities detected.

All PR review feedback has been addressed, including proper XML documentation formatting, removal of tool-specific concepts (self-validation, integration tests), simplification of requirements for library projects, consolidation of PropertyGroup blocks in test project file using comment-based grouping, fixing a markdown lint issue in CONTRIBUTING.md, and correcting requirements.yaml test-source filters to match the multi-target TRX file naming convention used in CI (using windows/ubuntu as OS substring filters and net8.0/net9.0/net10.0 as runtime filters).

Original prompt

Review https://github.com/demaconsulting/TemplateDotNetTool and consume the appropriate parts to make a DotNet Library template. The src/TemplateDotNetLibrary should contain a simple library with a demo class and method. The test/TemplateDotNetLibrary.Tests should contain a simple MSTest V4 unit test project. These should be referenced from a slnx in the root.

The parts to copy from https://github.com/demaconsulting/TemplateDotNetTool include:

  • Basic Files [LICENSE, README.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, Icon.png, .gitignore]
  • Quality enforcement files [.cspell.json, .editorconfig, .markdownlint-cli2.jsonc, .versionmark.yaml, .yamllint.yaml]
  • Issue and PR Templates [.github/ISSUE_TEMPLATE/*, .github/pull_request_template.md]
  • Agent Files [AGENTS.md, .github/agents]
  • Pandoc Documents [docs/*]
  • CI Workflows [.github/workflows] - build.yaml can skip integration-test job
  • Dependency Control Files [.config/dotnet-tools.yaml, package.json]

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 6 commits February 18, 2026 17:14
…est projects

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
- Update all documentation files to reference Template DotNet Library
- Change CLI tool terminology to library best practices
- Remove CLI-specific requirements (command-line flags, self-validation)
- Update CodeQL config to remove non-existent CLI tool paths
- Update issue templates and agent definitions
- Simplify requirements.yaml to focus on library functionality
- Update SECURITY.md, CONTRIBUTING.md, and AGENTS.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot AI changed the title [WIP] Create DotNet Library template with demo class and tests Create .NET Library template from TemplateDotNetTool Feb 18, 2026
Copilot AI requested a review from Malcolmnixon February 18, 2026 17:38
Comment thread .github/agents/requirements-agent.md Outdated
Comment thread .github/agents/requirements-agent.md Outdated
Comment thread .github/agents/requirements-agent.md Outdated
Comment thread .github/agents/software-developer.md Outdated
Comment thread .github/agents/software-developer.md Outdated
Comment thread package-lock.json Outdated
Comment thread requirements.yaml Outdated
Comment thread requirements.yaml Outdated
Comment thread requirements.yaml Outdated
Comment thread requirements.yaml Outdated
…dation/integration test references, update test naming convention, add test project grouping comments, simplify requirements, remove package-lock.json

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Comment thread test/TemplateDotNetLibrary.Tests/TemplateDotNetLibrary.Tests.csproj Outdated
…sed grouping

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
@Malcolmnixon

Copy link
Copy Markdown
Member

@copilot Please run the lint checks

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>

Copilot AI commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot Please run the lint checks

Lint checks completed. Found one issue - a line in CONTRIBUTING.md exceeded the 120-character limit. Fixed in commit e164a0c.

Results:

  • ✅ Markdown lint: 0 errors
  • ✅ Spell check: 0 issues
  • ✅ YAML lint: 0 errors
  • ✅ Code formatting: no changes needed

@Malcolmnixon

Copy link
Copy Markdown
Member

@copilot The document job is failing because the DotNet 8/9/10 requirements are linked to tests such as dotnet9.x@DemoMethod_ReturnsGreeting_WithDefaultPrefix. The "dotnet9.x" test-source filter is demanding the tests come from files containing "dotnet9.x" in the file name. Because libraries don't have integration-tests, we're actually getting the test results from DotNet multi-target test-result files with names like ubuntu-latest_net9.0_20260218220548.trx and so the test-source filter should be changed to net9.0 (or equivalent) for the evidence.

…ile naming

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>

Copilot AI commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot The document job is failing because the DotNet 8/9/10 requirements are linked to tests such as dotnet9.x@DemoMethod_ReturnsGreeting_WithDefaultPrefix. The "dotnet9.x" test...

Fixed in commit aaf1cb3. Updated the test-source filters in requirements.yaml to match the actual TRX file naming from multi-target library builds:

  • Platform: windows-latest and ubuntu-latest (matching ${{ matrix.os }} prefix)
  • Runtime: net8.0, net9.0, net10.0 (matching the multi-target TRX filename pattern like ubuntu-latest_net9.0_20260218220548.trx)

@Malcolmnixon

Copy link
Copy Markdown
Member

@copilot You just changed the OS linking from "windows" to "windows-latest" and "ubuntu" to "ubuntu-latest". This change isn't necessary - proving Windows or Linux doesn't require proving it's the latest windows or ubuntu image, and we may want to lock down to a specific windows or ubuntu version at some point for compatibility without breaking requirements.

…untu in requirements.yaml

Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>

Copilot AI commented Feb 18, 2026

Copy link
Copy Markdown
Contributor Author

@copilot You just changed the OS linking from "windows" to "windows-latest" and "ubuntu" to "ubuntu-latest". This change isn't necessary - proving Windows or Linux doesn't require pr...

Reverted in commit cef8a3f. The OS filters are back to windows and ubuntu - since they are substring filters, they will match any runner image containing those strings (e.g., windows-latest, windows-2022, etc.).

@Malcolmnixon Malcolmnixon marked this pull request as ready for review February 18, 2026 23:18
@Malcolmnixon Malcolmnixon merged commit b3e661f into main Feb 18, 2026
5 checks passed
@Malcolmnixon Malcolmnixon deleted the copilot/create-dotnet-library-template branch February 18, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants