GitHub – 1 1
GitHub Copilot Introduction
Agenda
Copilot Overview Tips & Tricks
A Peek into AI-Powered Coding Maximizing Copilot Efficiency
Getting Started Frequently Asked Questions
Your First Steps with Copilot Clarifying Common Curiosities
Prompt Engineering
Crafting Effective Commands
Copilot Overview
A Peek into AI-Powered Coding
3
What is Copilot?
“A new AI-powered code completion
tool that helps developers write code
faster.”
GitHub
Who is Copilot for?
Senior Engineers Junior Engineers
Accelerate boilerplate code Expedite learning, facilitate
generation leverage design as a pair programmer, and
patterns and simplify complex mentor.
problem-solving.
Offers code suggestions,
contextualized to your project
Convert comments to code
Autofill for repetitive code
Show alternatives
Copilot Overview
Copilot Copilot Chat
Copilot Chat
Context-aware ChatGPT-styled conversations with Copilot
Slash commands
/explain Explains how the selected code works
/fix Proposes a fix for the problems in the selected code
/help General help about GitHub Copilot
/tests Generate unit tests for the selected code
/vscode Ask questions about VS Code
/clear Clear the session
Limitations
“I’m powered by AI, so surprises and
mistakes are possible. Make sure to
verify any generated code or
suggestions, and share feedback so that
we can learn and improve.”
Copilot
Copilot “Wisdom”
Every Copilot needs a
Captain !
“If you don’t know where you
are going you’ll end up
someplace else.”
Yogi Berra
Copilot Impact
96% say they are faster
with repetitive tasks
Increase developer productivity
And satisfaction by focusing on real problems
88% say they are more
productive
Accelerate innovation
Prototype & innovate more rapidly
74% focus on more
satisfying work
Bridge skill gaps
Learn new languages and techniques
Getting Started
Your First Steps with Copilot
12
What is Required ?
GitHub account Copilot license Supported IDE
Copilot in Your IDE
IDE Extensions
Once Enabled…
Context
Suggestions
GitHub Copilot
Demo ● Copilot
● Inline help
● Open the Completions Panel
● Fix using Copilot
Copilot & Copilot Chat ● Explain using Copilot
Interaction
● Copilot Chat
○ Say Hello
○ Check its limits
○ Test its knowledge
○ Topics ‘/’
Prompt Engineering
Crafting Effective Commands
What is a Prompt?
In the context of Copilot, a prompt is a piece of
code or natural language description that is used
to generate code suggestions. It is the input that
Copilot uses to generate its output.
- Copilot
What is Prompt Engineering?
Prompt engineering is the process of designing
and creating high-quality prompts that can be
used to generate accurate and useful code
suggestions with Copilot.
- Copilot
Why is Prompt Engineering Important?
● Maximizes utility of Copilot
● Minimizes repeated iterations
● Determines code suggestion quality
● Skill prompts guide Copilot to
understand context & nuances
● Refined interactions reduces
misunderstandings
Techniques
Zero-Shot Prompting One-Shot Prompting Few-Shot Prompting
No Example One Example Handful of Examples
Techniques
Zero-Shot
Programming
with Copilot
Techniques
One-shot
Programming
with Copilot
Cornerstones of Prompting
Control Output Verbosity
Chaining Prompts Provide Examples
Evaluate Quality Give Direction
Format your Response
Tips & Tricks
Maximizing Copilot Efficiency
Enable non-programming Meta Files
In settings.json, add
“github.copilot.enable”:
{
“*”: true,
“yaml”: true,
“plaintext”: false,
“markdown”: true
}
Unit Testing Generation - Copilot Chat
Works best for
general unit
testing case
generation
Refactoring codes
Refactoring is
possible through
GitHub Copilot
Chat
Working in a project level
Ask in GitHub
Copilot Chat to
get started
GitHub Copilot Chat (default)
Working in a project level
Type / command
in GitHub Copilot
Chat to start with
a new project
Neighboring Tabs
Role Prompting
Use copilot to assume a role during a task
Focus to improves results
Improves results by narrowing the AI’s focus
Enhanced Results
When to use Copilot vs Copilot Chat
Copilot Copilot Chat
Direct Code Writing In-Depth Assistance
Seamless IDE Integration Learning & Teaching
Solo Development Collaborative Scenarios
The Token Limit
Strategies to overcome the Token
Limit
● Break Down Tasks
● Be Concise
● Iterative Development
● Post-Processing
● Stay Updated
● Feedback Loop
Asking for more Context
Giving Details
There can never be too much
Clarifying Requirements
Let Copilot know what you want!
Answering Questions
Ensure a clear understanding
Let’s think step by step
Breaking Down Tasks
Itemizes each step for you
Ensuring Clarity
Takes time to spell everything out
Avoiding Overwhelm
Organized approach
Let’s think step by step
Breaking Down Tasks
Ensuring Clarity
Avoiding Overwhelm
AI Hallucinations
● Nature of the Model
● Fabricated Outputs
● Highly Creative but not always right
● Reliance on Developers
● Feedback Loop
The
Copilot
effect.
The world’s most widely
adopted AI developer tool.
Maximize developer happiness
Increase developer productivity
Accelerate software development
GitHub – 1 1
GitHub Copilot Introduction