Skip to content

Exercise: Build Applications with GitHub Copilot Agent Mode #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
github-actions bot opened this issue Apr 8, 2025 · 4 comments
Open

Exercise: Build Applications with GitHub Copilot Agent Mode #1

github-actions bot opened this issue Apr 8, 2025 · 4 comments

Comments

@github-actions
Copy link
Contributor

github-actions bot commented Apr 8, 2025

Build Applications with GitHub Copilot Agent Mode

original github octocat

👋 Hey there ottlukas! Welcome to your Skills exercise!

Welcome to the exciting world of GitHub Copilot agent mode! 🚀 In this exercise, you'll unlock the potential of this AI-powered coding assistant to accelerate your development process. Let's dive in and have some fun exploring the future of coding together! 💻✨

As you complete each step, I will respond in the comments to:

  • check your work and give feedback
  • share next steps
  • occasionally share tips
  • congratulate you when you finish!

Good luck and have fun!
- Mona

Copy link
Contributor Author

github-actions bot commented Apr 8, 2025

Step 1: Hello GitHub Copilot agent mode

Welcome to your "Build applications with GitHub Copilot agent mode" exercise! 🤖

In this exercise, you will be using GitHub Copilot agent mode to build an application that tracks your fitness goals and progress. 🏋️‍♂️🏃‍♀️💪

What is GitHub Copilot agent mode?

Copilot agent mode can create apps from scratch, perform refactorings across multiple files, write and run tests, and migrate legacy code to modern frameworks. It can automatically generate documentation, integrate new libraries, or help answer questions about a complex codebase. Copilot agent mode helps you be super-productive by having an AI collaborator that understands the workspace. It can orchestrate your inner development flow while keeping you in control.

Copilot agent mode operates in a more autonomous and dynamic manner to achieve the desired outcome. To process a request, Copilot loops over the following steps and iterates multiple times as needed:

Determines the relevant context and files to edit autonomously.
Offers both code changes and terminal commands to complete the task. For example, Copilot might compile code, install packages, run tests, and more.
Monitors the correctness of code edits and terminal command output and iterates to remediate issues.

💡 Tip: You can learn more about GitHub Copilot agent mode in the Use agent mode documentation.

⌨️ Activity: Getting to know your GitHub Copilot agent mode development environment

  1. Right-click the below button to open the Create Codespace page in a new tab.

    Open in GitHub Codespaces

    • The free tier of Codespaces that comes with all GitHub accounts is fine, assuming you still have minutes available.
    • The default Codespace settings are fine.
  2. Confirm the Repository field is your copy of the exercise, not the original, then click the green Create Codespace button.

    • ✅ Your copy: /ottlukas/skills-build-applications-w-copilot-agent-mode
    • ❌ Original: /skills/build-applications-w-copilot-agent-mode
  3. Wait a moment for Visual Studio Code to load.

    1. You may need to switch to VS Code insiders edition in the codespace since agent mode was released on 4/4 as a phased rollout to users.
      switch-to-insiders-version-light
  4. Before we continue let's take a moment to familiarize ourselves with the project folder.

    • The left navigation bar is where you can access the file explorer, debugger, and search.
    • The lower panel (Ctrl+J) shows the debugger output, allows running terminal commands, and allows configuring the web service ports.
    • Our docs folder contains the another sample application repository that will give Copilot agent mode context to build your application. More on that in the next steps!
  5. At the top of VS Code, locate and click the Copilot icon to open a Copilot Chat panel.

image
  1. If this is your first, time using GitHub Copilot, you will have to accept the usage terms to continue.
    • Click the Accept button to continue.
    • If you are using Copilot Chat for the first time, you will also have to accept the usage terms to continue.
    • Click the Accept button to continue.

⌨️ Activity: Use Copilot agent mode to create a branch and publish it. 🙋

Great work! Now that we are familiar with the app and we know it works, let's ask copilot for help starting a branch so we can do some customizing.

  1. If not already there, return to VS Code.

  2. Open the GitHub Copilot Chat window if not already open.

  3. Copy and paste the following prompt in the GitHub Copilot Chat and select the Agent instead of Ask or Edit from the drop down where you are inserting the prompt.

🪧 Note:

  • Do not change the model from GPT-4o this will be an optional activity at the end of the course.
  • Keep in mind that the Copilot agent mode is conversational so it may ask you questions and you can ask it questions too.
  • Wait a moment for the Copilot to respond and press the continue button to execute commands presented by Copilot agent mode.
  1. Let's ask Copilot agent mode to help us remember the command and create the branch build-octofit-app and publishing it

    Static Badge

    Hey copilot, how can I create and publish a new Git branch called build-octofit-app?
    
  2. Now that we are happy with the command, press the Continue button to let Copilot agent mode run it for us. No need to copy and paste!

  3. After a moment, look in the VS Code lower status bar, on the left, to see the active branch. It should now say build-octofit-app. If so, you are all done with this step!

  4. Now that your branch is pushed to GitHub, Mona should already be busy checking your work. Give her a moment and keep watch in the comments. You will see her respond with progress info and the next lesson.

Having trouble? 🤷

If you don't get feedback, here are some things to check:

  • Make sure your created the branch with the exact name build-octofit-app. No prefixes or suffixes.
  • Make sure the branch was indeed published to your repository.

Copy link
Contributor Author

github-actions bot commented Apr 8, 2025

🎉🎉🎉 Nice work! Everything is perfect! 🎉🎉🎉
Preparing content for step 2! One moment... 🤓

Copy link
Contributor Author

github-actions bot commented Apr 8, 2025

Step 2: The initial application setup: Directory structure, Python requirements, and MongoDB

In this step, we will accomplish the following:

  • Create the octofit-tracker application directory structure.
  • Create the octofit-tracker/backend and octofit-tracker/frontend directories.
  • Create the octofit-tracker/backend/requirements.txt file.
  1. Open all files in the docs folder and keep this file open in the editor throughout this exercise.
    1. agent mode uses mona-high-school-fitness-tracker.md and octofit_story.md as a reference to create the application
  2. Copy and paste the following prompt(s) in the GitHub Copilot Chat and select the "Agent" instead of "Ask" or "Edit" from the drop down where you are inserting the prompt.

🪧 Note:

  • Do not change the model from GPT-4o this will be an optional activity at the end of the course.
  • Keep in mind that the Copilot agent mode is conversational so it may ask you questions and you can ask it questions too.
  • Wait a moment for the Copilot to respond and press the continue button to execute commands presented by Copilot agent mode.
  • Keep files created and updated by Copilot agent mode until it is finished.
  • Agent mode has the ability to evaluate your code base and execute commands and add/refactor/delete parts of your code base and automatically self heal if it or you makes a mistake in the process.

⌨️ Activity: Prompt for GitHub Copilot in agent mode to start the creation of our application

Static Badge

Let's take the following step by step and generate instructions in this order and execute the commands.
Use docs/mona-high-school-fitness-tracker.md as a guide for the project structure and requirements.

1. Understand the story of creating the fitness application from the docs/octofit_story.md file.
2. Create the initial directory structure for the octofit-tracker application octofit-tracker/backend, octofit-tracker/frontend.
3. Setup the backend python virtual environment, octofit-tracker/backend/requirements.txt based on docs/mona-high-school-fitness-tracker.md, and install required packages.

Don't proceed with the next activity until all of these steps are completed.

Important: Once the above activity installs all the required packages, proceed to the next activity.

⌨️ Activity: Let's install MongoDB

Static Badge

Based on the example monafit tracker app in the docs/mona-high-school-fitness-tracker.md file and use octofit as the name for mergington's high schools app. > Let's install MongoDB.

1. Install MongoDB and make sure the command is complete.

Don't proceed with the next activity until all of these steps are completed.

Important:

  • If the command completes in the terminal but agent mode shows it is still running click stop.
  • You may need to paste the prompt again in agent mode.

⌨️ Activity: Let's start and verify MongoDB is running

Static Badge

Based on the example monafit tracker app in the docs/mona-high-school-fitness-tracker.md file and use octofit as the name for mergington's high schools app. > Let's start and verify MongoDB is running.

1. Start the MongoDB service.
2. Verify the MongoDB service running.

Don't proceed with the next activity until all of these steps are completed.

Important:

  • If the command completes in the terminal but agent mode shows it is still running click stop.
  • You may need to paste the prompt again in agent mode.
  1. Now that we have created the app directory structure, setup a Python virtual environment, and Copilot agent mode helped write a requirements.txt to install all project dependencies let's check our changes in to our build-octofit-app branch.

  2. With our new changes complete, please commit and push the changes to GitHub.

  3. Wait a moment for Mona to check your work, provide feedback, and share the next lesson so we can keep working!

Having trouble? 🤷

If you don't get feedback, here are some things to check:

  • Make sure your commit changes were made for the following file to the branch build-octofit-app and pushed/synchronized to GitHub:
    • octofit-tracker/backend/requirements.txt and it contains the package Django==4.1
  • If Mona found a mistake, simply make a correction and push your changes again. Mona will check your work as many times as needed.

Copy link
Contributor Author

github-actions bot commented Apr 8, 2025

Please, follow the steps above.
I'll watch your progress in the background to provide feedback. 🧐

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants