Hackathon cheat sheetGitHub Copilot CLI

Vibe Coding an App with GitHub Copilot CLI Tobias & Jeffrey · live-build session
Grounded in docs.github.com/en/copilot/how-tos/copilot-cli
Vibe coding: describe the outcome, let Copilot plan it, steer while it works, make it prove the result.

Get running in 5 minutes

# pick one
npm install -g @github/copilot   # Node 22+
winget install GitHub.Copilot    # Windows
brew install --cask copilot-cli  # mac/Linux

cd my-project && copilot
copilot -sp "..."   # one-shot, response only
copilot --continue  # resume last session
/loginOAuth device flow — first run only
trustConfirm you trust this folder (opt 2 remembers)
/initWrite .github/copilot-instructions.md

The loop that works

explore→plan→review→implement→verify→commit
explore“Read the auth files but don't write code yet”
plan/plan Add OAuth2 with Google + GitHub
reviewPush back on the plan · Ctrl+Y to edit it
build“Proceed with the plan” / /fleet
verify/diff — read it yourself — then run the tests
acceptUse the feature by hand. Green tests ≠ working demo
commit“Commit with a descriptive message”

Don't skip verify. The agent that wrote the code will happily weaken a test to make it pass. Keep this line handy:

Don't weaken tests or change the acceptance criteria
to make things pass. Separate pre-existing failures
from ones you introduced. Show the diff, then stop.
  • One goal per session. /clear between unrelated tasks. Attach reality: @file, #123, screenshots (Ctrl+V).
  • Commit at every green state — cheapest escape hatch you have.

Init — teach the repo to Copilot

/init analyses the codebase and writes .github/copilot-instructions.md: build/test/lint commands, architecture, conventions. If it exists, it proposes improvements.

All merged: .github/copilot-instructions.md (repo) · .github/instructions/**/*.instructions.md + applyTo: glob (path-scoped) · AGENTS.md · ~/.copilot/copilot-instructions.md (you).

/instructions lists & toggles them. Keep them short and non-conflicting — edits apply on the next session.

Planning — highest-value habit

Shift+Tab cycles standard → plan → autopilot, or run /plan GOAL.

In plan mode Copilot analyses the repo, asks clarifying questions, writes a checklist to plan.md, and waits for your approval before touching code.

Plan it: multi-file changes, refactors, new features. Skip it: quick bug fixes, single-file edits, questions.

/session plan shows the current plan · Ctrl+Y opens it in your editor.

Steering — keep it on track

  • Just type while it's thinking. Mid-turn input is steering — it lands in the work already in flight. (Ctrl+Q is different: it holds a message until the turn ends.)
  • Rejecting a permission? Pick “No, and tell Copilot what to do differently” and say what you want instead.
  • Esc cancels · Esc Esc interrupts the turn.
  • /undo (/rewind) rewinds the last turn and reverts file changes. It restores your whole workspace to the snapshot — your own manual edits are reverted too, and files created since are deleted whatever their Git status. Commit first.
  • /compact focus on the auth module steers what survives summarisation.

MCP — new tools

The GitHub MCP server is built in. Add others to reach browsers, APIs, DBs, docs.

copilot mcp add playwright -- npx @playwright/mcp@latest
copilot mcp add --transport http notion https://mcp.notion.com/mcp

In-session /mcp add opens a form — Ctrl+S to save, live immediately. Then /mcp list|edit|delete|enable|disable|auth.

Config: ~/.copilot/mcp-config.json (personal) · .mcp.json (local, closest wins) · .github/mcp.json (commit this one).

.vscode/mcp.json is not read by the CLI. Project servers load only after folder trust. Find servers at github.com/mcp

Skills — how to do a job

A folder with a SKILL.md (+ optional scripts) loaded only when relevant, so it doesn't burn context every turn.

.github/skills/pr-review/SKILL.md
---
name: pr-review
description: Review checklist. Use when asked to
  review changes before opening a PR.
---

Project .github/skills/ · Personal ~/.copilot/skills/ · /skills list|info|add|reload|remove. Invoke explicitly: Use the /pr-review skill. Ready-made: awesome-copilot.github.com/skills

Instructions = always-on conventions. Skills = situational playbooks.

Custom agents — specialists

Markdown profiles in .github/agents/NAME.agent.md. Fastest route: /agent → Create new agent → describe it in plain English → restart the CLI. Use via the picker, by name, or copilot --agent NAME.

Subagents — their own context

The main agent hands work to another agent — built-in or one of yours. Each gets a separate context window, so the subtask's noise never reaches your thread; only the result does. Copilot picks one from your prompt, or name it: Use the explore agent to map how auth flows.

exploreRead-only search. Changes nothing → runs in parallel
taskTests, builds, linters — full output only on failure
general-purposeAnything the main agent does, in its own context
code-reviewBugs & security in diffs, never style
researchDeep research — only via /research
rubber-duckSecond opinion, different model

Context is your scarcest resource — subagents protect it.

Fleet & Tasks — go parallel

/fleet [PROMPT] runs many subagents at once. Only worth it on an approved plan with genuinely independent steps: plan mode → iterate → pick “Accept plan and build on autopilot + /fleet”, or type /fleet implement the plan.

/tasks monitors subagents & shell jobs: ↑↓ navigate · Enter details · k kill · r remove · Esc back.

Autopilot keeps going without asking after each step. Stops when done, blocked, on Ctrl+C, or at --max-autopilot-continues. Works best with full permissions; with limited ones it auto-denies anything needing approval and may stall. It's sticky: /settings stayInAutopilot false.

Rubber duck — second opinion

Critiques Copilot's own plans, code and tests on a different model family, so it's less likely to share the same blind spots. It never edits. Reports blocking / non-blocking / suggestions, silent on style. Auto-consulted after planning, mid-build, after tests, and after repeated failures.

Rubber duck your plan.
/rubber-duck What edge cases are missing?

Needs your session model to be Claude or GPT. Separate from /review and /security-review, which have no such restriction.

Chronicle — sessions as data

/chronicle standupReport of the last 24h (“for the last 3 days”)
/chronicle tipsTips from how you work · cost tips for spend
/chronicle improveUpgrade your copilot-instructions.md

Also /chronicle search across all history · /resume · /share.

GitHub Copilot app

Desktop app for macOS, Windows and Linux, built on Copilot CLI. Type /app to launch it or get the download link.

Parallel workspaces (each its own worktree + branch) · mode, model and reasoning effort per session · GitHub native — issue → session, open/review/merge PRs, CI results · carries over your instructions, MCP servers and skills · adds automations and canvases.

All Copilot plans. Business/Enterprise: the separate Copilot app policy must stay enabled.

Context, models & cost

Infinite sessions — context compacts automatically. Compaction summarises, so old detail can be lost: re-state the goal after a long run.

/contextToken usage breakdown
/usageSession metrics, per-model totals
/clear · /newFresh start between tasks
/limits setmax-ai-credits VALUE per response

Picking a model. Auto is the sane default; Opus-class for architecture and hard debugging, Sonnet-class for day-to-day speed. Run /model for your list — names change by plan.

Permissions & safety

Copilot asks before anything that modifies or executes. Choose: once, for the session, or no + tell it what to do instead.

copilot --allow-tool='shell(git:*)' \
        --deny-tool='shell(git push)'
copilot --allow-all   # --yolo: tools+paths+URLs
/permissions show|reset/reset-allowed-tools/allow-all/add-dir

Non-negotiables: read the diff before you merge · never commit secrets · --allow-all can delete files · treat third-party skills and MCP servers as code you're installing.

Keys & commands

Shift+Tabstandard → plan → autopilot
Esc / EscEsccancel / interrupt the turn
Ctrl+Ccancel, clear; twice = exit
@ FILE · # NUMadd a file · add an issue or PR
! CMDrun shell directly (! alone = shell mode)
Ctrl+Yedit the plan in your editor
Ctrl+Qhold a message until the turn ends
? · /helpquick help · full command list
/init/plan/fleet/tasks/rubber-duck/review/chronicle/skills/mcp/agent/model/context/undo/diff/worktree/pr/delegate/app

When it goes wrong

Hour two is where hackathons are lost. Work this top to bottom.

what changed?/diff · ! git status · ! git diff
mine or pre-existing?! git stash -u → re-run tests. Still failing = likely pre-existing. Say so.
wrong directionType the correction now, mid-turn. Don't wait.
gone too farEsc Esc to interrupt → /undo
looping on a fixTwo strikes: after 2 failed attempts stop. /clear, reopen with the error, the file, and what you ruled out.
lost the plotContext compacted — re-state goal + acceptance criteria in one message
nuke it! git reset --hard <last-good-sha> — only works if you committed

Cut scope early. Not working 60% of the way through your budget? Drop it. Say it out loud to the agent: Drop the export feature. Dashboard renders real data.

Working as a team

Two people driving agents in one checkout = conflicts and lost work. Split the surface first.

/worktreeNew worktree off HEAD, switch to it (exp.)
/moveMove uncommitted changes into a new worktree (exp.)
/forkFork the session, keeping the conversation (exp.)
/delegateSelf-contained task → cloud agent opens a PR
  • One workstream per person per worktree. Never two agents in one tree.
  • Agree interfaces before splitting — put the contract in copilot-instructions.md so every agent sees it.
  • Merge a walking skeleton early, then integrate hourly. Long branches + generated code = an unreviewable merge.
  • One person owns integration and the demo build.

Hackathon run sheet

Percentages of your budget — works for 4 hours or 2 days.

beforeInstall · /login · check repo & API access · dependencies in · baseline build green. Not event time.
first 10%Agree the demo: what's on screen at the end, 3 acceptance criteria, must-have vs. stretch. /init. Split worktrees.
next 10%Walking skeleton — riskiest integration end-to-end, stubs elsewhere. Add only the MCP servers & skills it needs. Merge it.
middle 55%Vertical slices: plan → rubber duck → build → /diff → test → commit. Interactive by default. Integrate hourly.
last 25%Scope freeze. Integrate, /review, blockers only, rehearse the demo on the real build, /pr create
wrap/chronicle standup · /chronicle improve

Reach for /fleet + autopilot only when the plan's steps are genuinely independent.

Do & don't

Do

  • Put acceptance criteria in the prompt
  • Point at real artifacts: @src/api.ts, #42, a mockup
  • Read the /diff before committing
  • Promote repeated instructions into a skill

Don't

  • One giant vague prompt
  • Unrelated tasks in one session
  • --allow-all without thinking
  • Paste secrets into prompts