Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions samples/da-resource-allocation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TeamsFx files
env/.env.*.user
env/.env.local
.localConfigs
appPackage/build

# dependencies
node_modules/

# misc
.env
.deployment
.DS_Store
5 changes: 5 additions & 0 deletions samples/da-resource-allocation/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"TeamsDevApp.ms-teams-vscode-extension"
]
}
37 changes: 37 additions & 0 deletions samples/da-resource-allocation/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Preview in Copilot (Edge)",
"type": "msedge",
"request": "launch",
"url": "https://m365.cloud.microsoft/chat/entity1-d870f6cd-4aa5-4d42-9626-ab690c041429/${agent-hint}?auth=2&developerMode=Basic",
"presentation": {
"group": "remote",
"order": 1
},
"internalConsoleOptions": "neverOpen",
"runtimeArgs": [
"--remote-debugging-port=9222",
"--no-first-run",
"--user-data-dir=${env:TEMP}/copilot-msedge-user-data-dir"
]
},
{
"name": "Preview in Copilot (Chrome)",
"type": "chrome",
"request": "launch",
"url": "https://m365.cloud.microsoft/chat/entity1-d870f6cd-4aa5-4d42-9626-ab690c041429/${agent-hint}?auth=2&developerMode=Basic",
"presentation": {
"group": "remote",
"order": 2
},
"internalConsoleOptions": "neverOpen",
"runtimeArgs": [
"--remote-debugging-port=9223",
"--no-first-run",
"--user-data-dir=${env:TEMP}/copilot-chrome-user-data-dir"
]
}
]
}
11 changes: 11 additions & 0 deletions samples/da-resource-allocation/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"debug.onTaskErrors": "abort",
"json.schemas": [
{
"fileMatch": [
"/aad.*.json"
],
"schema": {}
}
]
}
67 changes: 67 additions & 0 deletions samples/da-resource-allocation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Overview of the Resource Assistant agent sample
![Resource assistant start screen](assets/ResourceAssistant.png)

🚀 Resource Allocation Assistant is a Microsoft Teams Declarative AI Agent designed to help managers and project leads assess workloads, identify resource bottlenecks, and optimize task distribution within their teams. This AI-powered agent provides smart workload insights and recommendations based on user input, ensuring balanced work allocation and preventing burnout.

## 🛠 **Features**
✅ **Workload Assessment** – Helps managers evaluate ongoing tasks and resource availability.
✅ **Task Redistribution** – Suggests optimal ways to balance workloads across team members.
✅ **Bottleneck Detection** – Identifies overworked employees and underutilized resources.

## Get started with the template

> **Prerequisites**
>
> To run this app template in your local dev machine, you will need:
>
> - [Node.js](https://nodejs.org/), supported versions: 18, 20
> - A [Microsoft 365 account for development](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts).
> - [Teams Toolkit Visual Studio Code Extension](https://aka.ms/teams-toolkit) version 5.0.0 and higher or [Teams Toolkit CLI](https://aka.ms/teamsfx-toolkit-cli)
> - [Microsoft 365 Copilot license](https://learn.microsoft.com/microsoft-365-copilot/extensibility/prerequisites#prerequisites)

![image](https://github.com/user-attachments/assets/e1c2a3b3-2e59-4e9b-8335-19315e92ba30)

1. First, select the Teams Toolkit icon on the left in the VS Code toolbar.
2. In the Account section, sign in with your [Microsoft 365 account](https://docs.microsoft.com/microsoftteams/platform/toolkit/accounts) if you haven't already.
3. Create Teams app by clicking `Provision` in "Lifecycle" section.
4. Select `Preview in Copilot (Edge)` or `Preview in Copilot (Chrome)` from the launch configuration dropdown.
5. Once the Copilot app is loaded in the browser, click on the "…" menu and select "Copilot chats". You will see your declarative agent on the right rail. Clicking on it will change the experience to showcase the logo and name of your declarative agent.
6. Ask a question to your declarative agent and it should respond based on the instructions provided.

## What's included in the template

| Folder | Contents |
| ------------ | ---------------------------------------------------------------------------------------- |
| `.vscode` | VSCode files for debugging |
| `appPackage` | Templates for the Teams application manifest, the GPT manifest and the API specification |
| `env` | Environment files |

The following files can be customized and demonstrate an example implementation to get you started.

| File | Contents |
| ---------------------------------- | ---------------------------------------------------------------------------- |
| `appPackage/declarativeAgent.json` | Define the behaviour and configurations of the declarative agent. |
| `appPackage/manifest.json` | Teams application manifest that defines metadata for your declarative agent. |

The following are Teams Toolkit specific project files. You can [visit a complete guide on Github](https://github.com/OfficeDev/TeamsFx/wiki/Teams-Toolkit-Visual-Studio-Code-v5-Guide#overview) to understand how Teams Toolkit works.

| File | Contents |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `teamsapp.yml` | This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |

## Extend the template

- [Add conversation starters](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=3): Conversation starters are hints that are displayed to the user to demonstrate how they can get started using the declarative agent.
- [Add web content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=4) for the ability to search web information.
- [Add OneDrive and SharePoint content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=5) as grounding knowledge for the agent.
- [Add Microsoft Graph connectors content](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=6) to ground agent with enterprise knowledge.
- [Add API plugins](https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents?tabs=ttk&tutorial-step=7) for agent to interact with REST APIs.

## Addition information and references

- [Declarative agents for Microsoft 365](https://aka.ms/teams-toolkit-declarative-agent)

![](https://m365-visitor-stats.azurewebsites.net/SamplesGallery/da-resource-allocation)



Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 41 additions & 0 deletions samples/da-resource-allocation/appPackage/declarativeAgent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-agent/v1.2/schema.json",
"version": "v1.2",
"name": "Resource Allocation Assistant",
"description": "Resource Allocation Assistant is a declarative AI Agent that helps managers optimize team workloads and balance resource allocation effectively.",
"instructions": "$[file('instruction.txt')]",
"capabilities": [
{
"name": "OneDriveAndSharePoint"
},
{
"name": "GraphConnectors"
}
],
"conversation_starters": [
{
"title": "Assess Team Workload",
"text": "How many tasks is my team handling? Who is overloaded?"
},
{
"title": "Identify Workload Imbalances",
"text": "Which team members are overloaded, and who has availability?"
},
{
"title": "Optimize Task Distribution",
"text": "How can I redistribute tasks to balance workload across my team?"
},
{
"title": "Manage High-Priority Tasks",
"text": "Which critical tasks need immediate reassignment?"
},
{
"title": "Prevent Burnout & Improve Efficiency",
"text": "How can I reduce team overload while maintaining productivity?"
},
{
"title": "Monitor and Adjust Workload",
"text": "Can you help track workload changes over time and suggest adjustments?"
}
]
}
36 changes: 36 additions & 0 deletions samples/da-resource-allocation/appPackage/instruction.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Purpose:
You are an expert Resource Allocation Advisor in Microsoft Teams. Your goal is to help managers balance workloads efficiently by asking structured questions, providing insights, and offering best practices.

Goals:
* Assess workload distribution based on user-provided input.
* Identify overworked and underutilized team members through guided questions.
* Recommend workload balancing strategies without direct system access.
* Provide best practices for assigning tasks, upskilling, or deferring work.
* Help managers document decisions via Teams messages or Planner.

User Interaction Flow:
First, understand the team’s workload. Start by asking:
* "How many active tasks or projects are currently in progress?"
* "Which team members are struggling with too many tasks?"
* "Who in your team has capacity to take on more work?"

Second Identify workload bottlenecks:
* "It looks like [Employee X] has more than [Y] tasks. Should we consider redistributing?"
* "Are there any critical deadlines requiring immediate attention?"

Third Recommend solutions based on input:
* "To improve efficiency, consider shifting [Task A] to [Employee B] who has availability."
* "You may want to upskill [Employee X] in [Skill Y] for better task distribution."

Last Follow up:
* "Would you like to document this in a Teams message?"
* "Should I set a reminder for a follow-up check-in?"

Overall Direction:
* Always keep responses structured and actionable.
* If the user provides incomplete details, ask follow-up questions.
* Avoid overwhelming users with multiple questions at once—guide them step by step.
* Keep a helpful and proactive tone.
* If asked for automatic task reassignment, suggest best practices instead (since the agent has no direct system access).
* After each response, ask if the user needs further assistance.
* If greeted or asked for capabilities, briefly explain your role and provide examples.
39 changes: 39 additions & 0 deletions samples/da-resource-allocation/appPackage/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/teams/v1.19/MicrosoftTeams.schema.json",
"manifestVersion": "1.19",
"version": "1.0.0",
"id": "${{TEAMS_APP_ID}}",
"developer": {
"name": "Teams App, Inc.",
"websiteUrl": "https://www.example.com",
"privacyUrl": "https://www.example.com/privacy",
"termsOfUseUrl": "https://www.example.com/termofuse"
},
"icons": {
"color": "color.png",
"outline": "outline.png"
},
"name": {
"short": "Resource Allocation",
"full": "Resource Allocation App"
},
"description": {
"short": "Make resource allocation easy",
"full": "Resource Allocation App helps you to allocate resources easily"
},
"accentColor": "#FFFFFF",
"composeExtensions": [],
"permissions": [
"identity",
"messageTeamMembers"
],
"copilotAgents": {
"declarativeAgents": [
{
"id": "declarativeAgent",
"file": "declarativeAgent.json"
}
]
},
"validDomains": []
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions samples/da-resource-allocation/assets/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
[
{
"name": "pnp-copilot-pro-dev-resource-allocation",
"source": "pnp",
"title": "Resource Allocation Assistant",
"shortDescription": "Resource Allocation Assistant is a declarative AI Agent that helps managers optimize team workloads and balance resource allocation effectively.",
"url": "https://github.com/pnp/copilot-pro-dev-samples/tree/main/samples/da-resource-allocation",
"downloadUrl": "https://pnp.github.io/download-partial/?url=https://github.com/pnp/copilot-pro-dev-samples/tree/main/samples/da-resource-allocation",
"longDescription": [
"The \"Resource Allocation\" declarative agent is a sample agent that helps managers optimize team workloads and balance resource allocation effectively. It provides conversation starters to help managers assess team workload, identify workload imbalances, optimize task distribution, manage high-priority tasks, prevent burnout and improve efficiency, and monitor and adjust workload."
],
"creationDateTime": "2025-03-05",
"updateDateTime": "2025-03-05",
"products": [
"Microsoft 365 Copilot"
],
"metadata": [
{
"key": "PLATFORM",
"value": "Node.js"
},
{
"key": "LANGUAGE",
"value": "TypeScript"
},
{
"key": "API-PLUGIN",
"value": "No"
},
{
"key": "GRAPH-CONNECTOR",
"value": "No"
}
],
"thumbnails": [
{
"type": "image",
"order": 100,
"url": "https://github.com/pnp/copilot-pro-dev-samples/blob/main/samples/da-resource-allocation/assets/ResourceAssistant.png?raw=true",
"alt": "Resource Allocation Assistant"
}
],
"authors": [
{
"gitHubAccount": "Valeras Narbutas",
"pictureUrl": "https://github.com/ValerasNarbutas.png",
"name": "Valeras Narbutas"
}
],
"references": [
{
"name": "Microsoft 365 Copilot extensibility",
"description": "Learn more about what Microsoft 365 Copilot and how you can extend it.",
"url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/"
},
{
"name": "Declarative agents for Microsoft 365 Copilot overview",
"description": "Learn more about what declarative agents for Microsoft 365 Copilot are.",
"url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/overview-declarative-agent"
},
{
"name": "Build a declarative agent for Microsoft 365 Copilot",
"description": "Learn how to build a declarative agent for Microsoft 365 Copilot.",
"url": "https://learn.microsoft.com/microsoft-365-copilot/extensibility/build-declarative-agents"
}
]
}
]
11 changes: 11 additions & 0 deletions samples/da-resource-allocation/env/.env.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This file includes environment variables that will be committed to git by default.

# Built-in environment variables
TEAMSFX_ENV=dev
APP_NAME_SUFFIX=dev

# Generated during provision, you can also add your own variables.
TEAMS_APP_ID=
TEAMS_APP_TENANT_ID=
M365_TITLE_ID=
M365_APP_ID=
Loading