Welcome to the Antigravity workshop! This repository contains 10 activities, all built using Python and Flask, designed to showcase the power of agentic development.
Note
For a deep dive into the philosophy, benefits, and target audience of this curriculum, read our Workshop Overview.
You will explore 10 real-world software engineering tasks across two powerful platforms (Antigravity and Gemini CLI).
Before starting any activity, ensure you have Python 3.8+ installed. Follow these steps for EACH project folder:
-
Enter the activity directory:
cd 0X-[activity-name] -
Set up your virtual environment:
python3 -m venv venv && source venv/bin/activate pip install -r requirements.txt
You can complete this workshop using either the Antigravity or the Gemini CLI.
Best for: Visualizing implementation plans, side-by-side diffing, and multi-file orchestrations.
- Open Workspace: Go to
File>Open Folder...and select theagy-workshopdirectory. - Launch Agent Manager: Open the Agent Manager tab (usually at the side or bottom).
- Prompt: Type your instructions directly into the chat box. Antigravity will create implementation plans and artifacts for you to approve.
Best for: Fast, keyboard-centric iterations and staying in your development shell.
- Launch Gemini: From your terminal (inside a project folder), simply type
gemini. - Interactive Mode: You are now in an interactive session with the AI agent.
- Context is Key: Use the
@symbol to load the files you want to work on.- Example:
@app.py fix the security vulnerabilities in the search route.
- Example:
- Shell Integration: Use the
!prefix to run terminal commands (likepytestorflask run) without leaving the Gemini session.
| # | Activity | Goal | Unified Prompt / Instruction |
|---|---|---|---|
| 01 | Vibe-Coding | Prototyping | "Create a stunning, glassmorphic Zen Travel Planner using Flask. The UI should have smooth animations and a premium color palette." |
- Reproduce: Run
python3 app.pyand visithttp://127.0.0.1:5000. You'll see a completely empty, unstyled page. - Prompt: Paste the "Unified Prompt" above into Antigravity or Gemini CLI.
- Verify: Refresh the browser to see a fully reactive, high-end travel dashboard generated from scratch.
| 02 | Documentation | Knowledge | "@scheduler.py analyze this async logic and generate Google-style docstrings and a comprehensive README.md." |
- Reproduce: Open
scheduler.py. The logic is complex and lacks any comments or documentation. - Prompt: Use the prompt above to generate clear, structured documentation.
- Verify: Check the file for newly added docstrings and look for the new
README.mdin the02-documentationfolder.
| 03 | Feature-Building | Expansion | "@app.py implement a 'Low Stock Alert' system (< 5 units) with a new dashboard page and visual warnings." |
- Reproduce: Run
python3 app.py. Notice there's no way to see which items are low on stock. - Prompt: Ask the agent to add the alert system and a new dashboard route.
- Verify: Visit
/dashboardto see the new low-stock warnings in action.
| 04 | Refactoring | Cleanup | "@processor.py refactor this messy calculation logic into clean, modular functions. Remove the global state variables." |
- Reproduce: Read
processor.py. It's a "spaghetti" monolithic script with global variables that are hard to test. - Prompt: Ask the agent to modularize the logic.
- Verify: Run the refactored code and ensure calculations remain identical, but the code is now testable and clean.
| 05 | Testing | Quality | "Write a complete pytest suite for this Finance API, covering edge cases like divisions by zero and negative currency values." |
- Reproduce: Run
pytest. It will fail because there are no tests or they are incomplete. - Prompt: Use the agent to generate a robust test suite for the
app.pylogic. - Verify: Run
pytestagain and see all tests pass, including the complex edge cases.
| 06 | Migration | Modernization | "Migrate this legacy Flask app to Python 3.12 standards. Replace old formatting with f-strings and add comprehensive type hints." |
- Reproduce: Run
python3 legacy_script.py. Observe the old%string formatting and lack of type safety. - Prompt: Ask the agent to migrate the logic into a modern, type-hinted Flask API.
- Verify: Run the new Flask app and confirm the output matches the legacy script but with a modern architecture.
| 07 | Bug-Fixing | Diagnostics | "Find and fix the 3 bugs in the Inventory API: the ZeroDivision error, the shared order state, and the discount math error." |
- Reproduce: Run
python3 app.py. Submit an empty order (ZeroDivision). Submit two orders in a row (Order Bleeding). Add a loyalty discount and notice the incorrect total ($0.10 instead of 10%). - Prompt: Ask the agent to "Find and fix all logic bugs in the 07-bug-fixing/app.py file."
- Verify: Use curl or Postman to submit orders and ensure the calculations are accurate and orders don't persist across requests.
| 08 | Security | Hardening | "@app.py identify and patch the SQL Injection and XSS vulnerabilities. Use parameterized queries and proper output escaping." |
- Reproduce: In the search box, type
' OR '1'='1(SQLi) or<script>alert('XSS')</script>. - Prompt: Use the agent to audit
app.pyfor vulnerabilities and apply security best practices. - Verify: Attempt the same attacks; they should now be safely handled/escaped.
| 09 | Performance | Optimization | "@data_proc.py optimize the sales reporting logic. Replace the O(n^2) nested sorting loop with an efficient algorithm." |
- Reproduce: Run the analytics report and notice the significant lag (3+ seconds) caused by the inefficient sorting loop in
data_proc.py. - Prompt: Ask the agent to optimize the data processing logic for better time complexity.
- Verify: Run the report again; it should be near-instantaneous.
| 10 | Deployment | Ops | "Generate a multi-stage Dockerfile and a GitHub Actions workflow that runs tests and builds the image on every push." |
- Reproduce: Inspect the existing
Dockerfile. It's massive and unoptimized. - Prompt: Ask the agent to create a slim, multi-stage Docker build and a CI/CD pipeline.
- Verify: Build the image locally (
docker build . -t workshop-app) and check the image size reduction.
- Context Loading: In Gemini CLI, always start by loading your file context with
@. - Iteration: Agentic coding is a conversation. If the first result isn't perfect, just follow up: "That looks great, but could you move the button to the header?"
- Shell Tasks: Don't exit the agent to run tests. In the CLI, use
!pytest. In Antigravity, the agent can run commands for you!
Happy Coding! π