**Agent mode lets the AI:**
- Read and write multiple files
- Run terminal commands
- Install packages
- Create new files and directories
**The risks:**
- May change files you didn't expect
- Terminal commands can have side effects
- Changes can cascade across the project
- Harder to review than inline edits
**Rule of thumb:** Use Agent mode for well-scoped tasks. Review the plan before letting it execute.
## Plan Mode & Simulating It
**Plan mode** (where available) asks the AI to outline its approach before making changes.
**If your tool doesn't have a dedicated Plan mode, simulate it:**
> "Before making any changes, outline what files you'll modify and what changes you'll make in each. Wait for my approval."
This simple prompt turns any chat interaction into a plan-first workflow. Practice this -- it's a professional habit.
---
# Rules Files
> Teaching the AI your project's conventions
## What Are Rules Files?
A rules file is a **plaintext file** in your project root that the AI reads every time it generates code.
Think of it as **onboarding documentation for your AI pair programmer.**
It answers: "How do we do things around here?"
## Tool-by-Tool Names
| Tool | File Name | Scope |
|---|---|---|
| **Antigravity** | `.antigravityrules` | Project root |
| **GitHub Copilot** | `.github/copilot-instructions.md` | Repository |
| **Cursor** | `.cursorrules` | Project root |
| **Claude Code** | `CLAUDE.md` | Project root + subdirectories |
| **Windsurf** | `.windsurfrules` | Project root |
Same concept, different file names. The content is similar across all tools.
## What to Include
**A good rules file covers:**
- **Tech stack** -- "This project uses Next.js 14, TypeScript, Tailwind"
- **Patterns** -- "Use server components by default, client components only when needed"
- **Naming** -- "Use camelCase for variables, PascalCase for components"
- **Testing** -- "Write tests with Vitest, use Testing Library for components"
- **Architecture** -- "API routes go in `/app/api/`, shared utilities in `/lib/`"
- **Don'ts** -- "Never use `any` type. Never import from `@internal`."
**Keep it concise.** The rules file is injected into every prompt -- long rules waste context.
---
# Referencing Context
> Telling the AI exactly what to look at
## @ Mentions
Most IDE AI tools support **@ mentions** to pull specific context into the conversation:
| Reference | What It Does | Example |
|---|---|---|
| `@file` | Includes a specific file | `@src/auth/login.ts` |
| `@folder` | Includes files in a directory | `@src/components/` |
| `@docs` | Searches official documentation | `@docs Next.js routing` |
| `@codebase` | Searches your project index | `@codebase how is auth handled?` |
| `@web` | Searches the internet | `@web React 19 new features` |
| `@git` | References git history | `@git recent changes to auth` |
Not all tools support all references. Check your tool's docs.
## Referencing Lines & Selections
**Beyond @ mentions, you can reference specific code:**
- **Select code** before opening chat -- the selection is included as context
- **Highlight a function** and ask "What does this do?"
- **Copy an error message** and paste it into chat with "Fix this"
- **Reference line ranges** -- "Look at lines 45-60 in `api/users.ts`"
**The more specific your reference, the better the response.**
Vague: "Why is my app broken?"
Specific: "The `getUserProfile` function in `@src/api/users.ts` returns null when the user has no avatar. How should I handle this?"
---
# Providing the Right Context
> Context hierarchy and best practices
## The Context Hierarchy
**The AI assembles context in this priority order:**
```text
1. Rules files (always included, highest priority)
2. Explicit references (@ mentions you provide)
3. Current file (file open in editor)
4. Open tabs (other files you have open)
5. Project index (embeddings search results)
```
**Implication:** Your rules file always wins. Your explicit references come next. Everything else is best-effort.
This is why rules files and @ mentions are so powerful -- you control what the AI prioritizes.
## Best Practices
- **Open related files** before asking questions -- they become context
- **Close unrelated tabs** to reduce noise in the context window
- **Use @ mentions** for files the AI should definitely see
- **Keep rules files updated** as your project evolves
- **Break big questions into small ones** -- each question gets its own context budget
- **State what you want explicitly** -- don't assume the AI infers your intent
**Context engineering in the IDE is the same skill you learned for prompt engineering -- just applied to a different interface.**
---
# Tool Comparison
> Antigravity vs GitHub Copilot vs Cursor
| Feature | **Antigravity** | **GitHub Copilot** | **Cursor** |
|---|---|---|---|
| **Base Editor** | VS Code fork | VS Code extension | VS Code fork |
| **Default Model** | Gemini (Google) | GPT-4o / Claude | Claude / GPT-4o |
| **Tab Completion** | Yes | Yes | Yes |
| **Inline Edit** | Cmd+K | Cmd+I | Cmd+K |
| **Chat Panel** | Yes | Yes | Yes |
| **Agent Mode** | Yes | Yes (Copilot Agent) | Yes (Composer) |
## Tool Comparison (cont.)
| Feature | **Antigravity** | **GitHub Copilot** | **Cursor** |
|---|---|---|---|
| **Rules File** | `.antigravityrules` | `.github/copilot-instructions.md` | `.cursorrules` |
| **@ References** | @file, @folder, @docs, @codebase, @web | @file, @workspace | @file, @folder, @docs, @codebase, @web, @git |
| **Project Indexing** | Yes | Yes (workspace) | Yes |
| **Price** | ~$20/mo | $10/mo (individual) | $20/mo (Pro) |
| **Unique Strength** | Google ecosystem, Gemini integration | GitHub integration, broad adoption | Multi-model support, Composer UX |
All three are capable. We use **Antigravity** in this course, but the concepts transfer.
---
# P2 Launch: Working in Pairs
> Your next project is a team effort -- pairs of two
## P2 is a Pair Project
**Starting this week, form pairs for Project 2.**
- **Find a partner** -- someone with complementary skills or interests
- **Create a Canvas group** by end of Week 6 (one submission per pair)
- **Set up a shared GitHub repo** -- both partners need push access
- **Start your shared rules file** -- `.antigravityrules` with conventions you both agree on
**Why pairs?** Professional developers rarely work alone. Collaborating with a partner while using AI is a skill worth practicing.
## How Pairs Work: Scrum for Two
**Your P2 pair runs lightweight scrum:**
- **Sprint planning** -- Meet at sprint start, pick issues from the backlog
- **Split work via GitHub Issues** -- Each partner owns specific issues per sprint
- **Async standups** -- Daily/regular check-ins on progress and blockers
- **PR-based code review** -- Every PR reviewed by your partner before merge
- **Sprint review** -- Demo what you built, reflect on what to improve
Both partners take turns driving priorities. Your **design thinking** and **mom test** skills from Weeks 2-4 feed directly into backlog prioritization -- real user feedback shapes what you build next.
## Getting Started This Week
**Before next class:**
1. **Find your partner** and agree on a project idea
2. **Create your Canvas group** (instructions on Canvas)
3. **Create a shared GitHub repo** with both partners as collaborators
4. **Start a shared rules file** with your tech stack and conventions
**Both partners must have meaningful commits throughout the project.**
---
# What to Remember
1. **IDE AI tools see your code** -- not just your description of it. That changes everything.
2. **Context is assembled, not magical** -- the AI gets a prompt built from your files, rules, and references.
3. **Rules files are your highest-priority context** -- treat them like onboarding docs for a new team member.
4. **Three interaction modes** -- suggestions, inline edit, and chat. Learn when to use each.
5. **Agent mode is powerful but risky** -- always review the plan before letting it execute.
6. **These concepts transfer** -- Antigravity, Copilot, and Cursor all work the same way underneath.
---
# Looking Ahead
## Next Week: Agile/Scrum + Pair Workflow
**Week 7 -- Process for working in pairs**
- **Agile/Scrum crash course** -- Sprints, ceremonies, and roles for P2
- **GitHub as your scrumboard** -- Issues, Projects board, milestones
- **From PRD to sprint backlog** -- Turning your Weeks 3-4 PRD into actionable issues
- **Pair workflow** -- Scrum for two, splitting work via issues and PRs
- **Partner code review** -- PR-based review workflow between partners
---
# Resources
## Required Reading
| Resource | URL |
|----------|-----|
| Antigravity Docs (Getting Started) | [antigravity.google/docs/get-started](https://antigravity.google/docs/get-started) |
| GitHub Copilot Guide | [docs.github.com/copilot](https://docs.github.com/copilot) |
| Cursor Documentation | [docs.cursor.com](https://docs.cursor.com) |
## Recommended Reading
| Resource | URL |
|----------|-----|
| Inside GitHub Copilot (GitHub Blog) | [github.blog](https://github.blog/ai-and-ml/github-copilot/inside-github-copilot-how-github-copilot-works/) |
| How Copilot Understands Your Code (GitHub Blog) | [github.blog](https://github.blog/ai-and-ml/github-copilot/how-github-copilot-is-getting-better-at-understanding-your-code/) |
| GitHub's New Embedding Model (InfoQ) | [infoq.com](https://www.infoq.com/news/2025/10/github-embedding-model/) |
| Copilot Repository Indexing (GitHub Docs) | [docs.github.com](https://docs.github.com/copilot/concepts/indexing-repositories-for-copilot-chat) |
| cursor.directory (Community Rules Files) | [cursor.directory](https://cursor.directory/) |
| OpenSSF Guide for AI Code Assistants | [best.openssf.org](https://best.openssf.org/Security-Focused-Guide-for-AI-Code-Assistant-Instructions) |