This file provides guidance for AI coding agents working with the Alexa Skills SDK for .NET repository.
Alexa.NET is a helper library for working with Amazon Alexa skill requests/responses in C#. The library provides a strongly-typed object model for the Alexa API, supporting both AWS Lambda and self-hosted service scenarios.
- Language: C# / .NET
- Target Framework: .NET Standard 2.0
- Primary Library: Alexa.NET
- Test Framework: xUnit (used in Alexa.NET.Tests)
- Key Dependencies: Newtonsoft.Json (12.0.2)
/Alexa.NET/ # Main library source code
/Alexa.NET.Tests/ # Unit tests
/docs/ # Documentation files
/.github/workflows/ # CI/CD GitHub Actions workflows
- .NET SDK 6.0.x or later (recommended for development; the library targets .NET Standard 2.0)
- Visual Studio 2019+ or Visual Studio Code (optional)
# Restore dependencies
dotnet restore
# Build the project
dotnet build --configuration Release# Restore NuGet packages
dotnet restore
# Build in Debug mode
dotnet build --configuration Debug
# Build in Release mode
dotnet build --configuration Release --no-restore
# Create NuGet package
dotnet pack --configuration Release -o finalpackage --no-build# Run all tests
dotnet test
# Run tests for specific project
dotnet test Alexa.NET.Tests/Alexa.NET.Tests.csproj
# Run tests with detailed output
dotnet test --verbosity normal- Target Framework: All code must target .NET Standard 2.0 for maximum compatibility
- C# Version: Language version 8.0 is configured in the project
- JSON Serialization: Use Newtonsoft.Json for all JSON operations
- Naming: Follow standard C# naming conventions (PascalCase for classes, methods, properties; camelCase for private fields)
- Use meaningful names for classes, methods, and variables
- Keep methods focused and single-purpose
- Add XML documentation comments for public APIs
- Follow existing patterns in the codebase for consistency
- All Alexa requests inherit from
Requestbase class - All responses use
SkillResponseobject model - Use
ResponseBuilderhelper class for creating responses (e.g.,ResponseBuilder.Tell(),ResponseBuilder.Ask()) - Support for SSML via
SsmlOutputSpeechclass
- Place tests in
Alexa.NET.Testsproject - Follow existing test naming patterns (e.g.,
*Tests.cs) - Use xUnit test framework
- Include tests for new features and bug fixes
- Alexa.NET.csproj: Main library project file - contains version, package metadata, and dependencies
- Alexa.NET.sln: Solution file containing both library and test projects
- README.md: User-facing documentation (keep distinct from AGENTS.md)
The repository uses GitHub Actions for continuous integration:
- PR Build (
prbuild.yaml): Runs on pull requests - builds and tests the code - Build and Deploy (
build.yml): Runs on master branch - builds, tests, packs, signs, and publishes to NuGet
The CI/CD pipeline executes:
dotnet restoredotnet build --configuration Release --no-restoredotnet test(via custom action)dotnet pack --configuration Release -o finalpackage --no-build
.github/workflows/directory - CI/CD workflow files (*.yml and *.yaml) unless specifically taskedalexa-skills-dotnet.snk- Strong name key filenuget-icon.png- Package icon- Version numbers in
Alexa.NET.csprojwithout explicit instruction
- Do not add or update dependencies without justification
- Maintain compatibility with .NET Standard 2.0
- Consider impact on existing consumers when updating Newtonsoft.Json version
- Avoid breaking changes to public APIs
- Maintain backward compatibility where possible
- Document any necessary breaking changes clearly
- Never commit secrets, API keys, or certificates to the repository
- The
.pfxcertificate file is already in.gitignore - Review authentication and authorization code carefully
- Validate all input from Alexa requests
- Follow secure coding practices for JSON deserialization
- Create a new class in
/Alexa.NET/Request/that inherits fromRequest - Implement required properties and JSON serialization attributes
- Add corresponding tests in
/Alexa.NET.Tests/ - Update documentation if it's a user-facing feature
- Create appropriate classes in
/Alexa.NET/Response/ - Add helper methods to
ResponseBuilderif applicable - Include tests for serialization and builder methods
- Document usage patterns in code comments
- Write a failing test that reproduces the bug
- Fix the bug with minimal code changes
- Ensure the test passes
- Run full test suite to check for regressions
- Update documentation if behavior changes
- Package is published to NuGet.org automatically on merge to master
- Package is also published to GitHub Packages
- Signing is handled automatically in the workflow
- Version is read from
VersionPrefixinAlexa.NET.csproj - Release notes are read from
PackageReleaseNotesin project file
- This is a community-driven project following the .NET Foundation Code of Conduct
- The project uses the
all-contributorsspecification - Spanish documentation is available in
/docs/README_es.md - The library serves as a foundation for various Alexa skill extensions by other contributors