zustand-store-ts – skill Lập trình cho agent AI
Tạo store Zustand theo các mẫu đã thiết lập, với kiểu TypeScript và middleware phù hợp.
Cài skill zustand-store-ts bằng một lệnh
Chọn công cụ bạn đang dùng, copy lệnh và dán vào terminal. Skill sẽ nằm trong thư mục skills của công cụ đó và sẵn sàng dùng ở phiên làm việc tiếp theo.
Claude Code
mkdir -p ~/.claude/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.claude/skills
Gọi trong Claude Code: /zustand-store-ts – rồi mô tả công việc bạn muốn làm.
Codex
mkdir -p ~/.codex/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.codex/skills
Gọi trong Codex: $zustand-store-ts – rồi mô tả công việc bạn muốn làm.
Hermes Agent
mkdir -p ~/.hermes/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.hermes/skills
Gọi trong Hermes Agent: /zustand-store-ts – rồi mô tả công việc bạn muốn làm.
DeepSeek
mkdir -p ~/.deepcode/skills && curl -fsSL https://skill.dn1nguoi.com/z/zustand-store-ts-84670.tgz | tar xz -C ~/.deepcode/skills
Gọi trong DeepSeek: /zustand-store-ts – rồi mô tả công việc bạn muốn làm.
Nội dung SKILL.md
Nội dung SKILL.md gốc bằng tiếng Anh.
Zustand Store
Create Zustand stores following established patterns with proper TypeScript types and middleware.
Quick Start
No assets/template.ts is bundled. Adapt the inline examples to the installed Zustand version and actual project types; these are fragments, not a complete application.
Use subscribeWithSelector for selector subscriptions
import { create } from 'zustand';
import { subscribeWithSelector } from 'zustand/middleware';
export const useMyStore = create<MyStore>()(
subscribeWithSelector((set, get) => ({
// state and actions
}))
);Separate State and Actions
export interface MyState {
items: Item[];
isLoading: boolean;
}
export interface MyActions {
addItem: (item: Item) => void;
loadItems: () => Promise<void>;
}
export type MyStore = MyState & MyActions;Use Individual Selectors
// Good - only re-renders when `items` changes
const items = useMyStore((state) => state.items);
// Avoid - re-renders on any state change
const { items, isLoading } = useMyStore();Subscribe Outside React
useMyStore.subscribe(
(state) => state.selectedId,
(selectedId) => console.log('Selected:', selectedId)
);Integration Steps
1. Create store in src/frontend/src/store/
2. Export from src/frontend/src/store/index.ts
3. Add tests in src/frontend/src/store/*.test.ts
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Skill liên quan
- ab-testing – Khi người dùng muốn lên kế hoạch, thiết kế hoặc triển khai A/B test hoặc thử nghiệm…
- adaptyv – Dùng Adaptyv Bio Foundry API và Python SDK để thiết kế thí nghiệm mô tả protein, ước…
- ab-test-setup – Khi người dùng muốn lên kế hoạch, thiết kế hoặc triển khai A/B test hoặc thử nghiệm…
- access-lifecycle – Dùng khi chuẩn bị hoặc chạy đợt rà soát quyền truy cập người dùng, kiểm tra người đã…
- aspnet-core – Xây dựng, review, tái cấu trúc hoặc thiết kế kiến trúc ứng dụng web ASP.NET Core theo…
- deepcode-self-refer – Trả lời câu hỏi về chính Deep Code CLI, bao gồm tính năng, tùy chọn cấu hình, lệnh…
- api-noauth-hunt – Dùng khi một API có thể để lộ dữ liệu hoặc thao tác đặc quyền mà không cần xác thực.
- algorithmic-art – Tạo nghệ thuật thuật toán bằng p5.js với tính ngẫu nhiên có seed và khám phá tham số…