
Prompt:
"In greeter.py, use an f-string to fix the greeting."
Prompt:
Plan a script 'secure_check.py' to find .env files. Give me a detailed implementation plan first.
Prompt:
"Convert this list to a list of strings."
Prompt:
"Convert this list to a list of strings and do not run the stat.py" Just convert it to strings
Plan first: "Add a function to calculate the average of the strings list after converting them back to ints."
Plan first: A 60-line sys_info.py using stdlib 'os' and 'platform'. Output OS name and Python version. For the OS version, only add the first 10 characters.
Plan First: Create a 'hello.html' with the system info text from @sys_info.py output. Use the Browser Agent to take a screenshot Artifact of hello.html
"Surgical" UI Prompt:
Create a simple HTML page with a large blue button that says 'Access the Vault'. Use internal CSS for the button color. Keep it under 15 lines.
Verification Prompt:
Open index.html in the browser and take a screenshot Artifact to verify the button is blue.
The "Vague" Prompt:
Build me a full login page with a database for users. Make it look nice and professional with CSS.
The "Pro" Prompt:
Plan first: A single-file Flask app with a hardcoded 'Admin' login. Use a simple HTML form in the same file. Constraints: ≤100 LOC total, stdlib + Flask only. Goal: Verify the session logic before adding a database later.
The Prompt:
Type Open the browser to localhost:5000 and take a screenshot to verify the login form.
Prompt_1:
Plan first: "I want to add a feature to stats.py that exports results to JSON and CSV. under 90 LOC and use stdlib only if possible"
Prompt_2:
In @stats.py, rename the @stats.py#L4 function to get_total.
rules.md
# Workspace Rules
- Always use the Python Standard Library unless a specific library is requested.
- All code changes must be provided as partial Diffs, never full file rewrites.
- Keep every individual function or logic block under 50 lines of code.
- Before writing code, always generate a "Plan Artifact" for approval.
Vague Prompt
I need a script to fetch a random quote from a web API and save it to a file.
Evidence:
Show that the code uses json and urllib.
Show that the change is a small, surgical block of code.
The Prompt:
"Plan a system auditor script called 'sys_mon.py' that retrieves CPU percentage and RAM usage. Constraints: stdlib only, no external libraries, keep it under 40 LOC. Provide a detailed Implementation Plan."
The Prompt:
"Continue from the previous Implementation Plan. Update 'sys_mon.py' to also include Total/Used Storage and export all results to a JSON file. Reference the existing sys_mon.py on disk. Keep this update under 20 new lines of code."
Prompt:
"Using Gemini Pro High, plan a robust system health auditor called dashboard.py. It must include a centralized SystemMonitor class using only the stdlib to track CPU, RAM, and Disk metrics. Constraints: 100% Standard Library, secure error handling for Windows/Linux, and keep the core class under 50 LOC. Provide the Implementation Plan first."
Prompt:
"Continue from the SystemMonitor class in dashboard.py. Add a method to retrieve active network interface details and current uptime. Reference the existing class structure and ensure the new methods match the 'stdlib-only' coding style. Keep the addition under 20 new lines."
Prompt:
"Using Gemini Flash, add a main() execution block to dashboard.py. It should call the SystemMonitor methods and print the results as a pretty-printed JSON object to the terminal. Don't change the logic; just handle the output formatting. Keep it under 15 lines."
Prompt:
Plan first: healthcheck.py to print OS name, Python version, and timestamp. Constraints: ≤60 LOC, stdlib only. After write, run the script and capture a Walkthrough Artifact.
Why this worked (The Quota-Logic)
Pre-empting the Walkthrough: By asking for the "Walkthrough Artifact" in the first prompt, you save one entire message-turn (and the tokens that come with it).
Standard Library Bypass: Because the AI didn't have to search for external package documentation, the "Reasoning Time" was cut in half.
Immutable Proof: The Walkthrough Artifact ensures that if you ever hand this project to a different model, it knows exactly how the script is supposed to behave without re-running it.
Prompt:
Plan first: csv_cleaner.py to read 'data.csv', strip whitespace from all cells, and lowercase the 'Email' column, uppercase character the 'Name' and 'Marketing' colummn, . Output to 'clean_data.csv'. Constraints: Use ONLY the 'csv' and 'os' standard libraries. No Pandas. Keep it under 50 lines.
Why this worked (The Quota-Logic)
Pandas Prohibition: Pandas is a "Heavy Context" library. Using the built-in csv module is "Light Context," requiring less reasoning from the AI.
Atomic Output: By strictly defining the transformation (whitespace and casing), the AI doesn't waste tokens on unrequested features.
Local Verification: Checking the output file directly in the Editor saves an unnecessary message turn and the associated "Output Quota."
Prompt:
Plan first: md_converter.py to read 'test.md', convert H1 tags (#) and bold text (**) into HTML tags, and save to 'index.html'. Constraints: Use ONLY the 'sys' and 're' standard libraries. No external markdown libraries. Keep it under 50 lines.
Prompt:
Open index.html in the AI agent aware browser and take a screenshot to verify the H1 header and bold sentence is rendered and add the screenshot to the walkthrough.
Why this worked (The Quota-Logic)
Regex Efficiency: Regular Expressions are extremely cheap for AI to generate and execute, replacing hundreds of lines of conditional logic.
Eliminating Setup: Banning external libraries prevents the agent from searching documentation or troubleshooting installation errors.
Direct Verification: Using the Browser Agent provides immediate visual proof, ending the task without a long, token-heavy text report.
Prompt:
Plan first: server.py using http.server to create a GET endpoint at /status that returns {"result": "online"}. Constraints: Use 'http.server' and 'json' only. NO Flask or external frameworks. Keep it under 40 lines.
Use the Agent Aware Browser to visit http://localhost:8000/status and take a screenshot of the JSON response and add it to the walkthrough
Why this worked (The Quota-Logic)
High-Density Training: The AI's training data on http.server is extremely robust, leading to nearly perfect first-run code with minimal reasoning cycles.
Zero Dependency Chain: Avoiding frameworks like Flask prevents the agent from entering a "Fix-it" loop regarding environment setup or CORS issues.
Concise Networking: Built-in libraries follow an unchanging standard, which makes them "Predictably Efficient" for the AI to generate.
Prompt:
Plan summary_gen.py to create a Markdown table of files, sizes, and first-line comments; With argument to run script pointing at directory. Example: to scan root python3 summary_gen.py /root/ to scan current directory python3 summary_gen.py .; add the examples to script. ≤100 LOC; stdlib only; output file = Summary.md Plan first.
Why this worked (The Quota-Logic)
Plan First Trigger: Specifying "Plan first" in the prompt ensures you use low-cost reasoning tokens to lock in the architecture before the expensive code-generation begins.
Native Directory Walking: Using os or pathlib is a "Reflex" pattern for the AI, meaning it can generate the logic with high accuracy and minimal token usage.
Single-File Scope: By limiting the script to 80 lines, you prevent the agent from trying to create a complex documentation system, keeping the task "Atomic".
Prompt:
"Using Gemini Pro High, plan a vault.py script. It must generate a local key.key file for encryption and store credentials in vault.json. Use the cryptography.fernet library for actual symmetric encryption. Constraints: ≤100 LOC. Provide a detailed Implementation Plan first."
Why this worked (The Quota-Logic)
Explicit Dependency Exclusion: Stating "No external crypto libraries" prevents the agent from wasting quota on pip install commands or long-winded architectural debates.
Standard Library Lane: By using base64 and json, you leverage the AI's most accurate training data, leading to a faster, error-free "Planning" phase.
Atomic Commands: Focusing only on add and get keeps the logic block small enough for the AI to "reason" through in a single pass.
Prompt:
Plan dash.py, a web dashboard on port 8000 that displays current CPU and Memory usage. Constraints: ≤100 LOC, stdlib only. Use http.server and subprocess/os. No psutil or Flask. Provide the Implementation Plan first.
Prompt:
Run dash.py Use the Browser Agent to visit http://localhost:8000 and take a screenshot of the dashboard. Add screenshot to walkthough and kill dash.py PID
Why this worked (The Quota-Logic)
Native Over-Reliance: Leveraging the AI’s core knowledge of http.server and subprocess creates a "High-Precision" result with minimal reasoning tokens.
Visual Termination: Using the Browser Agent to "see" the dashboard replaces a long text-based status report, ending the thread early and saving output tokens.
Multi-Skill Synthesis: This lab combines several previous "Standard Library" patterns (Networking, File-System, and String Manipulation), proving that the AI is most efficient when reusing established "Surgical" patterns.
Prompt:
"plan meta_extract.py to read a local image file and print its dimensions and format. Constraints: ≤70 LOC, stdlib only. NO Pillow or external imaging libraries. Use struct or imghdr. Provide the Implementation Plan first."
Why this worked (The Quota-Logic)
Binary Precision: The AI's knowledge of the struct module is extremely high-accuracy. It can generate the specific "format strings" needed to unpack binary data with almost zero errors.
Setup Tax Avoidance: Banning libraries like Pillow (PIL) saves the tokens usually spent on creating virtual environments and managing C-extensions.
Atomic Task Focusing: By limiting the scope to "Dimensions and Format," we prevent the AI from trying to build a full image processing suite, keeping the output tokens at a minimum.
Prompt Gemini Pro High:
Using Google Antigravity, plan a web-based analyzer_gui.py. Features: 1. /upload to point at log files. 2. A Multi-File State manager to track multiple active logs. 3. Tabbed navigation. Constraints: Standard Library only (http.server, json). Plan the JSON state structure first."
Prompt Gemini Pro Low:
Create a dictionary to track 'Active Files' and their current analysis state. Ensure the server can serve different JSON data based on the selected tab. Constraints: ≤100 LOC." Keep the same analyzer_gui.py as is. Just implement what is needed. DO NOT REFACTOR.
Prompt Gemini Pro Low:
Continue with Gemini Pro Low. Add a classification function using re to count INFO, WARNING, and ERROR lines. Update the tabbed state with these counts. Keep the logic surgical and native. Keep the same analyzer_gui.py as is. Just implement what is needed. DO NOT REFACTOR.
Prompt Gemini Flash:
Using Gemini Flash, create a modern 'Glass-Morphism' UI for the analyzer. Include a horizontal tab-bar for active log files. Use neon-red for Errors and neon-green for Info. Ensure the 'Tab Controller' swaps content without a page reload.
Prompt Gemini Flash:
With Antigravity Browser Agent, run analyzer_gui.py. Add two logs files from my system: /var/log/auth.log and /var/log/xrdp.log, take a screenshot, and add it to the walkthrough.
Why this worked (The Quota-Logic)
Framework Avoidance: Every time you avoid an external framework, you save the AI from having to verify version compatibility or installation status.
Native JSON Handling: The json module is a core part of the AI's "Reflex" training, ensuring the code it generates for serialization is nearly bug-free.
Stateless Testing: Testing via the Browser Agent provides an immutable "Screenshot Artifact," which acts as a permanent record of success for this lab.
Quota-Logic
"Frameworks are for Humans; Standard Library is for AI." While Flask makes things easier for a human to type, http.server is easier for an AI to reason about because it has no external dependencies. This keeps your daily quota focused on your app's logic, not its boilerplate.
Why this worked (The Quota-Logic)
Template-Free Generation: Using f-strings for HTML avoids the tokens needed to manage multiple template files or external libraries.
Single-File Context: Keeping logic and output in one file makes it easier for the agent to "reason" through the whole project.
Visual Validation: A single screenshot replaces a long text report, saving significant output tokens.
Quota-Logic
Formatting is cheaper than reasoning. Asking the AI to "Make it look nice with CSS" in the same run as the logic is a "Quick Win." Because CSS patterns are standardized, the AI can write them almost as fast as plain text.
Prompt Gemini Pro High:
Using Google Antigravity, plan a web-based todo_suite.py. Features: 1. Multi-tab navigation by Category. 2. Notes with title, body, and category. 3. JSON persistence. Constraints: Standard Library only (http.server, json). Plan the nested JSON state structure first.
Prompt Gemini Pro low:
save_state. Ensure notes are saved in the JSON file by their category ID.
Prompt Gemini Pro low:
write a render_markdown(text) helper. Use re to transform #, ##, ###, **, *, and numbered lists into HTML tags. Ensure it handles newlines as <br>. Constraints: Standard Library only." keep todo_suite.py as is. DO NOT REFACTOR. Only add what is needed.
Using Gemini Flash, create a modern 'Glass-Morphism' UI for the suite. Include a horizontal tab-bar for Categories. Use a 'Neon-Border' effect for the active category tab. Ensure the layout is responsive and looks like a professional SaaS.
Why this worked (The Quota-Logic)
Flat-File Efficiency: JSON is "Native" to Python. The AI doesn't have to reason about SQL connections, which saves a massive amount of planning tokens.
Constraint-Driven Code: By enforcing a 100-line limit, you force the AI to write a clean dispatch loop rather than a bloated, multi-file architecture.
Verified Persistence: Asking for a "Second Run" verification in the prompt ensures the AI tests the most critical part of the code (the file read) immediately.
Quota-Logic
JSON is your "Junior Database." For any app with under 1,000 items, a JSON file is more token-efficient than SQL. It’s easier for the AI to read and write, which keeps your daily quota focused on features rather than database maintenance.
Prompt Pro High:
plan a digest_engine.py. Feature: A universal parser for RSS (XML), Atom (XML), and JSON feeds. Plan the normalization dictionary structure first. Plan a fetch_and_parse, filter_content functions that accepts whitelist and blacklist lists. Use re for case-insensitive matching. Only items that pass the filter should be added to the final digest. Constraints: Standard Library only (xml.etree.ElementTree, json, urllib). Under < 400 LOC IF POSSIBLE
Prompt Pro Low:
Add a /search endpoint and an archive_digest function. Save all processed items to archive.json. Implement a simple keyword search across the title and content of archived items. DO NOT REFACTOR. Keep the .py as it is. Add what is needed.
Prompt Pro Flash:
create a modern 'Glass-Morphism' UI. Feature: A central 'Agent Command' input box for URLs. Below it, show a feed of 'Intelligence Briefs' (digests). Use a dark-mode, neon-blue aesthetic."
Why this worked (The Quota-Logic)
Namespace Mastery: Specifying xml.etree.ElementTree keeps the AI within a high-accuracy training zone, preventing it from guessing how third-party libraries handle XML.
Static Output Efficiency: Generating an HTML file directly from the parser is more token-efficient than running a live web server for a simple dashboard.
Avoiding the Setup Tax: Every avoided pip install prevents a troubleshooting loop, keeping your daily quota focused on features.
Quota-Logic
Native XML is faster than "Easy" Libraries. While libraries like feedparser seem easier for humans, they are context-heavy for AI. Forcing the use of the Standard Library ensures the AI writes code that is fast, accurate, and completely free of external setup costs.
Prompt Gemini Pro High:
#Logic
Plan scanner_core.py. Features: 1. Threaded TCP/UDP scanning. 2. ICMP 'Ping' sweep for network discovery. 3. OS Fingerprinting via banner grabbing.
#functions
Add the scan_port and ping_sweep functions in scanner_core.py to the plan. Support both TCP and UDP. Add a timeout parameter to toggle between Fast/Slow speeds.
#We need a memory:
Add to the plan: A Scan Historian. It keeps a rolling buffer of the last 10 scans in history.json. We’re also adding a 'Save Scan' button that pins a report to a permanent 'Saved' list (limit 10). This ensures you never lose critical audit data during a reboot.
#Documentation
Add to the plan: Write the Export Engine. With one click, you can transform your scan results into a formatted Markdown report, a JSON object for other tools, or a CSV for spreadsheets."
#Constraints
Standard Library only (socket, threading, subprocess). Plan the 'Worker Queue' logic first. The scanner_core.py should be written in a way that it is easy to turn it into a webapp later.
#UI
Do not write any HTML or CSS. I will use Gemini Flash after the scanner_core.py is completed.
Prompt Gemini Flash:
#UI
Create a 'Glass-Morphism' UI for the scanner. Include checkboxes for scan options, a 'Scan Target' input (IP/CIDR), and a CSS-based progress bar. Use neon-blue accents on a dark blurred background. http.server running on port 8000. DO NOT REFACTOR. Add the HTML and CSS that is needed to turn the scanner_core.py into a web app
#Verification:
Antigravity Browser Agent. We’ll run a scan against localhost and watch the terminal output sync with the Web UI progress bar in real-time. We’ll verify that the 'App Version' correctly identifies our own http.server as the target. Take a screenshot and add it to the walkthrough.
Why this worked (The Quota-Logic)
Concurrency over Loops: Using ThreadPoolExecutor is a standard, highly-predictable pattern for the AI, reducing the "Reasoning Tax" compared to manual thread management.
Socket Precision: The socket module is a "Native Reflex" for the AI, ensuring the networking code is generated with high accuracy on the first try.
Batch Verification: Testing a range of ports in one go provides more "Proof of Work" for a single terminal execution, maximizing the value of your output tokens.
Quota-Logic
"Concurrency is cheaper than loops." While it sounds more complex, the AI’s training on concurrent.futures is so robust that it often writes better code for multi-threaded tasks than it does for complex nested loops. This saves you from the "Fix-it" loops that burn daily limits.
Prompt Gemini Pro High:
Build Phase: Shadow-Chat Core Logic
Objective: Develop shadow_chat.py as a high-security, ephemeral communication backend.
-Core Architecture:
Zero-Persistence Storage: All data (messages/images) must be stored in a volatile Python dictionary (RAM only).
24-Hour TTL: Implement a "Janitor" background thread to surgically wipe all data precisely 24 hours after creation.
Registration-Free Access: Users receive a Randomized Identity (e.g., 'Anonymous Falcon') upon connection.
Standard Library Only: No external databases (SQL/NoSQL) or 3rd-party libraries.
Security & Intelligence Features:
E2EE Handshake: Implement a native Diffie-Hellman key exchange using the secrets and hashlib modules.
In-Memory Media: Handle image uploads strictly as Base64 strings stored in RAM.
Anti-Spam Shield: Implement a Token Bucket algorithm to rate-limit incoming messages and prevent flooding.
-Verification & Walkthrough
Objective: Prove the integrity of the "Ghost" logic using the Antigravity Browser Agent.
-Test Suite:
Identity Check: Verify randomized name assignment for new sessions.
Encryption Audit: Confirm E2EE delivery (server as blind postman).
Wipe Verification: Simulate the 24-hour expiration and confirm total data deletion.
Walkthrough: Capture screenshots and document the logic flow for evidence.
-Critical Constraints
Modular Design: Write shadow_chat.py (and the initial scanner_core.py logic) to be easily integrated into a web app later.
UI Restriction: DO NOT write any HTML, CSS, or frontend code in this turn.
Tier Rotation: This phase is for logic architecture only. Gemini Flash will be used for the "Glass-Morphism" UI after the core engine is verified.
Prompt Gemini Flash:
--Phase: Shadow-Chat UI & Final Hardening
--Task 1: Glass-Morphism UI Integration
Objective: Wrap all shadow_chat.py functionalities into a "Glass-Morphism" web app.
Features: Dynamic message bubbles, a "Time Remaining" counter (TTL), and a file-drop zone for images.
Aesthetic: Deep blacks, neon purples, and heavy backdrop blurs.
Networking: Use http.server to listen on port 8000.
Constraint: DO NOT REFACTOR. Only add the necessary UI layer and logic to the existing shadow_chat.py code.
--Task 2: Verification & Evidence
Action: Run shadow_chat.py and initiate the Antigravity Browser Agent.
Test Suite: Send anonymous messages and upload an image to the chat.
Evidence: Take screenshots of all successful interactions and add them to the Walkthrough Artifact.
-Phase: Dockerization & "Ghost" Deployment
--Task 3: Docker-Compose Configuration
No-Disk-Write Policy: Set read_only: true in docker-compose.yml. Use tmpfs for system paths (like /tmp) to ensure the container is physically incapable of writing to the host disk.
Resource Constraints: Limit the container to 256MB RAM to prevent memory-exhaustion attacks.
Environment Hygiene: Use a slim Python base image and configure the app to run as a non-root user.
Zero-Persistence: Ensure no volumes are mounted; all data must vanish upon container restart.
--Task 4: Deployment Validation
Action: Deploy via docker-compose up -d.
Verification: Use the Antigravity Browser Agent to navigate to the running container. Test all chat and file functionalities.
Evidence: Take screenshots of the containerized app in action and add them to the Walkthrough.
-Phase: Documentation & Portability
--Task 5: Documentation (how-to-use.md)
Content: Provide a full description of all shadow_chat.py features.
Instructions: Include step-by-step guides for Docker deployment and general usage.
Artifacts: Embed the verification screenshots and evidence directly into the document.
--Task 6: Portable Zipping
Action: Zip all project files (shadow_chat.py, Dockerfile, docker-compose.yml, and documentation) into a single portable package ready for VPS deployment.
Why this worked (The Quota-Logic)
Standard Socket Patterns: The socket module is one of the most stable parts of Python's history. The AI has "Crystalized Knowledge" of this module, leading to nearly zero hallucinations.
Single-File Dualism: Putting the server and client in one file reduces the "Context Tax" because the AI doesn't have to jump between files to ensure the protocols match.
Byte-Level Efficiency: Dealing with bytes and utf-8 directly is computationally "Cheap" for the AI compared to parsing complex JSON or XML structures.
Quota-Logic
"Sockets are the bedrock." Forcing the AI to work at the socket layer ensures it doesn't spend tokens on "Black Box" abstractions. This keeps your daily limit focused on the actual movement of data, which is the most valuable part of the lab.
Welcome to the end of the "Chat-and-Paste" era.
In the past, using AI meant chatting in one window and manually copying code into another. That era is over. Google Antigravity is the world’s first dedicated Agent-First IDE, and this course is your roadmap to mastering it.
This is not a traditional "Learn to Code" course. This is a masterclass in AI Orchestration. You will stop being a manual laborer and start being the Architect. Instead of micromanaging lines of text, you will learn to give high-level goals to a suite of autonomous agents that build projects for you.
Why This Course is Different:
The Quota-Safe Method: Antigravity is built for the "Free-Plan Friendly" developer. You will learn "Quota-Logic"—a specific rhythm of planning and surgical editing that allows you to build complex software without spending a dime on tokens.
What You Will Master:
The Agent-First Rhythm: Master the "Plan → Diff → Apply → Verify" loop to ensure 100% code accuracy.
Decomposition: Learn the art of breaking massive ideas into small, successful "Atomic Runs" that never overwhelm the AI.
Artifact Transparency: Use Plan, Diff, and Walkthrough Artifacts to create a verifiable audit trail of every change.
Multi-Engine Strategy: Learn to swap between Gemini, Claude, and GPT-OSS mid-project to stay under quota and maintain momentum.