alexa-skills-dotnet
AGENTS.md554 starsChanged 22 months agoMITView on GitHub
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. The repository uses GitHub Actions for continuous integration:
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
29 rules. About 1 is common, 19 are distinctive, and 9 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 71
Target Framework: All code must target .NET Standard 2.0 for maximum compatibility
- Distinctive: line 73
JSON Serialization: Use Newtonsoft.Json for all JSON operations
- Distinctive: line 74
Naming: Follow standard C# naming conventions (PascalCase for classes, methods, properties.
- Distinctive: line 77
Use meaningful names for classes, methods, and variables
- Distinctive: line 78
Keep methods focused and single-purpose
- Distinctive: line 79
Add XML documentation comments for public APIs
- Distinctive: line 80
Follow existing patterns in the codebase for consistency
- Very specific: line 83
All Alexa requests inherit from Request base class
- Very specific: line 84
All responses use SkillResponse object model
- Very specific: line 85
Use ResponseBuilder helper class for creating responses (e.g., ResponseBuilder.Tell(), ResponseBuilder.Ask())
- Very specific: line 89
Place tests in Alexa.NET.Tests project
- Very specific: line 90
Follow existing test naming patterns (e.g., *Tests.cs)
- Distinctive: line 91
Use xUnit test framework
- Distinctive: line 123
Do not add or update dependencies without justification
- Distinctive: line 125
Consider impact on existing consumers when updating Newtonsoft.Json version
- Distinctive: line 128
Avoid breaking changes to public APIs
- Distinctive: line 130
Document any necessary breaking changes clearly
- Common: line 134
Never commit secrets, API keys, or certificates to the repository
- Distinctive: line 138
Follow secure coding practices for JSON deserialization
- Very specific: line 143
Create a new class in /Alexa.NET/Request/ that inherits from Request
- Very specific: line 145
Add corresponding tests in /Alexa.NET.Tests/
- Distinctive: line 146
Update documentation if it's a user-facing feature
- Very specific: line 149
Create appropriate classes in /Alexa.NET/Response/
- Very specific: line 150
Add helper methods to ResponseBuilder if applicable
- Distinctive: line 152
Document usage patterns in code comments
- Distinctive: line 155
Write a failing test that reproduces the bug
- Distinctive: line 157
Ensure the test passes
- Distinctive: line 158
Run full test suite to check for regressions
- Distinctive: line 159
Update documentation if behavior changes
≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AI Agent Guide for Alexa Skills SDK .NET
This file provides guidance for AI coding agents working with the Alexa Skills SDK for .NET repository.
Project Overview
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)
Repository Structure
/Alexa.NET/ # Main library source code
/Alexa.NET.Tests/ # Unit tests
/docs/ # Documentation files
/.github/workflows/ # CI/CD GitHub Actions workflowsSetup and Prerequisites
Prerequisites
- .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)
Initial Setup
# Restore dependencies
dotnet restore
# Build the project
dotnet build --configuration ReleaseBuild Commands
# 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-buildTesting
# 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 normalCoding Conventions
General Guidelines
- 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)
Code Style
- 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
Request/Response Handling
- 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
Testing Patterns
- 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
Project Files
- 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)
CI/CD Workflows
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
Workflow Commands
The CI/CD pipeline executes:
dotnet restoredotnet build --configuration Release --no-restoredotnet test(via custom action)dotnet pack --configuration Release -o finalpackage --no-build
Boundaries and Restrictions
Do Not Modify
.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
Dependency Management
- 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
Breaking Changes
- Avoid breaking changes to public APIs
- Maintain backward compatibility where possible
- Document any necessary breaking changes clearly
Security Considerations
- 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
Common Tasks
Adding a New Request Type
- 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
Adding a New Response Type
- 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
Fixing Bugs
- 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 Publishing
- 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
Additional Notes
- 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

