Command Palette

Search for a command to run...

UnylyUnyly
Browse all

Agentcamp Expense Agent

FreeNot checked

From Code to Skill: a 90-minute AgentCamp workshop. Build a Copilot Studio Expense Approval Agent in VS Code, author it with natural language, and teach it with

GitHubEmbed

About

From Code to Skill: a 90-minute AgentCamp workshop. Build a Copilot Studio Expense Approval Agent in VS Code, author it with natural language, and teach it with Dataverse Business Skills.

README

From Code to Skill - AgentCamp Workshop

From Code to Skill

Build, author, and teach an Expense Approval Agent on the Microsoft Power Platform.

Duration: 90 minutes Level: intermediate Cost: free 12 labs across 3 parts

Setup  •  Labs  •  Skills  •  Resources  •  Help


Welcome! This is your companion repository for the From Code to Skill workshop at AgentCamp. In 90 minutes you go from hand-writing an agent in VS Code, to authoring it with natural language, to teaching it your business rules with Dataverse Business Skills. The running scenario is an Expense Approval Agent, and by the end you will have built a working, policy-aware agent end to end.

Everything you need is here: the full lab guide, the files you upload during the labs, and the business skills you connect in Part 3.

First time here? Start with Before You Begin, then open docs/Hands-On-Lab-Guide.pdf and follow along part by part.

Contents

🎯 What you'll build

By the end of the session you will have created:

  • An Expense Approval Agent built and edited locally in VS Code with the Microsoft Copilot Studio extension.
  • A complete expense approval topic with conditional logic that routes by dollar threshold.
  • The same agent re-authored in plain English using the Skills for Copilot Studio plugin.
  • A Dataverse Business Skill that defines your expense policy in plain language.
  • A connected solution where the agent auto-discovers and applies the skill at runtime, with no republishing.

🧭 The workshop flow

flowchart LR
    S["🛠️ Pre-Workshop<br/>Setup"]:::setup --> P1["📦 Part 1<br/>Build in VS Code"]:::coral
    P1 --> P2["💬 Part 2<br/>Author with AI"]:::purple
    P2 --> P3["🧠 Part 3<br/>Teach with Skills"]:::teal
    P3 --> O["✅ Working Expense<br/>Approval Agent"]:::done
    classDef setup fill:#F0EDE6,stroke:#5A5A6E,color:#1A1A2E;
    classDef coral fill:#FDF0EB,stroke:#D97757,color:#1A1A2E;
    classDef purple fill:#F0EEFF,stroke:#6B5CE7,color:#1A1A2E;
    classDef teal fill:#ECFDF5,stroke:#0D9488,color:#1A1A2E;
    classDef done fill:#1A1A2E,stroke:#1A1A2E,color:#FFFFFF;

Each part builds on the last. You write the agent by hand first so you understand the shape of it, then let AI accelerate the same work, then move your business logic out of code entirely and into a skill you can edit in seconds.

📊 At a glance

Part Topic What you do Time
1 Build with the VS Code extension Clone the agent locally, hand-write a topic in YAML, sync and test ~25 min
2 Natural language authoring Recreate and extend the topic with the Skills for Copilot Studio plugin ~25 min
3 Teach with Dataverse Business Skills Encode the policy as a skill and connect it via the Dataverse MCP Server ~25 min
Wrap Review, Q&A, next steps Recap and where to go next ~15 min

Everything used here is free. No paid licenses are required.

🧰 Before you begin

Complete these before the session. Budget 20 to 30 minutes. You need a work or school Microsoft Entra ID account (not a personal Microsoft account).

Pre-workshop setup (8 steps)
  1. Install Visual Studio Code (v1.80+) from code.visualstudio.com. Open the Extensions panel (Ctrl+Shift+X), search for Copilot Studio, and install the Microsoft Copilot Studio extension.
  2. Install an AI CLI (pick one):
    • Claude Code (recommended): needs Node.js 18+ (nodejs.org). Run npm install -g @anthropic-ai/claude-code, then verify with claude. Requires an Anthropic API key or Max subscription.
    • GitHub Copilot CLI: install from github.com/copilot. Requires a GitHub Copilot subscription.
  3. Install the Skills for Copilot Studio plugin (open source, by the Microsoft Copilot Studio CAT team):
    /plugin marketplace add microsoft/skills-for-copilot-studio
    /plugin install copilot-studio@skills-for-copilot-studio
    
    Enable auto-updates when prompted.
  4. Sign up for the Power Apps Developer Plan (free) at aka.ms/PowerAppsDevPlan. Sign in with your work or school account and wait for the environment to provision (2 to 5 minutes).
  5. Start a Copilot Studio trial (free, 30 days) at copilotstudio.microsoft.com using the same account.
  6. Enable Managed Environment. In the Power Platform Admin Center, open Environments, select your developer environment, and toggle Managed Environment to On.
  7. Enable Dataverse Intelligence. In the same environment settings, turn Dataverse Intelligence On and save. This setting appears only after Managed Environment is enabled.
  8. Create a test agent. In Copilot Studio, create a solution, then a new agent named Expense Approval Agent, and accept the defaults. You will build it out during the workshop.
Verification checklist
  • VS Code installed with the Copilot Studio extension
  • Claude Code or GitHub Copilot CLI installed
  • Skills for Copilot Studio plugin installed
  • Developer environment provisioned
  • Copilot Studio trial active
  • Managed Environment enabled
  • Dataverse Intelligence enabled
  • Test agent created
Quick-reference URLs
Resource URL
VS Code code.visualstudio.com
Copilot Studio extension marketplace.visualstudio.com (search "Copilot Studio")
Claude Code npmjs.com/package/@anthropic-ai/claude-code
GitHub Copilot github.com/copilot
Skills for Copilot Studio github.com/microsoft/skills-for-copilot-studio
Power Apps Developer Plan aka.ms/PowerAppsDevPlan
Copilot Studio copilotstudio.microsoft.com
Power Platform Admin Center admin.powerplatform.microsoft.com

Setup trouble? Most issues come from using a personal account instead of a work or school account, or a missing PATH entry after installing Node. See Troubleshooting.

📂 What's in this repo

File Use it for
docs/Hands-On-Lab-Guide.pdf The full step-by-step guide with screenshots. Your main reference.
docs/Hands-On-Lab-Guide.docx Editable copy if you want to take notes.
docs/Contoso-Expense-Policy.pdf The policy document you upload as a knowledge source in Lab 1.2.
skills/expense-approval-policy.md The core Business Skill. Paste it into the form in Lab 3.2.
skills/department-budget-check.md Bonus skill: checks expenses against department budgets.
skills/expense-audit-anomaly-detection.md Bonus skill: risk scoring and anomaly detection.
skills/Department-Budget-Check-Skill.zip Packaged budget-check skill for one-click import.
.
├── docs/
│   ├── Hands-On-Lab-Guide.pdf      # primary, full detail with screenshots
│   ├── Hands-On-Lab-Guide.docx     # editable copy
│   ├── Contoso-Expense-Policy.pdf  # knowledge doc for Lab 1.2
│   └── assets/                     # banner and images
└── skills/
    ├── README.md                   # skills catalog
    ├── expense-approval-policy.md  # core skill (Lab 3.2)
    ├── department-budget-check.md  # bonus
    ├── expense-audit-anomaly-detection.md  # bonus
    └── Department-Budget-Check-Skill.zip   # importable package

📦 The labs

The PDF guide has every detail and screenshot. The summaries below give the objective of each lab plus the commands and prompts you will copy and paste.

📦 Part 1 · Build Agents with the VS Code Extension (~25 min)
  • Lab 1.1 - Install Extension & Sign In. Install the Microsoft Copilot Studio extension, click the Agents icon in the Activity Bar, and sign in with your Microsoft 365 account. Your developer environment should appear in the Agents panel.
  • Lab 1.2 - Create the Agent and Add Knowledge. In Copilot Studio, create a solution and set it as preferred, create the agent inside it, then upload docs/Contoso-Expense-Policy.pdf as knowledge and publish.
  • Lab 1.2b - Clone Locally. Right-click the agent in the Agents panel and choose Clone to Local. Explore agent.mcs.yaml, topics/, actions/, knowledge/, and .mcsignore.
  • Lab 1.3 - Build the Expense Approval Topic. Create expenseApproval.mcs.yaml in topics/. Add a greeting, three Question nodes (amount, category, description), and a ConditionGroup that escalates when the amount is over $500. Use Ctrl+Space for IntelliSense and Ctrl+Shift+M for the Problems pane.
  • Lab 1.4 - Sync & Test. Click Apply to push the diff, refresh Copilot Studio, and test in chat.

Checkpoint: $250 for a team lunch auto-approves (under $500). Submit expense report for $750 for conference travel escalates to manager approval (over $500).

💬 Part 2 · Natural Language Authoring with the Plugin (~25 min)
  • Lab 2.1 - Install the Plugin. In your AI CLI:
    /plugin marketplace add microsoft/skills-for-copilot-studio
    /plugin install copilot-studio@skills-for-copilot-studio
    
    Walkthrough video: https://www.youtube.com/watch?v=ES8HnvcLEWU
  • Lab 2.2 - Author with Natural Language. From your cloned agent folder, run:
    @copilot-studio:author Add a new topic that handles expense report submissions.
    The topic should collect the expense amount, category (Travel, Meals,
    Office Supplies, Training, Other), and description. If the amount is over
    $500, send a message saying manager approval is required. If over $2000,
    escalate to VP. Otherwise auto-approve. Add a final confirmation message
    summarizing the submission.
    
    Compare the generated YAML with what you wrote by hand in Part 1.
  • Lab 2.3 - Test & Troubleshoot from the Terminal. Apply and publish, then:
    @copilot-studio:test Test with: "I need to submit a $350 expense for office supplies"
    @copilot-studio:troubleshoot The agent is routing the wrong topic when I ask about expenses
    
  • Lab 2.4 - Explore Advanced Authoring. Try a richer request (mind your token usage):
    @copilot-studio:author Add a knowledge source that references our expense
    policy document. Also add an adaptive card that shows a formatted expense
    summary with amount, category, description, and approval status.
    

Checkpoint: The plugin generates valid YAML and the agent routes expense requests to the correct topic.

🧠 Part 3 · Teach Your Agent with Dataverse Business Skills (~25 min)
  • Lab 3.1 - Verify Dataverse Intelligence. In the Power Platform Admin Center, confirm Managed Environment is enabled and Dataverse Intelligence is active. Turn on MCP Clients to interact with Dataverse (preview).

  • Lab 3.2 - Create the Expense Approval Business Skill. In Power Apps, go to More > Business Skills (preview) > + New business skills. Copy the Name, Description, and Instructions from skills/expense-approval-policy.md. Set Visibility to Organization, then Save and Activate.

  • Lab 3.3 - Connect the Dataverse MCP Server. In your agent, open Tools (or Actions), add the Dataverse MCP Server (preview), and select your developer environment. The agent then auto-discovers every Active skill.

  • Lab 3.4 - Test the Complete Solution. Run these four prompts in the test chat:

    # Test Prompt Expected Behavior Policy Rule
    1 I need to submit a $350 expense for office supplies Auto-approves (under $500) Under $500: Auto-approve
    2 Submit $1,200 expense for conference registration Requires manager approval $500 to $2,000: Manager approval
    3 Process a $3,500 team event expense Escalates to VP Over $2,000: VP approval
    4 I need to submit a $5,000 expense for international travel to London Applies BOTH VP approval AND the international travel rule VP approval + International travel

Checkpoint: The agent applies all four scenarios correctly, including both rules at once for prompt 4.

🎁 Bonus: Change a threshold in the skill (for example, auto-approval from $500 to $300), save, and reactivate. The agent picks up the change with no republish.

🧠 Business skills

A Business Skill lets you define agent behavior in plain language, with no code and no republishing required to change the logic. This repo ships three, documented in the skills catalog:

  • Expense Approval Policy is the core skill you build in Lab 3.2. Start here.
  • Department Budget Check is a bonus skill that checks an expense against the submitting employee's department budget.
  • Expense Audit & Anomaly Detection is a bonus skill that risk-scores expenses and flags duplicates, round numbers, threshold gaming, and splitting.

Layer several Active skills and watch the agent combine them at runtime. See skills/README.md for how to add, import, and write your own.

🔧 Troubleshooting

Common setup and lab issues
Issue Fix
npm command not found Install Node.js 18+ from nodejs.org, then restart your terminal.
claude not found after install Re-run npm install -g @anthropic-ai/claude-code, or add your npm global bin folder to PATH.
Plugin not appearing after install Restart your CLI (type /exit and relaunch), then run /plugin list.
Power Apps Developer Plan sign-up fails Use a work or school Entra ID account, not a personal Microsoft account.
Copilot Studio trial unavailable Ask your IT admin if self-service purchases are disabled in your tenant.
Managed Environment toggle greyed out You need Power Platform Admin or Global Admin. Use your developer environment where you have full rights.
Dataverse Intelligence not visible Enable Managed Environment first. The setting appears only after that.
VS Code extension fails to load Update VS Code to v1.80+. Check View > Output for extension errors.

Still stuck? Open a Workshop help issue or start a Discussion.

❓ FAQ

Do I need a paid license for anything?

No. The Power Apps Developer Plan, the Copilot Studio trial, VS Code, and the Skills for Copilot Studio plugin are all free. You only need an AI CLI subscription (Anthropic or GitHub Copilot) for Part 2.

Claude Code or GitHub Copilot CLI, which should I use?

Either works. The Skills for Copilot Studio plugin behaves identically on both. Claude Code is the recommended path in this workshop.

What is a Business Skill, and how is it different from a topic?

A topic is conversational logic that lives in your agent's code (YAML). A Business Skill is plain-language policy stored in Dataverse that the agent discovers and applies at runtime. You can change a skill and reactivate it without republishing the agent, which keeps business rules separate from code.

Can I keep using my agent after the workshop?

Yes. Your developer environment and agent persist. Extend them with more skills, flows, and integrations. See Going further.

📚 Resources

🚀 Going further

  • Extend the logic. Add Business Skills for other processes (PTO, purchase orders, travel booking) and build a shared skill library.
  • Integrate. Add a Power Automate flow to create a Teams approval, or log submissions to a Dataverse table and report on them in Power BI.
  • Apply ALM. Put your agent YAML in source control, package the agent, skills, and flows into a Power Platform solution, and set up a CI/CD pipeline with the Power Platform CLI.
  • Govern. Use Copilot Studio Analytics and Dataverse audit logs to monitor outcomes and track skill changes.

🙋 Need help?

  • 🐛 Stuck on a lab? Open a Workshop help issue.
  • 💬 Questions or want to share what you built? Start a Discussion.
  • Found this useful? Star the repo so you can find it again, and watch it for future workshops.

📄 License and credits

These workshop materials are licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0). You are welcome to learn from and adapt them with attribution and for non-commercial use. For commercial delivery, please get in touch.

The Skills for Copilot Studio plugin is an open-source project by the Microsoft Copilot Studio CAT team. Microsoft, Power Platform, Copilot Studio, Dataverse, and related names are trademarks of Microsoft Corporation. "Contoso" is a fictional company used for sample data.

Thank you for joining the From Code to Skill workshop. See you at the next one.

from github.com/Wariowaqo/agentcamp-expense-agent

Installing Agentcamp Expense Agent

This server has no published package — it is built from source. Open the repository and follow its README.

▸ github.com/Wariowaqo/agentcamp-expense-agent

FAQ

Is Agentcamp Expense Agent MCP free?

Yes, Agentcamp Expense Agent MCP is free — one-click install via Unyly at no cost.

Does Agentcamp Expense Agent need an API key?

No, Agentcamp Expense Agent runs without API keys or environment variables.

Is Agentcamp Expense Agent hosted or self-hosted?

Self-hosted: the server runs locally on your machine via the install command above.

How do I install Agentcamp Expense Agent in Claude Desktop, Claude Code or Cursor?

Open Agentcamp Expense Agent on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.

Related MCPs

Compare Agentcamp Expense Agent with

Not sure what to pick?

Find your stack in 60 seconds

Author?

Embed badge for your README

Browse similar

All development MCPs