GitHub Copilot & VS Code
GitHub Copilot di VS Code mendukung instruksi tingkat repositori, file .instructions.md yang terlingkup jalur, serta server MCP Streamable HTTP yang dideklarasikan di .vscode/mcp.json.
Di mana menempatkan DESIGN.md dan instruksi
my-app/
├── DESIGN.md
├── .github/
│ ├── copilot-instructions.md
│ └── instructions/
│ └── design.instructions.md
└── .vscode/
└── mcp.jsonHubungkan DESIGN.md ke instruksi Copilot
File instruksi terlingkup (.github/instructions/design.instructions.md)
Gunakan glob applyTo agar Copilot melampirkan aturan sistem desain hanya saat menyunting kode UI:
---
applyTo: "src/components/**/*.{tsx,jsx,css},src/app/**/*.{tsx,jsx,css}"
---
Read `DESIGN.md` at the repository root before creating or editing UI components.
Use only the colors, typography, spacing, corner radii, and component states specified there, and follow its Do's and Don'ts.Cadangan tingkat repositori (.github/copilot-instructions.md)
## Design System
Visual tokens and UI layout constraints live in `DESIGN.md`. Apply them on every frontend component, page, and CSS update.Hubungkan server MCP DesignMD Pro di VS Code
VS Code menggunakan kunci root "servers" dengan "type": "http" di dalam .vscode/mcp.json (atau pengaturan tingkat pengguna):
{
"servers": {
"designmdpro": {
"type": "http",
"url": "https://designmdpro.app/mcp"
}
}
}Dengan kunci API Pro (dmdp_… dari Akun → Kunci API), prioritaskan variabel input VS Code agar rahasia tidak masuk ke git:
{
"inputs": [
{
"type": "promptString",
"id": "designmdpro-api-key",
"description": "DesignMD Pro API Key (dmdp_...)",
"password": true
}
],
"servers": {
"designmdpro": {
"type": "http",
"url": "https://designmdpro.app/mcp",
"headers": {
"Authorization": "Bearer ${input:designmdpro-api-key}"
}
}
}
}Untuk pengujian lokal cepat tanpa inputs, Anda juga dapat menempatkan "Authorization": "Bearer dmdp_your_api_key" langsung di pengaturan pengguna.
Templat prompt
#file:DESIGN.md Build a billing status banner component in src/components/.
Match the exact colors, spacing, and Shapes rules in DESIGN.md.Use #designmdpro to search for fintech design systems, pull the Colors and
Typography sections, and propose an accessible dark-mode token block for our DESIGN.md.Kesalahan umum
- Menggunakan
"mcpServers"alih-alih"servers"di.vscode/mcp.json: VS Code mewajibkan"servers"dengan"type": "http", berbeda dengan Cursor atau Windsurf. - Melakukan commit kunci API teks biasa ke
.vscode/mcp.json:.vscode/mcp.jsonbiasanya dilacak oleh git; selalu gunakan${input:...}atau konfigurasi tingkat pengguna untuk kuncidmdp_….
Langkah selanjutnya
- Halaman Pengaturan Server MCP — salin cuplikan untuk keempat klien
- Validator & Aturan Lint — verifikasi perubahan yang dihasilkan terhadap aturan kontras
Last updated on