GitHub Copilot Agent Mode is an autonomous AI pair programmer that can understand complex tasks and break them down into multiple steps, creating entire applications from scratch! In this warmup adventure, you’ll discover the power of Agent Mode and learn how to work with an AI assistant that can think, plan, and execute multi-step coding tasks.
What makes Agent Mode special:
If you’re brand new to GitHub Copilot, check out this content to learn about the foundational features of GitHub Copilot agent mode:
Before starting this adventure, you’ll need to perform the following steps:
Ctrl+Alt+I
/ ⌃⌘I
.By completing this adventure with Agent Mode, you’ll learn:
Let’s experience the power of autonomous AI programming!
Perched atop the highest hill, overlooking the kingdom, stands the majestic Echo Castle. Within its stone walls is a chamber known as the Echo Room. This chamber, unlike any other, has the mystic power to echo numbers to anyone who enters. However, the Echo Room doesn’t just echo back any numbers; it always echoes the next number in a sequence.
Legends tell of a wizard who enchanted this chamber to test the intellect of visitors. The room would echo numbers in sequence, and only those who could predict the next echo were deemed worthy of the castle’s hidden treasures.
Your task is to have GitHub Copilot Agent Mode create a complete application that can enter the Echo Room, listen to its sequence, and predict the next number it will echo. Unlike traditional step-by-step coding, Agent Mode will understand your high-level goal and autonomously build the entire solution.
In the Chat panel with “Agent” mode selected, provide a detailed prompt like the following. This prompt uses JavaScript and Node.js, but you can adapt it to your preferred language.
I need you to create a complete Echo Chamber application that solves a magical number sequence prediction puzzle. Here are the requirements:
**Project Setup:**
1. Use JavaScript and Node.js for the implementation
2. Create a new directory at the root of the "CopilotAdventures" directory called "echo-chamber" and a file named "index.js" inside of it
3. Include proper documentation and comments in the code you generate
**Core Functionality:**
1. Create a sequence predictor for arithmetic progressions
2. Start with the sample sequence: [3, 6, 9, 12]
3. Predict the next number in the sequence (should output 15 if done correctly)
4. Store the "memories" of previous echoes in an array
**Enhanced Features:**
1. Add input validation to ensure sequences are valid arithmetic progressions
2. Create a user-friendly console interface that explains the Echo Room story
3. Add the ability to test multiple sequences
4. Include error handling for edge cases
5. Generate comprehensive documentation
**Testing:**
1. Test the application with the provided sequence
2. Create additional test cases with different arithmetic progressions
3. Verify error handling works correctly
Please create the complete project structure, implement all functionality, test it thoroughly, and provide clear documentation on how to run it.
Agent Mode will autonomously:
You’ll see each step transparently in the UI, showing every tool invocation and decision.
As Agent Mode works, you can:
Once your basic Echo Chamber is working, try asking Agent Mode to:
Enhance the Echo Chamber application with these advanced features:
1. **Multi-Pattern Support**: Extend beyond arithmetic progressions to handle geometric progressions and polynomial sequences
2. **Web Interface**: Create a beautiful HTML/CSS/JavaScript interface with an Echo Castle theme
3. **Sequence Visualization**: Add charts or graphs to visualize the sequences
4. **Historical Analysis**: Track and analyze multiple sequences over time
5. **Advanced Testing**: Create a comprehensive test suite with edge cases
6. **Performance Optimization**: Optimize for handling large sequences efficiently
7. **Documentation Website**: Generate a complete documentation site explaining the mathematics
Make it production-ready with proper error handling, logging, and user experience.
When your Agent Mode implementation is complete, running the application should produce output similar to the following. AI is non-deterministic, so your results may vary slightly, but the structure should be similar.
🏰 Welcome to the Echo Chamber of Echo Castle! 🏰
The magical chamber echoes with ancient wisdom...
Analyzing the sequence: [3, 6, 9, 12]
🔮 Detecting pattern...
- Common difference found: 3
- Sequence type: Arithmetic Progression
- Pattern confirmed: Each number increases by 3
🔊 The chamber echoes the next number: 15
📚 Storing in magical memories: [3, 6, 9, 12, 15]
✨ The treasure of Echo Castle is revealed! ✨
You have successfully predicted the chamber's echo!
🧪 Testing with additional sequences:
Test 1: [5, 10, 15] → Next: 20
Test 2: [100, 90, 80, 70] → Next: 60
Test 3: [1, 4, 7, 10, 13] → Next: 16
Verification Checklist:
Ask Mode | Agent Mode |
---|---|
Line-by-line suggestions | Complete project creation |
Manual file management | Automatic project structure |
User drives each step | Autonomous task execution |
Code completion | End-to-end solutions |
Reactive assistance | Proactive problem solving |
Single-file focus | Multi-file coordination |
Tool Confirmation & Limits:
If Agent Mode isn’t working as expected:
Common Issues & Solutions:
🔧 Agent not creating files
🔧 Incomplete implementation
🔧 Tool confirmation needed
🔧 Agent stops mid-task
Setup Verification:
Pro Tips:
You’ve completed your first GitHub Copilot Agent Mode adventure! You’ve experienced the power of autonomous AI programming that can:
Now that you’ve mastered Agent Mode basics:
Check out the other adventures located in the Adventures/Agent folder to see more ways GitHub Copilot agent mode can enhance your development workflow!
Remember: Agent Mode is your autonomous development partner. Give it clear goals, let it work, and iterate together to build incredible software solutions!