/aws-sdk-swift-usage
AWS SDK for Swift development patterns. Use when writing Swift code that uses AWS services via aws-sdk-swift package.
$ npx -y skills add aws/agent-toolkit-for-aws --skill aws-sdk-swift-usage --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/aws-sdk-swift-usage
Context preview
The summary Claude sees to decide when to auto-load this skill.
AWS SDK for Swift development patterns. Use when writing Swift code that uses AWS services via aws-sdk-swift package.
SKILL.md
aws-sdk-swift-usage.SKILL.mdname: aws-sdk-swift-usage
description: |
AWS SDK for Swift development patterns. Use when writing Swift code that uses AWS services via aws-sdk-swift package.
AWS SDK for Swift
Async Code Structure
All SDK operations are async. Use `@main` entry point:
@main
struct Main {
static func main() async throws {
let client = try await S3Client()
// ... async operations
}
}CRITICAL: Use Struct Config Types
NEVER use `S3ClientConfiguration` or `DynamoDBClientConfiguration` - these are DEPRECATED classes.
ALWAYS use the struct-based config types:
- `S3Client.S3ClientConfig` (not S3ClientConfiguration)
- `DynamoDBClient.DynamoDBClientConfig` (not DynamoDBClientConfiguration)
- `STSClient.STSClientConfig` (not STSClientConfiguration)
Config parameters MUST be in declaration order. Region is ALWAYS required when creating a config. Check the service client source for exact order.
// CORRECT - struct config
let config = try await S3Client.S3ClientConfig(region: "us-west-2")
let client = S3Client(config: config)
// WRONG - deprecated class
// let config = try await S3Client.S3ClientConfiguration(region: "us-west-2")
Client Creation
All service clients follow the same pattern: `<Service>Client` with `<Service>Client.<Service>ClientConfig`.
Model types (structs/enums used in requests/responses) are namespaced under `<Service>ClientTypes`:
- `S3ClientTypes.Bucket`, `S3ClientTypes.Object`
- `DynamoDBClientTypes.AttributeValue`
- `CloudWatchClientTypes.MetricDatum`, `CloudWatchClientTypes.Dimension`
import AWSS3
import AWSDynamoDB
// Simple - auto-detects region
let s3 = try await S3Client()
let dynamo = try await DynamoDBClient()
// With region
let s3 = try S3Client(region: "us-west-2")
// With config - parameters must be in declaration order
let config = try await S3Client.S3ClientConfig(
useFIPS: true,
awsRetryMode: .adaptive,
maxAttempts: 5,
region: "us-west-2"
)
let client = S3Client(config: config)
// With custom endpoint and credentials
let config = try await S3Client.S3ClientConfig(
awsCredentialIdentityResolver: resolver,
region: "us-west-2",
endpoint: "https://s3.custom-endpoint.com"
)Common config parameters (MUST follow declaration order):
- `awsCredentialIdentityResolver` - Custom credentials
- `useFIPS` - Enable FIPS endpoints
- `useDualStack` - Enable dual-stack endpoints
- `awsRetryMode` - Retry strategy (.adaptive, .standard, .legacy)
- `maxAttempts` - Max retry attempts
- `region` - AWS region
- `httpClientEngine` - Custom HTTP client (requires HttpClientConfiguration parameter):
import ClientRuntime
let httpConfig = HttpClientConfiguration()
let httpClient = URLSessionHTTPClient(httpClientConfiguration: httpConfig)
let config = try await S3Client.S3ClientConfig(
region: "us-east-1",
httpClientEngine: httpClient
)- `endpoint` - Custom endpoint URL
For service-specific config options or exact parameter order, check `Sources/Services/AWS<Service>/Sources/AWS<Service>/<Service>Client.swift` in the SDK.
Credential Resolvers
import AWSSDKIdentity
import SmithyIdentity
// Static credentials - pass credential object directly
let creds = AWSCredentialIdentity(accessKey: "AKIA...", secret: "...")
let resolver = StaticAWSCredentialIdentityResolver(creds)
// Assume role - REQUIRES underlying resolver
let underlying = try DefaultAWSCredentialIdentityResolverChain()
let resolver = try STSAssumeRoleAWSCredentialIdentityResolver(
awsCredentialIdentityResolver: underlying,
roleArn: "arn:aws:iam::123456789012:role/MyRole",
sessionName: "session-name"
)
// Use in config
let config = try await S3Client.S3ClientConfig(
awsCredentialIdentityResolver: resolver,
region: "us-west-2"
)Waiters
Import `SmithyWaitersAPI`. WaiterOptions requires `maxWaitTime` parameter:
import AWSS3
import SmithyWaitersAPI
let client = try await S3Client()
_ = try await client.waitUntilBucketExists(
options: WaiterOptions(maxWaitTime: 120.0),
input: HeadBucketInput(bucket: "my-bucket")
)Pagination
let input = ListObjectsV2Input(bucket: "my-bucket")
for try await page in client.listObjectsV2Paginated(input: input) {
for object in page.contents ?? [] {
print(object.key ?? "")
}
}Presigned URLs
let url = try await client.presignedURLForGetObject(
input: GetObjectInput(bucket: "my-bucket", key: "file.pdf"),
expiration: 3600
)Common Operations
// Put object
_ = try await client.putObject(input: PutObjectInput(
body: .data(data),
bucket: "bucket",
key: "key"
))
// Get object
let output = try await client.getObject(input: GetObjectInput(bucket: "bucket", key: "key"))
let data = try await output.body?.readData()
// List buckets
let response = try await client.listBuckets(input: ListBucketsInput())
for bucket in response.buckets ?? [] {
print(bucket.name ?? "")
}Read more
name: aws-sdk-swift-usage description: | AWS SDK for Swift development patterns. Use when writing Swift code that uses AWS services via aws-sdk-swift package.
AWS SDK for Swift
Async Code Structure
All SDK operations are async. Use `@main` entry point:
@main
struct Main {
static func main() async throws {
let client = try await S3Client()
// ... async operations
}
}CRITICAL: Use Struct Config Types
NEVER use `S3ClientConfiguration` or `DynamoDBClientConfiguration` - these are DEPRECATED classes.
ALWAYS use the struct-based config types:
- `S3Client.S3ClientConfig` (not S3ClientConfiguration)
- `DynamoDBClient.DynamoDBClientConfig` (not DynamoDBClientConfiguration)
- `STSClient.STSClientConfig` (not STSClientConfiguration)
Config parameters MUST be in declaration order. Region is ALWAYS required when creating a config. Check the service client source for exact order.
// CORRECT - struct config let config = try await S3Client.S3ClientConfig(region: "us-west-2") let client = S3Client(config: config) // WRONG - deprecated class // let config = try await S3Client.S3ClientConfiguration(region: "us-west-2")
Client Creation
All service clients follow the same pattern: `<Service>Client` with `<Service>Client.<Service>ClientConfig`.
Model types (structs/enums used in requests/responses) are namespaced under `<Service>ClientTypes`:
- `S3ClientTypes.Bucket`, `S3ClientTypes.Object`
- `DynamoDBClientTypes.AttributeValue`
- `CloudWatchClientTypes.MetricDatum`, `CloudWatchClientTypes.Dimension`
import AWSS3
import AWSDynamoDB
// Simple - auto-detects region
let s3 = try await S3Client()
let dynamo = try await DynamoDBClient()
// With region
let s3 = try S3Client(region: "us-west-2")
// With config - parameters must be in declaration order
let config = try await S3Client.S3ClientConfig(
useFIPS: true,
awsRetryMode: .adaptive,
maxAttempts: 5,
region: "us-west-2"
)
let client = S3Client(config: config)
// With custom endpoint and credentials
let config = try await S3Client.S3ClientConfig(
awsCredentialIdentityResolver: resolver,
region: "us-west-2",
endpoint: "https://s3.custom-endpoint.com"
)Common config parameters (MUST follow declaration order):
- `awsCredentialIdentityResolver` - Custom credentials
- `useFIPS` - Enable FIPS endpoints
- `useDualStack` - Enable dual-stack endpoints
- `awsRetryMode` - Retry strategy (.adaptive, .standard, .legacy)
- `maxAttempts` - Max retry attempts
- `region` - AWS region
- `httpClientEngine` - Custom HTTP client (requires HttpClientConfiguration parameter):
import ClientRuntime
let httpConfig = HttpClientConfiguration()
let httpClient = URLSessionHTTPClient(httpClientConfiguration: httpConfig)
let config = try await S3Client.S3ClientConfig(
region: "us-east-1",
httpClientEngine: httpClient
)- `endpoint` - Custom endpoint URL
For service-specific config options or exact parameter order, check `Sources/Services/AWS<Service>/Sources/AWS<Service>/<Service>Client.swift` in the SDK.
Credential Resolvers
import AWSSDKIdentity
import SmithyIdentity
// Static credentials - pass credential object directly
let creds = AWSCredentialIdentity(accessKey: "AKIA...", secret: "...")
let resolver = StaticAWSCredentialIdentityResolver(creds)
// Assume role - REQUIRES underlying resolver
let underlying = try DefaultAWSCredentialIdentityResolverChain()
let resolver = try STSAssumeRoleAWSCredentialIdentityResolver(
awsCredentialIdentityResolver: underlying,
roleArn: "arn:aws:iam::123456789012:role/MyRole",
sessionName: "session-name"
)
// Use in config
let config = try await S3Client.S3ClientConfig(
awsCredentialIdentityResolver: resolver,
region: "us-west-2"
)Waiters
Import `SmithyWaitersAPI`. WaiterOptions requires `maxWaitTime` parameter:
import AWSS3
import SmithyWaitersAPI
let client = try await S3Client()
_ = try await client.waitUntilBucketExists(
options: WaiterOptions(maxWaitTime: 120.0),
input: HeadBucketInput(bucket: "my-bucket")
)Pagination
let input = ListObjectsV2Input(bucket: "my-bucket")
for try await page in client.listObjectsV2Paginated(input: input) {
for object in page.contents ?? [] {
print(object.key ?? "")
}
}Presigned URLs
let url = try await client.presignedURLForGetObject(
input: GetObjectInput(bucket: "my-bucket", key: "file.pdf"),
expiration: 3600
)Common Operations
// Put object
_ = try await client.putObject(input: PutObjectInput(
body: .data(data),
bucket: "bucket",
key: "key"
))
// Get object
let output = try await client.getObject(input: GetObjectInput(bucket: "bucket", key: "key"))
let data = try await output.body?.readData()
// List buckets
let response = try await client.listBuckets(input: ListBucketsInput())
for bucket in response.buckets ?? [] {
print(bucket.name ?? "")
}Help AI coding agents build, deploy, and manage applications on AWS. The Agent Toolkit for AWS gives AI coding agents the tools, knowledge, and guardrails they need to work with AWS services.
Repo: aws/agent-toolkit-for-aws
Other skills on agent-toolkit-for-aws.
- /analyzing-release-readiness
Trigger a pre-merge release readiness review on a GitHub PR, GitLab MR, or local branch. Use when the user wants to analyze code changes for risk, correctness, and potential rollback issues before merging. Trigger words include release readiness, analyze PR, analyze MR, review
Open skill - /chatting-with-aws-devops-agent
Have a fast, conversational analysis with the AWS DevOps Agent. Use for cost optimization, architecture review, topology mapping, knowledge / runbook discovery, security audits, dependency questions, and quick diagnostics — anything that needs a 5-30 second answer rather than a
Open skill - /coordinating-multi-space-devops-agent
Coordinate the AWS DevOps Agent across multiple AgentSpaces from one Claude Code session — route questions to the right space (prod vs staging vs knowledge), query several spaces in parallel and synthesize, or compare findings across accounts. Use whenever the user has more than
Open skill - /diff-scanning-with-aws-security-agent
Run a fast AWS Security Agent diff scan on only the changed code since a git ref. Use when the user asks to scan changes, run a diff scan, check what changed for security issues, scan before committing, scan before PR, or any pre-commit/pre-push security check.
Open skill - /investigating-incidents-with-aws-devops-agent
Run a deep root-cause investigation on the AWS DevOps Agent. Use when the user describes an incident, alarm, outage, or unexplained behavior — keywords like "5xx", "503", "OOM", "latency spike", "deployment failure", "rollback", "sev1", "investigate", "root cause", "debug",
Open skill - /pentesting-with-aws-security-agent
Run an AWS Security Agent penetration test against a live web application — registers and verifies the target domain, exercises the supplied endpoints with the managed Security Agent service, and returns verified runtime findings. Use when the user asks to pentest, run a
Open skill

