Install any skill in seconds. Free to start, no credit card required.
Get Started Free →ledgerhq/rtk-query-api
RTK Query createApi best practices
Passed 22 of 22 test cases with the skill, and 20 of 22 without it.
2 fixed20 passed either way0 still failing0 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 2 test cases the skill fixed. Same model, same prompt, with and without the skill.
I'm setting up a modular frontend architecture where multiple feature modules share a single backend service. Could you write the TypeScript code that splits the central backend service setup from a domain-specific file that defines a `getUser` endpoint with cache tagging? Output both files and the hook exports.
| Checked | Without skill | With skill |
|---|---|---|
| Defines an empty tagTypes array tagTypes: [] in the shared service API. | Missed | Passed |
| Uses enhanceEndpoints with addTagTypes in the domain file prior to endpoint injection. | Missed | Passed |
| Exports generated hooks from the injected API instance. | Passed | Passed |
The instructions your model reads when the skill loads.
createApi calls against the same backend// ✅ GOOD - state-manager/api.ts
import { createApi, fetchBaseQuery } from "@reduxjs/toolkit/query/react";
import { EntityTags } from "./types";
export const myApi = createApi({
reducerPath: "myApi",
baseQuery: fetchBaseQuery({ baseUrl: "/api" }),
tagTypes: [EntityTags.Entity, EntityTags.Entities],
endpoints: (build) => ({
getEntity: build.query<Entity, string>({
query: (id) => `entities/${id}`,
providesTags: [EntityTags.Entity],
}),
}),
});
export const { useGetEntityQuery } = myApi;
Define tags as enums in state-manager/types.ts:
export enum EntityTags {
Entity = "Entity",
Entities = "Entities",
}
In domain/api/, this is the default — not something you reach for once a second use case appears.
Always split reaching the backend from what you ask it for:
test cases passed, vs 20 / 22 without
More skills from the same source and nearby in the registry, with their headline benchmark lift.