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.

181 stars

Best use case

a2a-sdk-patterns is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using a2a-sdk-patterns should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/a2a-sdk-patterns/SKILL.md --create-dirs "https://raw.githubusercontent.com/majiayu000/claude-skill-registry/main/skills/data/a2a-sdk-patterns/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/a2a-sdk-patterns/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How a2a-sdk-patterns Compares

Feature / Agenta2a-sdk-patternsStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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

```bash
# Install SDK
./scripts/install-python.sh

# Verify installation
./scripts/validate-python.sh
```

### TypeScript

```bash
# Install SDK
./scripts/install-typescript.sh

# Verify installation
./scripts/validate-typescript.sh
```

### Java

```bash
# Install SDK
./scripts/install-java.sh

# Verify installation
./scripts/validate-java.sh
```

### C#

```bash
# Install SDK
./scripts/install-csharp.sh

# Verify installation
./scripts/validate-csharp.sh
```

### Go

```bash
# Install SDK
./scripts/install-go.sh

# Verify installation
./scripts/validate-go.sh
```

## Installation Scripts

All installation scripts are in `scripts/` directory:

- `install-python.sh` - Install Python SDK via pip
- `install-typescript.sh` - Install TypeScript SDK via npm/yarn
- `install-java.sh` - Install Java SDK via Maven/Gradle
- `install-csharp.sh` - Install C# SDK via NuGet
- `install-go.sh` - Install Go SDK via go get

Validation scripts verify installation and dependencies:

- `validate-python.sh` - Check Python SDK installation
- `validate-typescript.sh` - Check TypeScript SDK installation
- `validate-java.sh` - Check Java SDK installation
- `validate-csharp.sh` - Check C# SDK installation
- `validate-go.sh` - Check Go SDK installation

## Configuration Templates

Templates are in `templates/` directory:

**Environment Setup:**
- `env-template.txt` - Environment variable template (all languages)
- `python-config.py` - Python configuration example
- `typescript-config.ts` - TypeScript configuration example
- `java-config.xml` - Java Maven configuration
- `csharp-config.csproj` - C# project configuration
- `go-mod.txt` - Go module configuration

**Authentication:**
- `auth-api-key-template.txt` - API key authentication
- `auth-oauth-template.txt` - OAuth authentication
- `auth-jwt-template.txt` - JWT authentication

## Common Setup Patterns

### Environment Variables

All SDKs use environment variables for configuration:

```bash
# 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:

1. **API Key** - Simplest, for server-to-server
2. **OAuth 2.0** - For user-delegated access
3. **JWT** - For service-to-service with custom claims

See `templates/auth-*-template.txt` for implementation patterns.

### Error Handling

All SDKs provide consistent error handling:

- `A2AConnectionError` - Network/connectivity issues
- `A2AAuthenticationError` - Invalid credentials
- `A2ARateLimitError` - Rate limit exceeded
- `A2AValidationError` - Invalid request data

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:**
```bash
# 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:
```bash
./scripts/validate-<language>.sh
```

### Authentication Errors

1. Check environment variables are set
2. Verify API key format (no extra spaces/newlines)
3. Ensure base URL is correct
4. Check API key permissions

### Connection Issues

1. Verify network connectivity
2. Check firewall/proxy settings
3. Validate base URL is accessible
4. Review timeout settings

## Security Best Practices

**Environment Variables:**
- NEVER commit actual API keys
- Use `.env` files (add to `.gitignore`)
- Create `.env.example` with placeholders
- 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:

- `examples/python-basic.py` - Basic Python usage
- `examples/python-async.py` - Async Python usage
- `examples/typescript-basic.ts` - Basic TypeScript usage
- `examples/java-basic.java` - Basic Java usage
- `examples/csharp-basic.cs` - Basic C# usage
- `examples/go-basic.go` - Basic Go usage
- `examples/error-handling-python.md` - Python error handling
- `examples/error-handling-typescript.md` - TypeScript error handling
- `examples/error-handling-java.md` - Java error handling

## 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+

Related Skills

advanced-patterns

181
from majiayu000/claude-skill-registry

Advanced T-SQL patterns and techniques for SQL Server. Use this skill when: (1) User needs help with CTEs or recursive queries, (2) User asks about APPLY operator, (3) User wants MERGE or OUTPUT clause help, (4) User works with temporal tables, (5) User needs In-Memory OLTP guidance, (6) User asks about advanced grouping (ROLLUP, CUBE, GROUPING SETS).

advanced-js-mocking-patterns

181
from majiayu000/claude-skill-registry

Advanced mocking patterns for Jest and Vitest including module mocking, spies, and fake timers. PROACTIVELY activate for: (1) Module mocking, (2) Partial mocking with spies, (3) Mock lifecycle management, (4) Fake timers for time-dependent code, (5) Complex mock implementations. Triggers: "jest.mock", "vi.mock", "spyOn", "fakeTimers", "mockImplementation", "mockReturnValue", "mock lifecycle"

Advanced GetX Patterns

181
from majiayu000/claude-skill-registry

Advanced GetX features including Workers, GetxService, SmartManagement, GetConnect, GetSocket, bindings composition, and testing patterns

patterns/adapter

181
from majiayu000/claude-skill-registry

Adapter (Wrapper) Pattern pattern for C development

ActiveRecord Query Patterns

181
from majiayu000/claude-skill-registry

Complete guide to ActiveRecord query optimization, associations, scopes, and PostgreSQL-specific patterns. Use this skill when writing database queries, designing model associations, creating migrations, optimizing query performance, or debugging N+1 queries and grouping errors.

Action Cable & WebSocket Patterns

181
from majiayu000/claude-skill-registry

Real-time WebSocket features with Action Cable in Rails. Use when: (1) Building real-time chat, (2) Live notifications/presence, (3) Broadcasting model updates, (4) WebSocket authorization. Trigger keywords: Action Cable, WebSocket, real-time, channels, broadcasting, stream, subscriptions, presence, cable

accessibility-patterns

181
from majiayu000/claude-skill-registry

Build inclusive web experiences following WCAG guidelines. Covers semantic HTML, ARIA, keyboard navigation, color contrast, and testing strategies. Triggers on accessibility, a11y, WCAG, screen readers, or inclusive design requests.

access-control-patterns

181
from majiayu000/claude-skill-registry

[STUB - Not implemented] Access control auditing with IDOR detection, RBAC/ABAC patterns, and privilege escalation prevention. PROACTIVELY activate for: [TODO: Define on implementation]. Triggers: [TODO: Define on implementation]

acc-stability-patterns-knowledge

181
from majiayu000/claude-skill-registry

Stability Patterns knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for Circuit Breaker, Retry, Rate Limiter, Bulkhead, and resilience audits.

abp-service-patterns

181
from majiayu000/claude-skill-registry

ABP Framework application layer patterns including AppServices, DTOs, Mapperly mapping, Unit of Work, and common patterns like Filter DTOs and ResponseModel. Use when: (1) creating AppServices, (2) mapping DTOs with Mapperly, (3) implementing list filtering, (4) wrapping API responses.

abp-infrastructure-patterns

181
from majiayu000/claude-skill-registry

ABP Framework cross-cutting patterns including authorization, background jobs, distributed events, multi-tenancy, and module configuration. Use when: (1) defining permissions, (2) creating background jobs, (3) publishing/handling distributed events, (4) configuring modules.

abp-entity-patterns

181
from majiayu000/claude-skill-registry

ABP Framework domain layer patterns including entities, aggregates, repositories, domain services, and data seeding. Use when: (1) creating entities with proper base classes, (2) implementing custom repositories, (3) writing domain services, (4) seeding data.