Back to Skills

concurrent-safe-state-machines

majiayu000
Updated Yesterday
58
9
58
View on GitHub
Designaidesign

About

This skill helps developers design deterministic state machines that remain correct under React 18's concurrent features and StrictMode re-renders. It focuses on implementing idempotent reducers, replay-tolerant transitions, and preventing torn reads during interleaved rendering. Use it when you need to prove state machine invariants under double-invocation and randomized scheduling for high-reliability components.

Quick Install

Claude Code

Recommended
Plugin CommandRecommended
/plugin add https://github.com/majiayu000/claude-skill-registry
Git CloneAlternative
git clone https://github.com/majiayu000/claude-skill-registry.git ~/.claude/skills/concurrent-safe-state-machines

Copy and paste this command in Claude Code to install this skill

Documentation

Concurrent-Safe State Machines (React 18)

Summary

Design deterministic state machines that remain correct under concurrent rendering and re-entrancy.

Key Capabilities

  • Apply idempotent reducers and effect cleanup patterns.
  • Model state transitions as pure functions with replay tolerance.
  • Prevent torn reads during interleaved renders.

PhD-Level Challenges

  • Prove invariants under double-invocation in StrictMode.
  • Provide a correctness argument for side-effect isolation.
  • Stress-test state transitions under randomized scheduling.

Acceptance Criteria

  • Document state invariants and transition table.
  • Demonstrate correctness under StrictMode double effects.
  • Provide property-based tests for state machine correctness.

GitHub Repository

majiayu000/claude-skill-registry
Path: skills/concurrent-safe-state-machines

Related Skills

content-collections

Meta

This skill provides a production-tested setup for Content Collections, a TypeScript-first tool that transforms Markdown/MDX files into type-safe data collections with Zod validation. Use it when building blogs, documentation sites, or content-heavy Vite + React applications to ensure type safety and automatic content validation. It covers everything from Vite plugin configuration and MDX compilation to deployment optimization and schema validation.

View skill

creating-opencode-plugins

Meta

This skill provides the structure and API specifications for creating OpenCode plugins that hook into 25+ event types like commands, files, and LSP operations. It offers implementation patterns for JavaScript/TypeScript modules that intercept and extend the AI assistant's lifecycle. Use it when you need to build event-driven plugins for monitoring, custom handling, or extending OpenCode's capabilities.

View skill

sglang

Meta

SGLang is a high-performance LLM serving framework that specializes in fast, structured generation for JSON, regex, and agentic workflows using its RadixAttention prefix caching. It delivers significantly faster inference, especially for tasks with repeated prefixes, making it ideal for complex, structured outputs and multi-turn conversations. Choose SGLang over alternatives like vLLM when you need constrained decoding or are building applications with extensive prefix sharing.

View skill

evaluating-llms-harness

Testing

This Claude Skill runs the lm-evaluation-harness to benchmark LLMs across 60+ standardized academic tasks like MMLU and GSM8K. It's designed for developers to compare model quality, track training progress, or report academic results. The tool supports various backends including HuggingFace and vLLM models.

View skill