The Magical Forest of Algora - Agent Mode Adventure
Background
Deep within the enchanted Forest of Algora, two mystical creatures called the Lox and the Faelis perform a sacred dance every millennium. This dance is not just for celebration but is a ritual to bring balance to the forest. Each creature has its own set of dance moves, and the combination of moves creates various magical effects in the forest.
Objective
Your task is to create a system that simulates the sacred dance between Lox and Faelis creatures. You’ll need to determine the magical effects of their combined dance moves and track the state of the forest after each sequence of the dance.
In this adventure, you’ll learn to use GitHub Copilot Agent Mode - an autonomous AI assistant that can understand complex tasks and break them down into multiple steps, creating entire applications from scratch!
Prerequisites
Before starting this adventure, you’ll need to perform the following steps:
- Install VS Code - Download from VS Code.
- Set up GitHub Copilot in VS Code - Follow the instructions at Set up GitHub Copilot in VS Code.
Learning Outcomes
By completing this adventure with Agent Mode, you’ll learn:
- ✅ How to give high-level instructions to an AI agent
- ✅ How Agent Mode breaks down complex tasks autonomously
- ✅ How to iterate and refine solutions with an AI pair programmer
- ✅ The power of autonomous coding assistance for complete projects
- ✅ Best practices for prompting Agent Mode effectively
Setting Up Agent Mode
- Open VS Code and ensure you’re signed in to GitHub.
- Open the Chat view by selecting the chat icon in the top bar.
- Select “Agent” mode from the dropdown at the bottom of the Chat panel.
Specifications
Now let’s define the requirements for the magical dance simulation so that you can start using Agent Mode effectively!
- Dance Mechanics:
- Each creature can perform one of three dance moves:
Twirl
, Leap
, or Spin
- The dance consists of 5 sequences
- Display the state of the forest after each sequence
- Magical Effects from Move Combinations:
- Twirl + Twirl = Fireflies light up the forest
- Leap + Spin = Gentle rain starts falling
- Spin + Leap = A rainbow appears in the sky
- Other combinations create different magical effects
- Predefined Move Sequences:
- Lox moves: Twirl, Leap, Spin, Twirl, Leap
- Faelis moves: Spin, Twirl, Leap, Leap, Spin
Using Agent Mode to Solve the Adventure
Step 1: Give Agent Mode a High-Level Task
In the Chat panel with “Agent” mode selected, provide a comprehensive prompt like:
Create a complete magical dance simulation system for the Forest of Algora. The system should:
1. Create a console application in JavaScript (or your preferred language)
2. Define two mystical creatures: Lox and Faelis with their predefined dance moves
3. Lox dance sequence: [Twirl, Leap, Spin, Twirl, Leap]
4. Faelis dance sequence: [Spin, Twirl, Leap, Leap, Spin]
5. Implement magical effects for dance move combinations:
- Twirl + Twirl = Fireflies light up the forest
- Leap + Spin = Gentle rain starts falling
- Spin + Leap = A rainbow appears in the sky
- Create additional magical effects for other combinations
6. Simulate the 5-sequence dance and display the forest state after each sequence
7. Include proper error handling and clear documentation
8. Make the code readable and maintainable with a beautiful console interface
Please create the project structure, write the code, and test it.
Step 2: Watch Agent Mode Work
Agent Mode will autonomously:
- 🔍 Analyze your workspace and determine what files to create
- 📁 Create the necessary project structure
- 💻 Write the complete application code
- 🧪 Test the application by running it
- 🔧 Fix any issues that arise automatically
You’ll see each step in the UI, showing every tool invocation.
Step 3: Interact and Refine
As Agent Mode works, you can:
- Approve or modify proposed changes
- Ask for improvements: “Can you add visual ASCII art for the forest?”
- Request explanations: “Explain how the magical effects system works”
- Add features: “Add the ability to create custom dance sequences”
Step 4: Explore Advanced Features
Once your basic system works, try asking Agent Mode to:
Enhance the magical dance system with these features:
1. Add beautiful ASCII art representations of the forest states
2. Create a system for users to define custom dance moves and effects
3. Add sound effects descriptions for each magical effect
4. Generate documentation explaining the magical dance mechanics
5. Create unit tests for the dance simulation logic
Expected Output Example
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 Magical Forest of Algora! 🌲
🦋 Lox and Faelis begin their sacred millennium dance...
=== Sequence 1 ===
Lox performs: Twirl
Faelis performs: Spin
Combined effect: Mystical energy swirls through the trees
Forest State: ✨ Enchanted glow
=== Sequence 2 ===
Lox performs: Leap
Faelis performs: Twirl
Combined effect: Magical harmony resonates through the woodland
Forest State: ✨🎵 Enchanted glow, harmonious melodies
=== Sequence 3 ===
Lox performs: Spin
Faelis performs: Leap
Combined effect: 🌈 A magnificent rainbow appears in the sky!
Forest State: ✨🎵🌧️🌈 Enchanted glow, harmonious melodies, rainbow, gentle rain
Forest Visualization:
💧 💧 💧
🌈
🌲 🌳 🌲
🌿 🍄 🍄 🌿
🌱 ✨🦋✨ 🌱
🌟 The millennium dance is complete! The Forest of Algora is in perfect harmony! 🌟
🎭 Final Dance Statistics:
Total sequences performed: 5
Magical effects triggered: 5
Forest transformations: 5
Verification Checklist:
- ✅ Simulates 5 sequences with Lox and Faelis moves
- ✅ Tracks cumulative forest state changes
- ✅ Includes ASCII art forest visualizations
- ✅ Shows magical effects for each dance combination
- ✅ Provides final statistics and completion message
- ✅ Handles move validation and error cases
Agent Mode Tips
Effective Prompting Strategies
- Be Comprehensive: Give Agent Mode the full context and all requirements upfront
- Specify Preferences: Mention your preferred programming language, frameworks, or patterns
- Set Clear Goals: Define what “done” looks like for your project
- Ask for Best Practices: Request clean, maintainable, and well-documented code
Leverage Agent Mode’s Autonomy
- Let it work: Allow Agent Mode to complete multi-step tasks without interruption
- Review and approve: Check the proposed changes before they’re applied
- Iterate naturally: Ask for improvements or modifications as needed
- Learn from the process: Observe how Agent Mode structures and solves problems
Important Agent Mode Considerations
Tool Confirmation & Limits:
- Agent Mode requires your confirmation before invoking tools or running commands
- Maximum of 128 tools can be used per request
- You can interrupt or pause requests at any time
- Always review suggested edits before accepting
Troubleshooting Agent Mode
If Agent Mode isn’t working as expected:
Common Issues & Solutions:
🔧 Agent not creating files
- Check your workspace permissions
- Ensure you’re in a valid project directory
- Approve file creation when prompted
🔧 Incomplete implementation
- Your prompt may need more detail - be more comprehensive
- Add specific success criteria and requirements
- Include examples of expected behavior
🔧 Tool confirmation needed
- Agent Mode requires your approval for tool usage
- Click “Allow” when prompted for file operations
- Review what tools will be used before approving
🔧 Agent stops mid-task
- May have hit the 128 tool limit per request
- Break complex tasks into smaller chunks
- Continue with a follow-up prompt
Setup Verification:
- Check VS Code version: Ensure you’re using a recent version of VS Code
- Verify settings: Confirm
chat.agent.enabled
is checked
- Check mode selection: Make sure “Agent” is selected in the Chat dropdown
- Sign in: Ensure you’re signed in to GitHub with Copilot access
- Tool Permissions: Approve tool usage when prompted
Pro Tips:
- Start with smaller tasks to get familiar with Agent Mode
- Be very specific about what “done” looks like
- Include testing and validation requirements in your prompts
What’s Next?
After trying out Agent Mode with this adventure:
- Try the Intermediate adventures using Agent Mode for more complex scenarios
- Experiment with custom tools and extensions that integrate with Agent Mode
- Use Agent Mode for real projects - it excels at creating complete applications
- Share your experience and provide feedback to help improve Agent Mode
Remember: Agent Mode is your autonomous coding partner. Give it clear goals, let it work, and iterate together to build amazing software!