Thank you for your interest in contributing! This document provides guidelines and instructions for contributors.
AgentFrameworkToolkit/
├── src/ # Library packages
│ ├── AgentFrameworkToolkit/ # Core library
│ └── AgentFrameworkToolkit.*/ # Provider-specific packages
├── development/ # Development resources and tests
│ ├── Sandbox/ # Sandbox area for various testing while coding
│ ├── Secrets/ # UserSecrets LLM API Keys etc.
│ └── Tests/ # Unit tests
├── nuget-package.props # NuGet package metadata
├── Directory.Packages.props # Central package version management
├── Directory.Build.props # Shared build properties
├── Directory.Build.targets # Shared build targets
├── README.md # Package documentation (goes to NuGet)
├── CHANGELOG.md # Version history
└── CONTRIBUTING.md # This file
- .NET 8.0 SDK or later (core libraries)
- .NET 10.0 SDK (development utilities in the
development/folder target net10.0) - IDE: Visual Studio 2022, VS Code, or JetBrains Rider
git clone https://github.com/rwjdk/AgentFrameworkToolkit.git
cd AgentFrameworkToolkitdotnet restoredotnet build --configuration Releasedotnet test --configuration ReleaseAll package versions are centrally managed in Directory.Packages.props. When adding or updating a package:
-
Add/update the version in
Directory.Packages.props:<PackageVersion Include="PackageName" Version="1.2.3" />
-
Reference it in project files without version:
<PackageReference Include="PackageName" />
Common build properties are defined in:
Directory.Build.props: Shared settings (TargetFramework, Nullable, TreatWarningsAsErrors, etc.)Directory.Build.targets: Packaging standards (SourceLink, symbols, package validation)nuget-package.props: NuGet metadata (authors, license, icon, README)
-
Create a new project under
src/:dotnet new classlib -n AgentFrameworkToolkit.NewProvider -o src/AgentFrameworkToolkit.NewProvider
-
Update the
.csprojfile:<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <Description>An opinionated C# Toolkit targeting NewProvider for Microsoft Agent Framework that makes life easier</Description> </PropertyGroup> <Import Project="..\..\nuget-package.props" /> <ItemGroup> <PackageReference Include="NewProvider.SDK" /> </ItemGroup> <ItemGroup> <ProjectReference Include="..\AgentFrameworkToolkit\AgentFrameworkToolkit.csproj" /> </ItemGroup> </Project>
-
Add the package version to
Directory.Packages.props -
Add the project to
AgentFrameworkToolkit.slnxunder the/Packages/folder
dotnet run --project development/Sandbox/Sandbox.csprojThe sandbox references every provider package so you can experiment with agent flows locally. Configure API keys via dotnet user-secrets or the development/Secrets utility below before running it.
dotnet run --project development/Secrets/Secrets.csprojUse this helper to manage local secrets (API keys, endpoints, etc.) that both the sandbox and tests consume.
- C# Version: Latest (defined in
Directory.Build.props) - Nullable Reference Types: Enabled
- Warnings as Errors: Enabled (
TreatWarningsAsErrors=true) - Code Analysis: Enabled with
AnalysisLevel=latest - EditorConfig: Follow the rules defined in
.editorconfig(repo root) andsrc/.editorconfig
- Classes:
PascalCase - Methods:
PascalCase - Parameters:
camelCase - Private fields:
_camelCase(with underscore) - Constants:
PascalCase
All public APIs must have XML documentation:
/// <summary>
/// Creates a new agent with the specified options.
/// </summary>
/// <param name="options">The agent configuration options.</param>
/// <returns>A configured AI agent instance.</returns>
public OpenAIAgent CreateAgent(OpenAIAgentOptions options)
{
// ...
}-
Branch Naming:
- Features:
feature/description - Bug fixes:
fix/description - Chores:
chore/description
- Features:
-
Commit Messages:
- Use conventional commits:
type: description - Types:
feat,fix,docs,chore,refactor,test,style - Example:
feat: add support for streaming responses
- Use conventional commits:
-
PR Description:
- Clearly describe what the PR does
- Reference related issues (e.g.,
Fixes #123) - Include examples if adding new features
-
Before Submitting:
- Ensure all tests pass:
dotnet test - Build succeeds:
dotnet build --configuration Release - No warnings or errors
- Code follows existing patterns
- Ensure all tests pass:
All packages are versioned together (coordinated releases). Version is defined in nuget-package.props:
<PackageVersion>1.0.0-preview.251217.1</PackageVersion>Version format: MAJOR.MINOR.PATCH-preview.YYMMDD.BUILD
When making changes that affect users, update CHANGELOG.md:
## Version X.Y.Z-preview.YYMMDD.BUILD
- Added: New feature description
- Fixed: Bug fix description
- [BREAKING]: Breaking change description- Unit Tests: Located in
development/Tests/ - How to run:
dotnet test development/Tests/Tests.csproj --configuration Release(or rundotnet test AgentFrameworkToolkit.sln) - Test Framework: xUnit v3
- Coverage: Aim for high coverage on public APIs
- Naming:
MethodName_Scenario_ExpectedBehavior
Example:
[Fact]
public void CreateAgent_WithValidOptions_ReturnsAgent()
{
// Arrange
var factory = new OpenAIAgentFactory("api-key");
var options = new OpenAIAgentOptions { Model = "gpt-4" };
// Act
var agent = factory.CreateAgent(options);
// Assert
Assert.NotNull(agent);
}- Update version in
nuget-package.props - Update
CHANGELOG.mdwith changes - Create PR with version bump
- After merge, CI/CD will:
- Build all packages
- Run tests
- Push to NuGet (if configured)
- The GitHub Actions workflow defined in
.github/workflows/Build.ymlexecutes the restore/build/test/pack sequence for every PR and push. - Keep your local verification steps aligned with that workflow so CI stays green.
- Bugs: Open an issue
- Questions: Start a discussion
By contributing, you agree that your contributions will be licensed under the MIT License.