AI-141

Using GitHub Copilot as Coding Assistant

Detailed Course Outline

Course Length

1 day or 2 half days

Course Overview

GitHub Copilot is one of the most popular among coding assistant applications which help programmers to generate, refactor, explain and document program codes in dozens of languages as well to generate tests for the same codes.

Learning Objectives

At the end of the training participants will:

  • • Understand the basic LLM and GitHub Copilot concepts
  • • Gain practical skills in prompt engineering
  • • Gain practical skills in using GitHub Copilot for code and test generation, code refactoring, explanation and documentation

Main Topics

  • • LLMs in a nutshell
  • • Introduction and main features of GitHub Copilot
  • • Test Driven Development with GitHub Copilot
  • • GitHub Copilot autocompletion
  • • GitHub Copilot Chat
  • • Prompt engineering for code generation
  • • Advanced features (Explain, Document, Refactor, Unit-test generation)
  • • Adding context

The lab exercises are available either in a VS Code + Python, VSCode + C, C++ or VSCode + Java environment.

Structure

Roughly 50% lecture, 50% hands-on lab exercises

Target Audience

Software developers and testers as well as their technical managers who want to use GitHub Copilot in their daily work.

Prerequisites

Basic understanding of AI concepts, experience in using the programming language where GitHub Copilot would be used as a coding assistant, user experience with ChatGPT or similar chatbots.

Course Modules

Module 1: LLMs in a nutshell

  • Main parts and working of LLMs in a nutshell
  • Most important base LLM vendors and models
  • LLMs used in GitHub Copilot

Module 2: Introduction and main features of GitHub Copilot

  • Main features of GitHub Copilot
  • VS Code basics
  • Core features of GitHub Copilot
  • Different Types of Interaction with GitHub Copilot
  • Using different LLMs (GPT, Claude Sonnet)

Module 3: GitHub Copilot autocompletion

  • Auto completion
  • Accept suggestion, accept next word, next suggestion
  • With cycle menu
  • With shortcuts
  • Lab: Hands-on autocompletion exercises

Module 4: GitHub Copilot Chat

  • GitHub Copilot Chat: Inline commands
  • GitHub Copilot Chat: Chat panel
  • GitHub Copilot Chat: Tips & Tricks
  • Lab: Interactive chat exercises

Module 5: Prompt engineering for code generation

  • The 2 golden rules of prompt engineering
  • 10 Prompting rules of thumb
  • Be concise and give clear instructions
  • Be specific and include relevant details
  • Add positive and negative prompts
  • Define roles for the LLM
  • Define roles for the LLM's audience
  • Provide examples for the solution or response style (one-shot or few-shot prompting)
  • Add relevant context
  • Divide difficult tasks into subtasks (Prompt Chaining)
  • "Let's think step by step" (Chain of Thought)
  • Let the LLM ask questions
  • Lab: Prompt engineering practice

Module 6: Advanced features

  • Explain: Generate explanation for a code-block: With the built in chat or from an editor panel
  • Documentation: Generate language specific documentation in the right format
  • Refactoring: Language specific refactoring options in the refactor menu
  • Unit-test generation: Integrated ways to handle test failures
  • Test Driven Development with GitHub Copilot
  • Lab: Advanced feature implementation

Module 7: Adding context

  • Context handling in GitHub Copilot
  • Custom chat instructions
  • Prompt files, chat modes
  • Setting up indexes, using multi root workspaces
  • Lab: Context optimization exercises

AI Portfolio at ComponentSoft

This training is part of the AI portfolio of ComponentSoft which explores essential AI topics, such as:

  • AI-101: Intro to GenAI with Large Language Model (LLMs) and LLM-based apps
  • AI-151: Using Windsurf as coding assistant
  • AI-161: Using Amazon Q as coding assistant
  • AI-434: GenAI Application Development with LLMs