This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Microsoft Agent 365 DevTools CLI (a365) - A .NET CLI tool built on .NET 8.0 with support for running on .NET 8.0 or higher (e.g., .NET 9, 10). Used for deploying and managing Microsoft Agent 365 applications on Azure. Supports .NET, Node.js, and Python applications with auto-detection.
# Install CLI locally (from repo root)
.\scripts\cli\install-cli.ps1
# Manual build and install
cd src/Microsoft.Agents.A365.DevTools.Cli
dotnet clean
dotnet build -c Release
dotnet pack -c Release --no-build
dotnet tool install -g Microsoft.Agents.A365.DevTools.Cli --add-source ./bin/Release --prerelease
# Restore all dependencies
cd src
dotnet restore dirs.proj
dotnet restore tests.proj
# Build all projects
dotnet build dirs.proj --configuration Release# Run all tests
cd src
dotnet test tests.proj --configuration Release
# Run specific test class
dotnet test --filter "FullyQualifiedName~SetupCommandTests"
# Run with coverage
dotnet test --collect:"XPlat Code Coverage"Test Framework: xUnit with FluentAssertions and NSubstitute
Test Location: src/Tests/Microsoft.Agents.A365.DevTools.Cli.Tests/
Parallel Test Execution: Tests modifying environment variables or shared resources must disable parallelization:
[CollectionDefinition("EnvTests", DisableParallelization = true)]
public class EnvTestCollection { }
[Collection("EnvTests")]
public class MyTests { }src/Microsoft.Agents.A365.DevTools.Cli/
├── Commands/ # CLI command implementations (AsyncCommand<Settings>)
├── Services/ # Business logic (ConfigService, DeploymentService, etc.)
├── Models/ # Data models (Agent365Config, etc.)
├── Constants/ # Centralized error codes, messages, auth constants
├── Exceptions/ # Custom exceptions
├── Templates/ # Embedded resources (manifest.json, icons)
└── Helpers/ # Helper utilities
-
Command Pattern: Commands inherit from
AsyncCommand<Settings>, return exit codes (0=success) -
Configuration Architecture (Two-file design):
a365.config.json- Static, user-managed, version-controlleda365.generated.config.json- Dynamic, CLI-managed, gitignoredAgent365Configmodel has init-only (static) and get/set (dynamic) properties
-
Platform Builder Strategy:
IPlatformBuilderinterface with implementations for DotNet, Node, Python -
Dependency Injection: ServiceCollection in Program.cs with singletons for stateless services
ConfigService- Configuration load/merge/save with environment variable overridesDeploymentService- Multiplatform deployment orchestrationPlatformDetector- Auto-detect project type (.NET/Node/Python)AuthenticationService- MSAL.NET for Azure and Graph authenticationGraphApiService- Microsoft Graph API interactions
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.- Commands:
{Verb}Command.cs - Services:
{Noun}Service.csor{Noun}Configurator.cs - Tests:
{ClassName}Tests.cs - Private fields:
_camelCase - Public properties:
PascalCase
- No emojis in code, comments, logs, or output
- Nullable reference types enabled (strict null checking)
- Warnings treated as errors
- All
IDisposableobjects must be disposed (especiallyHttpResponseMessage) - Cross-platform compatibility required (Windows, macOS, Linux)
- Use centralized error codes from
Constants/ErrorCodes.cs - Use centralized messages from
Constants/ErrorMessages.cs - Structured logging with
ILogger<T>and named placeholders
Central NuGet package management in src/Directory.Packages.props. Key dependencies:
- System.CommandLine v2.0.0-beta4
- Microsoft.Identity.Client (MSAL.NET)
- Azure.ResourceManager.* (Azure SDK)
- Microsoft.Graph (Graph API)
- ModelContextProtocol (MCP support)
- docs/design.md - Repository-level architecture, patterns, decisions
- src/Microsoft.Agents.A365.DevTools.Cli/design.md - CLI project architecture, configuration system
- src/Microsoft.Agents.A365.DevTools.MockToolingServer/design.md - Mock MCP server architecture
- src/DEVELOPER.md - How to develop, build, test, contribute
- Agent 365 CLI reference - CLI usage guide with examples
.github/copilot-instructions.md- Code standards and review rulesdocs/commands/- Index/pointers to CLI command documentation on Microsoft Learn
- Check for "Kairo" keyword - flag for review if found
- Verify Microsoft copyright header on all .cs files
- Ensure SOLID principles are followed
- Resource disposal for all IDisposable objects
- Cross-platform compatibility