Claude-skill-registry a2a-sdk-patterns
SDK installation and setup patterns for Agent-to-Agent Protocol across Python, TypeScript, Java, C#, and Go. Use when implementing A2A protocol, setting up SDKs, configuring authentication, or when user mentions SDK installation, language-specific setup, or A2A integration.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/a2a-sdk-patterns" ~/.claude/skills/majiayu000-claude-skill-registry-a2a-sdk-patterns && rm -rf "$T"
skills/data/a2a-sdk-patterns/SKILL.md- pip install
- references .env files
- references API keys
Agent-to-Agent Protocol SDK Patterns
Purpose: Provide installation, configuration, and usage patterns for A2A Protocol SDKs across multiple programming languages.
Activation Triggers:
- SDK installation requests
- Language-specific A2A setup
- Authentication configuration
- Package dependency issues
- SDK version compatibility
- Import/setup errors
Supported Languages:
- Python (3.8+)
- TypeScript/JavaScript (Node 18+)
- Java (11+)
- C# (.NET 6+)
- Go (1.20+)
Quick Start by Language
Python
# Install SDK ./scripts/install-python.sh # Verify installation ./scripts/validate-python.sh
TypeScript
# Install SDK ./scripts/install-typescript.sh # Verify installation ./scripts/validate-typescript.sh
Java
# Install SDK ./scripts/install-java.sh # Verify installation ./scripts/validate-java.sh
C#
# Install SDK ./scripts/install-csharp.sh # Verify installation ./scripts/validate-csharp.sh
Go
# Install SDK ./scripts/install-go.sh # Verify installation ./scripts/validate-go.sh
Installation Scripts
All installation scripts are in
scripts/ directory:
- Install Python SDK via pipinstall-python.sh
- Install TypeScript SDK via npm/yarninstall-typescript.sh
- Install Java SDK via Maven/Gradleinstall-java.sh
- Install C# SDK via NuGetinstall-csharp.sh
- Install Go SDK via go getinstall-go.sh
Validation scripts verify installation and dependencies:
- Check Python SDK installationvalidate-python.sh
- Check TypeScript SDK installationvalidate-typescript.sh
- Check Java SDK installationvalidate-java.sh
- Check C# SDK installationvalidate-csharp.sh
- Check Go SDK installationvalidate-go.sh
Configuration Templates
Templates are in
templates/ directory:
Environment Setup:
- Environment variable template (all languages)env-template.txt
- Python configuration examplepython-config.py
- TypeScript configuration exampletypescript-config.ts
- Java Maven configurationjava-config.xml
- C# project configurationcsharp-config.csproj
- Go module configurationgo-mod.txt
Authentication:
- API key authenticationauth-api-key-template.txt
- OAuth authenticationauth-oauth-template.txt
- JWT authenticationauth-jwt-template.txt
Common Setup Patterns
Environment Variables
All SDKs use environment variables for configuration:
# Required A2A_API_KEY=your_api_key_here A2A_BASE_URL=https://api.a2a.example.com # Optional A2A_TIMEOUT=30 A2A_RETRY_ATTEMPTS=3 A2A_LOG_LEVEL=info
CRITICAL: Always use placeholders in committed files. Create
.env.example with placeholder values only.
Authentication Setup
All SDKs support three authentication methods:
- API Key - Simplest, for server-to-server
- OAuth 2.0 - For user-delegated access
- JWT - For service-to-service with custom claims
See
templates/auth-*-template.txt for implementation patterns.
Error Handling
All SDKs provide consistent error handling:
- Network/connectivity issuesA2AConnectionError
- Invalid credentialsA2AAuthenticationError
- Rate limit exceededA2ARateLimitError
- Invalid request dataA2AValidationError
See
examples/error-handling-*.md for language-specific patterns.
Language-Specific Considerations
Python
- Requires Python 3.8+
- Install via pip:
pip install a2a-protocol - Async support via asyncio
- Type hints available
- See
examples/python-basic.py
TypeScript
- Requires Node 18+
- Install via npm:
npm install @a2a/protocol - Full TypeScript definitions included
- Promise-based async/await
- See
examples/typescript-basic.ts
Java
- Requires Java 11+
- Maven: Add to pom.xml
- Gradle: Add to build.gradle
- Thread-safe client
- See
examples/java-basic.java
C#
- Requires .NET 6+
- NuGet:
dotnet add package A2A.Protocol - Async/await support
- Dependency injection ready
- See
examples/csharp-basic.cs
Go
- Requires Go 1.20+
- Install:
go get github.com/a2a/protocol-go - Context-aware operations
- Goroutine-safe
- See
examples/go-basic.go
Troubleshooting
Installation Issues
Package not found:
# Python pip install --upgrade pip pip install a2a-protocol # TypeScript npm cache clean --force npm install @a2a/protocol # Java mvn clean install -U # C# dotnet restore --force # Go go clean -modcache go get -u github.com/a2a/protocol-go
Version conflicts: Run the appropriate validation script to check dependencies:
./scripts/validate-<language>.sh
Authentication Errors
- Check environment variables are set
- Verify API key format (no extra spaces/newlines)
- Ensure base URL is correct
- Check API key permissions
Connection Issues
- Verify network connectivity
- Check firewall/proxy settings
- Validate base URL is accessible
- Review timeout settings
Security Best Practices
Environment Variables:
- NEVER commit actual API keys
- Use
files (add to.env
).gitignore - Create
with placeholders.env.example - Use secret management in production (Vault, AWS Secrets Manager, etc.)
API Keys:
- Rotate keys regularly
- Use different keys for dev/staging/prod
- Implement key expiration
- Monitor key usage
Network Security:
- Always use HTTPS
- Validate SSL certificates
- Implement request signing for sensitive operations
- Use VPN/private networks for production
Examples
Complete examples for each language:
- Basic Python usageexamples/python-basic.py
- Async Python usageexamples/python-async.py
- Basic TypeScript usageexamples/typescript-basic.ts
- Basic Java usageexamples/java-basic.java
- Basic C# usageexamples/csharp-basic.cs
- Basic Go usageexamples/go-basic.go
- Python error handlingexamples/error-handling-python.md
- TypeScript error handlingexamples/error-handling-typescript.md
- Java error handlingexamples/error-handling-java.md
Resources
Official Documentation:
- Python SDK: https://docs.a2a-protocol.org/python
- TypeScript SDK: https://docs.a2a-protocol.org/typescript
- Java SDK: https://docs.a2a-protocol.org/java
- C# SDK: https://docs.a2a-protocol.org/csharp
- Go SDK: https://docs.a2a-protocol.org/go
GitHub Repositories:
- Python: https://github.com/a2a/protocol-python
- TypeScript: https://github.com/a2a/protocol-ts
- Java: https://github.com/a2a/protocol-java
- C#: https://github.com/a2a/protocol-dotnet
- Go: https://github.com/a2a/protocol-go
Version: 1.0.0 Protocol Compatibility: A2A Protocol 1.0+