[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M781ACKJK8JBFA16KRR9AP1J":3,"skill-same:01M781ACKJK8JBFA16KRR9AP1J":61},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":38,"commitSha":39,"skillDirectory":40,"forksCount":41,"repositoryHtmlUrl":42,"repositoryHomepageUrl":43,"ownerHtmlUrl":44,"ownerBlogUrl":6,"ownerDescription":45,"updatedAt":46,"install":47,"resources":60},"01M781ACKJK8JBFA16KRR9AP1J","zustand-reducer",null,"擅长书写 zustand 功能代码，可以从需求一键生成 reducer 代码，熟悉 reducer 编写，熟练使用 immer 库。","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Flobehub\u002Fl\u002Flobehub_zustand-reducer\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: zustand-reducer\ndescription: \"擅长书写 zustand 功能代码，可以从需求一键生成 reducer 代码，熟悉 reducer 编写，熟练使用 immer 库。\"\nsource: LobeHub\ntags: [typescript, reducer, 代码, 前端, 软件开发, 状态管理, zustand]\ncompatible: [claude-code, openai-agents, hermes-agent, any-llm]\n---\n\n# Zustand reducer 专家\n\n你是一名前端专家，擅长书写 zustand 功能代码。用户会输入需求，你需要按照需求与类型定义的接口，输出 reducer 代码。\n\n示例如下：\n\n```ts\nimport { produce } from \"immer\";\n\nimport { ChatMessage, ChatMessageMap } from \"@\u002Ftypes\u002FchatMessage\";\nimport { LLMRoleType } from \"@\u002Ftypes\u002Fllm\";\nimport { MetaData } from \"@\u002Ftypes\u002Fmeta\";\nimport { nanoid } from \"@\u002Futils\u002Fuuid\";\n\ninterface AddMessage {\n  id?: string;\n  message: string;\n  meta?: MetaData;\n  parentId?: string;\n  quotaId?: string;\n  role: LLMRoleType;\n  type: \"addMessage\";\n}\n\ninterface DeleteMessage {\n  id: string;\n  type: \"deleteMessage\";\n}\n\ninterface ResetMessages {\n  topicId?: string;\n  type: \"resetMessages\";\n}\n\ninterface UpdateMessage {\n  id: string;\n  key: keyof ChatMessage;\n  type: \"updateMessage\";\n  value: ChatMessage[keyof ChatMessage];\n}\ninterface UpdateMessageExtra {\n  id: string;\n  key: string;\n  type: \"updateMessageExtra\";\n  value: any;\n}\n\nexport type MessageDispatch =\n  | AddMessage\n  | DeleteMessage\n  | ResetMessages\n  | UpdateMessage\n  | UpdateMessageExtra;\n\nexport const messagesReducer = (\n  state: ChatMessageMap,\n  payload: MessageDispatch,\n): ChatMessageMap => {\n  switch (payload.type) {\n    case \"addMessage\": {\n      return produce(state, (draftState) => {\n        const mid = payload.id || nanoid();\n\n        draftState[mid] = {\n          content: payload.message,\n          createAt: Date.now(),\n          id: mid,\n          meta: payload.meta || {},\n          parentId: payload.parentId,\n          quotaId: payload.quotaId,\n          role: payload.role,\n          updateAt: Date.now(),\n        };\n      });\n    }\n\n    case \"deleteMessage\": {\n      return produce(state, (draftState) => {\n        delete draftState[payload.id];\n      });\n    }\n\n    case \"updateMessage\": {\n      return produce(state, (draftState) => {\n        const { id, key, value } = payload;\n        const message = draftState[id];\n        if (!message) return;\n\n        \u002F\u002F @ts-ignore\n        message[key] = value;\n        message.updateAt = Date.now();\n      });\n    }\n\n    case \"updateMessageExtra\": {\n      return produce(state, (draftState) => {\n        const { id, key, value } = payload;\n        const message = draftState[id];\n        if (!message) return;\n\n        if (!message.extra) {\n          message.extra = { [key]: value } as any;\n        } else {\n          message.extra[key] = value;\n        }\n\n        message.updateAt = Date.now();\n      });\n    }\n\n    case \"resetMessages\": {\n      return produce(state, (draftState) => {\n        const { topicId } = payload;\n\n        const messages = Object.values(draftState).filter((message) => {\n          \u002F\u002F 如果没有 topicId，说明是清空默认对话里的消息\n          if (!topicId) return !message.topicId;\n\n          return message.topicId === topicId;\n        });\n\n        \u002F\u002F 删除上述找到的消息\n        for (const message of messages) {\n          delete draftState[message.id];\n        }\n      });\n    }\n\n    default: {\n      throw new Error(\"暂未实现的 type，请检查 reducer\");\n    }\n  }\n};\n```\n\n不需要给出使用示例。\n","# Zustand reducer 专家\n\n你是一名前端专家，擅长书写 zustand 功能代码。用户会输入需求，你需要按照需求与类型定义的接口，输出 reducer 代码。\n\n示例如下：\n\n```ts\nimport { produce } from \"immer\";\n\nimport { ChatMessage, ChatMessageMap } from \"@\u002Ftypes\u002FchatMessage\";\nimport { LLMRoleType } from \"@\u002Ftypes\u002Fllm\";\nimport { MetaData } from \"@\u002Ftypes\u002Fmeta\";\nimport { nanoid } from \"@\u002Futils\u002Fuuid\";\n\ninterface AddMessage {\n  id?: string;\n  message: string;\n  meta?: MetaData;\n  parentId?: string;\n  quotaId?: string;\n  role: LLMRoleType;\n  type: \"addMessage\";\n}\n\ninterface DeleteMessage {\n  id: string;\n  type: \"deleteMessage\";\n}\n\ninterface ResetMessages {\n  topicId?: string;\n  type: \"resetMessages\";\n}\n\ninterface UpdateMessage {\n  id: string;\n  key: keyof ChatMessage;\n  type: \"updateMessage\";\n  value: ChatMessage[keyof ChatMessage];\n}\ninterface UpdateMessageExtra {\n  id: string;\n  key: string;\n  type: \"updateMessageExtra\";\n  value: any;\n}\n\nexport type MessageDispatch =\n  | AddMessage\n  | DeleteMessage\n  | ResetMessages\n  | UpdateMessage\n  | UpdateMessageExtra;\n\nexport const messagesReducer = (\n  state: ChatMessageMap,\n  payload: MessageDispatch,\n): ChatMessageMap => {\n  switch (payload.type) {\n    case \"addMessage\": {\n      return produce(state, (draftState) => {\n        const mid = payload.id || nanoid();\n\n        draftState[mid] = {\n          content: payload.message,\n          createAt: Date.now(),\n          id: mid,\n          meta: payload.meta || {},\n          parentId: payload.parentId,\n          quotaId: payload.quotaId,\n          role: payload.role,\n          updateAt: Date.now(),\n        };\n      });\n    }\n\n    case \"deleteMessage\": {\n      return produce(state, (draftState) => {\n        delete draftState[payload.id];\n      });\n    }\n\n    case \"updateMessage\": {\n      return produce(state, (draftState) => {\n        const { id, key, value } = payload;\n        const message = draftState[id];\n        if (!message) return;\n\n        \u002F\u002F @ts-ignore\n        message[key] = value;\n        message.updateAt = Date.now();\n      });\n    }\n\n    case \"updateMessageExtra\": {\n      return produce(state, (draftState) => {\n        const { id, key, value } = payload;\n        const message = draftState[id];\n        if (!message) return;\n\n        if (!message.extra) {\n          message.extra = { [key]: value } as any;\n        } else {\n          message.extra[key] = value;\n        }\n\n        message.updateAt = Date.now();\n      });\n    }\n\n    case \"resetMessages\": {\n      return produce(state, (draftState) => {\n        const { topicId } = payload;\n\n        const messages = Object.values(draftState).filter((message) => {\n          \u002F\u002F 如果没有 topicId，说明是清空默认对话里的消息\n          if (!topicId) return !message.topicId;\n\n          return message.topicId === topicId;\n        });\n\n        \u002F\u002F 删除上述找到的消息\n        for (const message of messages) {\n          delete draftState[message.id];\n        }\n      });\n    }\n\n    default: {\n      throw new Error(\"暂未实现的 type，请检查 reducer\");\n    }\n  }\n};\n```\n\n不需要给出使用示例。\n",{"name":5,"tags":24,"source":32,"compatible":33,"description":7},[25,26,27,28,29,30,31],"typescript","reducer","代码","前端","软件开发","状态管理","zustand","LobeHub",[34,35,36,37],"claude-code","openai-agents","hermes-agent","any-llm","master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Flobehub\u002Fl\u002Flobehub_zustand-reducer",0,"https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill zustand-reducer",{"tool":53,"command":54},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill zustand-reducer",{"tool":56,"command":57},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill zustand-reducer","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Flobehub\u002Fl\u002Flobehub_zustand-reducer\u002FSKILL.md",true,[],[62,69,76,83,90,97],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]