wode-emittery-pattern
Wode Emittery Event-Driven Pattern
You are strictly required to follow this event-driven architecture when implementing inter-component communication or side-effect handling. This pattern decouples state management (Zustand) from side-effects (event handlers).
1. Core Rules (MUST FOLLOW)
- Event Types: MUST use
as constobjects namedXxxEventType. NEVER use TypeScript enums. - Event Naming: MUST use
Module:Actionformat (e.g.,FileSystem:Open,User:Login). - Typed Emitter: MUST define
type XxxEmitter = Emittery<XxxEventData>for full type safety. - Sidecar Pattern: Side-effects (toast, confirm dialogs, network requests) MUST be handled in Sidecar components, NEVER inside Store actions.
- Store Decoupling: Store actions MUST only emit events. They MUST NOT care who handles them.
2. Event Type Definition
// MUST use as const, NEVER enum
export const FileSystemEventType = {
Open: 'FileSystem:Open',
Goto: 'FileSystem:Goto',
More from wenerme/ai
glab-cli
Use when interacting with GitLab via the glab CLI: creating/reviewing merge requests, managing issues, monitoring CI/CD pipelines, making API calls, or performing any GitLab operation from the terminal. Triggers on glab, gitlab cli, merge request, MR create, pipeline status, ci lint.
34mikro-orm-v6-to-v7
Use when upgrading @mikro-orm packages from v6 to v7, fixing v7 runtime/type errors (decorator SyntaxError, persistAndFlush removed, nativeInsert not found), adapting knex to kysely or better-sqlite to new SQLite drivers, running MikroORM in Edge/Bun/node:sqlite environments, or choosing between defineEntity vs decorator entity definitions. Triggers on "mikro-orm v7", "persistAndFlush", "@mikro-orm/decorators", "@mikro-orm/sql", "defineEntity", "bun:sqlite mikro-orm".
31orpc-implementation-sops
Use when building, updating, or refactoring oRPC contracts, server handlers, clients, or React Query integration
30zustand-mutative-pattern
Use when implementing React state management with Zustand, including context-scoped stores, mutative updates, or actions namespace patterns
25tmux-session-manager
Use when executing commands, running builds, starting services, or monitoring logs in a visible tmux pane
25wode-db-schema-pattern
Use when designing, creating, or modifying PostgreSQL table schemas in the Wode project, including ID strategy, multi-tenant isolation, or naming conventions
24