|
| 1 | +# Part 1: Setup & Context Engineering |
| 2 | + |
| 3 | +[🎮 Live Demo](https://dotnet-presentations.github.io/vscode-github-copilot-agent-lab/) • [📚 Lab Guide](https://dotnet-presentations.github.io/vscode-github-copilot-agent-lab/docs/) • [← Overview](00-overview.md) |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +> ⏱️ **Time:** ~15 minutes |
| 8 | +
|
| 9 | +In this section, you'll set up your development environment and teach GitHub Copilot about your codebase. |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +## 🔧 Initial Setup |
| 14 | + |
| 15 | +### Step 1: Create Your Repository |
| 16 | + |
| 17 | +1. Open [github.com/dotnet-presentations/vscode-github-copilot-agent-lab](https://github.com/dotnet-presentations/vscode-github-copilot-agent-lab) |
| 18 | +2. Click **Use this template** → **Create a new repository** |
| 19 | + - Name: `my-soc-ops-csharp` |
| 20 | + - Visibility: **Public** |
| 21 | +3. ✅ Your own Soc Ops repo is ready! |
| 22 | + |
| 23 | +### Step 2: Enable GitHub Pages |
| 24 | + |
| 25 | +1. Go to your repo's **Settings** → **Pages** |
| 26 | +2. Under "Build and deployment", select **GitHub Actions** |
| 27 | +3. ✅ Every commit will now publish to: `https://{username}.github.io/{repo-name}` |
| 28 | + |
| 29 | +### Step 3: Clone & Open in VS Code |
| 30 | + |
| 31 | +1. Open VS Code |
| 32 | +2. Run command: `Git: Clone` → `Clone from GitHub` |
| 33 | +3. Select your new repository |
| 34 | +4. When prompted, install **recommended extensions** |
| 35 | + |
| 36 | +### Step 4: Run the Setup Agent |
| 37 | + |
| 38 | +In the Chat panel: |
| 39 | + |
| 40 | +``` |
| 41 | +/setup |
| 42 | +``` |
| 43 | + |
| 44 | +The agent will: |
| 45 | +- Detect your environment |
| 46 | +- Install any missing dependencies |
| 47 | +- Start the development server |
| 48 | + |
| 49 | +✅ **Success:** App is running in your browser! |
| 50 | + |
| 51 | +--- |
| 52 | + |
| 53 | +## 📚 Understanding Context Engineering |
| 54 | + |
| 55 | +Context engineering is how you teach AI about your specific codebase. This makes Copilot's suggestions more accurate and relevant. |
| 56 | + |
| 57 | +### Task 1: Generate Workspace Instructions |
| 58 | + |
| 59 | +Instructions guide all agentic interactions, making them efficient and reliable. |
| 60 | + |
| 61 | +**Steps:** |
| 62 | + |
| 63 | +1. Run command: `Chat: Generate Workspace Instructions File` |
| 64 | +2. Wait for the agent to analyze your codebase |
| 65 | +3. Review the generated instructions (probably too detailed!) |
| 66 | +4. Follow up with: |
| 67 | + ``` |
| 68 | + Compress down by half and add a mandatory development checklist |
| 69 | + (lint, build, test) to the top |
| 70 | + ``` |
| 71 | +5. **Commit** the instructions file |
| 72 | + |
| 73 | +✅ **Result:** All future requests have a basic map of your workspace. |
| 74 | + |
| 75 | +--- |
| 76 | + |
| 77 | +### Task 2: Background Agents for Parallel Work |
| 78 | + |
| 79 | +Background agents run in isolated git worktrees — perfect for tasks that don't need handholding. |
| 80 | + |
| 81 | +**Steps:** |
| 82 | + |
| 83 | +1. Click `+` in Chat → **New background agent** |
| 84 | +2. Enter: |
| 85 | + ``` |
| 86 | + Add linting rules for unused vars and async/await usage; fix any errors |
| 87 | + ``` |
| 88 | +3. Let it run, then **Review** and **Apply** the changes |
| 89 | +4. Right-click the session to delete it when done |
| 90 | + |
| 91 | +**Try a Cloud Agent too:** |
| 92 | + |
| 93 | +1. Click `+` → **New cloud agent** |
| 94 | +2. Enter: |
| 95 | + ``` |
| 96 | + Make the README more engaging as a landing page to the project |
| 97 | + ``` |
| 98 | + |
| 99 | +✅ **Result:** Linting rules added, errors fixed, README improved — all merged back to main! |
| 100 | + |
| 101 | +--- |
| 102 | + |
| 103 | +### Task 3: Explore Existing Instructions |
| 104 | + |
| 105 | +Your repo comes with pre-configured instructions that help the AI understand the project. |
| 106 | + |
| 107 | +#### CSS Utilities Instructions |
| 108 | + |
| 109 | +📄 See `.github/instructions/css-utilities.instructions.md` |
| 110 | + |
| 111 | +These document the custom Tailwind-like CSS classes available in this Blazor project. |
| 112 | + |
| 113 | +> 💡 **Optional:** Delete the main text and re-run the prompt to see how it generates |
| 114 | +
|
| 115 | +#### Frontend Design Instructions |
| 116 | + |
| 117 | +📄 See `.github/instructions/frontend-design.instructions.md` |
| 118 | + |
| 119 | +The "no purple gradients" instructions challenge the agent to think like a designer. |
| 120 | + |
| 121 | +> 💡 **Think about:** What other AI biases could you challenge and nudge? |
| 122 | +
|
| 123 | +--- |
| 124 | + |
| 125 | +## ✅ Part 1 Complete! |
| 126 | + |
| 127 | +You've learned how to: |
| 128 | +- Set up your development environment |
| 129 | +- Generate and refine workspace instructions |
| 130 | +- Use background and cloud agents for parallel work |
| 131 | +- Understand existing instruction files |
| 132 | + |
| 133 | +--- |
| 134 | + |
| 135 | +[🎮 Live Demo](https://dotnet-presentations.github.io/vscode-github-copilot-agent-lab/) • [📚 Lab Guide](https://dotnet-presentations.github.io/vscode-github-copilot-agent-lab/docs/) • [← Overview](00-overview.md) |
| 136 | + |
| 137 | +👉 **[Continue to Part 2: Design-First Frontend →](02-design.md)** |
0 commit comments