Skip to content

Commit a2435a2

Browse files
authored
Initial commit
0 parents  commit a2435a2

File tree

31 files changed

+2524
-0
lines changed

31 files changed

+2524
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "Python 3",
3+
"image": "mcr.microsoft.com/vscode/devcontainers/python:3.13",
4+
"customizations": {
5+
"vscode": {
6+
"extensions": [
7+
"GitHub.copilot",
8+
"ms-python.python",
9+
"ms-python.debugpy",
10+
"ms-vscode.live-server",
11+
"mechatroner.rainbow-csv"
12+
],
13+
"settings": {
14+
"livePreview.openPreviewTarget": "External Browser",
15+
16+
// These are defaults but keeping them here for clarity and explicitness
17+
"github.copilot.chat.codeGeneration.useInstructionFiles": true,
18+
"chat.promptFilesLocations": {
19+
".github/prompts": true
20+
},
21+
"chat.instructionsFilesLocations": {
22+
".github/instructions": true
23+
},
24+
"chat.modeFilesLocations": {
25+
".github/chatmodes": true
26+
}
27+
}
28+
}
29+
}
30+
}

.github/steps/1-step.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
## Step 1: Setting Up Copilot Instructions
2+
3+
You're a teacher at Mergington High School who creates homework assignments and coding exercises for students. You maintain a static website to share these assignments and want to establish general standards for AI assistants to ensure consistent code quality and project structure.
4+
5+
You've heard Copilot Instructions can help with that!
6+
7+
<details>
8+
<summary>Website screenshot 📸</summary><br/>
9+
10+
You will run this website in the first activity!
11+
12+
<img width="600" alt="screenshot of homework website" src="https://github.com/user-attachments/assets/2383b6e9-64d5-4907-94b3-b67153efb008" />
13+
14+
</details>
15+
16+
### 📖 Theory: What are repository custom instructions?
17+
18+
Repository custom instructions let you provide Copilot with repository-specific guidance and preferences that help it understand your project context and standards. By creating a `.github/copilot-instructions.md` file, you can ensure that Copilot's suggestions consistently follow your project conventions and coding standards.
19+
20+
The complete set of instructions will be automatically added to all requests that you submit to Copilot Chat in your repository.
21+
22+
> [!TIP]
23+
> Keep instructions short and focused on the "how" of the project. This could be purpose, folder structure, coding standards, key tools, expected formats, etc.
24+
25+
See the [GitHub Docs: Repository Custom Instructions](https://docs.github.com/en/copilot/how-tos/custom-instructions/adding-repository-custom-instructions-for-github-copilot) page for more information.
26+
27+
### ⌨️ Activity: Explore the Educational Website Project
28+
29+
To work with custom instructions, let's first set up our development environment and explore the project structure.
30+
31+
1. Right-click the below button to open the **Create Codespace** page in a new tab. Use the default configuration.
32+
33+
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/{{full_repo_name}}?quickstart=1)
34+
35+
1. Confirm the **Repository** field is your copy of the exercise, not the original, then click the green **Create Codespace** button.
36+
37+
- ✅ Your copy: `/{{full_repo_name}}`
38+
- ❌ Original: `/skills/customize-your-github-copilot-experience`
39+
40+
1. Wait a moment for Visual Studio Code to load in your browser and for all extensions to install.
41+
42+
- Ensure the **Live Preview** extension is activated.
43+
- Ensure the **Python** extension is activated.
44+
45+
1. Right-click on `index.html` and select **Show Preview** to see the website in action.
46+
47+
> **Important**: Keep the preview tab open to see the live updates. We will be making edits throughout the exercise.
48+
49+
1. Explore the project structure:
50+
51+
- Browse the `assets/` folder to see the website assets (CSS, JavaScript, images).
52+
- Look at the `assignments/` folder to understand the existing assignment formats.
53+
- Review `index.html` in the root directory to see the main website structure.
54+
- Review `config.json` in the root directory to see how the assignments are set up.
55+
56+
### ⌨️ Activity: Create Repository Copilot Instructions
57+
58+
Now that you've explored the project, let's create custom instructions to help Copilot understand your educational website project.
59+
60+
1. In VS Code, create a new file called `.github/copilot-instructions.md`
61+
62+
> **Important:** Make sure the file name is correct. This specific filename is required for Copilot to recognize it.
63+
64+
1. Add the following content so Copilot understands the project's purpose, structure, and requirements:
65+
66+
```markdown
67+
# Project Description
68+
69+
This project is an educational website for sharing homework assignments and coding exercises with students. Students can browse, view, and download assignments directly from the portal.
70+
71+
## Project Structure
72+
73+
- [`assignments/`](../assignments/) Each homework assignment is stored in its own subfolder with a consistent structure.
74+
- [`templates/`](../templates/) Reusable templates for new content
75+
- [`assets/`](../assets/) Contains the website assets including CSS, JavaScript, images, and configuration files
76+
- [`index.html`](../index.html) The main website page that serves as a static portal for browsing and viewing assignments. Content is configurable via [`config.json`](../config.json) file to dynamically generate assignment lists and details.
77+
78+
## Project Guidelines
79+
80+
- Maintain consistent styling across all pages
81+
- Keep file and folder names descriptive and organized
82+
83+
## Educational Standards
84+
85+
When generating content for this project:
86+
87+
- **Learning-focused**: All content should be designed with clear learning objectives and appropriate difficulty levels
88+
- **Student-friendly**: Use clear, encouraging language that motivates students
89+
```
90+
91+
1. Test your instructions by asking Copilot about the project:
92+
93+
> ![Static Badge](https://img.shields.io/badge/-Prompt-text?style=social&logo=github%20copilot)
94+
>
95+
> ```prompt
96+
> Briefly explain this project to me
97+
> ```
98+
99+
1. Notice that Copilot uses your custom instructions as a reference in the response.
100+
101+
<img width="504" height="183" alt="image" src="https://github.com/user-attachments/assets/2214ed9e-c165-4440-a23e-d2d33c0231a9" />
102+
103+
1. Commit the `.github/copilot-instructions.md` file to the `main` branch and push it to GitHub.
104+
105+
1. Wait for Mona to prepare the next step!
106+
107+
<details>
108+
<summary>Having trouble? 🤷</summary><br/>
109+
110+
- The `.github/copilot-instructions.md` file should be at the root of the `.github` folder
111+
- Make sure you committed and pushed the changes.
112+
113+
</details>

.github/steps/2-step.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
## Step 2: File-Specific Instructions
2+
3+
With the general project instructions ready, you realize you need more specific formatting rules related to just the assignments. While your repository-wide instructions work great for general coding standards, you don't want to clutter them with detailed assignment structure requirements that get included in every chat message.
4+
5+
You want to make sure all your assignments follow the same pattern and structure so students have a consistent experience, but these rules should only apply when working on assignment files.
6+
7+
### 📖 Theory: Custom Instruction Files
8+
9+
Instruction files (`*.instructions.md`) provide Copilot targeted guidance for specific files or directories in your project.
10+
11+
Unlike repository-wide instructions that apply everywhere, these files use the `applyTo` field in the [frontmatter](https://jekyllrb.com/docs/front-matter/) using [glob syntax](https://code.visualstudio.com/docs/editor/glob-patterns) to target specific files. This automatically applies the instructions whenever Copilot works on files matching that pattern. Alternatively, you can manually attach instructions using the **Add Context** button in Copilot Chat.
12+
13+
Visual Studio Code will look for `*.instructions.md` files in `.github/instructions/` directory by [default](vscode://settings/chat.instructionsFilesLocations).
14+
15+
> [!TIP]
16+
> Instructions should focus on **HOW** a task should be done - describing the guidelines, standards, and conventions used in that particular part of the codebase
17+
18+
See the [VS Code Docs: Custom Instructions](https://code.visualstudio.com/docs/copilot/copilot-customization#_custom-instructions) page for more information.
19+
20+
### ⌨️ Activity: Create Assignment-Specific Instructions
21+
22+
Now let's create targeted instructions specifically for assignment files to ensure they follow consistent structure and formatting.
23+
24+
1. First, let's examine the existing assignment template. Open `templates/assignment-template.md` to see the structure we want all assignments to follow.
25+
26+
1. Create a new file called `.github/instructions/assignments.instructions.md`
27+
28+
1. Add the following content to define assignment formatting standards. It will also ensure they are automatically applied for every chat request to Markdown (`.md`) files in `assignments` directory.
29+
30+
```markdown
31+
---
32+
applyTo: "assignments/**/*.md"
33+
---
34+
35+
# Assignment Markdown Structure Guidelines
36+
37+
All assignment markdown files should follow these guidelines:
38+
39+
## 1. Template Usage
40+
41+
- Assignment markdown files must follow the structure in [`templates/assignment-template.md`](../../templates/assignment-template.md).
42+
- The assignment must be created as a `README.md` file
43+
- Do not remove or skip required sections from the template.
44+
45+
## 2. Section Guidance
46+
47+
The section headers should reflect the structure in the template, including the exact icon usage.
48+
49+
- **Title**: Replace `[Assignment Title]` with a short, descriptive name (e.g., `Python Basics`, `Loops and Conditionals`, `Functions and Modules`).
50+
- **Objective**: Write 1-2 sentences summarizing what the student will learn or accomplish. Focus on the main skills or concepts.
51+
- **Tasks**: For each task:
52+
- Use a specific, action-oriented task name
53+
- In the Description, clearly state what the student must do.
54+
- In Requirements, use bullet points to list the expected outcomes or features. Be specific and measurable
55+
- Provide example input/output in code blocks if helpful.
56+
57+
Do not include extra sections unless explicitly specified.
58+
```
59+
60+
### ⌨️ Activity: Test the Assignment Instructions
61+
62+
1. Open the file `assignments/games-in-python/README.md` in VS Code. This assignment doesn't match all the conventions you've setup as a teacher.
63+
64+
1. Take a moment to review the current structure of this assignment file. Notice how it differs from the template structure you examined earlier. You can also view how it currently appears on the **Site Preview** tab.
65+
66+
1. With the assignment file open, ask Copilot in `Agent` mode to update the assignment structure:
67+
68+
> ![Static Badge](https://img.shields.io/badge/-Prompt-text?style=social&logo=github%20copilot)
69+
>
70+
> ```prompt
71+
> Update this assignment file to follow the project standards and template structure
72+
> ```
73+
74+
1. Observe how Copilot references the general project instructions and the assignment specific instruction files.
75+
76+
<img width="492" height="376" alt="screenshot of Copilot chat showing attached references" src="https://github.com/user-attachments/assets/dbf26be3-5940-4619-af4e-0a4380f16494" />
77+
78+
1. Compare the suggested changes with the original file structure to see how Copilot applied your instructions. Apply the suggested changes and check how the updated assignment now appears on the **Site Preview**.
79+
80+
1. Commit both files to the `main` branch and push your changes to GitHub.
81+
82+
- `.github/instructions/assignments.instructions.md`
83+
- `assignments/games-in-python/README.md`
84+
85+
1. Wait for Mona to prepare the next step!
86+
87+
<details>
88+
<summary>Having trouble? 🤷</summary><br/>
89+
90+
- Make sure you committed both files to `main` branch:
91+
- `.github/instructions/assignments.instructions.md`
92+
- `assignments/games-in-python/README.md`
93+
94+
</details>

.github/steps/3-step.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
## Step 3: Building Reusable Prompts
2+
3+
Now that you've established instructions for assignments, you want to streamline creating new assignments.
4+
5+
Creating assignments is a repetitive task and involves multiple steps, a perfect scenario for a reusable prompt!
6+
7+
- Creating the assignment
8+
- Updating the website configuration to load the new assignment
9+
10+
### 📖 Theory: Prompt Files
11+
12+
Prompt files (`*.prompt.md`) are reusable prompts to simplify common and useful tasks in your project. They are selected in Copilot Chat using slash commands (`/`).
13+
14+
They can reference other workspace files, prompt files, or instructions files by using Markdown-style links relative to the prompt file location.
15+
16+
Visual Studio Code will look for `*.prompt.md` files in `.github/prompts/` directory by [default](vscode://settings/chat.promptFilesLocations).
17+
18+
> [!TIP]
19+
> Use prompt files to define repeatable tasks and workflows.
20+
>
21+
> When writing prompts focus on **WHAT** needs to be done. You can reference instructions for the **HOW**.
22+
23+
See the [VS Code Docs: Prompt Files](https://code.visualstudio.com/docs/copilot/copilot-customization#_prompt-files-experimental) page for more information.
24+
25+
### ⌨️ Activity: Create an Assignment Prompt
26+
27+
Now let's create a reusable prompt that automates the entire assignment creation process. This is perfect for a prompt file because creating assignments involves multiple repetitive steps that follow the same pattern every time - exactly the kind of workflow that benefits from automation.
28+
29+
1. Create a new file called `.github/prompts/new-assignment.prompt.md`
30+
31+
1. Add the following content to create a comprehensive assignment generation prompt:
32+
33+
```markdown
34+
---
35+
mode: agent
36+
description: Create a new programming homework assignment
37+
---
38+
39+
# Create New Programming Assignment
40+
41+
Your goal is to generate a new homework assignment for the Mergington High School students.
42+
43+
## Step 1: Gather Assignment Information
44+
45+
If not already provided by the user, ask what the assignment will be about.
46+
47+
## Step 2: Create Assignment Structure
48+
49+
1. Create a new directory in the `assignments` folder with a unique name based on the assignment topic
50+
1. Create a new file in the directory named `README.md` with the structure from the [assignment-template.md](../../templates/assignment-template.md) file
51+
1. Fill out the assignment details in the README file
52+
1. (Optional) Add starter code or attachments if the assignment needs them - add these files to the same assignment folder
53+
54+
## Step 3: Update Website Configuration
55+
56+
Update the assignments list in [config.json](../../config.json) website configuration file to include the new assignment. For the dueDate field, use the current date plus 7 days unless specified otherwise.
57+
```
58+
59+
### ⌨️ Activity: Test the Assignment Prompt
60+
61+
1. Open Copilot Chat in VS Code and ensure you're in `Agent` mode.
62+
63+
1. Run your prompt by typing `/new-assignment` in the chat input. There are 2 options:
64+
65+
- Type just `/new-assignment` without a description. Copilot will ask what the assignment should be about.
66+
- Include the topic directly: `/new-assignment Building REST APIs with FastAPI framework`
67+
68+
<details>
69+
<summary>💡 Assignment Topic Ideas</summary>
70+
71+
```text
72+
Python Text Processing - working with strings, file I/O, and text manipulation
73+
```
74+
75+
```text
76+
Data Structures in Python - lists, dictionaries, sets, and tuples
77+
```
78+
79+
```text
80+
Python Data Visualization - using matplotlib or plotly for charts and graphs
81+
```
82+
83+
```text
84+
Building REST APIs with FastAPI framework
85+
```
86+
87+
```text
88+
Statistics with Python - data analysis and statistical calculations using pandas and numpy
89+
```
90+
91+
</details>
92+
93+
1. Verify the new assignment appears in the assignments list on the website preview.
94+
95+
<details>
96+
<summary>Assignment not showing? 🔍</summary>
97+
98+
Check these items:
99+
100+
- Refresh the page.
101+
- A new directory was created in `assignments/`.
102+
- The `config.json` file was updated with the new assignment.
103+
104+
</details>
105+
106+
1. Review the generated assignment content to ensure it matches your established conventions.
107+
108+
1. Commit and push your changes:
109+
110+
- The new prompt file: `.github/prompts/new-assignment.prompt.md`
111+
- The generated assignment directory and files.
112+
- Updated `config.json` configuration.
113+
114+
1. Wait for Mona to prepare the next step!
115+
116+
<details>
117+
<summary>Having trouble? 🤷</summary><br/>
118+
119+
- Make sure the prompt file is in the `.github/prompts/` directory with the `.prompt.md` extension.
120+
121+
</details>

0 commit comments

Comments
 (0)