|
| 1 | +--- |
| 2 | +id: course-github-copilot |
| 3 | +type: course |
| 4 | +title: Hands-on with GitHub Copilot |
| 5 | +summary: The verified Python workflow — task contract, bounded change, objective verify.py evidence — taught hands-on with GitHub Copilot in VS Code, where the Agent role runs the loop and you supervise permissions, instructions files, and diffs. |
| 6 | +lang: en-US |
| 7 | +content_version: 1 |
| 8 | +status: reviewed |
| 9 | +reviewed_on: 2026-10-11 |
| 10 | +badge: |
| 11 | + id: course-github-copilot |
| 12 | + name_en: Reproduce with Copilot in the loop |
| 13 | + name_zh: Copilot 协同复现 |
| 14 | + requires: All five checkpoints claimed (L01–L05) |
| 15 | +course_id: course-github-copilot |
| 16 | +--- |
| 17 | + |
| 18 | +# Hands-on with GitHub Copilot |
| 19 | + |
| 20 | +> TL;DR: open VS Code with GitHub Copilot signed in, optionally install the |
| 21 | +> FlyPython Skill, and let the agent fetch this course — lesson 1 walks you |
| 22 | +> through all three steps and you download nothing. Open the Chat view, |
| 23 | +> pick the **Agent** role, and say **"start lesson 1"**. You finish with a |
| 24 | +> working report tool, a reproducible pass/fail command, and the Copilot |
| 25 | +> workflow: Agent/Plan/Ask roles, manual permissions, `.github` instructions |
| 26 | +> files, checkpoints, and diff review. The exercise core is the same one the |
| 27 | +> Claude Code, Codex, and Cursor courses use — only the tool you drive |
| 28 | +> changes. |
| 29 | +
|
| 30 | +## What you build |
| 31 | + |
| 32 | +A small Python report tool that reads messy real-world data (CSV or JSON), |
| 33 | +isolates invalid rows instead of crashing, aggregates valid rows, and writes |
| 34 | +its report atomically. Three scenario "skins" ship with the course so you can |
| 35 | +practice on a domain you recognize: |
| 36 | + |
| 37 | +| Skin | You are… | Data | |
| 38 | +| --- | --- | --- | |
| 39 | +| `scenario/excel-report/` | turning a weekly orders export into a region summary | `orders.csv` | |
| 40 | +| `scenario/data-monitor/` | checking service latency numbers from your servers | `metrics.csv` | |
| 41 | +| `scenario/api-tool/` | summarizing ticket data pulled from an internal API | `tickets.json` | |
| 42 | + |
| 43 | +All three run through the same code and the same tests. The skills — |
| 44 | +contracts, error isolation, rounding, atomic writes, verification — are the |
| 45 | +actual product; the skins just make them concrete. |
| 46 | + |
| 47 | +## Teaching contract (read this first, agent) |
| 48 | + |
| 49 | +If you are GitHub Copilot teaching this course, follow these rules: |
| 50 | + |
| 51 | +- **Audience:** a project owner who already has Copilot in their editor — |
| 52 | + often through work — and uses it for completions or chat, but has not |
| 53 | + yet trusted the agent to change a project end to end. Not a Python |
| 54 | + beginner tutorial; not a prompt-engineering course. |
| 55 | +- **Prerequisites:** Python 3.11+ on PATH, VS Code installed, and a GitHub |
| 56 | + account signed in to GitHub Copilot in VS Code. No packages to install — |
| 57 | + the course is standard library only. Whether the Copilot Free plan's |
| 58 | + monthly chat request allowance lasts the whole course is unverified at |
| 59 | + authoring time — see `REVIEW.md`. |
| 60 | +- **Tool:** authored against VS Code 1.134 with GitHub Copilot, as |
| 61 | + documented at code.visualstudio.com/docs/copilot (fetched 2026-10-11): |
| 62 | + the Chat view with the Copilot session target, the Agent/Plan/Ask roles, |
| 63 | + the Manual permissions / Allow all permission levels, Folder vs. New |
| 64 | + Worktree code isolation, `.github/copilot-instructions.md` and |
| 65 | + `.github/instructions/*.instructions.md` (`applyTo` front matter), |
| 66 | + Agent Skills in `.github/skills/`, and checkpoints. A live teaching |
| 67 | + run-through is pending — `REVIEW.md` records what has and has not been |
| 68 | + exercised. A VS Code or Copilot major change to these surfaces triggers a |
| 69 | + course re-review. |
| 70 | +- **Lesson order:** L01 → L02 → L03 → L04 → L05, one lesson per session. |
| 71 | + Never skip the checkpoint at the end of a lesson. |
| 72 | +- **Teaching style:** work from the files in this folder, not from general |
| 73 | + knowledge. Quote the exact contract line you are satisfying. Make the |
| 74 | + smallest change that moves a test from red to green. Never add |
| 75 | + dependencies, never edit `solution/`, and ask before touching any file |
| 76 | + not named in the current lesson. Keep the learner on **Manual |
| 77 | + permissions** — every edit and command waits for their approval. Read |
| 78 | + `AGENTS.md` in the repository root if one exists — Copilot reads it too. |
| 79 | +- **When to stop:** a lesson is done when its checkpoint command runs and |
| 80 | + the learner can say, in their own words, what failed and why. If the |
| 81 | + learner cannot, re-teach from the failing test, not from the solution. |
| 82 | +- **How to use `verify.py`:** the learner's command is plain |
| 83 | + `python verify.py` — it runs the suites, prints per-checkpoint status |
| 84 | + and earned claim codes, and exits non-zero while the gated checkpoints |
| 85 | + (l03, l04) are still open. `starter --expect-failure` and `solution` |
| 86 | + remain maintainer checks. "Done" means the default command shows every |
| 87 | + gate `[passed]` after the learner's bounded change. |
| 88 | +- **Honesty rules:** say what you did not verify. Do not claim the code is |
| 89 | + production-ready. Do not promise learning or career outcomes. |
| 90 | + |
| 91 | +## What this course does NOT cover |
| 92 | + |
| 93 | +Copilot plans and pricing, model selection, inline completions, the Copilot |
| 94 | +cloud agent on GitHub.com, Copilot code review on pull requests, MCP setup, |
| 95 | +organization policies, or selling anything. For those, the companion |
| 96 | +repository has guides and playbooks — link, don't improvise. |
| 97 | + |
| 98 | +## Badge contract |
| 99 | + |
| 100 | +- Badge: **Reproduce with Copilot in the loop Badge** (badge id `course-github-copilot`) — earned by claiming all five checkpoints. |
| 101 | +- Challenges: L01–L05 checkpoints, 10 points each; +50 course-badge bonus when all five are claimed on flypython.com. |
| 102 | +- Evidence: `python verify.py` — L03 (bounded change) and L04 (verify & review) are objectively gated by the suite; L01/L02/L05 are learner-attested. |
| 103 | +- Submission: each test-passed checkpoint prints a deterministic claim code; a reflection checkpoint prints one only after you answer its questions and run `python verify.py --attest ID`; record it on flypython.com against your account. Self-reported evidence, never a certificate. |
| 104 | + |
| 105 | +## Folder map |
| 106 | + |
| 107 | +``` |
| 108 | +COURSE.md / COURSE_cn.md this file (EN / 中文) |
| 109 | +lessons/L01.md … L05.md lessons (each has an _cn.md pair) |
| 110 | +scenario/<skin>/ data files and scenario.json per skin |
| 111 | +TASK.md / TASK_cn.md the task contract the change must satisfy |
| 112 | +starter/report_tool.py the deliberately unfinished implementation |
| 113 | +solution/report_tool.py the reviewed solution (do not copy in lesson 3) |
| 114 | +tests/test_report_tool.py the contract suite (read-only) |
| 115 | +verify.py objective pass/fail evidence |
| 116 | +REVIEW.md maintainer run-through record |
| 117 | +``` |
| 118 | + |
| 119 | +## Evidence and licensing |
| 120 | + |
| 121 | +The course folder is reviewed content: `REVIEW.md` records the last |
| 122 | +run-through with dates, tool versions, and observed deviations. Code in this |
| 123 | +folder is MIT-licensed; lesson prose is CC BY 4.0 (see repository `LICENSE`). |
| 124 | +Report teaching drift or unclear lessons via the repository's |
| 125 | +`course-feedback` issue form. |
0 commit comments