/bobmatnyc:zustandfrom bobmatnyc
Zustand state management guide. Use when working with store code (src/store/**), implementing actions, managing state, or creating slices. Triggers on Zustand store development, state management questions, or action implementation.
Ships in bobmatnyc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Main interfaces for UI components:
createTopic, sendMessage)internal_*)Core business logic implementation:
internal_ prefix (internal_createTopic)internal_dispatch*)State update handlers:
internal_dispatch + entity (internal_dispatchTopic)setUse Reducer Pattern:
messagesMap, topicMaps)Use Simple set:
internal_createTopic: async (params) => {
const tmpId = Date.now().toString();
// 1. Immediately update frontend (optimistic)
get().internal_dispatchTopic(
{ type: 'addTopic', value: { ...params, id: tmpId } },
'internal_createTopic'
);
// 2. Call backend service
const topicId = await topicService.createTopic(params);
// 3. Refresh for consistency
await get().refreshTopic();
return topicId;
},
Delete operations: Don't use optimistic updates (destructive, complex recovery)
Actions:
createTopic, sendMessageinternal_createTopic, internal_updateMessageContentinternal_dispatchTopicinternal_toggleMessageLoadingState:
messageLoadingIds, topicEditingIdstopicMaps, messagesMapactiveTopicIdtopicsInitreferences/action-patterns.mdreferences/slice-organization.mdWe are migrating slices from plain StateCreator objects to class-based actions.
(set, get, api) in the constructor.#private fields (e.g., #set, #get) to avoid leaking internals.StoreSetter<T> from @/store/types for set.Pick<ActionImpl, keyof ActionImpl> to expose only public methods.create*Slice helper that returns a class instance.type Setter = StoreSetter<HomeStore>;
export const createRecentSlice = (set: Setter, get: () => HomeStore, _api?: unknown) =>
new RecentActionImpl(set, get, _api);
export class RecentActionImpl {
readonly #get: () => HomeStore;
readonly #set: Setter;
constructor(set: Setter, get: () => HomeStore, _api?: unknown) {
void _api;
this.#set = set;
this.#get = get;
}
useFetchRecentTopics = () => {
// ...
};
}
export type RecentAction = Pick<RecentActionImpl, keyof RecentActionImpl>;
flattenActions (do not spread class instances).flattenActions binds methods to the original class instance and supports prototype methods and class fields.const createStore: StateCreator<HomeStore, [['zustand/devtools', never]]> = (...params) => ({
...initialState,
...flattenActions<HomeStoreAction>([
createRecentSlice(...params),
createHomeInputSlice(...params),
]),
});
flattenActions.PublicActions<T> helper if you need to combine multiple classes and hide private fields.type PublicActions<T> = { [K in keyof T]: T[K] };
export type ChatGroupAction = PublicActions<
ChatGroupInternalAction & ChatGroupLifecycleAction & ChatGroupMemberAction & ChatGroupCurdAction
>;
export const chatGroupAction: StateCreator<
ChatGroupStore,
[['zustand/devtools', never]],
[],
ChatGroupAction
> = (...params) =>
flattenActions<ChatGroupAction>([
new ChatGroupInternalAction(...params),
new ChatGroupLifecycleAction(...params),
new ChatGroupMemberAction(...params),
new ChatGroupCurdAction(...params),
]);
ChatGroupStoreWithSwitchTopic for lifecycle switchTopicChatGroupStoreWithRefresh for member refreshChatGroupStoreWithInternal for curd internal_dispatchChatGroupStateCreator params (set, get, api).#private to avoid set/get being exposed.flattenActions instead of spreading class instances.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ulpi-io/plugin-marketplace --plugin bobmatnyc3 plugins in one repository ship this exact skill · first indexed Nov 8, 2026
Other plugins' skills for the same job
121 skills in this plugin
/anthropic-sdkOfficial Anthropic SDK for Claude AI with chat, streaming, function calling, and vision capabilities/api-design-patternsRESTful API design, error handling, versioning, and best practices. Use when designing APIs, reviewing endpoints, implementing error responses, or setting up API structure. Triggers on "design API", "review API", "REST best practices", or "API patterns"./api-documentationCreate comprehensive API documentation for developers. Use when documenting REST APIs, GraphQL schemas, or SDK methods. Handles OpenAPI/Swagger, interactive docs, examples, and API reference guides.