[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6P4RQTMN6NDRMNRYE405CWS":3,"skill-same:01M6P4RQTMN6NDRMNRYE405CWS":53},{"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":26,"linkOnly":27,"markdownContent":28,"markdownBody":29,"frontMatter":30,"refName":31,"commitSha":32,"skillDirectory":33,"forksCount":34,"repositoryHtmlUrl":35,"repositoryHomepageUrl":6,"ownerHtmlUrl":36,"ownerBlogUrl":6,"ownerDescription":37,"updatedAt":38,"install":39,"resources":52},"01M6P4RQTMN6NDRMNRYE405CWS","setup-command-system",null,"Install the Command System architecture in the project","maurodesouza\u002Fai-kanban-app-lab","maurodesouza","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F54520907?v=4","01M6P3VA3WVQC4XZ0RQWJCDKW6","Mauro de Souza","01M6P3VA7YK770SNWT12GBEGAF",1,"MIT","https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.claude\u002Fskills\u002Fsetup-command-system\u002FSKILL.md",[],[19,20,21,22,23,24,25],"setup","system","command","setup command system","architecture","install","project","2026-11-10 10:12:30",false,"---\nname: setup-command-system\ndescription: Install the Command System architecture in the project\n---\n\n# Setup Command System\n\nInstall the Command System architecture in the current project by creating the files listed below exactly as provided.\n\n## What this skill does\n\nThe files below are the **reference implementation** of the Command System (V2). They are correct and define the architecture and public API.\n\n1. Create the files listed below with the provided content.\n2. Adapt them so they compile and run in this project. Allowed and expected:\n   * Fix imports, aliases and paths.\n   * Adjust references to the project structure (e.g. env access, file locations).\n   * Fix type or compilation errors caused by the project setup (TypeScript config, strictness, lint rules).\n   * Format with the project formatter.\n3. Keep the design: the public API (`command`, `actions`, `Action`, `ScopedAction`, `useTransition`, `InstanceRegistry`, `TransitionStore`), the file roles and the behavior stay the same. Do not redesign, add features or switch to another version (V3).\n\nDecide these adaptations yourself and continue. Never stop to ask the user about them; list them in the final output.\n\n## Before copying\n\nThe files import through the `#\u002F` and `@\u002F` aliases. Prefer configuring both to resolve to `src\u002F`; if the project uses another alias convention, change the imports instead:\n\n* `tsconfig.json` → `compilerOptions.paths`: `\"#\u002F*\": [\".\u002Fsrc\u002F*\"]` and `\"@\u002F*\": [\".\u002Fsrc\u002F*\"]`.\n* `package.json` → `\"imports\": { \"#\u002F*\": \".\u002Fsrc\u002F*\" }`, or the bundler alias equivalent.\n\nThe architecture rules for using the Command System live in the `command-bus-architecture` skill. Do not create a rule file.\n\n## Files to create\n\nCreate the following files in the project, using EXACTLY the content provided below for each file:\n\n### 1. src\u002Ftypes\u002Fhelpers.ts\n```typescript\nexport type ActionPaths\u003CT> = T extends (...args: any[]) => any\n  ? never\n  : {\n      [K in keyof T & string]: T[K] extends (...args: any[]) => any\n        ? K\n        : `${K}.${ActionPaths\u003CT[K]>}`;\n    }[keyof T & string];\n\nexport type DeepKeyPaths\u003CT> = T extends object\n  ? {\n      [K in keyof T & string]: K | `${K}.${DeepKeyPaths\u003CT[K]>}`;\n    }[keyof T & string]\n  : never;\n\nexport type DeepKeys\u003CT> = T extends object\n  ? {\n      [K in keyof T]: K | DeepKeys\u003CT[K]>;\n    }[keyof T]\n  : never;\n\nexport type PathValue\u003C\n  T,\n  P extends string,\n> = P extends `${infer K}.${infer Rest}`\n  ? K extends keyof T\n    ? PathValue\u003CT[K], Rest>\n    : never\n  : P extends keyof T\n  ? T[P]\n  : never;\n\nexport type PayloadFromAction\u003CT> = T extends (\n  payload: infer P,\n  ...args: any[]\n) => any\n  ? P\n  : never;\n\nexport type ReturnFromAction\u003CT> = T extends (...args: any[]) => infer R\n  ? Awaited\u003CR>\n  : never;\n```\n\n### 2. src\u002Futils\u002Fdev\u002Fdev.ts\n```typescript\nexport const dev = {\n  isDev: import.meta.env?.MODE === 'development' || process.env.NODE_ENV === 'development',\n\n  run: (fn: () => void) => {\n    if (dev.isDev) fn();\n  }\n};\n```\n\n### 3. src\u002Flib\u002Fcommand\u002Fsubject.ts\n```typescript\nexport class Subject {\n  private observers = new Set\u003C() => void>();\n\n  subscribe(observer: () => void) {\n    this.observers.add(observer);\n\n    return () => this.observers.delete(observer);\n  }\n\n  notify() {\n    for (const observer of this.observers) observer();\n  }\n}\n```\n\n### 4. src\u002Flib\u002Fcommand\u002Ftypes.ts\n```typescript\nimport type {\n  ActionPaths,\n  PathValue,\n  PayloadFromAction,\n  ReturnFromAction,\n} from \"#\u002Ftypes\u002Fhelpers\";\nimport type { Actions } from \".\u002Fglobal\";\n\n\u002F\u002F #region Transitions\nexport type TransitionKey = unknown | unknown[];\n\u002F\u002F #endregion\n\n\u002F\u002F #region Command Bus\nexport type Handler\u003CTPayload = unknown, TResult = void> = (\n  payload: TPayload,\n) => Promise\u003CTResult>;\n\nexport type Dispose = () => void;\n\nexport type DispatchConfig = {\n  transition?: TransitionKey;\n};\n\u002F\u002F #endregion\n\n\u002F\u002F #region Instance Registry\nexport type Instance = {\n  id: string;\n  label?: string;\n};\n\u002F\u002F #endregion\n\n\u002F\u002F #region Actions\nexport type Config = DispatchConfig & {\n  instanceId: string;\n};\n\nexport type Action\u003CTPayload = undefined, TResult = void> = [TPayload] extends [\n  undefined,\n]\n  ? (payload?: TPayload, config?: DispatchConfig) => Promise\u003CTResult>\n  : (payload: TPayload, config?: DispatchConfig) => Promise\u003CTResult>;\n\nexport type ScopedAction\u003CTPayload = undefined, TResult = void> = [\n  TPayload,\n] extends [undefined]\n  ? (payload: undefined, config: Config) => Promise\u003CTResult>\n  : (payload: TPayload, config: Config) => Promise\u003CTResult>;\n\u002F\u002F #endregion\n\n\u002F\u002F #region Aliases\nexport type ActionPath = ActionPaths\u003CActions>;\n\nexport type ActionValue\u003CTCommand extends ActionPath> = PathValue\u003C\n  Actions,\n  TCommand\n>;\n\nexport type CommandMeta = { label: string };\n\u002F\u002F #endregion\n\n\u002F\u002F #region Derived\nexport type ActionPayload\u003CTCommand extends ActionPath> = PayloadFromAction\u003C\n  ActionValue\u003CTCommand>\n>;\n\nexport type ActionReturn\u003CTCommand extends ActionPath> = ReturnFromAction\u003C\n  ActionValue\u003CTCommand>\n>;\n\nexport type IsScopedCommand\u003CTCommand extends ActionPath> =\n  ActionValue\u003CTCommand> extends (\n    payload: any,\n    config: Config,\n  ) => Promise\u003Cany>\n    ? true\n    : false;\n\nexport type HandleConfig\u003CTCommand extends ActionPath> =\n  IsScopedCommand\u003CTCommand> extends true\n    ? { instanceId: string; meta?: CommandMeta }\n    : { instanceId?: string; meta?: CommandMeta };\n\nexport type SecondArg\u003CT> = T extends (a: any, b: infer B) => any ? B : never;\n\nexport type ScopedCommands = {\n  [K in ActionPath]: SecondArg\u003CActionValue\u003CK>> extends Config ? K : never;\n}[ActionPath];\n\nexport type UnscopedCommands = Exclude\u003CActionPath, ScopedCommands>;\n\u002F\u002F #endregion\n```\n\n### 5. src\u002Flib\u002Fcommand\u002Fcommand-bus.ts\n```typescript\nimport { dev } from \"#\u002Futils\u002Fdev\u002Fdev\";\nimport type { TransitionStore } from \".\u002Ftransitions-store\";\nimport type { DispatchConfig, Dispose, Handler } from \".\u002Ftypes\";\n\nexport class CommandBus {\n  private handlers: Map\u003Cstring, Handler> = new Map();\n\n  constructor(private readonly transition: TransitionStore) {}\n\n  handle\u003CTPayload = unknown, TResult = void>(\n    command: string,\n    handler: Handler\u003CTPayload, TResult>,\n  ): Dispose {\n    if (this.handlers.has(command)) {\n      dev.run(() =>\n        console.error(\n          `[command]: already exist a handle registered for ${command}`,\n        ),\n      );\n      return () => null;\n    }\n\n    this.handlers.set(command, handler as Handler);\n\n    return () => this.dispose(command);\n  }\n\n  async dispatch\u003CTResult = void>(\n    command: string,\n    payload?: unknown,\n    config?: DispatchConfig,\n  ): Promise\u003CTResult | undefined> {\n    dev.run(() => console.info(`[command dispatched]: ${command}`, payload));\n\n    const handler = this.handlers.get(command);\n    if (!handler) {\n      const message = `[command]: no handler registered for ${command}`;\n      dev.run(() => console.error(message));\n      return;\n    }\n\n    const transitionKey = config?.transition ? config.transition : [command];\n    this.transition.start(transitionKey);\n\n    try {\n      return (await handler(payload)) as TResult;\n    } finally {\n      this.transition.done(transitionKey);\n    }\n  }\n\n  dispose(command: string): void {\n    this.handlers.delete(command);\n  }\n}\n```\n\n### 6. src\u002Flib\u002Fcommand\u002Ftransitions-store.ts\n```typescript\nimport { Subject } from \".\u002Fsubject\";\nimport type { TransitionKey } from \".\u002Ftypes\";\n\nexport class TransitionStore extends Subject {\n  private static instance: TransitionStore;\n\n  private counts: Map\u003Cstring, number> = new Map();\n\n  private constructor() {\n    super();\n  }\n\n  start(key: TransitionKey) {\n    const serializedKey = TransitionStore.serializeKey(key);\n    const count = this.counts.get(serializedKey) ?? 0;\n\n    this.counts.set(serializedKey, count + 1);\n    this.notify();\n  }\n\n  done(key: TransitionKey) {\n    const serializedKey = TransitionStore.serializeKey(key);\n    const count = (this.counts.get(serializedKey) ?? 0) - 1;\n\n    if (count \u003C= 0) this.counts.delete(serializedKey);\n    else this.counts.set(serializedKey, count);\n\n    this.notify();\n  }\n\n  isExecuting(key: TransitionKey) {\n    const serializedKey = TransitionStore.serializeKey(key);\n    return (this.counts.get(serializedKey) ?? 0) > 0;\n  }\n\n  static serializeKey(key: TransitionKey) {\n    return JSON.stringify(key);\n  }\n\n  static getInstance() {\n    if (!TransitionStore.instance) {\n      TransitionStore.instance = new TransitionStore();\n    }\n\n    return TransitionStore.instance;\n  }\n}\n```\n\n### 7. src\u002Flib\u002Fcommand\u002Finstance-registry.ts\n```typescript\nimport { Subject } from \".\u002Fsubject\";\nimport type { Instance } from \".\u002Ftypes\";\n\nexport class InstanceRegistry extends Subject {\n  private static instance: InstanceRegistry;\n  private domains: Map\u003Cstring, Map\u003Cstring, Instance>> = new Map();\n  private instancesCache: Map\u003Cstring, readonly Instance[]> = new Map();\n\n  private constructor() {\n    super();\n  }\n\n  add(domain: string, instance: Instance) {\n    if (!this.domains.has(domain)) {\n      this.domains.set(domain, new Map());\n    }\n\n    this.domains.get(domain)?.set(instance.id, instance);\n    this.instancesCache.delete(domain);\n    this.notify();\n  }\n\n  getInstances(domain: string): readonly Instance[] {\n    const cached = this.instancesCache.get(domain);\n    if (cached) return cached;\n\n    const fresh = Array.from(this.domains.get(domain)?.values() ?? []);\n    this.instancesCache.set(domain, fresh);\n    return fresh;\n  }\n\n  remove(domain: string, instanceId: string) {\n    if (!this.domains.has(domain)) return;\n\n    this.domains.get(domain)?.delete(instanceId);\n    this.instancesCache.delete(domain);\n    this.notify();\n  }\n\n  static getInstance() {\n    if (!InstanceRegistry.instance) {\n      InstanceRegistry.instance = new InstanceRegistry();\n    }\n\n    return InstanceRegistry.instance;\n  }\n}\n```\n\n### 8. src\u002Fhooks\u002Fuse-transition.ts\n```typescript\nimport { useSyncExternalStore } from \"react\";\nimport { TransitionStore } from \"@\u002Flib\u002Fcommand\u002Ftransitions-store\";\n\nexport function useTransition(key: unknown[]) {\n  return useSyncExternalStore(\n    (callback) => TransitionStore.getInstance().subscribe(callback),\n    () => TransitionStore.getInstance().isExecuting(key),\n  );\n}\n```\n\n### 9. src\u002Flib\u002Fcommand\u002Findex.ts\n```typescript\nimport type { DeepKeys } from \"#\u002Ftypes\u002Fhelpers\";\nimport { CommandBus } from \".\u002Fcommand-bus\";\nimport { InstanceRegistry } from \".\u002Finstance-registry\";\nimport { TransitionStore } from \".\u002Ftransitions-store\";\nimport type { Actions } from \".\u002Fglobal\";\nimport type {\n  ActionPath,\n  ActionPayload,\n  ActionReturn,\n  CommandMeta,\n  Config,\n  Handler,\n  ScopedCommands,\n  UnscopedCommands,\n} from \".\u002Ftypes\";\n\nexport type {\n  Action,\n  Actions,\n  HandleConfig,\n  IsScopedCommand,\n  ScopedAction,\n  UnscopedCommands,\n} from \".\u002Ftypes\";\n\nexport class Command {\n  private $commandBus: CommandBus;\n  private $transitions: TransitionStore;\n  private $instanceRegistry: InstanceRegistry;\n\n  constructor() {\n    this.$transitions = TransitionStore.getInstance();\n    this.$commandBus = new CommandBus(this.$transitions);\n    this.$instanceRegistry = InstanceRegistry.getInstance();\n  }\n\n  handle\u003CTCommand extends ScopedCommands>(\n    command: TCommand,\n    handler: Handler\u003CActionPayload\u003CTCommand>, ActionReturn\u003CTCommand>>,\n    config: {\n      instanceId: string;\n      meta?: CommandMeta;\n    },\n  ): () => void;\n  handle\u003CTCommand extends UnscopedCommands>(\n    command: TCommand,\n    handler: Handler\u003CActionPayload\u003CTCommand>, ActionReturn\u003CTCommand>>,\n    config?: {\n      meta?: CommandMeta;\n    },\n  ): () => void;\n  handle\u003CTCommand extends ActionPath>(\n    command: TCommand,\n    handler: Handler\u003CActionPayload\u003CTCommand>, ActionReturn\u003CTCommand>>,\n    config?: {\n      instanceId?: string;\n      meta?: CommandMeta;\n    },\n  ) {\n    const result = this.parseCommand(command, config?.instanceId);\n    const { domain, key, instanceId } = result;\n\n    if (domain && instanceId) {\n      this.$instanceRegistry.add(domain, {\n        id: instanceId,\n        label: config?.meta?.label,\n      });\n    }\n\n    const dispose = this.$commandBus.handle\u003C\n      ActionPayload\u003CTCommand>,\n      ActionReturn\u003CTCommand>\n    >(key, handler);\n\n    return () => {\n      if (domain && instanceId)\n        this.$instanceRegistry.remove(domain, instanceId);\n      dispose();\n    };\n  }\n\n  dispatch\u003CTCommand extends ActionPath>(\n    command: TCommand,\n    payload?: ActionPayload\u003CTCommand>,\n    config?: Config,\n  ) {\n    const result = this.parseCommand(command, config?.instanceId);\n    return this.$commandBus.dispatch\u003CActionPayload\u003CTCommand>>(\n      result.key,\n      payload,\n      config,\n    );\n  }\n\n  getActionsProxy(path: DeepKeys\u003CActions>[] = []): Actions {\n    const self = this;\n\n    return new Proxy(() => {}, {\n      get(_target, prop: DeepKeys\u003CActions>) {\n        return self.getActionsProxy([...path, prop]);\n      },\n\n      apply(_target, _thisArg, args: [ActionPayload\u003CActionPath>, Config?]) {\n        const commandName = path.join(\".\") as ActionPath;\n        return self.dispatch(commandName, args[0], args[1]);\n      },\n    }) as unknown as Actions;\n  }\n\n  private parseCommand(command: ActionPath, instanceId?: string) {\n    const parts = command.split(\".\");\n    const hasDomain = parts.length > 1;\n\n    if (!hasDomain) {\n      return { domain: undefined, instanceId, key: command };\n    }\n\n    const domain = parts[0];\n    const path = parts.slice(1).join(\".\");\n    const key = instanceId ? `${instanceId}:${domain}.${path}` : command;\n\n    return { domain, instanceId, key };\n  }\n}\n\nexport const command = new Command();\n\nexport const actions = command.getActionsProxy();\n```\n\n### 10. src\u002Flib\u002Fcommand\u002Fglobal.ts\n```typescript\nimport type { Action, ScopedAction } from \".\u002Ftypes\";\n\nexport interface Actions {\n  \u002F\u002F Define your global actions here\n  \u002F\u002F Example:\n  \u002F\u002F counter: {\n  \u002F\u002F   increment: Action;\n  \u002F\u002F   decrement: Action;\n  \u002F\u002F   reset: Action;\n  \u002F\u002F };\n  \u002F\u002F\n  \u002F\u002F content: {\n  \u002F\u002F   show: ScopedAction\u003Cstring>;\n  \u002F\u002F };\n}\n```\n\n## Final output\n\nReturn:\n\n* Files created\n* Adaptations made, with the reason for each\n\nReturn this output to the calling skill and continue its flow. Do not end the run here unless this skill was invoked directly by the user.\n","# Setup Command System\n\nInstall the Command System architecture in the current project by creating the files listed below exactly as provided.\n\n## What this skill does\n\nThe files below are the **reference implementation** of the Command System (V2). They are correct and define the architecture and public API.\n\n1. Create the files listed below with the provided content.\n2. Adapt them so they compile and run in this project. Allowed and expected:\n   * Fix imports, aliases and paths.\n   * Adjust references to the project structure (e.g. env access, file locations).\n   * Fix type or compilation errors caused by the project setup (TypeScript config, strictness, lint rules).\n   * Format with the project formatter.\n3. Keep the design: the public API (`command`, `actions`, `Action`, `ScopedAction`, `useTransition`, `InstanceRegistry`, `TransitionStore`), the file roles and the behavior stay the same. Do not redesign, add features or switch to another version (V3).\n\nDecide these adaptations yourself and continue. Never stop to ask the user about them; list them in the final output.\n\n## Before copying\n\nThe files import through the `#\u002F` and `@\u002F` aliases. Prefer configuring both to resolve to `src\u002F`; if the project uses another alias convention, change the imports instead:\n\n* `tsconfig.json` → `compilerOptions.paths`: `\"#\u002F*\": [\".\u002Fsrc\u002F*\"]` and `\"@\u002F*\": [\".\u002Fsrc\u002F*\"]`.\n* `package.json` → `\"imports\": { \"#\u002F*\": \".\u002Fsrc\u002F*\" }`, or the bundler alias equivalent.\n\nThe architecture rules for using the Command System live in the `command-bus-architecture` skill. Do not create a rule file.\n\n## Files to create\n\nCreate the following files in the project, using EXACTLY the content provided below for each file:\n\n### 1. src\u002Ftypes\u002Fhelpers.ts\n```typescript\nexport type ActionPaths\u003CT> = T extends (...args: any[]) => any\n  ? never\n  : {\n      [K in keyof T & string]: T[K] extends (...args: any[]) => any\n        ? K\n        : `${K}.${ActionPaths\u003CT[K]>}`;\n    }[keyof T & string];\n\nexport type DeepKeyPaths\u003CT> = T extends object\n  ? {\n      [K in keyof T & string]: K | `${K}.${DeepKeyPaths\u003CT[K]>}`;\n    }[keyof T & string]\n  : never;\n\nexport type DeepKeys\u003CT> = T extends object\n  ? {\n      [K in keyof T]: K | DeepKeys\u003CT[K]>;\n    }[keyof T]\n  : never;\n\nexport type PathValue\u003C\n  T,\n  P extends string,\n> = P extends `${infer K}.${infer Rest}`\n  ? K extends keyof T\n    ? PathValue\u003CT[K], Rest>\n    : never\n  : P extends keyof T\n  ? T[P]\n  : never;\n\nexport type PayloadFromAction\u003CT> = T extends (\n  payload: infer P,\n  ...args: any[]\n) => any\n  ? P\n  : never;\n\nexport type ReturnFromAction\u003CT> = T extends (...args: any[]) => infer R\n  ? Awaited\u003CR>\n  : never;\n```\n\n### 2. src\u002Futils\u002Fdev\u002Fdev.ts\n```typescript\nexport const dev = {\n  isDev: import.meta.env?.MODE === 'development' || process.env.NODE_ENV === 'development',\n\n  run: (fn: () => void) => {\n    if (dev.isDev) fn();\n  }\n};\n```\n\n### 3. src\u002Flib\u002Fcommand\u002Fsubject.ts\n```typescript\nexport class Subject {\n  private observers = new Set\u003C() => void>();\n\n  subscribe(observer: () => void) {\n    this.observers.add(observer);\n\n    return () => this.observers.delete(observer);\n  }\n\n  notify() {\n    for (const observer of this.observers) observer();\n  }\n}\n```\n\n### 4. src\u002Flib\u002Fcommand\u002Ftypes.ts\n```typescript\nimport type {\n  ActionPaths,\n  PathValue,\n  PayloadFromAction,\n  ReturnFromAction,\n} from \"#\u002Ftypes\u002Fhelpers\";\nimport type { Actions } from \".\u002Fglobal\";\n\n\u002F\u002F #region Transitions\nexport type TransitionKey = unknown | unknown[];\n\u002F\u002F #endregion\n\n\u002F\u002F #region Command Bus\nexport type Handler\u003CTPayload = unknown, TResult = void> = (\n  payload: TPayload,\n) => Promise\u003CTResult>;\n\nexport type Dispose = () => void;\n\nexport type DispatchConfig = {\n  transition?: TransitionKey;\n};\n\u002F\u002F #endregion\n\n\u002F\u002F #region Instance Registry\nexport type Instance = {\n  id: string;\n  label?: string;\n};\n\u002F\u002F #endregion\n\n\u002F\u002F #region Actions\nexport type Config = DispatchConfig & {\n  instanceId: string;\n};\n\nexport type Action\u003CTPayload = undefined, TResult = void> = [TPayload] extends [\n  undefined,\n]\n  ? (payload?: TPayload, config?: DispatchConfig) => Promise\u003CTResult>\n  : (payload: TPayload, config?: DispatchConfig) => Promise\u003CTResult>;\n\nexport type ScopedAction\u003CTPayload = undefined, TResult = void> = [\n  TPayload,\n] extends [undefined]\n  ? (payload: undefined, config: Config) => Promise\u003CTResult>\n  : (payload: TPayload, config: Config) => Promise\u003CTResult>;\n\u002F\u002F #endregion\n\n\u002F\u002F #region Aliases\nexport type ActionPath = ActionPaths\u003CActions>;\n\nexport type ActionValue\u003CTCommand extends ActionPath> = PathValue\u003C\n  Actions,\n  TCommand\n>;\n\nexport type CommandMeta = { label: string };\n\u002F\u002F #endregion\n\n\u002F\u002F #region Derived\nexport type ActionPayload\u003CTCommand extends ActionPath> = PayloadFromAction\u003C\n  ActionValue\u003CTCommand>\n>;\n\nexport type ActionReturn\u003CTCommand extends ActionPath> = ReturnFromAction\u003C\n  ActionValue\u003CTCommand>\n>;\n\nexport type IsScopedCommand\u003CTCommand extends ActionPath> =\n  ActionValue\u003CTCommand> extends (\n    payload: any,\n    config: Config,\n  ) => Promise\u003Cany>\n    ? true\n    : false;\n\nexport type HandleConfig\u003CTCommand extends ActionPath> =\n  IsScopedCommand\u003CTCommand> extends true\n    ? { instanceId: string; meta?: CommandMeta }\n    : { instanceId?: string; meta?: CommandMeta };\n\nexport type SecondArg\u003CT> = T extends (a: any, b: infer B) => any ? B : never;\n\nexport type ScopedCommands = {\n  [K in ActionPath]: SecondArg\u003CActionValue\u003CK>> extends Config ? K : never;\n}[ActionPath];\n\nexport type UnscopedCommands = Exclude\u003CActionPath, ScopedCommands>;\n\u002F\u002F #endregion\n```\n\n### 5. src\u002Flib\u002Fcommand\u002Fcommand-bus.ts\n```typescript\nimport { dev } from \"#\u002Futils\u002Fdev\u002Fdev\";\nimport type { TransitionStore } from \".\u002Ftransitions-store\";\nimport type { DispatchConfig, Dispose, Handler } from \".\u002Ftypes\";\n\nexport class CommandBus {\n  private handlers: Map\u003Cstring, Handler> = new Map();\n\n  constructor(private readonly transition: TransitionStore) {}\n\n  handle\u003CTPayload = unknown, TResult = void>(\n    command: string,\n    handler: Handler\u003CTPayload, TResult>,\n  ): Dispose {\n    if (this.handlers.has(command)) {\n      dev.run(() =>\n        console.error(\n          `[command]: already exist a handle registered for ${command}`,\n        ),\n      );\n      return () => null;\n    }\n\n    this.handlers.set(command, handler as Handler);\n\n    return () => this.dispose(command);\n  }\n\n  async dispatch\u003CTResult = void>(\n    command: string,\n    payload?: unknown,\n    config?: DispatchConfig,\n  ): Promise\u003CTResult | undefined> {\n    dev.run(() => console.info(`[command dispatched]: ${command}`, payload));\n\n    const handler = this.handlers.get(command);\n    if (!handler) {\n      const message = `[command]: no handler registered for ${command}`;\n      dev.run(() => console.error(message));\n      return;\n    }\n\n    const transitionKey = config?.transition ? config.transition : [command];\n    this.transition.start(transitionKey);\n\n    try {\n      return (await handler(payload)) as TResult;\n    } finally {\n      this.transition.done(transitionKey);\n    }\n  }\n\n  dispose(command: string): void {\n    this.handlers.delete(command);\n  }\n}\n```\n\n### 6. src\u002Flib\u002Fcommand\u002Ftransitions-store.ts\n```typescript\nimport { Subject } from \".\u002Fsubject\";\nimport type { TransitionKey } from \".\u002Ftypes\";\n\nexport class TransitionStore extends Subject {\n  private static instance: TransitionStore;\n\n  private counts: Map\u003Cstring, number> = new Map();\n\n  private constructor() {\n    super();\n  }\n\n  start(key: TransitionKey) {\n    const serializedKey = TransitionStore.serializeKey(key);\n    const count = this.counts.get(serializedKey) ?? 0;\n\n    this.counts.set(serializedKey, count + 1);\n    this.notify();\n  }\n\n  done(key: TransitionKey) {\n    const serializedKey = TransitionStore.serializeKey(key);\n    const count = (this.counts.get(serializedKey) ?? 0) - 1;\n\n    if (count \u003C= 0) this.counts.delete(serializedKey);\n    else this.counts.set(serializedKey, count);\n\n    this.notify();\n  }\n\n  isExecuting(key: TransitionKey) {\n    const serializedKey = TransitionStore.serializeKey(key);\n    return (this.counts.get(serializedKey) ?? 0) > 0;\n  }\n\n  static serializeKey(key: TransitionKey) {\n    return JSON.stringify(key);\n  }\n\n  static getInstance() {\n    if (!TransitionStore.instance) {\n      TransitionStore.instance = new TransitionStore();\n    }\n\n    return TransitionStore.instance;\n  }\n}\n```\n\n### 7. src\u002Flib\u002Fcommand\u002Finstance-registry.ts\n```typescript\nimport { Subject } from \".\u002Fsubject\";\nimport type { Instance } from \".\u002Ftypes\";\n\nexport class InstanceRegistry extends Subject {\n  private static instance: InstanceRegistry;\n  private domains: Map\u003Cstring, Map\u003Cstring, Instance>> = new Map();\n  private instancesCache: Map\u003Cstring, readonly Instance[]> = new Map();\n\n  private constructor() {\n    super();\n  }\n\n  add(domain: string, instance: Instance) {\n    if (!this.domains.has(domain)) {\n      this.domains.set(domain, new Map());\n    }\n\n    this.domains.get(domain)?.set(instance.id, instance);\n    this.instancesCache.delete(domain);\n    this.notify();\n  }\n\n  getInstances(domain: string): readonly Instance[] {\n    const cached = this.instancesCache.get(domain);\n    if (cached) return cached;\n\n    const fresh = Array.from(this.domains.get(domain)?.values() ?? []);\n    this.instancesCache.set(domain, fresh);\n    return fresh;\n  }\n\n  remove(domain: string, instanceId: string) {\n    if (!this.domains.has(domain)) return;\n\n    this.domains.get(domain)?.delete(instanceId);\n    this.instancesCache.delete(domain);\n    this.notify();\n  }\n\n  static getInstance() {\n    if (!InstanceRegistry.instance) {\n      InstanceRegistry.instance = new InstanceRegistry();\n    }\n\n    return InstanceRegistry.instance;\n  }\n}\n```\n\n### 8. src\u002Fhooks\u002Fuse-transition.ts\n```typescript\nimport { useSyncExternalStore } from \"react\";\nimport { TransitionStore } from \"@\u002Flib\u002Fcommand\u002Ftransitions-store\";\n\nexport function useTransition(key: unknown[]) {\n  return useSyncExternalStore(\n    (callback) => TransitionStore.getInstance().subscribe(callback),\n    () => TransitionStore.getInstance().isExecuting(key),\n  );\n}\n```\n\n### 9. src\u002Flib\u002Fcommand\u002Findex.ts\n```typescript\nimport type { DeepKeys } from \"#\u002Ftypes\u002Fhelpers\";\nimport { CommandBus } from \".\u002Fcommand-bus\";\nimport { InstanceRegistry } from \".\u002Finstance-registry\";\nimport { TransitionStore } from \".\u002Ftransitions-store\";\nimport type { Actions } from \".\u002Fglobal\";\nimport type {\n  ActionPath,\n  ActionPayload,\n  ActionReturn,\n  CommandMeta,\n  Config,\n  Handler,\n  ScopedCommands,\n  UnscopedCommands,\n} from \".\u002Ftypes\";\n\nexport type {\n  Action,\n  Actions,\n  HandleConfig,\n  IsScopedCommand,\n  ScopedAction,\n  UnscopedCommands,\n} from \".\u002Ftypes\";\n\nexport class Command {\n  private $commandBus: CommandBus;\n  private $transitions: TransitionStore;\n  private $instanceRegistry: InstanceRegistry;\n\n  constructor() {\n    this.$transitions = TransitionStore.getInstance();\n    this.$commandBus = new CommandBus(this.$transitions);\n    this.$instanceRegistry = InstanceRegistry.getInstance();\n  }\n\n  handle\u003CTCommand extends ScopedCommands>(\n    command: TCommand,\n    handler: Handler\u003CActionPayload\u003CTCommand>, ActionReturn\u003CTCommand>>,\n    config: {\n      instanceId: string;\n      meta?: CommandMeta;\n    },\n  ): () => void;\n  handle\u003CTCommand extends UnscopedCommands>(\n    command: TCommand,\n    handler: Handler\u003CActionPayload\u003CTCommand>, ActionReturn\u003CTCommand>>,\n    config?: {\n      meta?: CommandMeta;\n    },\n  ): () => void;\n  handle\u003CTCommand extends ActionPath>(\n    command: TCommand,\n    handler: Handler\u003CActionPayload\u003CTCommand>, ActionReturn\u003CTCommand>>,\n    config?: {\n      instanceId?: string;\n      meta?: CommandMeta;\n    },\n  ) {\n    const result = this.parseCommand(command, config?.instanceId);\n    const { domain, key, instanceId } = result;\n\n    if (domain && instanceId) {\n      this.$instanceRegistry.add(domain, {\n        id: instanceId,\n        label: config?.meta?.label,\n      });\n    }\n\n    const dispose = this.$commandBus.handle\u003C\n      ActionPayload\u003CTCommand>,\n      ActionReturn\u003CTCommand>\n    >(key, handler);\n\n    return () => {\n      if (domain && instanceId)\n        this.$instanceRegistry.remove(domain, instanceId);\n      dispose();\n    };\n  }\n\n  dispatch\u003CTCommand extends ActionPath>(\n    command: TCommand,\n    payload?: ActionPayload\u003CTCommand>,\n    config?: Config,\n  ) {\n    const result = this.parseCommand(command, config?.instanceId);\n    return this.$commandBus.dispatch\u003CActionPayload\u003CTCommand>>(\n      result.key,\n      payload,\n      config,\n    );\n  }\n\n  getActionsProxy(path: DeepKeys\u003CActions>[] = []): Actions {\n    const self = this;\n\n    return new Proxy(() => {}, {\n      get(_target, prop: DeepKeys\u003CActions>) {\n        return self.getActionsProxy([...path, prop]);\n      },\n\n      apply(_target, _thisArg, args: [ActionPayload\u003CActionPath>, Config?]) {\n        const commandName = path.join(\".\") as ActionPath;\n        return self.dispatch(commandName, args[0], args[1]);\n      },\n    }) as unknown as Actions;\n  }\n\n  private parseCommand(command: ActionPath, instanceId?: string) {\n    const parts = command.split(\".\");\n    const hasDomain = parts.length > 1;\n\n    if (!hasDomain) {\n      return { domain: undefined, instanceId, key: command };\n    }\n\n    const domain = parts[0];\n    const path = parts.slice(1).join(\".\");\n    const key = instanceId ? `${instanceId}:${domain}.${path}` : command;\n\n    return { domain, instanceId, key };\n  }\n}\n\nexport const command = new Command();\n\nexport const actions = command.getActionsProxy();\n```\n\n### 10. src\u002Flib\u002Fcommand\u002Fglobal.ts\n```typescript\nimport type { Action, ScopedAction } from \".\u002Ftypes\";\n\nexport interface Actions {\n  \u002F\u002F Define your global actions here\n  \u002F\u002F Example:\n  \u002F\u002F counter: {\n  \u002F\u002F   increment: Action;\n  \u002F\u002F   decrement: Action;\n  \u002F\u002F   reset: Action;\n  \u002F\u002F };\n  \u002F\u002F\n  \u002F\u002F content: {\n  \u002F\u002F   show: ScopedAction\u003Cstring>;\n  \u002F\u002F };\n}\n```\n\n## Final output\n\nReturn:\n\n* Files created\n* Adaptations made, with the reason for each\n\nReturn this output to the calling skill and continue its flow. Do not end the run here unless this skill was invoked directly by the user.\n",{"name":5,"description":7},"main","6f1867f215cf86d20099b6dfb1164c79abfb87ce","lab-10\u002F.claude\u002Fskills\u002Fsetup-command-system",0,"https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab","https:\u002F\u002Fgithub.com\u002Fmaurodesouza","Software Engineer","2026-10-28 02:01:00",{"source":8,"skillName":5,"commands":40,"prompt":50,"zipAvailable":51},[41,44,47],{"tool":42,"command":43},"npx","npx skills add maurodesouza\u002Fai-kanban-app-lab --skill setup-command-system",{"tool":45,"command":46},"bunx","bunx skills add maurodesouza\u002Fai-kanban-app-lab --skill setup-command-system",{"tool":48,"command":49},"pnpm","pnpm dlx skills add maurodesouza\u002Fai-kanban-app-lab --skill setup-command-system","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.claude\u002Fskills\u002Fsetup-command-system\u002FSKILL.md",true,[],[54,80,97,120,132,137],{"skillNo":55,"name":56,"nameZh":6,"description":57,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":26},"01M6P519M13JTBZDK3ZJP48P2C","utils-implementation","Write and organize utils (pure helpers for formatting, mapping, filtering, math, parsing, ids, storage) as one namespace object per domain with clear, readable names. Use before creating or changing any util.","https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.codex\u002Fskills\u002Futils-implementation\u002FSKILL.md",[],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79],"utils implementation","implementation","utils","parsing","for","object","storage","ids","clear","math","write","filtering","with","use","organize","domain","mapping","formatting","as",{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":91,"publishedAt":26},"01M6P516BP8GPRJHPGVFWRF5T8","test-writer","Write tests for the current implementation","https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.codex\u002Fskills\u002Ftest-writer\u002FSKILL.md",[86],{"categoryNo":87,"categoryName":88,"taxonomyType":89,"taxonomyTypeDesc":90},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[92,93,94,95,71,62,96,65],"test","test writer","writer","write tests","tests",{"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":26},"01M6P50M0Z2AQH32ZTV90D5V32","tech-lead","Analyze a project, turn the user's goal into an implementation-ready GitHub Epic and Issues (following project rules, the Command Bus architecture and Fragiola UI), then start epic-implementer automatically (use the no-implement flag to stop after planning).","https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.codex\u002Fskills\u002Ftech-lead\u002FSKILL.md",[],[104,105,106,107,108,109,110,23,111,112,113,114,115,116,21,117,74,118,119,25],"tech","tech lead","ready","command bus architecture","implement","github","EPIC","planning","issues","ui","start","analyze","Rules","implementer","goal","stop",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":26},"01M6P50GND99S9QQY6KWPP6NW9","tech-lead-publish","Publish a final Epic and its Issues to GitHub, linked and labeled, keeping dependency and execution information. Sub-skill of tech-lead.","https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.codex\u002Fskills\u002Ftech-lead-publish\u002FSKILL.md",[],[127,105,104,128,109,112,129,130,110,131],"tech lead publish","publish","execution","dependency","information",{"skillNo":133,"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":134,"categories":135,"keywords":136,"publishedAt":26},"01M6P50D4P2SQSYZM7TZMHZA0J","https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.codex\u002Fskills\u002Fsetup-command-system\u002FSKILL.md",[],[22,21,20,19,23,24,25],{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":26},"01M6P50A032630X9JDDZYJMNV3","reviewer","Review code changes and provide feedback","https:\u002F\u002Fgithub.com\u002Fmaurodesouza\u002Fai-kanban-app-lab\u002Fblob\u002Fmain\u002Flab-10\u002F.codex\u002Fskills\u002Freviewer\u002FSKILL.md",[],[139,144,145,146,147,148],"code","review code","feedback","changes","review"]