1 Setup

1.1 Setup Google Antigravity

  1. Subscribe to Google AI Pro at one.google.com/ai (use a personal Gmail account, 18+ years old).
  2. Download, install, and sign in to Google Antigravity from antigravity.google.
  3. Configure Antigravity Permissions: Open Settings > General > Permissions > This Computer and select Turbo.
  4. Quit Antigravity from the System Tray & Restart as Administrator: Right-click the Antigravity icon in the bottom-right Windows taskbar tray > Quit, then open the Start menu, right-click Antigravity > More > Run as administrator.
    Note: Clicking the top-right [X] button only hides the window in the background - it does NOT quit Antigravity.
  5. Start a + New Conversation:
    • Select Gemini 4 Neon (Low) as the AI model.
    • Verify that the permission mode is set to Turbo.

1.2 Setup AI MCP Tools and Environment

Copy and paste the setup prompt below into the chat box. Required just once on a new PC:

The Setup Magic Spell - Install & Upgrade Environment
Perform a 2-in-1 fresh installation or safe version upgrade of my AI web development environment:

1. Global AI Behavior Tuning:
Create or update %USERPROFILE%\.gemini\config\AGENTS.md (UTF-8 without BOM). Add or keep rules to:
- Always read entire source files in full by omitting StartLine and EndLine; never micro-slice files into small line ranges.
- When investigating across multiple files, read all related files in parallel in a single turn to build a complete holistic understanding.
- Keep source files modular and under ~600 lines when practical so each file can be read in full in a single call.

2. Check, Download & Upgrade Tools in C:\tools\:
Check the latest GitHub release version against any existing local installation for each tool below (install if missing, upgrade if a newer release exists, or skip download if already on the latest version):
- Hearth Portable Web Server (choose the zip with "Bundled-PHP-Python-NodeJS" in its name; ships with both HearthPortableWebServer.Manager.exe and mcp-webserver.exe):
  https://github.com/ASP-NET-Web-Forms-Club/Hearth-ASPNET-Server/releases/latest -> C:\tools\hearth-web-server\
- MCP-Browser:
  https://github.com/adriancs2/MCP-Browser/releases/latest -> C:\tools\mcp-browser\
- MCP-SQLite:
  https://github.com/adriancs2/MCP-SQLite/releases/latest -> C:\tools\mcp-sqlite\
- MCP-FTP:
  https://github.com/adriancs2/MCP-FTP/releases/latest -> C:\tools\mcp-ftp\

Upgrade safety rules:
- Before extracting an update to Hearth, back up C:\tools\hearth-web-server\manager_sites.json if it exists, stop HearthManagerService if running so files are not locked, extract the update, and restore my backed-up manager_sites.json. If this is a brand-new install with no prior user sites, initialize manager_sites.json as an empty JSON array [] (do NOT create any sample or default websites yet).
- When upgrading MCP-FTP, preserve the existing C:\tools\mcp-ftp\profiles\ folder so saved FTP accounts and encrypted passwords are never overwritten.
- Ensure the root folder C:\www\ exists (leave it empty if new; do not create any website yet).

3. Verify & Configure Bundled Runtimes in User PATH:
Test whether python, pip, and node work from any directory via python --version, pip --version, and node --version (ignore the Microsoft Store WindowsApps stub). For each one that does not work, add the bundled Hearth runtime path to the User PATH environment variable (skip any that already work):
- C:\tools\hearth-web-server\runtimes\python
- C:\tools\hearth-web-server\runtimes\python\Scripts
- C:\tools\hearth-web-server\runtimes\node

4. Verify & Install All 4 MCP Servers in Antigravity:
Create or merge the following entries into %USERPROFILE%\.gemini\config\mcp_config.json (UTF-8 without BOM, preserving any other existing MCP servers):
- "mcp-webserver": command "C:\\tools\\hearth-web-server\\mcp-webserver.exe", args []
- "mcp-browser": command "C:\\tools\\mcp-browser\\MCP-Browser.exe", args []
- "mcp-sqlite": command "C:\\tools\\mcp-sqlite\\MCP-SQLite.exe", args []
- "mcp-ftp": command "C:\\tools\\mcp-ftp\\mcp-ftp.exe", args []

5. Verify & Install Hearth Windows Service + Desktop Shortcut:
- First check whether this session is already running with Administrator (elevated) privileges:
  * If ALREADY running as Administrator, proceed directly to install/update and start the service without interrupting me.
  * If NOT running as Administrator, pause and explain to me in plain beginner-friendly language BEFORE running the elevated command that a Windows permission window ("User Account Control - Do you want to allow this app to make changes to your device?") will pop up on screen (or blink on the taskbar) and that I should click "Yes" to continue.
- Install (or update) and start the Windows Service "HearthManagerService" with BinaryPathName:
  "C:\tools\hearth-web-server\HearthPortableWebServer.Manager.exe" --service
  and StartupType: Automatic.
- Confirm HearthManagerService status is Running.
- Create a shortcut on the Desktop named "Hearth Server Manager" pointing to C:\tools\hearth-web-server\HearthPortableWebServer.Manager.exe.
- Report a clear summary of installed/upgraded versions and service status. Do NOT create any website yet.

Once finished, quit Antigravity from the system tray and reopen Antigravity normally (non-Administrator). Start a + New Conversation and verify MCP tools installation status:

Verify MCP Tools Status
Are you able to see mcp-webserver, mcp-browser, mcp-sqlite, and mcp-ftp?

2 Begin a New Project (or Continue an Existing Project)

Send both parts together in one message to the AI - the Tech Stack (First Spell) followed by your Project Info (Second Spell):

-- First Spell: The Tech Stack --
-- Second Spell: The Project Info --

This is only required once at the start of a new conversation, whether you are starting a new web project or continuing an existing project.

First Spell: The Tech Stack

First Spell - The Tech Stack
This is a specially arranged combination of local tech stack and tools designed to work in orchestration with you for developing and deploying web applications. Follow these standards throughout this conversation:

Core Web Tech Stack:
php, sqlite (high concurrency: wal mode, sync normal, temp=ram, foreign key off, busy time 10s, transaction BEGIN IMMEDIATE), universal OS font Segoe UI, icon=local host font awesome. Sqlite db auto-created inside /App_Data/ (use "local.db" on localhost/127.0.0.1 and "prod.db" on live server; auto-generate .htaccess & web.config in /App_Data/ to deny public download). Save all code and config files as standard UTF-8 without BOM.
Auto-upgrade the SQLite schema on startup: track the schema version with PRAGMA user_version and apply only the new changes in order (new tables, new columns, indexes), so an existing prod.db on the live server is upgraded without losing data. Never require deleting the database.
Local runtimes: python, pip, and node.js are already installed and available in user PATH for running scripts or custom tasks.
Code structure: keep files modular and under ~600 lines each (split by logical responsibility: shared DB/layout, page views, API endpoints, CSS, and JS, without over-fragmenting). Place page-specific CSS in /assets/css/<page>.css and static JavaScript in /assets/js/<page>.js (loaded with ?v=<?= filemtime(...) ?> using the filesystem path for cache busting) instead of inlining large <style> or <script> blocks in .php files. If JS needs initial PHP values, pass only a tiny JSON config object inline (e.g., window.APP_CONFIG) or fetch via API.

Orchestrated MCP Tools:
- mcp-webserver: Responsible for hosting local live development (Hearth Portable Web Server) and managing multi-project profiles. Each project uses the Project Name (<name>) mapped to local folder C:\www\<name> (unless a custom Project Folder is specified) and an auto-assigned localhost port.
- mcp-browser: Specialized AI-controlled browser capable of screenshots, console checks, and custom JavaScript execution for debugging and diagnosis. Always test and verify every feature you build or update in mcp-browser before finishing.
- mcp-sqlite: Convenient tool to inspect and work directly with the SQLite database (/App_Data/local.db).
- mcp-ftp: Convenient tool for cPanel / shared hosting FTP operations and automation with multi-profile support (note: mcp-ftp tools and C:\tools\mcp-ftp\profiles\*\ftp_config.json use snake_case keys: profile_name, host, port, security_mode, username, local_folder, remote_folder, website_url; never expose password_protected). Keep profile_name identical to the Project Name (<name>), mapped to local_folder, with exclude rules protecting App_Data/local.db and dynamic user content folders (such as uploads/). Never ask for FTP passwords in chat - call ftp_create_profile (with show_ui: true and snake_case fields profile, local_folder, host, port, security_mode, username, remote_folder, website_url, excludes) to open mcp-ftp's local dialog pre-filled so I can enter the password safely.

Project Safety Guardrails (Mandatory Step-0 Pre-Flight Audit Before Touching Any Files):
1. Always Inspect All 3 Sources First: Before creating folders, registering profiles, or writing/modifying any code, ALWAYS inspect mcp-webserver (webserver_list_sites: snake_case keys name, port, url, status, root), mcp-ftp (ftp_list_profiles and C:\tools\mcp-ftp\profiles\*\ftp_config.json: snake_case keys profile_name, host, port, security_mode, username, local_folder, remote_folder, website_url), and the existing folders inside C:\www\.
2. When Starting a NEW Project:
   - Check for BOTH exact collisions AND ambiguous/similar lookalike names (e.g., spaces vs. hyphens like "stock inventory" vs "stock-inventory", case differences, or partial matches) across mcp-webserver sites (name / root), C:\www\ folders, and mcp-ftp profiles (profile_name / local_folder).
   - If FTP details are provided, also check whether another existing mcp-ftp profile already targets the same host / remote_folder / website_url, or if the target local_folder already contains files.
   - If ANY exact match, lookalike ambiguity, non-empty folder, or duplicate FTP target is found: STOP immediately, show me what already exists, and ask for my explicit confirmation before doing anything.
3. When CONTINUING an Existing Project:
   - Verify that the specified Project Name / Folder actually exists. If no exact match exists (for example, a typo or space/hyphen difference like "stock inventory" vs "stock-inventory"), NEVER silently create a new empty folder! Instead, STOP, list the closest existing project(s) found on this PC, and ask me to confirm which one I meant.
   - Verify 3-way alignment: confirm that the local project folder, the mcp-webserver site root, and the matching mcp-ftp profile's local_folder all point to the exact same directory (warn me immediately if any of them mismatch).
4. Upload / Sync Confirmation Gate:
   - Whenever I say "Upload the files to web server" or "sync the files to the web server" (or ask to deploy/upload), inspect the project's mcp-ftp profile first (profile_name, local_folder, website_url, remote_folder, and host), display a clear pre-flight summary (Project Name, Local Folder, Target Live Website URL / FTP Host), and wait for my "Yes" before running ftp_sync. On a brand-new project's very first sync, list remote files first and warn me if another website already exists in that remote_folder.

To Begin:
- Run the Mandatory Step-0 Pre-Flight Audit above first!
- If I ALREADY provided my Project Info below and every pre-flight check passes cleanly with zero ambiguity: set up or load the project in mcp-webserver (and open the pre-filled mcp-ftp dialog if FTP info is supplied and not yet saved), then proceed with my build/update request (or ask what to build if no requirements were included yet).
- If I have NOT provided a Project Name yet: do not write code yet - display any existing projects found in a numbered list (Project Name, Local Folder, Localhost URL, Status, and Live Website URL) and guide me to pick one or provide a new Project Name, optional FTP info, and what I want to build.
- Occasionally remind me where I can view this web project full-screen by copying its local URL (e.g., http://localhost:8090) into a web browser (Chrome, Firefox, Edge, etc.).

Second Spell: Example of Project Info

Second Spell - Example Project Info
Project info:

project name: HeroBill
description: a restaurant billing system
Website: https://www.example.com
FTP Host: ftp.example.com
FTP Port: 21
FTP Security: Explicit FTPS
FTP Username: example@example.com

The AI will set up the website and pop up an FTP setup dialog box - enter your password and click [Save Profile]. (Website and FTP lines are optional if developing locally only.)

Check progress in your browser: http://localhost:{port number} (example: http://localhost:8090).
Note: The exact port number will be set up and reported by the AI.

Next: Talk & Discuss with the AI Agent

Tell the AI what you want it to build or update:

Example 1: Begin a New Project

Example 1 - New Project
Build a coffee shop billing system. Staff should be able to pick menu items, set quantities, apply a discount, and generate a printable receipt with tax. It should also keep a daily record of sales.

Example 2: Continuing a Project

Example 2 - Continue Project
I'm continuing my coffee shop billing system, which already handles orders and receipts. Next I'd like to add a sales report (daily and weekly totals), a best-sellers list, and an option for staff to edit menu items and prices. Please build on the existing code.

Upload & Deploy to the Internet (3rd Magic Spell)

When ready to publish online, just say to the AI:

3rd Magic Spell - Upload / Sync
Upload the files to web server

or:

3rd Magic Spell - Alternative
sync the files to the web server