plugins/developer-kit-java/skills/aws-sdk-java-v2-s3/SKILL.md
Provides Amazon S3 patterns and examples using AWS SDK for Java 2.x. Use when working with S3 buckets, uploading/downloading objects, multipart uploads, presigned URLs, S3 Transfer Manager, object operations, or S3-specific configurations.
npx skillsauth add giuseppe-trisciuoglio/developer-kit aws-sdk-java-v2-s3Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Provides patterns for S3 operations: bucket management, object upload/download with multipart support, presigned URLs, S3 Transfer Manager, and S3-specific configurations using AWS SDK for Java 2.x.
| Operation | Method | Notes |
|-----------|--------|-------|
| Create bucket | createBucket() | Wait with waiter().waitUntilBucketExists() |
| Upload object | putObject() | Use RequestBody.fromFile() |
| Download object | getObject() | Streams to file or memory |
| Delete objects | deleteObjects() | Batch up to 1000 keys |
| Presigned URL | presigner.presignGetObject() | Max 7 days expiration |
| Class | Use Case |
|-------|----------|
| STANDARD | Frequently accessed data |
| STANDARD_IA | Infrequently accessed data |
| GLACIER | Long-term archive |
| INTELLIGENT_TIERING | Automatic cost optimization |
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.20.0</version>
</dependency>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3-transfer-manager</artifactId>
<version>2.20.0</version>
</dependency>
S3Client s3Client = S3Client.builder()
.region(Region.US_EAST_1)
.build();
// With retry logic
S3Client s3Client = S3Client.builder()
.region(Region.US_EAST_1)
.overrideConfiguration(b -> b
.retryPolicy(RetryPolicy.builder()
.numRetries(3)
.build()))
.build();
CreateBucketRequest request = CreateBucketRequest.builder()
.bucket(bucketName)
.build();
s3Client.createBucket(request);
// Wait until ready
s3Client.waiter().waitUntilBucketExists(
HeadBucketRequest.builder().bucket(bucketName).build()
);
PutObjectRequest request = PutObjectRequest.builder()
.bucket(bucketName)
.key(key)
.contentType("application/pdf")
.serverSideEncryption(ServerSideEncryption.AES256)
.storageClass(StorageClass.STANDARD_IA)
.build();
s3Client.putObject(request, RequestBody.fromFile(Paths.get(filePath)));
// Validate upload completion
HeadObjectResponse headResp = s3Client.headObject(HeadObjectRequest.builder()
.bucket(bucketName)
.key(key)
.build());
GetObjectRequest request = GetObjectRequest.builder()
.bucket(bucketName)
.key(key)
.build();
s3Client.getObject(request, Paths.get(destPath));
try (S3Presigner presigner = S3Presigner.create()) {
GetObjectRequest getRequest = GetObjectRequest.builder()
.bucket(bucketName)
.key(key)
.build();
GetObjectPresignRequest presignRequest = GetObjectPresignRequest.builder()
.signatureDuration(Duration.ofMinutes(10))
.getObjectRequest(getRequest)
.build();
String url = presigner.presignGetObject(presignRequest).url().toString();
}
try (S3TransferManager tm = S3TransferManager.create()) {
UploadFileRequest request = UploadFileRequest.builder()
.putObjectRequest(req -> req.bucket(bucketName).key(key))
.source(Paths.get(filePath))
.build();
FileUpload upload = tm.uploadFile(request);
CompletedFileUpload result = upload.completionFuture().join();
}
S3AsyncClient for I/O-bound operations// 1. Upload with validation
PutObjectRequest putRequest = PutObjectRequest.builder()
.bucket(bucketName)
.key(key)
.contentType(contentType)
.build();
s3Client.putObject(putRequest, RequestBody.fromFile(Paths.get(filePath)));
// 2. Validate with headObject
HeadObjectResponse headResp = s3Client.headObject(HeadObjectRequest.builder()
.bucket(bucketName)
.key(key)
.build());
// 3. Verify metadata
long fileSize = Files.size(Paths.get(filePath));
if (headResp.contentLength() != fileSize) {
throw new IllegalStateException("Upload size mismatch");
}
// 1. Initiate multipart upload
CreateMultipartUploadRequest createRequest = CreateMultipartUploadRequest.builder()
.bucket(bucketName)
.key(key)
.build();
CreateMultipartUploadResponse multipartUpload = s3Client.createMultipartUpload(createRequest);
String uploadId = multipartUpload.uploadId();
try {
// 2. Upload parts
List<CompletedPart> parts = new ArrayList<>();
int partNumber = 1;
byte[] fileBytes = Files.readAllBytes(Paths.get(filePath));
int chunkSize = 5 * 1024 * 1024; // 5MB minimum
for (int offset = 0; offset < fileBytes.length; offset += chunkSize) {
int length = Math.min(chunkSize, fileBytes.length - offset);
UploadPartRequest uploadPartRequest = UploadPartRequest.builder()
.bucket(bucketName)
.key(key)
.uploadId(uploadId)
.partNumber(partNumber)
.build();
UploadPartResponse partResponse = s3Client.uploadPart(uploadPartRequest,
RequestBody.fromBytes(Arrays.copyOfRange(fileBytes, offset, offset + length)));
parts.add(CompletedPart.builder()
.partNumber(partNumber)
.eTag(partResponse.eTag())
.build());
partNumber++;
}
// 3. Complete multipart upload
CompleteMultipartUploadRequest completeRequest = CompleteMultipartUploadRequest.builder()
.bucket(bucketName)
.key(key)
.uploadId(uploadId)
.multipartUpload(CompletedMultipartUpload.builder().parts(parts).build())
.build();
s3Client.completeMultipartUpload(completeRequest);
} catch (Exception e) {
// 4. Abort on failure
AbortMultipartUploadRequest abortRequest = AbortMultipartUploadRequest.builder()
.bucket(bucketName)
.key(key)
.uploadId(uploadId)
.build();
s3Client.abortMultipartUpload(abortRequest);
throw new RuntimeException("Upload failed, cleanup performed", e);
}
aws-sdk-java-v2-core - Core AWS SDK patterns and configurationspring-boot-dependency-injection - Spring dependency injection patternsdevelopment
Explore codebase before committing to a change. Phase executor skill for specs.explore command.
development
Executes real end-to-end verification against a running application after specification implementation. Detects the application type, starts the local runtime (Docker, Node, Spring Boot, etc.), runs real tests (curl for REST APIs, Playwright for web SPAs, computer-use for desktop apps), verifies acceptance criteria from the functional specification, generates a markdown report, and tears down the environment. Use when: user asks to verify a completed spec with real tests, run e2e checks after implementation, validate acceptance criteria in a live environment, or test the feature for real after task completion.
development
Initialize Spec-Driven Development context — detects tech stack, conventions, architecture patterns, and bootstraps persistence backends. Triggers on 'sdd-init', 'init sdd', 'setup sdd', 'initialize sdd', 'setup project', 'initialize project context'. Creates/updates docs/specs/architecture.md & ontology.md (Constitution), and populates knowledge-graph.json.
development
Optimizes raw idea descriptions into structured prompts ready for the brainstorming workflow. TRIGGER when: user says "optimize for brainstorm", "prepare idea for brainstorm", "enhance this idea", "make this ready for brainstorming", "imposta per brainstorm", or wants to improve a feature idea before using /specs.brainstorm. DO NOT TRIGGER for code optimization, refactoring, or general prompt engineering tasks.