Let's vibe code a Copilot Studio agent together
What you will build
Camille starts at Contoso, a fictitious company, on Monday. Before anyone writes a line of code, the team held a 38-minute workshop on Teams. You give its transcript to Claude, and Claude does the rest: a blueprint, a workflow that welcomes Camille, and an agent that answers her questions.
Camille's journey
π The blueprint
Claude reads the transcript and writes a functional and technical blueprint, with two diagrams. Every requirement cites the moment of the workshop it came from, and the two questions the team left open are flagged, not guessed.
β‘ The workflow
Claude writes it, saves it in Dataverse with Azure command-line interface (Azure CLI) and turns it on. It opens in the new Copilot Studio editor, Workflows page.
π The agent
Claude creates and publishes the Contoso Onboarding Assistant on the Microsoft Copilot harness: instructions, the Human Resources site as its only source, no web search.
β You
You paste three prompts, decide two business questions, test, evaluate and publish to Teams. Nothing else to copy anywhere.
Before you start
- A Microsoft 365 test tenant with SharePoint, Outlook and Teams, and an account that can create a site.
- A Power Platform environment with Dataverse and Copilot credits allocated: that is what shows the new Copilot Studio experience (workflows and agents on the Microsoft Copilot harness).
- Azure CLI installed (the
azcommand): install Azure CLI. - PowerShell 7 (the
pwshcommand): install PowerShell 7. - Claude Code: in the Claude desktop app (Code tab) or on the command line (
claude), with a paid Claude plan or an Anthropic Console account. - The lab files:
Want to read before you build? The workshop transcript and the blueprint template open in your browser.
1Prepare SharePoint
β±οΈ About 5 minutes
- Download the documents zip and the
sharepoint-setup.ps1script into the same folder. - Once, if the module is missing:
Install-Module Microsoft.Graph.Authentication -Scope CurrentUser. - Run the script in PowerShell 7, from that folder, with the SharePoint host of your test tenant. A sign-in window opens: sign in with your test account and accept the permissions.
/sites/contoso-hr), its New starters list with two past new starters, the 5 documents in the Documents library, and remote-work-policy-2021.pdf in the Archives folder. That old policy is the trap of step 5: keep it. Open the list to check.-SiteUrl https://your-tenant.sharepoint.com/sites/your-site.The columns the script creates, and their internal name, the one the workflow uses:
| Displayed name | Internal name | Type |
|---|---|---|
| Full name | Title | Single line of text |
Email | Single line of text | |
| Job title | JobTitle | Single line of text |
| Start date | StartDate | Date only |
| Manager | Manager | Person |
| Buddy | Buddy | Person |
| Equipment handed over | EquipmentHandedOver | Choice: No, Yes (No by default) |
2Prepare the environment and note 5 values
β±οΈ About 10 minutes
- In Power Automate, test environment, Connections menu: create a SharePoint, an Office 365 Outlook and a Microsoft Teams connection, with your account. Creating them now avoids any consent window later. Claude creates the three Dataverse connection references that point to them by itself: that is how a Copilot Studio workflow uses a connection.
- Note the 5 values below.
| In the file | Where to find it |
|---|---|
YOUR_TENANT_ID | Tenant identifier: az login then az account show --query tenantId -o tsv |
YOUR_ENVIRONMENT_ID | In the Power Automate or Copilot Studio address, after /environments/ |
YOUR_DATAVERSE_URL | Power Platform admin center, Environments, your environment: "Environment URL", for example https://your-env.crm.dynamics.com (no trailing slash) |
YOUR_SITE_URL | The site address, for example https://your-tenant.sharepoint.com/sites/contoso-hr |
YOUR_LIST_ID | New starters list, List settings: the address contains List=%7Bβ¦%7D, the identifier is between the braces (without %7B and %7D) |
β¨ Your context file, ready to use
Paste your 5 values: the page fills them into CLAUDE.md and downloads it. No find-and-replace by hand.
/environments/ in the address..dynamics.com, no trailing slash.%7B and %7D in the list settings address.3From the workshop to the blueprint
β±οΈ About 10 minutes, a few of them with Claude working on its own
- Unzip the starter folder to a new folder, for example
C:\lab-onboarding. It containsworkshop-transcript.txtandtemplates\blueprint-template.html. - Put your
CLAUDE.mdfrom step 2 at the root of that folder. Claude Code reads it at the start of every session. - Open a terminal and sign in:
az login --tenant YOUR_TENANT_ID. - Open a new session of Claude Code on that folder: in the Claude desktop app, Code tab, choose the folder; or in a terminal,
cd C:\lab-onboardingthenclaude. - Paste this prompt and send it:
blueprint\onboarding-blueprint.html, fills every zone, draws the journey and the architecture, and opens the page. Scroll it: the pain points, the requirements with their timestamps, the two diagrams, and two open questions in their own blocks. The team did not decide who gets the equipment reminder, nor whether the buddy needs a message: Claude flags them instead of guessing.4Decide, then build the workflow
β±οΈ About 15 minutes
- In the same session, answer the two open questions and ask for the workflow:
flow\create-workflow.ps1 (the definition and the editor graph), saves the workflow in Dataverse, turns it on and gives you the link. It opens in the new editor of Copilot Studio, Workflows page. The editor badge may say "Draft" even though the workflow is on.workflows table. It holds two views of the same workflow: the definition that runs and the graph the editor draws. Without the graph, the workflow runs but the editor cannot show it; CLAUDE.md gives Claude the exact rules.Test
- Add a row to the list: Camille Martin, the email of a test account, a start date in the past (the 3-day wait is then already over), Equipment handed over: No.
- The trigger polls every minute. Tell Claude the row is added: it follows the run and summarises each action.
CLAUDE.md. If a session read an older version of the file, open a new one: a session sticks to what it read.Did you know? A workflow run lasts at most 30 days. For a real onboarding, split it in two: the immediate welcome, and a daily reminder.
5The agent, on the Microsoft Copilot harness
β±οΈ About 10 minutes
- Still in the same session, ask for the agent:
agent\instructions.txt and agent\create-agent.ps1, creates the Contoso Onboarding Assistant in Dataverse, adds the Human Resources site as its only knowledge source, turns web search off, publishes it and gives you the link. About 15 seconds of publishing.- Open the link. In the Preview pane, ask:
π΅οΈ The trap: your guess
The site holds the 2026 remote work policy (two days) and, in the Archives folder, the 2021 one (one day). Before you read the agent's answer: which source will it cite?
Only the 2026 policy. Two days per week, with the manager's approval, and only the 2026 policy in the sources. That is thanks to one line of its instructions: "Ignore documents in the Archives folder". Without that line, the archive shows up in the sources even when the answer is right: a dead document stays a source as long as it sits on the site. In production, the real fix is to move the archive off the site.
Evaluate
- Evaluate tab: name "Contoso onboarding", Import, choose the Conversations type before dropping
test-set-onboarding.csv(comma-separated values), then run it.
Publish
- Channels, Teams and Microsoft 365, "Microsoft Copilot and Microsoft Teams" (this choice cannot change after publishing), Add channel, then Publish.
- A few minutes later, open the agent in Teams ("View in Teams and Microsoft 365"; if the launch page hangs, open Teams on the web) and ask:
6Clean up
β±οΈ 5 minutes. The Microsoft Copilot harness uses Copilot credits for every test and evaluation.
- Copilot Studio, Workflows: turn off, then delete the "New starter onboarding" workflow.
- Copilot Studio: remove the agent from Teams, then delete it.
- SharePoint: delete the test rows, or the whole site if you do not keep it.

← All labs