スキルフォーマット仕様

skills.mdフォーマットは、スキルの構造、設定、実行方法を定義します。この仕様により、すべてのTajoスキルが一貫した動作をします。

ファイル構成

スキルはYAMLフロントマター付きの単一のマークダウンファイルで定義されます。

---
name: customer-sync
version: 2.1.0
description: Sync customer data to Brevo contacts
category: data-sync
status: stable
triggers:
- event: customer_created
- event: customer_updated
- event: customer_deleted
actions:
- brevo/create-contact
- brevo/update-contact
- brevo/delete-contact
brevoEndpoints:
- POST /v3/contacts
- PUT /v3/contacts/{identifier}
- DELETE /v3/contacts/{identifier}
permissions:
- contacts:write
- contacts:read
---
# Customer Sync
Automatically synchronize customer data from your platform to Brevo contacts.
## Overview
This skill listens for customer lifecycle events and mirrors changes to Brevo...

フロントマターフィールド

必須フィールド

フィールド説明
namestring一意の識別子(kebab-case)
versionstringセマンティックバージョン(例: “2.1.0”)
descriptionstring短い説明(最大160文字)
categoryenumdata-syncemail-marketingsms-whatsapployaltyanalyticsintegrationsのいずれか
triggersarrayこのスキルを起動するイベント
actionsarrayこのスキルが実行できる操作

オプションフィールド

フィールドデフォルト説明
statusenumstablestablebetaexperimentalのいずれか
brevoEndpointsarray[]使用するBrevo APIエンドポイント
permissionsarray[]必要なBrevo APIパーミッション
relatedSkillsarray[]関連スキルのID
featuredbooleanfalseスキルカタログで強調表示

トリガー

トリガーはスキルを起動するイベントを定義します。

イベントトリガー

triggers:
- event: cart_abandoned
conditions:
- cart_value: "> 50" # Minimum cart value
- items_count: ">= 1" # At least one item
- time_since_activity: "> 30m" # 30 minutes of inactivity
debounce: 5m # Wait 5 minutes before re-triggering

スケジュールトリガー

triggers:
- schedule: "0 9 * * *" # Cron expression (daily at 9am)
timezone: "America/New_York"
- schedule: every_hour
- schedule: every_day

Webhookトリガー

triggers:
- webhook: /skills/customer-sync/trigger
method: POST
authentication: api_key

条件演算子

演算子説明
=等しいstatus: "active"
!=等しくないstatus: "!= deleted"
>より大きいcart_value: "> 50"
>=以上items: ">= 1"
<より小さいage: "< 30"
<=以下quantity: "<= 10"
contains文字列に含まれるemail: "contains @gmail.com"
starts_with文字列の接頭辞name: "starts_with Dr."
inリスト内の値country: "in US,CA,UK"

アクション

アクションはスキルが実行する操作を定義します。

アクション定義

actions:
- id: send_reminder_email
type: brevo/send-email
parameters:
template_id: 12345
to: "{{ contact.email }}"
params:
first_name: "{{ contact.firstName }}"
cart_items: "{{ cart.items }}"
retry:
attempts: 3
backoff: exponential
on_error: continue # or 'stop'

アクションタイプ

タイプ説明
brevo/send-emailトランザクションメールを送信
brevo/send-smsSMSメッセージを送信
brevo/send-whatsappWhatsAppメッセージを送信
brevo/create-contact新しいコンタクトを作成
brevo/update-contactコンタクト属性を更新
brevo/delete-contactコンタクトを削除
brevo/add-to-listコンタクトをリストに追加
brevo/remove-from-listコンタクトをリストから削除
brevo/track-eventカスタムイベントを追跡
http/requestHTTPリクエストを発行
transform/mapデータを変換
control/delay続行前に待機
control/condition条件で分岐

テンプレート変数

{{ }}構文でデータを参照します。

parameters:
to: "{{ contact.email }}"
subject: "Your order #{{ order.number }} has shipped"
params:
name: "{{ contact.firstName | default: 'Customer' }}"
items: "{{ cart.items | map: 'name' | join: ', ' }}"
total: "{{ cart.total | currency: 'USD' }}"

利用可能なフィルター

フィルター説明
defaultデフォルト値{{ name | default: 'Guest' }}
uppercase大文字化{{ name | uppercase }}
lowercase小文字化{{ email | lowercase }}
capitalize先頭文字を大文字化{{ name | capitalize }}
truncate文字列を切り詰める{{ desc | truncate: 100 }}
date日付をフォーマット{{ date | date: 'YYYY-MM-DD' }}
currency通貨をフォーマット{{ price | currency: 'EUR' }}
map配列プロパティをマップ{{ items | map: 'name' }}
join配列を連結{{ tags | join: ', ' }}
first配列の最初の要素{{ items | first }}
last配列の最後の要素{{ items | last }}
size配列・文字列の長さ{{ items | size }}

パーミッション

必要なBrevo APIパーミッションを定義します。

permissions:
- contacts:read # Read contact data
- contacts:write # Create/update contacts
- email:send # Send transactional emails
- sms:send # Send SMS messages
- lists:write # Manage contact lists
- events:write # Track events

完全な例

---
name: abandoned-cart-recovery
version: 3.0.0
description: Recover abandoned shopping carts with a multi-step email sequence
category: email-marketing
status: stable
triggers:
- event: cart_abandoned
conditions:
- cart_value: "> 25"
- customer_email: "exists"
- items_count: ">= 1"
debounce: 30m
actions:
- id: wait_1h
type: control/delay
parameters:
duration: 1h
- id: check_purchase
type: control/condition
parameters:
condition: "{{ cart.converted }} = false"
then: send_first_email
else: stop
- id: send_first_email
type: brevo/send-email
parameters:
template_id: {{ env.ABANDONED_CART_TEMPLATE_1 }}
to: "{{ contact.email }}"
params:
first_name: "{{ contact.firstName }}"
cart_url: "{{ cart.recovery_url }}"
items: "{{ cart.items }}"
total: "{{ cart.total | currency }}"
- id: wait_24h
type: control/delay
parameters:
duration: 24h
- id: check_purchase_2
type: control/condition
parameters:
condition: "{{ cart.converted }} = false"
then: send_second_email
else: stop
- id: send_second_email
type: brevo/send-email
parameters:
template_id: {{ env.ABANDONED_CART_TEMPLATE_2 }}
to: "{{ contact.email }}"
params:
first_name: "{{ contact.firstName }}"
cart_url: "{{ cart.recovery_url }}"
discount_code: "{{ generate_discount(10, 'percent') }}"
brevoEndpoints:
- POST /v3/smtp/email
- GET /v3/contacts/{identifier}
permissions:
- contacts:read
- email:send
relatedSkills:
- customer-sync
- order-events
- browse-abandonment
---
# Abandoned Cart Recovery
Recover lost sales with a proven multi-step email sequence...

MCPツールとしての公開

スキルはMCPツールとして公開でき、AIエージェントから呼び出し可能になります。フロントマターにmcpフィールドを追加します。

---
name: abandoned-cart-recovery
version: 3.0.0
description: Recover abandoned shopping carts with a multi-step email sequence
category: email-marketing
# MCP Configuration
mcp:
tool_name: tajo/recover-abandoned-cart
description: Execute abandoned cart recovery sequence for a specific cart
inputSchema:
type: object
properties:
cart_id:
type: string
description: The abandoned cart identifier
customer_email:
type: string
description: Customer email address
min_cart_value:
type: number
description: Minimum cart value to trigger recovery
default: 25
required: [cart_id, customer_email]
brevo_servers:
- brevo_contacts
- brevo_email_campaign_management
- brevo_templates
---

MCP公開の仕組み

スキルにmcpフィールドがあると、AIエージェントが発見して呼び出せるツールになります。

Agent: "Recover abandoned cart #4521 for [email protected]"
MCP Tool Discovery: finds tajo/recover-abandoned-cart
Tool Execution: runs the skill's action chain
Brevo MCP Servers: contacts + email modules called
Result: recovery sequence initiated

MCPフィールド

フィールド説明
mcp.tool_namestringMCPツール名(形式: tajo/skill-name
mcp.descriptionstringツール発見時にAIエージェントに表示される説明
mcp.inputSchemaobjectツールの入力パラメータを定義するJSON Schema
mcp.brevo_serversarrayこのスキルが必要とするBrevo MCPサーバーモジュール

スキルと直接MCPツールの比較

側面MCPツールとしてのスキル直接Brevo MCP
抽象化高い, エージェントは「このカートをリカバリー」と言うだけ低い, エージェントは個別のBrevoエンドポイントを呼び出す必要がある
複雑さ多段階のロジックをカプセル化エージェントが各ステップをオーケストレートする必要がある
ガードレールスキル内に組み込み(条件、デバウンス)エージェントが独自に実装する必要がある
適した用途繰り返し可能なワークフロー単発の操作

Tip

MCPツールとしてのスキルは、エージェントに毎回作り直させたくない複雑な多段階ワークフローに使用してください。コンタクトの参照や単発メール送信のようなシンプルな一回限りの操作には直接Brevo MCPツールを使用します。

スキルとエージェントの組み合わせ

エージェントは(MCPツールとしての)スキルと直接Brevo MCPモジュールの両方を使えます。

# Agent spec
---
name: retention-agent
tools:
# Tajo Skills as MCP tools
- tajo/recover-abandoned-cart
- tajo/customer-sync
- tajo/win-back-sequence
# Direct Brevo MCP modules
- brevo_contacts
- brevo_campaign_analytics
- brevo_segments
---

これにより、エージェントは一般的なパターンに対して高レベルのオートメーション(スキル)を使いつつ、カスタムロジック用に低レベルアクセス(Brevo MCP)も維持できます。

詳しくはエージェント仕様フォーマットエージェントの構築をご覧ください。

ベストプラクティス

Tip

スキルにはセマンティックバージョニングを使ってバージョンを付けてください。破壊的変更はメジャーバージョンの引き上げが必要です。

  1. スキルは焦点を絞る - 1つのスキルで1つのことを上手にこなす
  2. わかりやすい名前を使う - acrではなくabandoned-cart-recovery
  3. 条件をドキュメント化 - 各条件が存在する理由を説明する
  4. エラーを優雅に処理 - クリティカルでないアクションにはon_error: continueを使う
  5. 小さなオーディエンスでテスト - 開発中はstatus: experimentalを使う
  6. MCP公開を追加 - エージェントが直接呼び出せるべきスキルに

次のステップ

Subscribe to updates

developer-docs

Drop your email or phone number — we'll send you what matters next.

auto-detect
AIアシスタント

こんにちは!ドキュメントについて何でもお聞きください。