🤖 GitHub Copilot in VS Code

Dev Workshop, WPXPO

Samin Yaser, SWE
Abdullah Al Asif, SWE

2025 © Samin Yaser

🛠️ Setup

  • VS Code Insiders
  • GitHub Copilot Extension
2025 © Samin Yaser

✨ Features: Code Completions

  • inline "ghost text" as you type
  • Tab to next edit
2025 © Samin Yaser

💬 Features: Chat Modes

  • Ask mode: Regular chatting.
  • Inline chat: Quick chat in the editor/terminal for in-flow edits
  • Edit mode: Almost never used.
  • Agent mode: Most powerful; can create files, run tasks, and iterate with you
2025 © Samin Yaser

⌨️ Essential Shortcuts

💬 Chat & Modes

  • Inline Chat: Ctrl+I / ⌘I
  • Chat View: Ctrl+Alt+I / ⌃⌘I
  • Agent Mode: Ctrl+Shift+I / ⌘⇧I

💡 Pro Tip: Bind "Toggle Copilot" to your favorite key!

2025 © Samin Yaser

🎭 Context is King

📂 File Management

  • Drag files/folders/problems into Chat
  • Type #fileName, #folder, #symbol

🛠️ Power Tools

  • #codebase — semantic search
  • @terminal, @workspace
2025 © Samin Yaser

⚙️ Settings to Tweak

  • "chat.agent.maxRequests": 100 - Increase agent iterations
  • "github.copilot.chat.codesearch.enabled": true - Enables codebase search
  • "github.copilot.chat.agent.thinkingTool": true - Enables agent reasoning
  • "editor.aiStats.enabled": true - View usage stats in status bar
2025 © Samin Yaser

🚀 Prompt Boosting

Use the Prompt Boost to easily improve your prompts.

  • Invoke the #promptBoost tool in your prompt

2025 © Samin Yaser

📝 Prompt Examples (1/4)

React hook:

"Create useDebouncedValue<T>(value, delay) with cleanup and type-safe API. Add example."

A11y:

"Refactor Modal for WCAG 2.2: focus trap, ARIA roles, ESC to close, Tab cycle. Add tests."

2025 © Samin Yaser

🧪 Prompt Examples (2/4)

Inline Chat refactor (paste & run):

"Refactor selected code to be side-effect-free, improve naming, keep public API stable, and add JSDoc with examples. Don't change behavior."

REST API Endpoint:

"Create a REST API endpoint my-plugin/v1/products/featured returning featured products (wc_get_products). Require edit_posts capability. Add PHPDoc and follow standards."

2025 © Samin Yaser

🧪 Prompt Examples (3/4)

WP_Query Example:

"Write get_expiring_subscriptions() using WP_Query to fetch shop_subscription posts where _schedule_end is within 7 days. Return post IDs."

WordPress Standards:

"Refactor selected PHP code to follow WP Coding Standards. Snake_case, PHPDoc, and wrap strings in __() with text domain my-plugin-text-domain."

2025 © Samin Yaser

� Prompt Examples (4/4)

WooCommerce Hook (PHP):

"Write a PHP function hooking into woocommerce_after_add_to_cart_button. It should show a text input field and save its value as custom cart item data."

React Settings (Admin):

"Build a React component with a TextControl and Button. On click, save value via @wordpress/api-fetch to /my-plugin/v1/settings."

2025 © Samin Yaser

🔍 Awesome Copilot

2025 © Samin Yaser

💰 Prevent Overbilling

🔎 Request Limits

  • 300 premium requests/month included
  • Beyond that → $0.04 per extra request

2025 © Samin Yaser

🙏 Thanks!

Get the slides from GitHub

2025 © Samin Yaser

![bg right:40% opacity:0.8](https://images.unsplash.com/photo-1461749280684-dccba630e2f6?w=400)