Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
93f81ce
Updating gramatical errors
Whowong Nov 29, 2023
8ddaa07
Merge branch 'microsoft:master' into master
Whowong Jan 20, 2024
5431b80
Merge branch 'microsoft:master' into master
Whowong Oct 4, 2024
452411e
Merge branch 'microsoft:master' into master
Whowong Oct 28, 2024
cf3c564
Create .devcontain.json
Whowong Oct 28, 2024
a4bd57a
rename devcontainer file properly
Whowong Oct 28, 2024
f83a0c1
Rename .devcontainer.json to devcontainer.json
Whowong Oct 28, 2024
2dc1448
Merge branch 'microsoft:master' into master
Whowong Nov 14, 2024
6852ce0
Update README.md
Whowong Feb 4, 2025
dfad661
Merge branch 'microsoft:master' into master
Whowong Oct 17, 2025
247781d
Merge branch 'master' of https://github.com/Whowong/WhatTheHack
Whowong Dec 2, 2025
315bae2
Merge branch 'master' of https://github.com/Whowong/WhatTheHack
Whowong Dec 30, 2025
eca08a4
Merge branch 'microsoft:master' into master
Whowong Jan 23, 2026
f627a92
Merge branch 'microsoft:master' into master
Whowong Feb 17, 2026
b4449bf
Merge branch 'master' of https://github.com/Whowong/WhatTheHack
Whowong Jun 3, 2026
e9c1fa1
Created WhatTheHack template stub
Jun 3, 2026
908b3e6
Initial Commit
Whowong Jun 3, 2026
e7a1ab4
Refine README for clarity on prerequisites and challenges
Whowong Jun 3, 2026
af190a2
Update to follow guidelines
Whowong Jun 3, 2026
33d0e22
removing less steps
Whowong Jun 3, 2026
18887e4
Update Challenge-02.md
Whowong Jun 3, 2026
d944723
Update Challenge-04.md
Whowong Jun 3, 2026
9a22d2f
Update Challenge-05.md
Whowong Jun 3, 2026
368d77d
Removing duplicate template from challenges
Whowong Jun 10, 2026
3a5188e
Updating challenge 3
Whowong Jun 10, 2026
6f86dda
feat(challenge-05): Replace spec-first with Spec Kit hands-on workflow
AndressaSiqueira Jun 11, 2026
4f3f699
Restructure Challenge-05 to compare ad-hoc vs Spec Kit approaches
AndressaSiqueira Jun 19, 2026
187f9bc
Simplify Challenge 05 to notes app with 2 requirements, remove sample…
AndressaSiqueira Jun 19, 2026
f4ac8b9
Merge pull request #28 from Whowong/ansiqueira/challenge-05
AndressaSiqueira Jun 19, 2026
5b9295c
Merge branch 'microsoft:master' into xxx-GitHubCopilotCostOptimization
devanshithakar12 Jun 19, 2026
463ee77
initial starter code for challenge 2
devanshithakar12 Jun 19, 2026
2c1949d
initial solutions guide for challenge 2
devanshithakar12 Jun 19, 2026
99ecb92
Updating challenge numbes after shifting spec driven down to 1
Whowong Jun 19, 2026
5be6e46
Build Challenge 03: Model Selection & Output Constraints
Jun 26, 2026
a71907d
Redesign Challenge 03: car-wash reasoning task, base/premium terminology
ana-codes-1 Jun 29, 2026
0ee4baf
Merge branch 'microsoft:master' into xxx-GitHubCopilotCostOptimization
devanshithakar12 Jun 30, 2026
b66336e
added a more bloated instructions file and updated events files
devanshithakar12 Jun 30, 2026
850b216
Merge branch 'xxx-GitHubCopilotCostOptimization' of https://github.co…
devanshithakar12 Jun 30, 2026
cd52431
Create sales.csv
Whowong Jul 1, 2026
97f73c3
Adding devcontainer files
Whowong Jul 1, 2026
a998930
Updated to install spec kit
Whowong Jul 1, 2026
7948ddd
updated to smaller container
Whowong Jul 1, 2026
77fcc99
Add open-ended pickleball planning task to Challenge 03
ana-codes-1 Jul 9, 2026
0f3ae9d
restructured the Challenge-02.md file with latest instructions for th…
devanshithakar12 Jul 10, 2026
afb10ec
Update Challenge-04.md
Whowong Jul 10, 2026
ccfe0e5
Update Challenge-05.md
Whowong Jul 10, 2026
8e59922
Update Challenge-05.md
Whowong Jul 10, 2026
273f4fb
Update Challenge-05.md
Whowong Jul 10, 2026
c4ccad6
Update Challenge-05.md
Whowong Jul 10, 2026
0b5268b
Replace car wash hard task with open-ended pickleball planning task
ana-codes-1 Jul 24, 2026
37e86ca
Revise Challenge 01 for clarity and structure
AndressaSiqueira Aug 7, 2026
fa3ac3e
Remove additional challenge from Challenge-01.md
AndressaSiqueira Aug 7, 2026
68c5eaa
Revise Challenge 01 Coach's Guide for clarity
AndressaSiqueira Aug 24, 2026
c9d0353
Add contributors to README.md
Whowong Aug 31, 2026
b07aca3
Updating number to 076
Whowong Aug 31, 2026
63cb8fd
updating hack number
Whowong Aug 31, 2026
a4765a9
Adding wordlist
Whowong Aug 31, 2026
7c76344
fixing spelling
Whowong Aug 31, 2026
b69a594
Updating for spellcheck
Whowong Aug 31, 2026
84c2141
Update .wordlist.txt
Whowong Aug 31, 2026
958e973
Potential fix for pull request finding
Whowong Aug 31, 2026
4dc1ce6
Fix for keeping the events updated
devanshithakar12 Aug 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "076-GitHubCopilotCostOptimization",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"workspaceFolder": "/workspace/076-GitHubCopilotCostOptimization/Student/Resources",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"hostRequirements": {
"cpus": 2
},
"features": {
"ghcr.io/devcontainers/features/python:1": { "version": "3.12" }
},
"customizations": {
"vscode": {
"extensions": [
"github.copilot",
"github.copilot-chat",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
},
"codespaces": {
"openFiles": [
"076-GitHubCopilotCostOptimization/Student/Resources/README.md"
]
}
},
"postCreateCommand": "curl -LsSf https://astral.sh/uv/install.sh | sh && ~/.local/bin/uv tool install specify-cli --from git+https://github.com/github/spec-kit.git",

"forwardPorts": [3000],
"portsAttributes": {
"3000": {
"label": "CityScout NYC App",
"onAutoForward": "notify"
}
}
}
32 changes: 32 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
{
"name" : "DevOps with GitHub WTH in Codespaces",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/dotnet:0-6.0",
"workspaceFolder": "/workspace/031-DevOpsWithGitHub",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"features": {
"ghcr.io/devcontainers/features/azure-cli:1": {
"installBicep": true,
"version": "latest"
}
}

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [5000, 5001],
// "portsAttributes": {
// "5001": {
// "protocol": "https"
// }
// }

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "dotnet restore",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "076-GitHubCopilotCostOptimization",
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"workspaceFolder": "/workspace/076-GitHubCopilotCostOptimization/Student/Resources",
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
Comment thread
Whowong marked this conversation as resolved.
"hostRequirements": {
"cpus": 2
},
"features": {
"ghcr.io/devcontainers/features/python:1": { "version": "3.12" }
},
"customizations": {
"vscode": {
"extensions": [
"github.copilot",
"github.copilot-chat",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
},
"codespaces": {
"openFiles": [
"076-GitHubCopilotCostOptimization/Student/Resources/README.md"
]
}
},
"postCreateCommand": "curl -LsSf https://astral.sh/uv/install.sh | sh && ~/.local/bin/uv tool install specify-cli --from git+https://github.com/github/spec-kit.git",

"forwardPorts": [3000],
"portsAttributes": {
"3000": {
"label": "CityScout NYC App",
"onAutoForward": "notify"
}
}
}
32 changes: 32 additions & 0 deletions 076-GitHubCopilotCostOptimization/.wordlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
UBB
SDD
completable
Unoptimized
mathrm
tokenization
backoff
invalidations
subtask
Linters
applyTo
CityScout
runnable
Monotonicity
Andressa
Siqueira
Nefedova
discoverable
checkable
pickleball
breakpoint
differentiator
selectable
NYCApp
geolocation
unmanaged
useEffect
useState
YYYY
priceLevel
bestFor
walkability
Binary file not shown.
131 changes: 131 additions & 0 deletions 076-GitHubCopilotCostOptimization/Coach/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# What The Hack - GitHub Copilot Cost Optimization - Coach Guide

## Introduction

Welcome to the coach's guide for the GitHub Copilot Cost Optimization What The Hack. Here you will find links to specific guidance for coaches for each of the challenges.

This hack teaches teams to maximize code quality while minimizing GitHub Copilot credit spend under usage-based billing (UBB). The focus is on practical engineering techniques: context engineering, model selection, session hygiene, and spec-driven development.

**NOTE:** If you are a Hackathon participant, this is the answer guide. Don't cheat yourself by looking at these during the hack! Go learn something. :)

## Coach's Guides

- Challenge 00: **[Prerequisites & Baseline](./Solution-00.md)**
- Set up the hack environment and establish baseline credit spend measurements
- Challenge 01: **[Spec-Driven Development](./Solution-01.md)**
- Leverage deterministic controls as token controls
- Challenge 02: **[Context Engineering](./Solution-02.md)**
- Optimize instruction architecture and attachment precision
- Challenge 03: **[Model Selection & Output Constraints](./Solution-03.md)**
- Compare models and apply output constraints to reduce costs
- Challenge 04: **[Session Configuration (Tools + Cache)](./Solution-04.md)**
- Manage MCP tool sprawl and understand cache invalidation
- Challenge 05: **[Context Window Management](./Solution-05.md)**
- Use /compact proactively to maintain quality and control costs
- Challenge 06: **[Token Golf Competition](./Solution-06.md)**
- Competitive coding challenge optimizing for lowest credit spend

## Coach Prerequisites

This hack has pre-reqs that a coach is responsible for understanding and/or setting up BEFORE hosting an event. Please review the [What The Hack Hosting Guide](https://aka.ms/wthhost) for information on how to host a hack event.

The guide covers the common preparation steps a coach needs to do before any What The Hack event, including how to properly configure Microsoft Teams.

### Student Resources

Before the hack, it is the Coach's responsibility to download and package up the contents of the `/Student/Resources` folder of this hack into a "Resources.zip" file. The coach should then provide a copy of the Resources.zip file to all students at the start of the hack.

The Student/Resources folder should contain:

- **Starter codebase** with intentionally sub-optimal GitHub Copilot configuration:
- Bloated `.github/copilot-instructions.md` (~1500 tokens) for Challenge 02
- Multiple MCP tools enabled (some unnecessary) for Challenge 04
- Sample code with opportunities for spec-first vs. trial-and-error comparison
- **Baseline coding task** (baseline-task.md) for Challenge 00
- **Model selection prompts + measurement template** (`Challenge-03-ModelSelection/`) for Challenge 03
- **Token Golf task specification** for Challenge 06 with acceptance criteria

Always refer students to the [What The Hack website](https://aka.ms/wth) for the student guide: [https://aka.ms/wth](https://aka.ms/wth)

**NOTE:** Students should **not** be given a link to the What The Hack repo before or during a hack. The student guide does **NOT** have any links to the Coach's guide or the What The Hack repo on GitHub.

### Additional Coach Prerequisites

**Coach must complete Challenge 06 (Token Golf) before the hack:**

- Complete the Token Golf coding task yourself to establish "par" score
- Document your credit spend and techniques used
- This "par" becomes the benchmark teams compete against

**Prepare measurement tools:**

- Verify token visibility in VS Code Output panel (GitHub Copilot Chat)
- Test access to GitHub Copilot usage dashboard

## Azure Requirements

This hack does not require Azure resources. All work is done locally with GitHub Copilot in Visual Studio Code.

## Suggested Hack Agenda

This hack can be delivered as a half-day or full-day event:

### Half-Day Format (4 hours)
- Challenge 00: Prerequisites & Baseline (30 minutes)
- Challenge 01: Spec-Driven Development (45 minutes)
- Challenge 02: Context Engineering (45 minutes)
- Challenge 03: Model Selection & Output Constraints (45 minutes)
- Challenge 04: Session Configuration (30 minutes)
- Challenge 06: Token Golf Competition (45 minutes)

### Full-Day Format (6-7 hours)
- Challenge 00: Prerequisites & Baseline (45 minutes)
- Challenge 01: Spec-Driven Development (60 minutes)
- Challenge 02: Context Engineering (60 minutes)
- Break (15 minutes)
- Challenge 03: Model Selection & Output Constraints (60 minutes)
- Challenge 04: Session Configuration (45 minutes)
- Challenge 05: Context Window Management (45 minutes)
- Break (15 minutes)
- Challenge 06: Token Golf Competition (60 minutes)
- Debrief & Winning Strategies (30 minutes)

## Repository Contents

- `./Coach`
- Coach's Guide and related files
- `./Coach/Solutions`
- Solution files with example measurements and techniques for each challenge
- `./Student`
- Student's Challenge Guide
- `./Student/Resources`
- Starter codebase, baseline task, Token Golf specification (Must be packaged up by the coach and provided to students at start of event)

- Azure resources that will be consumed by a student implementing the hack's challenges
- Azure permissions required by a student to complete the hack's challenges.

## Suggested Hack Agenda (Optional)

_This section is optional. You may wish to provide an estimate of how long each challenge should take for an average squad of students to complete and/or a proposal of how many challenges a coach should structure each session for a multi-session hack event. For example:_

- Sample Day 1
- Challenge 1 (1 hour)
- Challenge 2 (30 mins)
- Challenge 3 (2 hours)
- Sample Day 2
- Challenge 4 (45 mins)
- Challenge 5 (1 hour)
- Challenge 6 (45 mins)

## Repository Contents

_The default files & folders are listed below. You may add to this if you want to specify what is in additional sub-folders you may add._

- `./Coach`
- Coach's Guide and related files
- `./Coach/Solutions`
- Solution files with completed example answers to a challenge
- `./Student`
- Student's Challenge Guide
- `./Student/Resources`
- Resource files, sample code, scripts, etc meant to be provided to students. (Must be packaged up by the coach and provided to students at start of event)
76 changes: 76 additions & 0 deletions 076-GitHubCopilotCostOptimization/Coach/Solution-00.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Challenge 00 - Prerequisites & Baseline - Coach's Guide

**[Home](./README.md)** - [Next Solution >](./Solution-01.md)

## Notes & Guidance

This challenge establishes the measurement baseline that all subsequent challenges compare against. Students must be able to track credit consumption accurately before they can optimize.

### Key Concepts to Explain

**Usage-Based Billing (UBB) Fundamentals:**
- Credit cost = (input tokens × input rate) + (output tokens × output rate)
- Different models have different rates (Sonnet/GPT-4 class vs. Haiku class can be 10x difference)
- VS Code Output panel shows token breakdowns per interaction
- GitHub Copilot usage dashboard shows cumulative spend

**Baseline Purpose:**
- Establishes "before" measurement for all optimization techniques
- Students should use their natural workflow—no optimization yet
- Document approach (inline completions, chat frequency, workspace references used)
- This baseline will likely be inefficient—that's intentional

### Common Blockers

**UBB Not Enabled:**
- Some organizations may still be on seat-based billing
- Students need admin access or must coordinate with billing admin
- Workaround: Coach can provide sample baseline data if UBB isn't available

**Token Visibility Issues:**
- VS Code Output panel must be configured to show GitHub Copilot Chat logs
- Some students may not see token counts if using older Copilot extension version
- Solution: Update GitHub Copilot extension to latest version

**Baseline Task Selection:**
- Task should be non-trivial (10-20 minutes of development)
- Task should be completable in multiple ways (leaves room for optimization)
- Suggested baseline tasks:
- Implement a REST API endpoint with validation and error handling
- Add authentication middleware to an existing service
- Refactor a module to use dependency injection

### Expected Time

45 minutes total:
- 15 minutes: Environment setup and UBB verification
- 20 minutes: Complete baseline coding task
- 10 minutes: Document measurements and approach

### Success Criteria Validation

Students should demonstrate:
- Screenshot or screen share of VS Code Output panel showing token counts
- Screenshot of GitHub Copilot usage dashboard showing current credit balance
- Completed baseline task code (doesn't need to be perfect)
- Written documentation: total credits consumed, features used, approach taken

### Hints to Share

- Don't optimize yet! Use your natural workflow
- Document everything—this is your "before" picture
- If credits seem surprisingly high, that's normal and expected
- Track not just total credits, but which interactions cost the most
- Note: inline completions are typically much cheaper per-interaction than chat/edits

### Reference Measurements

Typical baseline measurements for a 15-20 minute coding task:
- Unoptimized: 50-80 credits (using GPT-4 class model, verbose chat, broad references)
- Expected after optimization: 10-20 credits (targeted instructions, efficient model, pinned attachments)

### Additional Resources for Coach

- Ensure Resources.zip contains `baseline-task.md` with clear requirements
- Consider providing a reference completion for teams that get stuck
- Have sample token breakdowns ready to share if students can't see theirs
Loading
Loading