skills/state-ref/SKILL.md
Use when working in projects that use state-ref; follow proxy-based reactivity and lens pattern guidelines.
npx skillsauth add superlucky84/state-ref state-refInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Document Version: {{version}}
Additional materials (optional):
These guidelines apply only when state-ref is installed in the current project.
Before following this document:
package.json for state-ref in dependencies/devDependenciesnode_modules/state-ref existsstate-refIf state-ref is not installed, use the project's existing conventions. Do not suggest adding state-ref unless the user asks.
createStore<T>(initialValue) for auto-sync mode..value property on StateRefStore proxies.watch(callback) - callback receives (stateRef, isFirst)..value reads inside callbacks trigger re-runs on change.AbortController.signal returned from callback to unsubscribe.createStoreManualSync() for Flux-like patterns with updateRef and sync().connectReact, connectPreact, connectVue, connectSvelte, connectSolid.combineWatch([watch1, watch2] as const).createComputed([watches], callback).copyable() for manual copy-on-write updates..value.node_modules/state-ref/dist/index.d.ts..value// BAD
const age = stateRef.john.age;
// GOOD
const age = stateRef.john.age.value;
// BAD - accessing .value outside callback won't track
const externalRef = watch();
watch((ref) => {
console.log(externalRef.count.value); // NOT tracked
});
// GOOD - use the callback's ref parameter
watch((ref) => {
console.log(ref.count.value); // Tracked
});
const controller = new AbortController();
watch((ref) => {
console.log(ref.value);
return controller.signal;
});
controller.abort(); // Unsubscribe
import { createStore } from 'state-ref';
const watch = createStore({ count: 0, name: 'John' });
watch((ref, isFirst) => {
console.log('Count changed:', ref.count.value);
});
const ref = watch();
ref.count.value = 10; // Triggers subscription
import { createStore } from 'state-ref';
import { connectReact } from '@stateref/connect-react';
const watch = createStore({ age: 20 });
export const useStore = connectReact(watch);
// In component
function Component() {
const { age } = useStore();
return <button onClick={() => age.value++}>{age.value}</button>;
}
import { createStoreManualSync } from 'state-ref';
const { watch, updateRef, sync } = createStoreManualSync({ count: 0 });
export const increment = () => {
updateRef.count.value += 1;
sync(); // Notify subscribers
};
import { createStore, createStoreManualSync, combineWatch, createComputed } from 'state-ref'import { lens, copyable, cloneDeep } from 'state-ref'import { connectReact } from '@stateref/connect-react'import { connectPreact } from '@stateref/connect-preact'import { connectVue } from '@stateref/connect-vue'import { connectSvelte } from '@stateref/connect-svelte'import { connectSolid } from '@stateref/connect-solid'Use createStore for reactive state, access via .value, subscribe with watch(callback). Dependencies are tracked automatically inside callbacks. Use framework connectors for UI integration. For Flux patterns, use createStoreManualSync. Combine watches with combineWatch or derive computed values with createComputed.
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.
development
Maintainer workflow for OpenClaw releases, prereleases, changelog release notes, and publish validation. Use when Codex needs to prepare or verify stable or beta release steps, align version naming, assemble release notes, check release auth requirements, or validate publish-time commands and artifacts.
development
Run, watch, debug, and extend OpenClaw QA testing with qa-lab and qa-channel. Use when Codex needs to execute the repo-backed QA suite, inspect live QA artifacts, debug failing scenarios, add new QA scenarios, or explain the OpenClaw QA workflow. Prefer the live OpenAI lane with regular openai/gpt-5.4 in fast mode; do not use gpt-5.4-pro or gpt-5.4-mini unless the user explicitly overrides that policy.
development
End-to-end Parallels smoke, upgrade, and rerun workflow for OpenClaw across macOS, Windows, and Linux guests. Use when Codex needs to run, rerun, debug, or interpret VM-based install, onboarding, gateway smoke tests, latest-release-to-main upgrade checks, fresh snapshot retests, or optional Discord roundtrip verification under Parallels.