Thunderbird Extensionのロゴ

Thunderbird Extension

組織
CodeAtCode
thunderbird-extension

Use when developing Thunderbird MailExtensions - Manifest V2/V3 configuration, messenger.* APIs for accounts, messages, folders and compose, UI actions, message display scripts, Experiment APIs, ATN submission, or migration from legacy extensions

概要

公開者CodeAtCode
リポジトリoss-ai-skills
スキル名thunderbird-extension
スター
30
フォーク
3
同梱ファイル
4
ライセンスGPL-3.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 4個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    CodeAtCodeがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルThunderbird ExtensionをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/CodeAtCode/oss-ai-skills/tree/master/extend/thunderbird-extension
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/CodeAtCode/oss-ai-skills.git /tmp/oss-ai-skills
mkdir -p .claude/skills
cp -r /tmp/oss-ai-skills/extend/thunderbird-extension .claude/skills/thunderbird-extension
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでThunderbird Extensionを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にThunderbird Extensionを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Thunderbird Extensionは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Objective: Use this skill to reduce manifest-schema rejections, messenger-API-typed errors, and ATN-review failures by enforcing manifest-version discipline, API-boundary rules, and permission-scoping patterns below.

Thunderbird MailExtension Development

Core Rules

Do manifest_version discipline because MV2 deprecation will break extensions at Thunderbird 137+. Set manifest_version: 3 for new extensions; migrate existing MV2 extensions now.

Do declare messenger. permissions explicitly because missing permissions fail silently at runtime.* Enumerate every API namespace in permissions before calling it.

Do use Experiment APIs only when messenger. cannot reach required functionality because reviewers reject unnecessary Experiment access.* Cite the missing built-in API in submission notes.

Do validate message content before processing because untrusted email data causes XSS in display scripts. Sanitize HTML, escape user input, verify MIME types.

Do use vCard format for contacts in MV3 because legacy contacts API is removed. Call messenger.addressBooks.contacts.create with vCard string, not name/email fields.

Do implement onStartup/onShutdown in Experiment APIs because missing cleanup causes crashes on extension reload. Unregister observers, clear caches, remove listeners.

Do place extension ID in browser_specific_settings.gecko.id because ATN rejects extensions without stable IDs. Generate UUID-formatted ID, do not use auto-generated values.

Do set strict_min_version to "128.0" because older Thunderbird versions lack MV3 support. Test on Thunderbird 128 ESR minimum.

UI Actions

Do attach listeners to action.onClicked because extensions with no popup need click handlers. Register in background.js, not in popup script.

Do update badge text asynchronously because setBadgeText returns a Promise. Awaiting prevents race conditions with badge color updates.

Do use compose_action for compose-window tools because message_display_action only works in message view. Match button location to API scope.

Message Display Scripts

Do execute display scripts via messenger.scripting.messageDisplay.executeScript in MV3 because manifest declaration is removed. Call dynamically after tab loads.

Do limit display script APIs to runtime/storage/i18n because full messenger. is unavailable.* Communicate with background via runtime.sendMessage for privileged operations.

Do validate message DOM before manipulation because email content varies widely. Check element existence, handle plain-text vs HTML, catch parsing errors.

MV2 → MV3 Migration Decision Guide

Do migrate now because Thunderbird 137 removes MV2 support. Priority order:

  1. Replace browser_action with action
  2. Migrate background.scripts to background.service_worker
  3. Convert composeScripts to scripting.compose
  4. Update contacts API to messenger.addressBooks.contacts.*

Do not use messenger.contacts. in MV3 because it is removed.* Use messenger.addressBooks.contacts.quickSearch and contacts.create with vCard.

Do test display scripts on both HTML and plain-text messages because rendering differs. Verify script handles text/plain bodies gracefully.

Deep Dives

See references for detailed API catalogs loaded on demand:

  • Messenger APIs — Complete messenger.* reference (accounts, messages, folders, addressBooks, compose, mailTabs): ./references/messenger-apis.md
  • Experiment APIs — Custom Experiment API development: ./references/experiment-apis.md
  • ATN Submission — Publishing workflow and review criteria: ./references/atn-submission.md
  • Testing & Migration — Debugging, testing workflow, legacy migration: ./references/testing-migration.md

Do structure extensions with clear separation because monolithic files become unmaintainable. Pattern:

my-extension/
├── manifest.json
├── background.js          # Event handlers, API orchestration
├── popup.html/js          # UI, user interaction
├── compose_popup.html/js  # Compose window UI
├── message_popup.html/js  # Message view UI
├── message_content.js     # Display script (limited API)
├── api/                   # Experiment APIs (if needed)
│   └── myapi/
│       ├── schema.json
│       └── implementation.js
├── icons/                 # 16, 32, 64 px
└── _locales/              # i18n strings

Error Handling

Do wrap async calls with explicit error logging because silent failures hide bugs. Log error message plus context (message ID, folder, operation).

Do check messenger.runtime.lastError after promises because unresolved errors accumulate. Clear lastError before next operation.

Do return structured error objects because callers need to distinguish failure modes. Include error type, offending values, suggested fix.

Performance

Do use messages.query with filters because server-side filtering is faster than client-side. Avoid list() + filter manually for large folders.

Do debounce rapid events because user actions fire multiple times. Throttle onMessage, onMessageDisplayed handlers.

Do paginate large message lists because loading all messages blocks the UI. Use limit/offset in queries.

Security

Do validate all user input before storage because unvalidated data corrupts state. Schema-validate permissions, folder IDs, message IDs.

Do sanitize HTML before injection because email content may contain scripts. Use DOMParser, strip dangerous elements.

Do use minimal permissions because excessive permissions trigger ATN review rejection. Request only what the extension needs.

Do not store sensitive data unencrypted because storage.local is readable. Encrypt passwords, tokens before storage.

Differences from Firefox WebExtensions

Do use messenger. for mail APIs because browser. lacks email functionality.** messenger.accounts, messenger.messages, messenger.compose are Thunderbird-specific.

Do expect content scripts to work only in web tabs because email content is sandboxed. Use message_display_scripts for email body access.

Do implement Experiment APIs for XPCOM access because WebExtensions cannot reach internals. Experiments bridge the gap but require justification.

Quick Reference

Essential Permissions

json
{
  "permissions": [
    "storage",           // Data persistence
    "messagesRead",      // Read message content
    "messagesMove",      // Move/copy/delete
    "addressBooks",      // Contact access
    "compose",           // Compose windows
    "accountsRead",      // Account listing
    "accountsFolders"    // Folder access
  ]
}

Essential APIs

javascript
// Messages — list, get, query, update, move, delete
messenger.messages.list(folderId)
messenger.messages.get(messageId)
messenger.messages.query({ from, unread, limit })
messenger.messages.update(messageId, { read: true })
messenger.messages.move([messageId], destinationFolderId)

// Folders — get, create, rename, delete
messenger.folders.get(folderId)
messenger.folders.getSubFolders(account)
messenger.folders.create(accountId, name)

// Compose — open, modify, send拦截
messenger.compose.beginNew({ to, subject, body })
messenger.compose.getComposeDetails(tabId)
messenger.compose.onBeforeSend.addListener(handler)

// Address Books — vCard-only in MV3
messenger.addressBooks.list()
messenger.addressBooks.contacts.create(addressBookId, { vCard })
messenger.addressBooks.contacts.quickSearch(query)

// Display — event-driven
messenger.messageDisplay.onMessageDisplayed.addListener(handler)
messenger.messageDisplay.getDisplayedMessage(tabId)

Workflow

  1. Develop: Load temporarily via Debug Add-ons
  2. Debug: Inspect background/popup via DevTools
  3. Test: Verify on HTML and plain-text messages
  4. Build: Create .zip with manifest and all scripts
  5. Submit: Upload to ATN with inline privacy policy
  6. Review: Respond within 10 days
  7. Publish: Extension goes live after approval

References

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Thunderbird Extension」では何ができますか?

Use when developing Thunderbird MailExtensions - Manifest V2/V3 configuration, messenger.* APIs for accounts, messages, folders and compose, UI actions, message display scripts, Experiment APIs, ATN submission, or migration from legacy extensions

TypingMindでThunderbird Extensionを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Thunderbird Extensionはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにThunderbird Extensionをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/CodeAtCode/oss-ai-skills/tree/master/extend/thunderbird-extensionを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Thunderbird Extensionを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Thunderbird Extensionは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもThunderbird Extensionを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Thunderbird Extension」は無料ですか?

はい。CodeAtCodeがGitHubでGPL-3.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇