Available in
Marketplaces, most starred first
Tags
Add to README
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Marketplaces, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Claude loads one when your task matches it, or you run it by name.
1 marketplace, most starred first
Shows its components, always-on context cost and install status, kept current. Add ?tokens=0 to hide the cost.
Typesafe state-dependent methods on an observable store. Zero dependencies.
pnpm add @muxmuxmux/core
import { controller } from "@muxmuxmux/core";
const button = controller("idle", {
idle: { onClick: submit },
loading: {}, // clicks do nothing while loading
error: { onClick: submit }, // retry
});
async function submit() {
button.set("loading");
try {
await sendForm();
button.set("idle");
} catch {
button.set("error");
}
}
button.onClick(); // runs idle.onClick
button.get(); // "loading"
button.onClick(); // does nothing: "loading" has no onClick
A controller is two things at once:
get() reads it, set() changes it, and subscribe() watches it.undefined.Methods change state by calling set on the controller's variable. The controller exists before any method runs, so referring to it from inside a method is safe.
set("typo") fails to compile.undefined.const counter = controller("idle", {
idle: { read: () => 0, reset: () => true },
busy: { read: () => "busy" },
});
counter.read(); // number | string
counter.reset(); // boolean | undefined
Checking get() does not narrow method types. Narrow the call's result instead.
set ignores a state equal to the current one (Object.is), so subscribers don't fire.subscribe(listener) calls the listener right away with the current state, then on every change. It returns an unsubscribe function.get, set or subscribe fail to compile, because the store owns those names. In plain JavaScript they are ignored.The controller follows Svelte's store contract, so $button reads the current state.
<script lang="ts">
import { controller } from "@muxmuxmux/core";
const button = controller("idle", {
idle: { onClick: submit },
loading: {},
});
async function submit() {
button.set("loading");
await sendForm();
button.set("idle");
}
</script>
<button onclick={button.onClick} disabled={$button === "loading"}>
{$button === "loading" ? "Sending..." : "Send"}
</button>
Use useController from @muxmuxmux/react.
inspectMethods(controller) returns the methods object you passed in, so tests can assert on spies:
import { controller, inspectMethods } from "@muxmuxmux/core";
const ctrl = controller("idle", {
idle: { start: vi.fn() },
running: {},
});
ctrl.start();
expect(inspectMethods(ctrl).idle.start).toHaveBeenCalled();
| Export | Kind | What it is |
|---|---|---|
controller(defaultState, methods) | function | Creates a controller |
inspectMethods(controller) | function | Returns the methods object a controller was created with |
Controller<M> | type | The store plus one dispatcher per method name |
Methods | type | Each state's methods: state name → method name → function |
Store<T> | type | The get/set/subscribe contract |
This package ships an Agent Skill at skills/muxmuxmux/SKILL.md. It lists the patterns and the common mistakes.
These options load the copy that matches your installed version:
node_modules/@muxmuxmux/core/skills/muxmuxmux/SKILL.md.npx skills experimental_sync from the skills CLI. It links the skills your dependencies ship into .agents/skills/.npx @tanstack/intent install. It adds a block to your agent's instructions file that points at the skill.These options install the skill without the package:
npx skills add vadirn/muxmuxmux --skill muxmuxmux./plugin marketplace add vadirn/muxmuxmux, then /plugin install muxmuxmux@muxmuxmux.Both copy the skill from main, so it can describe changes that are not released yet.
MIT
Built from public signals: copy clicks on this site, GitHub stars and activity, the README and the manifest. Not a security audit or an endorsement.
npx claudepluginhub vadirn/muxmuxmux --plugin muxmuxmuxPlugins from other owners that cover similar ground