mcpField
P
Powerplatform

Powerplatform

github.com/robdtaylor生産性50 回インストール
リポジトリ

Powerplatform について

Powerplatform は、自然言語の依頼とエクスポート済みコネクターのスキーマから Power Automate フローを生成するスキルです。テンプレートを使い、インポート用のソリューション ZIP にまとめます。

主な機能

  1. 01自然言語からフローを生成
  2. 02エクスポート済みコネクターを確認
  3. 03テンプレートとスキーマを利用
  4. 04フローをソリューション ZIP 化

活用シーン

  1. 01メールや Teams の通知作成
  2. 02文書の承認フロー構築
  3. 03定期レポートのスケジュール

インストール

コマンドをコピーしてターミナルで実行します。

$npx skills add https://github.com/robdtaylor/personal-ai-infrastructure --skill powerplatform

インストール後、Claude Code で/powerplatformを入力して読み込まれたか確認します。

同梱ファイル

SKILL.md と一緒にインストールされる参考資料やスクリプト。

examples/
weekly-report.json
urgent-email-teams-notification.json
sharepoint-item-approval.json
reference/
triggers.md
expressions.md
actions.md
templates/
email-attachment-handler.json
notification-flow.json
scheduled-report.json
approval-flow.json
tools/
package-solution.sh

詳細

PowerPlatform - フロー生成スキル

作業環境からエクスポートしたコネクタースキーマを使用して、自然言語の説明から Power Automate フローを生成します。

ワークフローの振り分け

Power Platform には Workflows/ ディレクトリがありません。各リクエストは、templates/ の開始テンプレートをコネクタースキーマに合わせてカスタマイズし、tools/package-solution.sh でパッケージ化します。完成したフローの例は examples/ を参照してください。

トリガーとなる語句開始テンプレート参照例
"notify", "send a message when", "alert on new email/item"templates/notification-flow.jsonexamples/urgent-email-teams-notification.json
"approval", "route for sign-off", "approve/reject"templates/approval-flow.jsonexamples/sharepoint-item-approval.json
"scheduled report", "every week/day send", "recurring summary"templates/scheduled-report.jsonexamples/weekly-report.json
"save attachments", "process incoming email files"templates/email-attachment-handler.jsonreference/actions.md
その他/スクラッチから作成スキーマを参照してインラインで作成reference/expressions.md、reference/triggers.md、reference/actions.md

必ず最初に ~/Projects/work/scripts/power-platform/manifest.json を読み、必要なコネクターが利用可能であることを確認してください。


例

例 1:緊急メールを受信したときに Teams へ通知

User: "When an urgent email arrives in my work inbox, post it to the Ops Teams channel"
-> Reads manifest.json → confirms shared_office365 + shared_teams available
-> Starts from templates/notification-flow.json
-> Trigger: When_a_new_email_arrives (Office365), condition on importance = high
-> Action: Post_message_in_a_chat_or_channel (Teams)
-> Packages via tools/package-solution.sh
-> Saves to ~/Projects/work/scripts/power-platform/generated/urgent-email-notify.zip

例 2:ドキュメント承認ワークフロー

User: "Make a flow for document approval - when a file is added to SharePoint, start an approval, then move to approved/rejected folder"
-> Starts from templates/approval-flow.json
-> Trigger: When_a_file_is_created (SharePoint)
-> Action: Start_and_wait_for_an_approval (Approvals)
-> Condition branches on outcome → Update_item to move to approved/rejected library
-> Outputs deployable solution ZIP for import at work

例 3:毎週の定期レポート

User: "Every Monday at 8am, pull last week's list items and email me a summary"
-> Starts from templates/scheduled-report.json
-> Trigger: Recurrence (Schedule), weekly on Monday 08:00
-> Action: Get_items (SharePoint) + Apply_to_each to build HTML table
-> Action: Send_an_email (Office365) with @{length(body('Get_items')?['value'])} count
-> Saves to generated/ as weekly-report.zip

アーキテクチャ

Work Repo (schemas)                    PAI (this skill)
~/Projects/work/scripts/               ~/.claude/skills/PowerPlatform/
power-platform/
├── connectors/          ──reads──>    ├── SKILL.md
│   ├── shared_teams.json              ├── templates/
│   ├── shared_outlook.json            ├── reference/
│   └── ...                            └── examples/
├── manifest.json
└── generated/           <──writes──   [Solution ZIPs]

ワークフロー

1. 利用可能なコネクターを確認する

生成する前にマニフェストを読み、利用可能なコネクターを確認します。

cat ~/Projects/work/scripts/power-platform/manifest.json

manifest.json が存在しないか、古い場合は、職場でエクスポートスクリプトを実行するようユーザーに伝えてください。

2. ユーザーのリクエストを解析する

自然言語から次の情報を抽出します。

  • トリガー:フローを開始するもの(メールの受信、ファイルの作成、スケジュール、手動)
  • アクション:フローが実行する処理(メッセージの送信、アイテムの作成、レコードの更新)
  • 条件:分岐ロジック(if/then、switch)
  • データフロー:ステップ間で受け渡されるデータ
3. フロー定義を生成する

Power Automate スキーマに従って、フローの JSON を作成します。主な構造は次のとおりです。

{
  "properties": {
    "definition": {
      "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
      "triggers": { ... },
      "actions": { ... }
    },
    "connectionReferences": { ... }
  }
}
4. ソリューションとしてパッケージ化する

インポート用にソリューション構造でラップします。

solution/
├── [Content_Types].xml
├── customizations.xml
├── solution.xml
└── Workflows/
    └── {flow-guid}-{flow-name}.json
5. 出力する

保存先:~/Projects/work/scripts/power-platform/generated/


接続参照

フローでは、ターゲット環境の実際の接続に対応付ける接続参照を使用します。インポート時に解決されるプレースホルダー ID を使用してください。

"connectionReferences": {
  "shared_teams": {
    "connectionName": "shared_teams",
    "source": "Embedded",
    "id": "/providers/Microsoft.PowerApps/apis/shared_teams",
    "tier": "NotSpecified"
  }
}

インポート時に Power Platform が、これらを実際の接続に対応付けるようユーザーに求めます。


式の構文

Power Automate では専用の式言語を使用します。一般的なパターンを以下に示します。

動的コンテンツの参照
@{triggerOutputs()?['body/subject']}           # Email subject from trigger
@{body('Get_item')?['Title']}                  # Field from previous action
@{items('Apply_to_each')?['name']}             # Current item in loop
関数
@{utcNow()}                                    # Current timestamp
@{concat('Hello ', triggerBody()?['name'])}   # String concatenation
@{if(equals(1,1),'yes','no')}                 # Conditional
@{length(body('Get_items')?['value'])}        # Array length
@{formatDateTime(utcNow(),'yyyy-MM-dd')}      # Date formatting
条件
"expression": {
  "and": [
    { "contains": ["@triggerOutputs()?['body/subject']", "urgent"] },
    { "equals": ["@triggerOutputs()?['body/importance']", "high"] }
  ]
}

構文の全容については、reference/expressions.md を参照してください。


一般的なトリガー

トリガーコネクターユースケース
When_a_new_email_arrivesOffice365メールの自動化
When_a_file_is_createdSharePointドキュメントのワークフロー
When_an_item_is_createdSharePointリストの自動化
When_a_row_is_addedDataverseデータベースのトリガー
RecurrenceScheduleスケジュールされたジョブ
manualManualボタンで起動
When_a_HTTP_request_is_receivedHTTPWebhook/API トリガー

一般的なアクション

アクションコネクターユースケース
Send_an_emailOffice365メール通知
Post_message_in_a_chat_or_channelTeamsチームへの通知
Create_itemSharePointリストアイテムの追加
Update_itemSharePointリストアイテムの変更
Start_and_wait_for_an_approvalApprovals承認ワークフロー
Create_a_rowDataverseデータベースへの書き込み
HTTPHTTP外部 API の呼び出し

テンプレート

templates/ に用意されているパターン:

  • approval-flow.json - 標準的な承認ワークフロー
  • notification-flow.json - イベントによってトリガーされる通知
  • scheduled-report.json - スケジュールに基づくデータ収集
  • form-processing.json - フォームの回答処理
  • file-sync.json - システム間のファイル操作

生成プロセス

フローの作成を依頼された場合:

  1. 利用可能なスキーマを読み込みます:

    ls ~/Projects/work/scripts/power-platform/connectors/
    cat ~/Projects/work/scripts/power-platform/manifest.json
    
  2. 依頼された機能に関連するコネクタースキーマを読み込みます

  3. 適切なテンプレートを選択するか、ゼロから作成します

  4. 以下を含むフロー JSON を生成します:

    • フロー用の一意な GUID
    • 適切なトリガー設定
    • 正しい操作 ID を使ったアクションの順序
    • 使用するすべてのコネクターの接続参照
    • 動的コンテンツ用の式構文
  5. tools/package-solution.sh を使用してソリューションパッケージを作成します

  6. 生成フォルダーに保存し、ユーザーに知らせます


制限事項

  • 直接デプロイできません - ユーザーは職場でインポートする必要があります
  • 接続のマッピングが必要です - ユーザーはインポート時に接続をマッピングします
  • プレミアムコネクター - プレミアムライセンスが必要なものもあります
  • カスタムコネクター - スキーマをエクスポートしない場合はサポートされません
  • スキーマの鮮度 - 職場でのエクスポート頻度に依存します

ファイル一覧

ファイル用途
templates/*.json用意されているフローパターン
reference/expressions.md式構文ガイド
reference/triggers.mdトリガー設定
reference/actions.mdアクション設定
examples/*.json動作するフローの例
tools/package-solution.shソリューションのパッケージ化スクリプト

コメント