商业与职场
MCP 插件自适应卡片开发
为Microsoft 365 Copilot的MCP插件接入自适应卡片,展示状态和格式化金额。
````prompt
---
mode: 'agent'
tools: ['changes', 'search/codebase', 'edit/editFiles', 'problems']
description: 'Add Adaptive Card response templates to MCP-based API plugins for visual data presentation in Microsoft 365 Copilot'
model: 'gpt-4.1'
tags: [mcp, adaptive-cards, m365-copilot, api-plugin, response-templates]
---
# Create Adaptive Cards for MCP Plugins
Add Adaptive Card response templates to MCP-based API plugins to enhance how data is presented visually in Microsoft 365 Copilot.
## Adaptive Card Types
### Static Response Templates
Use when API always returns items of the same type and format doesn't change often.
Define in `response_semantics.static_template` in ai-plugin.json:
```json
{
"functions": [
{
"name": "GetBudgets",
"description": "Returns budget details including name and available funds",
"capabilities": {
"response_semantics": {
"data_path": "$",
"properties": {
"title": "$.name",
"subtitle": "$.availableFunds"
},
"static_template": {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{
"type": "Container",
"$data": "${$root}",
"items": [
{
"type": "TextBlock",
"text": "Name: ${if(name, name, 'N/A')}",
"wrap": true
},
{
"type": "TextBlock",
"text": "Available funds: ${if(availableFunds, formatNumber(availableFunds, 2), 'N/A')}",
"wrap": true
}
]
}
]
}
}
}
}
]
}
```
### Dynamic Response Templates
Use when API returns multiple types and each item needs a different template.
**ai-plugin.json configuration:**
```json
{
"name": "GetTransactions",
"description": "Returns transaction details with dynamic templates",
"capabilities": {
"response_semantics": {
"data_path": "$.transactions",
"properties": {
"template_selector": "$.displayTemplate"
}
}
}
}
```
**API Response with Embedded Templates:**
```json
{
"transactions": [
{
"budgetName": "Fourth Coffee lobby renovation",
"amount": -2000,
"description": "Property survey for permit application",
"expenseCategory": "permits",
"displayTemplate": "$.templates.debit"
},
{
"budgetName": "Fourth Coffee lobby renovation",
"amount": 5000,
"description": "Additional funds to cover cost overruns",
"expenseCategory": null,
"displayTemplate": "$.templates.credit"
}
],
"templates": {
"debit": {
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"color": "attention",
"text": "Debit"
},
{
"type": "FactSet",
"facts": [
{
"title": "Budget",
"value": "${budgetName}"
},
{
"title": "Amount",
"value": "${formatNumber(amount, 2)}"
},
{
"title": "Category",
"value": "${if(expenseCategory, expenseCategory, 'N/A')}"
},
{
"title": "Description",
"value": "${if(description, description, 'N/A')}"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
},
"credit": {
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"color": "good",
"text": "Credit"
},
{
"type": "FactSet",
"facts": [
{
"title": "Budget",
"value": "${budgetName}"
},
{
"title": "Amount",
"value": "${formatNumber(amount, 2)}"
},
{
"title": "Description",
"value": "${if(description, description, 'N/A')}"
}
]
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
}
}
```
### Combined Static and Dynamic Templates
Use static template as default when item doesn't have template_selector or when value doesn't resolve.
```json
{
"capabilities": {
"response_semantics": {
"data_path": "$.items",
"properties": {
"title": "$.name",
"template_selector": "$.templateId"
},
"static_template": {
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "TextBlock",
"text": "Default: ${name}",
"wrap": true
}
]
}
}
}
}
```
## Response Semantics Properties
### data_path
JSONPath query indicating where data resides in API response:
```json
"data_path": "$" // Root of response
"data_path": "$.results" // In results property
"data_path": "$.data.items"// Nested path
```
### properties
Map response fields for Copilot citations:
```json
"properties": {
"title": "$.name", // Citation title
"subtitle": "$.description", // Citation subtitle
"url": "$.link" // Citation link
}
```
### template_selector
Property on each item indicating which template to use:
```json
"template_selector": "$.displayTemplate"
```
## Adaptive Card Template Language
### Conditional Rendering
```json
{
"type": "TextBlock",
"text": "${if(field, field, 'N/A')}" // Show field or 'N/A'
}
```
### Number Formatting
```json
{
"type": "TextBlock",
"text": "${formatNumber(amount, 2)}" // Two decimal places
}
```
### Data Binding
```json
{
"type": "Container",
"$data": "${$root}", // Break to root context
"items": [ ... ]
}
```
### Conditional Display
```json
{
"type": "Image",
"url": "${imageUrl}",
"$when": "${imageUrl != null}" // Only show if imageUrl exists
}
```
## Card Elements
### TextBlock
```json
{
"type": "TextBlock",
"text": "Text content",
"size": "medium", // small, default, medium, large, extraLarge
"weight": "bolder", // lighter, default, bolder
"color": "attention", // default, dark, light, accent, good, warning, attention
"wrap": true
}
```
### FactSet
```json
{
"type": "FactSet",
"facts": [
{
"title": "Label",
"value": "Value"
}
]
}
```
### Image
```json
{
"type": "Image",
"url": "https://example.com/image.png",
"size": "medium", // auto, stretch, small, medium, large
"style": "default" // default, person
}
```
### Container
```json
{
"type": "Container",
"$data": "${items}", // Iterate over array
"items": [
{
"type": "TextBlock",
"text": "${name}"
}
]
}
```
### ColumnSet
```json
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [ ... ]
},
{
"type": "Column",
"width": "stretch",
"items": [ ... ]
}
]
}
```
### Actions
```json
{
"type": "Action.OpenUrl",
"title": "View Details",
"url": "https://example.com/item/${id}"
}
```
## Responsive Design Best Practices
### Single-Column Layouts
- Use single columns for narrow viewports
- Avoid multi-column layouts when possible
- Ensure cards work at minimum viewport width
### Flexible Widths
- Don't assign fixed widths to elements
- Use "auto" or "stretch" for width properties
- Allow elements to resize with viewport
- Fixed widths OK for icons/avatars only
### Text and Images
- Avoid placing text and images in same row
- Exception: Small icons or avatars
- Use "wrap": true for text content
- Test at various viewport widths
### Test Across Hubs
Validate cards in:
- Teams (desktop and mobile)
- Word
- PowerPoint
- Various viewport widths (contract/expand UI)
## Complete Example
**ai-plugin.json:**
```json
{
"functions": [
{
"name": "SearchProjects",
"description": "Search for projects with status and details",
"capabilities": {
"response_semantics": {
"data_path": "$.projects",
"properties": {
"title": "$.name",
"subtitle": "$.status",
"url": "$.projectUrl"
},
"static_template": {
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{
"type": "Container",
"$data": "${$root}",
"items": [
{
"type": "TextBlock",
"size": "medium",
"weight": "bolder",
"text": "${if(name, name, 'Untitled Project')}",
"wrap": true
},
{
"type": "FactSet",
"facts": [
{
"title": "Status",
"value": "${status}"
},
{
"title": "Owner",
"value": "${if(owner, owner, 'Unassigned')}"
},
{
"title": "Due Date",
"value": "${if(dueDate, dueDate, 'Not set')}"
},
{
"title": "Budget",
"value": "${if(budget, formatNumber(budget, 2), 'N/A')}"
}
]
},
{
"type": "TextBlock",
"text": "${if(description, description, 'No description')}",
"wrap": true,
"separator": true
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "View Project",
"url": "${projectUrl}"
}
]
}
}
}
}
]
}
```
## Workflow
Ask the user:
1. What type of data does the API return?
2. Are all items the same type (static) or different types (dynamic)?
3. What fields should appear in the card?
4. Should there be actions (e.g., "View Details")?
5. Are there multiple states or categories requiring different templates?
Then generate:
- Appropriate response_semantics configuration
- Static template, dynamic templates, or both
- Proper data binding with conditional rendering
- Responsive single-column layout
- Test scenarios for validation
## Resources
- [Adaptive Card Designer](https://adaptivecards.microsoft.com/designer) - Visual design tool
- [Adaptive Card Schema](https://adaptivecards.io/schemas/adaptive-card.json) - Full schema reference
- [Template Language](https://learn.microsoft.com/en-us/adaptive-cards/templating/language) - Binding syntax guide
- [JSONPath](https://www.rfc-editor.org/rfc/rfc9535) - Path query syntax
## Common Patterns
### List with Images
```json
{
"type": "Container",
"$data": "${items}",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"width": "auto",
"items": [
{
"type": "Image",
"url": "${thumbnailUrl}",
"size": "small",
"$when": "${thumbnailUrl != null}"
}
]
},
{
"type": "Column",
"width": "stretch",
"items": [
{
"type": "TextBlock",
"text": "${title}",
"weight": "bolder",
"wrap": true
}
]
}
]
}
]
}
```
### Status Indicators
```json
{
"type": "TextBlock",
"text": "${status}",
"color": "${if(status == 'Completed', 'good', if(status == 'In Progress', 'attention', 'default'))}"
}
```
### Currency Formatting
```json
{
"type": "TextBlock",
"text": "$${formatNumber(amount, 2)}"
}
```
````同类提示词
商业与职场
招聘面试轮次与面试官排期
提供岗位要求和面试官的可用时间,规划各轮评估内容、人员搭配及面试顺序,并起草题库和候选人通知。
# 面试安排 > 设计高效的面试流程,优化面试小组构成和日程安排,带来良好的候选人体验。 ## 何时使用此技能 - 设置多轮面试流程 - 协调面试小组日程 - 设计面试阶段 - 优化候选人体验 - 创建面试执行手册 ## 方法论基础 基于**结构化面试最佳实践**和**候选人体验研究**,结合: - 与阶段相适应的评估 - 面试小组多样性要求 - 招聘周期优化 - 候选人沟通 ## Claude的工作与由你决定的事项 | Claude的工作 | 由你决定 | |-------------|------------| | 设计面试阶段 | 最
可填 1 项
商业与职场
十五镜头产品营销视频分镜
填写营销文案与产品外观描述,按开场钩子、故事和促销安排分镜,逐条标明产品镜头或场景镜头。
你是一位精通营销心理学的商业视频分镜师。请根据营销文本和产品外观描述,创建具有强营销力的15个分镜。 营销文本:{text} 产品外观描述:{image} 【核心标记规则】⚠️ 极其重要 每个分镜必须在开头使用以下标记之一: - [产品镜头] - 画面中包含产品实体,需要保持产品外观一致性 - [场景镜头] - 不包含产品的纯环境、人物或情境画面 标记决定后端使用哪个生成模型,必须准确标注! 【营销策略分析】(内部分析,不输出) 分析营销文本,提取以下信息用于指导分镜创作: 1. 目标受众:识别目标人群特征,确定画面风格和场景选择 2. 核心卖点可填 2 项中文原创
商业与职场
等距分层与爆炸图动画
为产品演示或信息图制作 2.5D 场景,用统一投影和分面明暗表现立体感,支持层叠展开及爆炸图动画。
# 等轴测(2.5D)动画 等轴测场景无需使用真正的透视,就能让讲解动画、UI 操作演示和信息图呈现出搭建而成的立体感:各轴等比例缩短、Z 轴方向堆叠的层级、拉伸立体块、爆炸图。整体风格几何感强、构图讲究——深度来自一致的轴向和各面的明暗处理,动效则通过逐层展示结构来实现。 ## 适用场景 - 用于讲解动画、产品 UI 或“工作原理”信息图的 2.5D 场景。 - 从下往上搭建的堆叠层级 / 楼层 / 技术栈塔。 - 拉伸立体块、等轴测网格、等轴测城市 / 服务器机架场景。 - 沿 Z 轴拆开再重新组装的爆炸图。 - 需要增添轻微生动感的静态等轴测
商业与职场
六页电影感演示文稿设计总览
选择浅色或深色方向,用图像模型把六页幻灯片合成一张电影感概览图,适合演示提案和版式评审。
# 演示文稿设计 创建一张**高端 6 页演示文稿设计展板**,将所有幻灯片合成为一张图片——让用户一眼看完整套演示文稿,适合电视屏幕展示,具有电影感。 主要用途:PPT 设计概念、主题演讲风格的幻灯片设计稿、战略演示文稿视觉方案、活动 / 新闻 / 体育 / 商业分析演示文稿、编辑式数据故事、高管演示文稿。 ## 图像生成要求 最终展板必须由**图像生成模型**生成(默认使用内置的 `image_gen` 工具,或经批准的项目图像生成工作流)。不要使用代码、SVG、HTML/CSS、canvas、图表、占位图或确定性形状脚本创建展板。这些方法只
商业与职场
十五款AI视频模型选型顾问
回答三至四个需求问题,按中文表现、音频、编辑能力、时长和可用性等条件获取模型推荐及理由。
# model-selector 15 个主流 AI 视频模型(11 商业 + 4 开源)的"购物顾问"。问用户 3-4 个关键问题,给出推荐 + 理由。 ## 何时不用此 skill - 用户已经确定要用某个模型 → 用对应的 `<model>-prompter` skill - 用户问"提示词怎么写" → 用 `seedance-prompter` / `kling-prompter` / `happyhorse-prompter` - 用户的提示词不工作 → 用 `seedance-debugger` ## 11 模型能力速查矩阵 | 模
中文原创
商业与职场
界面创意转视觉设计规格
填写界面用途、受众、尺寸和文案,将初步构想细化为包含网格、字体、配色与图像风格的设计规格。
# 设计优先的 UI 提示词技能 此技能适用于**设计优先的提示词编写**:将模糊的想法转化为严谨的规格说明,生成风格一致的 UI。 ## 核心原则 **像设计系统一样编写提示词,而不是许愿。** ## 提示词结构(复制/粘贴) 使用以下框架,然后填入空白。 ```text GOAL - What are we making? (e.g., landing page hero / onboarding / dashboard / carousel slide) - Who is it for? (persona) - What’s the suc