In a recent #BCOpenDiscussion session, we delved into the fascinating concept of Vibe Coding—a new way of building software where developers collaborate with AI (like GitHub Copilot) to co-create solutions.
The session covered practical setup, how AI understands context, and even touched on Microsoft's new Model Context Protocol (MCP) integration for enhanced learning.
Let’s break down the journey, step by step.
🔍 What is Vibe Coding?
Vibe Coding is all about working with AI—not just using it as a tool but treating it as a coding partner. It's about defining your coding standards, supplying the right context, and letting the AI guide and generate meaningful solutions.
As I explored more, I found that once you start feeding proper information—like design rules, naming conventions, and requirement documents—the output from Copilot becomes surprisingly accurate and helpful.
📝 Setting the Stage: The Use Case
A few weeks ago, Kamal from the community volunteered to prepare a design document. While we initially discussed one idea, he shared a requirement on a different (but still relevant) use case: “Implementing Dynamic Payment-Based Discounts in Business Central.”
We decided to use this real-world scenario to demonstrate how vibe coding works with GitHub Copilot in VS Code.
🧠 Step 1: Understanding GitHub Copilot Modes
When using Copilot in VS Code, there are three main modes to work with:
-
Ask – Just like chatting with an AI assistant. You ask a question, it answers.
-
Edit – Makes changes to a specific file based on your input.
-
Agent – This is where the magic happens. It can understand context across files and even auto-execute tasks without continuous manual input.
For Vibe Coding, we focus heavily on the Agent Mode because it allows Copilot to analyze multiple inputs and files to build a project more holistically.
💻 Step 2: Creating a New Business Central Workspace
Inside VS Code, we tried the "Create new workspace with Copilot" feature. It walked us through:
-
Setting up a new AL project
-
Automatically generating
app.json
, default table, and page objects -
Adding
launch.json
,tasks.json
, and even a GitHub.gitignore
-
Checking for AL Language Extension
-
Setting up code analyzers and default dependencies
Note: It defaulted the target version to v19 and runtime to an older version. We manually updated it to match Business Central 26 (runtime 14.0) for relevance.
🧾 Step 3: Writing Copilot Instructions (copilot-instructions.md)
The core of vibe coding is setting the rules for your AI partner.
We created a copilot-instructions.md
file to define our coding conventions:
-
Field prefix:
SDH
-
Field captions: should not include the prefix
-
Dependencies: should include base and system apps
-
ApplicationArea: should be defined for UI elements
-
Naming rules, documentation standards, and more
You can customize this markdown document as much as you like. The key is to make it a living style guide for your AL projects.
📄 Step 4: Adding a Functional Requirement Document
We took Kamal’s use case on Dynamic Payment-Based Discounts and converted it into a .md
format to add as a functional requirement doc.
You can use online converters or manually format the document in markdown. This document helps Copilot understand what functionality it’s expected to build.
🌐 Step 5: Integrating Microsoft Learn MCP
Microsoft recently introduced Model Context Protocol (MCP) support via Microsoft Learn. This allows AI tools like Copilot to:
-
Use Microsoft’s official documentation as part of their knowledge base
-
Generate more context-aware, standards-compliant AL code
To integrate MCP in VS Code:
-
Run MCP: Add Server from the Command Palette
-
Use the endpoint:
https://learn.microsoft.com/api/mcp
-
Choose to connect globally or just for this workspace
This adds a mcp.json
file in your project and enables AI to access Microsoft Learn content directly.
🧠 Step 6: Providing Context Before You Code
With everything in place, here’s how you set up the context for Copilot Agent:
-
Select your model
-
Choose Agent Mode
-
Add context sources:
-
✅ Instruction File (
copilot-instructions.md
) -
✅ Requirement Document (
discount-feature.md
) -
✅ MCP Integration
-
Optionally add:
-
Project files
-
Symbols
-
Screenshots (for UI guidance)
-
-
Once done, Copilot starts analyzing your workspace and begins drafting solutions.
🔄 What’s Next?
The setup now allows Copilot to generate Business Central AL code tailored to your company’s standards and functional requirements. In upcoming sessions, we’ll dive deeper into:
-
Auto-generating test cases
-
Using screenshots as design context
-
Real-time code reviews by Copilot
-
Versioning and documenting via AI
👨💻 Final Thoughts
Vibe Coding isn't just a trend—it’s a paradigm shift. By combining human intent with AI execution, we're unlocking new productivity levels for Business Central developers. As this ecosystem evolves, expect more seamless integrations between tooling, documentation, and AI.
If you haven't tried this yet, now is a great time to start. All you need is:
-
VS Code
-
GitHub Copilot
-
AL Language Extension
-
A clear set of rules and requirements
Let the AI handle the boilerplate, and you focus on the business logic.
💬 Join the Discussion
Have thoughts or want to try this in your own team? Join our Teams Community: Saurav’s Dynamic Hub and be part of the #BCOpenDiscussion every Friday!
Happy Coding!
— Saurav Dhyani
Founder, Edhate Consulting
YouTube: Saurav Dhyani - Business Central
Comments
Post a Comment