スキル一覧に戻る
blikblum

manage-dom-tasks

by blikblum

1🍴 0📅 2025年12月28日
GitHubで見るManusで実行

SKILL.md


name: manage-dom-tasks description: Create or update DOM event "tasks" used to communicate between components and services via src/helpers/domTask.ts. Use when adding a new task event, changing task params/returns, or updating handlers/dispatchers for those tasks in src/setup/tasks.ts, pages, or services.

Manage DOM Tasks

Follow these steps to create or update a task (DOM event) in this project.

1) Find or add the task registry entry

Edit src/setup/tasks.ts to extend TaskEventRegistry with the task name, params, and return type.

Example (new task):

declare module '../helpers/domTask' {
  interface TaskEventRegistry {
    'login': { params: { user: string; password: string }; returns: void }
  }
}

Use discriminated unions for conditional params (e.g., when some params only apply for certain types):

declare module '../helpers/domTask' {
  interface TaskEventRegistry {
    'login': {
      params:
        | { type: 'google' }
        | { type: 'email'; email: string; password: string }
      returns: void
    }
  }
}

2) Update dispatchers (components/pages)

Find all dispatchers via dispatchTask (or createTaskEvent) and update params to match the registry type.

Example:

dispatchTask(this, 'login', { type: 'email', email, password })

3) Update handlers (services/components)

Update task handlers registered via registerTaskHandler, or decorators via @taskHandler. Ensure handler signatures align with the registry params and return type.

Example:

registerTaskHandler('login', async (params) => {
  if (params.type === 'google') return
  await signInWithEmail(params.email, params.password)
})

4) Verify usage consistency

Use rg to find all occurrences of the task name and update:

  • dispatchTask(this, 'task-name', ...)
  • registerTaskHandler('task-name', ...)
  • @taskHandler('task-name')

Prefer updating types first in src/setup/tasks.ts so TypeScript surfaces mismatches.

スコア

総合スコア

50/100

リポジトリの品質指標に基づく評価

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

0/10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

3ヶ月以内に更新がある

0/10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

0/5

レビュー

💬

レビュー機能は近日公開予定です