ai-sdk-5
FreeVercel AI SDK 5 patterns. Trigger: When building AI chat features - breaking changes from v4.
The English summary is being prepared. Showing the original description.
Java 21 language and runtime patterns for modern, safe code. Trigger: When writing Java 21 code using records, sealed types, or virtual threads.
The English summary is being prepared. Showing the original description.
Run score Not tested
See how to installReview the instructions the agent will receive before you install.
Load this skill when:
Use records for DTOs and value objects, validate in compact constructors.
Use sealed interfaces/classes and switch pattern matching for exhaustiveness.
Use virtual threads to handle blocking I/O without large thread pools.
package com.acme.user;
public record Email(String value) {
public Email {
if (value == null || !value.contains("@")) {
throw new IllegalArgumentException("Invalid email");
}
}
}
package com.acme.payment;
public sealed interface Payment permits Card, BankTransfer { }
public record Card(String last4) implements Payment { }
public record BankTransfer(String iban) implements Payment { }
public final class PaymentPrinter {
public String describe(Payment payment) {
return switch (payment) {
case Card card -> "card-" + card.last4();
case BankTransfer bank -> "iban-" + bank.iban();
};
}
}
package com.acme.io;
import java.util.concurrent.Executors;
public final class Fetcher {
public void fetchAll(java.util.List<String> urls) throws Exception {
try (var executor = Executors.newVirtualThreadPerTaskExecutor()) {
for (String url : urls) {
executor.submit(() -> blockingFetch(url));
}
}
}
private void blockingFetch(String url) {
// perform blocking I/O here
}
}
// BAD: mutable DTO
public class UserDto {
public String name;
public String email;
}
// BAD: expensive and unbounded
new Thread(() -> blockingFetch("https://api" )).start();
| Task | Pattern |
|---|---|
| Immutable DTOs | Use records with validation |
| Closed hierarchies | Use sealed interfaces + switch |
| Blocking I/O scale | Use virtual threads executor |
No reviews yet. Tell others what you thought.
No login needed. Share how it worked for you, ask a question, or note where it did not run.
No comments yet. Be the first to write one.
Vercel AI SDK 5 patterns. Trigger: When building AI chat features - breaking changes from v4.
The English summary is being prepared. Showing the original description.
Angular architecture: Scope Rule, project structure, file naming, style guide. Trigger: When structuring Angular projects or deciding where to place components.
The English summary is being prepared. Showing the original description.
Angular core patterns: standalone components, signals, inject, control flow, zoneless. Trigger: When creating Angular components, using signals, or setting up zoneless.
The English summary is being prepared. Showing the original description.
Angular forms: Signal Forms (experimental) and Reactive Forms. Trigger: When working with forms, validation, or form state in Angular.
The English summary is being prepared. Showing the original description.
Angular performance: NgOptimizedImage, @defer, lazy loading, SSR. Trigger: When optimizing Angular app performance, images, or lazy loading.
The English summary is being prepared. Showing the original description.
Django REST Framework patterns. Trigger: When building REST APIs with Django - ViewSets, Serializers, Filters.
The English summary is being prepared. Showing the original description.