From teikk-agents-skills
Handles data operations and concurrency in Java. Use when writing RxJava streams, CompletableFutures, Retrofit network requests in Java, or Room database queries in Java.
How this skill is triggered — by the user, by Claude, or both
Slash command
/teikk-agents-skills:android-data-and-concurrency-javaThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Manage asynchronous operations, network communications, and database persistence in Java. Adhere to RxJava concurrency standards, type-safe Retrofit configurations, and Room ORM in Java.
Manage asynchronous operations, network communications, and database persistence in Java. Adhere to RxJava concurrency standards, type-safe Retrofit configurations, and Room ORM in Java.
CompletableFuture.android-data-and-concurrency-kotlin instead).Schedulers.io()) and observe results on the UI thread (AndroidSchedulers.mainThread()).CompositeDisposable and clear them in onCleared() (ViewModel) or onDestroy() (Activity/Fragment) to prevent memory leaks.public class TaskRepository {
private final TaskApiService apiService;
private final TaskDao taskDao;
public Single<List<Task>> getTasks() {
return apiService.fetchTasks()
.subscribeOn(Schedulers.io())
.flatMap(dtos -> {
List<TaskEntity> entities = convertToEntities(dtos);
taskDao.insertTasks(entities);
return Single.just(convertToDomain(entities));
});
}
}
// ViewModel usage with CompositeDisposable
public class TaskViewModel extends ViewModel {
private final TaskRepository repository;
private final CompositeDisposable disposables = new CompositeDisposable();
private final MutableLiveData<List<Task>> tasks = new MutableLiveData<>();
public void loadTasks() {
disposables.add(repository.getTasks()
.observeOn(AndroidSchedulers.mainThread())
.subscribe(tasks::setValue, throwable -> {
// Handle error
}));
}
@Override
protected void onCleared() {
super.onCleared();
disposables.clear(); // Prevents memory leaks
}
}
Single<T>, Observable<T>, or Call<T>.public interface TaskApiService {
@GET("tasks")
Single<List<TaskDto>> fetchTasks();
}
Single<T>, Maybe<T>, or Flowable<T> for reactive operations.@Dao
public interface TaskDao {
@Query("SELECT * FROM tasks")
Flowable<List<TaskEntity>> getTasksFlowable();
@Insert(onConflict = OnConflictStrategy.REPLACE)
void insertTasks(List<TaskEntity> tasks);
}
CompletableFuture.supplyAsync() running on a dedicated executor thread pool.CompletableFuture.supplyAsync(() -> taskDao.getTasksOnce(), Executors.newSingleThreadExecutor())
.thenAccept(tasks -> {
// Handle result on UI thread (if directed)
});
| Rationalization | Reality |
|---|---|
| "I'll just subscribe without disposing because it finishes quickly" | If the user rotates the device or leaves the screen before the network/db request completes, the subscriber retains a reference to the View/ViewModel, causing severe memory leaks. |
| "I can run short DB operations on the Main thread" | Even small DB operations can block the Main thread under write lock or heavy disk usage, resulting in skipped frames and ANRs. Enforce background thread processing. |
| "Error consumers in RxJava are optional during testing" | An RxJava stream without an error consumer will throw an unhandled OnErrorNotImplementedException, crashing the app immediately if a network error occurs. |
.blockingGet() or .get() on RxJava/CompletableFuture.CompositeDisposable that gets cleared.List<TaskEntity>) running synchronously inside View classes.onCleared() or onDestroy().npx claudepluginhub 22teikk/22teikk-agent-skills-hub --plugin teikk-agents-skillsProvides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.