/sinux-plugin:sinuxfrom sinux-plugin
Provides helpers for the Sinux signal-driven Flux state management library: creating stores, writing signal handlers, building middleware, and integrating with TanStack Query or Apollo Client.
Ships in sinux-plugin. 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.
npm install @sinuxjs/core @sinuxjs/react
Use createStore with record-style signals:
import { createStore } from '@sinuxjs/core';
const store = createStore(
{ count: 0 },
{
increment: (state) => ({ count: state.count + 1 }),
add: (state, amount: number) => ({ count: state.count + amount }),
}
);
await store.increment(); // { count: 1 }
Signal handler signature: (state: T, ...args) => Partial<T> | Promise<Partial<T>> | void
Signals return Promises. Async/await and generators work natively.
For full Store/Signal API, see core-api.md.
import { useStore } from '@sinuxjs/react';
const { count } = useStore(store, s => ({ count: s.count }));
Selector = only re-render when selected slice changes.
For useComputed, combine, useStores, see react-api.md.
Third argument to createStore. Three hooks: onInit, onDispatch, onStateChange.
const logger: MiddlewareConfig<MyState> = {
onStateChange(state, prev, signalName) {
console.log(`[${signalName}]`, prev, '→', state);
}
};
const store = createStore(state, signals, [logger, persist({ key: 'app' }), devtools()]);
Built-in: persist, devtools, immer. For full middleware API + custom patterns, see middleware-api.md.
import { querySignal, mutationSignal, tanstackQuery } from '@sinuxjs/tanstack-query';
const store = createStore(
{ users: [] },
{
loadUsers: querySignal({
queryKey: ['users'],
queryFn: () => fetch('/api/users').then(r => r.json()),
mapToState: (data) => ({ users: data }),
}),
addUser: mutationSignal({
mutationFn: (user) => api.post('/users', user),
mapToState: (data, s) => ({ users: [...s.users, data] }),
invalidates: [['users']],
}),
},
[tanstackQuery({ queryClient })]
);
For full API, optimistic updates, useQuerySignal, fromTRPC, see tanstack-query-api.md.
import { graphqlQuery, graphqlMutation, apolloClient } from '@sinuxjs/apollo';
const store = createStore(
{ users: [] },
{
loadUsers: graphqlQuery({
query: GET_USERS,
mapToState: (d) => ({ users: d.users }),
}),
createUser: graphqlMutation({
mutation: CREATE_USER,
variables: (input) => ({ input }),
mapToState: (d, s) => ({ users: [...s.users, d.createUser] }),
}),
},
[apolloClient({ client })]
);
For full GraphQL API, see apollo-api.md.
await otherStore.signal() inside a handlerstore.signal.add(handler) stacks handlersyield otherStore.signal() for sequential orchestrationcomputed(store, s => derived) + useComputed(c) in ReactFor multi-store patterns, optimistic updates, rollback, see patterns.md.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
Other plugins' skills for the same job
npx claudepluginhub jbpin/sinux --plugin sinux-plugin