Powerplatform について
Powerplatform は、自然言語の依頼とエクスポート済みコネクターのスキーマから Power Automate フローを生成するスキルです。テンプレートを使い、インポート用のソリューション ZIP にまとめます。
主な機能
- 01自然言語からフローを生成
- 02エクスポート済みコネクターを確認
- 03テンプレートとスキーマを利用
- 04フローをソリューション ZIP 化
活用シーン
- 01メールや Teams の通知作成
- 02文書の承認フロー構築
- 03定期レポートのスケジュール
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ robdtaylor/ personal-ai-infrastructure --skill powerplatformインストール後、Claude Code で/powerplatformを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
examples/weekly-report.jsonurgent-email-teams-notification.jsonsharepoint-item-approval.jsonreference/triggers.mdexpressions.mdactions.mdtemplates/email-attachment-handler.jsonnotification-flow.jsonscheduled-report.jsonapproval-flow.jsontools/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.json | examples/urgent-email-teams-notification.json |
| "approval", "route for sign-off", "approve/reject" | templates/approval-flow.json | examples/sharepoint-item-approval.json |
| "scheduled report", "every week/day send", "recurring summary" | templates/scheduled-report.json | examples/weekly-report.json |
| "save attachments", "process incoming email files" | templates/email-attachment-handler.json | reference/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_arrives | Office365 | メールの自動化 |
When_a_file_is_created | SharePoint | ドキュメントのワークフロー |
When_an_item_is_created | SharePoint | リストの自動化 |
When_a_row_is_added | Dataverse | データベースのトリガー |
Recurrence | Schedule | スケジュールされたジョブ |
manual | Manual | ボタンで起動 |
When_a_HTTP_request_is_received | HTTP | Webhook/API トリガー |
一般的なアクション
| アクション | コネクター | ユースケース |
|---|---|---|
Send_an_email | Office365 | メール通知 |
Post_message_in_a_chat_or_channel | Teams | チームへの通知 |
Create_item | SharePoint | リストアイテムの追加 |
Update_item | SharePoint | リストアイテムの変更 |
Start_and_wait_for_an_approval | Approvals | 承認ワークフロー |
Create_a_row | Dataverse | データベースへの書き込み |
HTTP | HTTP | 外部 API の呼び出し |
テンプレート
templates/ に用意されているパターン:
approval-flow.json- 標準的な承認ワークフローnotification-flow.json- イベントによってトリガーされる通知scheduled-report.json- スケジュールに基づくデータ収集form-processing.json- フォームの回答処理file-sync.json- システム間のファイル操作
生成プロセス
フローの作成を依頼された場合:
-
利用可能なスキーマを読み込みます:
ls ~/Projects/work/scripts/power-platform/connectors/ cat ~/Projects/work/scripts/power-platform/manifest.json -
依頼された機能に関連するコネクタースキーマを読み込みます
-
適切なテンプレートを選択するか、ゼロから作成します
-
以下を含むフロー JSON を生成します:
- フロー用の一意な GUID
- 適切なトリガー設定
- 正しい操作 ID を使ったアクションの順序
- 使用するすべてのコネクターの接続参照
- 動的コンテンツ用の式構文
-
tools/package-solution.shを使用してソリューションパッケージを作成します -
生成フォルダーに保存し、ユーザーに知らせます
制限事項
- 直接デプロイできません - ユーザーは職場でインポートする必要があります
- 接続のマッピングが必要です - ユーザーはインポート時に接続をマッピングします
- プレミアムコネクター - プレミアムライセンスが必要なものもあります
- カスタムコネクター - スキーマをエクスポートしない場合はサポートされません
- スキーマの鮮度 - 職場でのエクスポート頻度に依存します
ファイル一覧
| ファイル | 用途 |
|---|---|
templates/*.json | 用意されているフローパターン |
reference/expressions.md | 式構文ガイド |
reference/triggers.md | トリガー設定 |
reference/actions.md | アクション設定 |
examples/*.json | 動作するフローの例 |
tools/package-solution.sh | ソリューションのパッケージ化スクリプト |