Learn to steer GitHub Copilot with intentional context, planning, tests, and governance guard rails.
This repository is a set of hands-on labs designed to teach students (and teams) how to use GitHub Copilot responsibly and effectively within real-world code quality constraints. Each lab layers additional forms of context—global instructions, local artifacts, plans, tests, diagrams, decision logs—to demonstrate how they influence Copilot suggestions.
- Writing clear instruction files to shape style and architecture
- Planning-first prompting ("Do not write code yet") to reduce rework
- Test-first workflows that anchor Copilot's generations
- Refactoring duplication into small pure functions
- Reconciling conflicting constraints across docs, diagrams, and code
- Prompt snippet governance and lifecycle management
- Reflection-driven improvement habits
We emphasize:
- Functional Core: Pure functions, no hidden mutable state
- Plan Before Code: Always request and refine a plan first
- Test-First & Diff Review: Tests define success; review generated diffs
- Minimal, Intentional Prompts: Short, directive, explicit output requests
- Governance & Maintenance: Snippet lifecycle (Active / Needs Review / Deprecated)
- Reflection: Every lab ends with a
REFLECTION.mdanswered as questions
See CONTRIBUTING.md and .github/copilot-instructions.md for full guidelines.
A quick summary (see labs-index.md for details):
| Lab | Focus | Key Concepts |
|---|---|---|
| 01 | Basic Instructions | Global context shaping suggestions |
| 02 | Advanced Patterns | Structured prompts, refactoring targets |
| 03 | Integration Testing | Coverage gaps, quality gates |
| 04 | Refactoring Duplication | Pure helper extraction, DRY |
| 05 | Test-First | Tests constrain generation |
| 06 | Conflicting Constraints | Reconciliation strategies |
| 07 | Planning-First | Multi-step plan refinement |
| 08 | Snippet Governance | Lifecycle & metadata |
- Start at Lab 01 and progress sequentially.
- For each lab: Read README → Run a planning prompt → Capture the plan in
PLAN.md→ Implement → Reflect. - Apply global functional instructions consistently.
- Use prompt snippets (see
prompt-snippets/) for repeatable patterns.
plan → clarify → implement → test → diff review → reflect → improve
/.github/copilot-instructions.md Global functional & style guidance
CONTRIBUTING.md Responsible Copilot usage guard rails
labs/ Lab directories (each with README, PLAN, REFLECTION, src/)
labs-index.md Quick navigation index
prompt-snippets/ Shared prompt snippet JSON + governance policy
slides/ Intro & theory materials
| Step | Prompt Pattern | Goal |
|---|---|---|
| Plan | "Create a 5-step plan... Do not write code yet." | Elicit structure & ambiguities |
| Refine | "Clarify step 3; add edge cases." | Improve specificity |
| Implement | "Generate code per approved plan; keep pure functions." | Constrained generation |
| Test | "List edge cases for X; produce test skeletons." | Expand coverage |
| Review | "Explain diff impact in 3 bullets." | Understand changes |
| Reflect | "Summarize what worked and one improvement." | Continuous improvement |
When artifacts disagree (instructions vs diagram vs code):
- Identify conflicts explicitly
- Propose reconciliation strategies (adapt docs, refactor code, hybrid compromise)
- Implement a small, safe slice
- Record rationale in
DECISIONS.md
Prompt snippets include metadata comments (STATUS, LAST-REVIEW, OWNER). Keep them:
- Short
- Single-purpose
- Versioned via diffs
- Reviewed periodically
See labs/lab-08-prompt-snippet-governance/ and SNIPPET-GOVERNANCE.md for details.
Clone the repo, open a lab directory, and begin with the planning prompt.
git clone https://github.com/wouterfennis/copilot-lab.git
cd copilot-lab/labs/lab-01-basic-instructions
# Open README and start with a planning prompt in Copilot ChatFollow CONTRIBUTING.md. Always:
- Add or update a plan before large changes
- Keep functions small & pure when possible
- Update reflection questions after completing a lab
Licensed under the MIT License.
You are free to use, copy, modify, distribute, and sell copies of the software provided the copyright and permission notice are included.
Copyright (c) 2025 Wouter Fennis
Questions or suggestions? Open an issue or start a discussion.