When building apps or websites, follow these practices for professional-quality output.

Getting Started - Start Here

STRONGLY RECOMMENDED: Start every new web app by adding a template with the add tool. Pick the right one (web-simple for static frontend-only, web-fullstack for backend+DB, api for pure API). It creates the standard src/ structure with favicon, meta tags, and working starter files (including a demo you can customize). Deploy automatically uses src/ when it exists. Only hand-roll files if the user explicitly tells you to skip the template.

Naming: Use the user's name verbatim if they gave one. If you need to invent a name, blend "Gip" or "Gipity" into it (e.g. "Gipity Notes", "GipPic", "Gip Tac Toe") - be creative but don't force it if it genuinely doesn't fit.

Starting over in an existing project: If src/ (or functions/, migrations/ for fullstack/api) already exists and the user wants a clean rebuild, call file_delete on those directories first, then run add normally. Or pass force=true to add to overwrite in one step - destructive, so confirm with the user first. Non-template content (media, data, notes) is preserved either way.

Multi-language (web-simple): The template ships a dormant i18n system. Flip config.features.i18n to true in src/js/config.js to enable the language picker and translations.js lookup; the code in src/js/strings.js, src/js/i18n.js, and src/js/main.js is self-documenting - read those to see the render() + i18n:changed event pattern.

File Structure

HTML

CSS

JavaScript

External Packages

Code Quality

Testing

Images

Deployment

Browser Debugging

Two separate browser capabilities - pick the right one:

gipity page-inspect <url> (CLI) - one-shot inspection. Returns console errors, failed resources, timing, oversized images. No actions, no screenshots. Use this first after every deploy. Options: --wait <ms> (default 3000), --json. If unsure: gipity page-inspect --help.

browser agent tool - interactive debugging with actions. Use when the CLI inspection surfaces something you need to dig into:

Flow: deploy → gipity page-inspect <url> → if anything's off, switch to the agent tool.

Build Incrementally

For non-trivial apps, don't write the whole thing in one pass. Work in small verified steps:

  1. Add a template (add tool / gipity add <template>) and deploy - confirm the starter renders.
  2. Add ONE feature or screen, deploy, verify.
  3. Repeat.

A 300+ line single-file rewrite is hard to debug when something breaks - a single bad API call or typo can break everything silently. Small increments keep the failure surface tiny and let you bisect by diff.

Verification After Deploy

After gipity deploy dev:

Deploy Verification

Use the browser tool to verify deploys when it matters - first deploy, structural changes (new pages, new frameworks, changed imports), or when something might have broken. Skip verification for trivial changes (copy tweaks, style adjustments, config values).

To verify: browser action=open url=<deployed-url> - waits for async modules, captures console errors automatically. Check output for [Console errors captured after page load]. Use browser action=screenshot to confirm visual correctness.

Debugging in production: Add console.error() calls to app code for diagnostics, redeploy, then use browser action=console to read the output. Remove debug logging when done.

3D World

3D World is the 3D multiplayer game template on Gipity. All 3D World games share the same visual style, physics engine (Rapier), and multiplayer backend (Colyseus). All files are fully editable.

Add a 3D World project with add name=3d-world (web agent) or gipity add 3d-world (CLI). This creates a playable 3D game with Three.js + Rapier physics + Colyseus multiplayer. Key files: config.js (metadata), settings.js (tunable values), strings.js (display text), objects.js (entity factories), game.js (orchestrator), plus engine files (core.js, world.js, physics.js, etc.).

Genres: obby/parkour, tycoon, simulator, PvP combat, shooter, tower defense, horror, racing, RPG, social.

Features: Opt-in gameplay modules enabled via config.features. Available: rocket-launcher (projectile weapon with physics explosions). Example: features: { 'rocket-launcher': true } in config.js. Features auto-initialize during boot.

Regular game requests ("make a wordle", "build a quiz") should use the standard web scaffold - they don't need the 3D template.

Load 3d-engine for a blank-slate template, or 3d-world for the full API, genre recipes, and playable starter.

2D Game

2D Game is the Phaser-based game scaffold on Gipity. It creates a fully editable project with the Phaser 3 game engine loaded via CDN - no build step, no locked files.

Add a 2D game with add name=2d-game (web agent) or gipity add 2d-game (CLI). This creates a playable 2D game with arcade physics, keyboard input, and a Boot/Game scene structure. All files are editable: config.js (Phaser setup), settings.js (tunable values), strings.js (display text), scenes/boot.js (preloader), scenes/game.js (main gameplay).

Genres: side-scroller, platformer, top-down, arcade, puzzle, endless runner, shooter, RPG.

Use 2d-game when the user wants a 2D game with physics, sprites, or scene management. Use web for simple games (wordle, quiz, card games) that don't need a game engine. Use 3d-world for 3D multiplayer games.

Load 2d-game for the full Phaser API and genre recipes.

Make it testable

A few small rules turn a flaky click test into a reliable one:

These are about ten lines of code in total. For multiplayer apps, also read the URL-param test mode pattern in app-realtime - it turns a click-driven 2-client test into two passive page loads.

Related App Skills

When building apps that need backend features, load these skills: