2026 10 19 doit front page design - xopherdeep/do-it-for-the-xp GitHub Wiki

The doit.forthexp.com front page on Magic Hat โ€” design

Date: 2026-10-19. Status: design approved in chat by the owner (scope narrowed to doit.forthexp.com); this spec awaits review.

Why

doit.forthexp.com is the app's home and the owner's own implementation of the For the XP plugin on the My Compass suite. Today its front page runs the One Page Express theme with copy from 2022 ("Xadion", "$XPCS crystal shards", play-to-earn), stock imagery, and invented numbers ("Over 5000 achievements unlocked", "users avg 20 daily completed tasks") that break the suite's no-mock-data rule. The owner wants a front page that looks good, reads well, explains the app, and runs on the suite's own Magic Hat theme so the whole stack is in use.

Success: a visitor on a phone understands in one screen what Do It For The XP is and can tap Play; the page is Magic Hat's; nothing on it is invented; the whole thing is reproducible from this repo by one script, and reversible.

Scope

In: the doit.forthexp.com front page (content, imagery, the block-template override, site title and tagline), a publish script that applies it to any WordPress site over REST, the local rehearsal, the live publish.

Out (owner, 2026-10-19): forthexp.com and its theme; the Compass site-control endpoint (a later pass; theme activation is the owner's click for now); pricing on the page; the plugin's /play mount; analytics.

Decisions

  • The page content owns the hero. Magic Hat's front-page template renders a dynamic hero from theme mods and protected page meta, neither writable over REST. The page instead carries Magic Hat's own hero pattern as static blocks, and a user override of the front-page template drops the dynamic hero block (header part, <main> with post content, footer part). Same look, lives in git, no dependency on the endpoint.
  • REST with the existing admin. DOIT_WP_USER / DOIT_WP_APP_PASSWORD in the gitignored ../Xophz-COMPASS/.env.local is an administrator on doit with edit_theme_options; it covers media, pages, templates and settings. Credentials are read from that file (or DOIT_WP_ENV_FILE) and never printed.
  • Rehearse first. The local Docker WordPress (http://localhost, already on Magic Hat) gets the page first, with a local Application Password minted by WP-CLI (docker exec u-wordpress wp --allow-root user application-password create โ€ฆ). Live is published only after the owner has seen the rehearsal.
  • Theme activation is the owner's click (Appearance โ†’ Themes โ†’ Xophz Magic Hat, already installed and allowed on the site). The page is published and set as the front page before the click, so the switch is one step.
  • Play goes to app.doit.forthexp.com, which is live on Cloudflare and allows framing (no X-Frame-Options, no frame-ancestors). The in-page phone frame shows the real app.
  • No invented numbers, no prices. The live XP Pro plan catalogue is empty until the plugin update lands and the owner's billing decisions (#1434, #1338) are open, so the page says "free to play, XP Pro for families who want more" and links to the app. A live quest-library count can come later from the engine.
  • Nothing is deleted. The old "Welcome" page (id 1141369) becomes a draft; switching the theme back and re-setting the front page restores the old site (--rollback).

1. The page

One page, slug home, title "Do It For The XP", rendered by the front-page override of section 3 (so the page content is the whole page between the theme's header and footer). Sections, in order, phone-first (everything reads at 390 px with a 16 px gutter and no horizontal scroll; the buttons sit under the thumb):

# Section Built from Copy and content
1 Hero, split xophz-magic-hat/hero pattern Badge: A family chore app. H1: Do It For The XP. Line: Chores become quests. Kids become heroes. Parents are the Game Masters. Buttons: Play now โ†’ https://app.doit.forthexp.com, How it works โ†’ #how-it-works. Media: the hometown screenshot in the phone frame.
2 How it works xophz-magic-hat/features (3 cards), anchor how-it-works The Game Master writes the quests. A parent sets up the family, writes the chores as quests, chooses what each one pays and which need approval. ยท Heroes fight chores as beasts. Each kid has their own portal, stats and gear; a chore is a beast with an attack clock, and finishing it wins the fight. ยท Rewards you can spend. Done quests pay XP to level up, gold for the shops in town, and ability points for real-life powers.
3 See it xophz-magic-hat/phone-slider Slide 1: the live app in the phone frame (iframe of app.doit.forthexp.com). Slides 2โ€“5: battle, victory, temple map, beast log screenshots; if the pattern's slides are iframe-only, those four become a 4-up image gallery under the slider instead. Caption: Runs in the browser on any phone. Nothing to install. The family's data stays on the device.
4 The look plain group + paragraph A love letter to EarthBound, A Link to the Past and Chrono Trigger: pixel fonts, battle swirls, chiptune music, dungeons with keys and boss doors. Three small screenshots: boss, small key, my home.
5 Built on For the XP xophz-magic-hat/cta This app is our own implementation of the For the XP plugin on the My Compass suite. The Town Hall in the game posts to this site's boards, and families register here. Buttons: The For the XP plugin โ†’ https://www.forthexp.com, Community boards โ†’ /cafeteria-board/feature-requests/.
6 Free to play group Free to play. XP Pro is for families who want their quests and approvals on every phone. Link: Open the app โ†’ app.doit.
7 Footer xophz-magic-hat/footer part (theme's) Links: Play, Blog (/blog/), Boards, GitHub (https://github.com/xopherdeep/do-it-for-the-xp).

Site settings: show_on_front=page, page_on_front=<home>, title Do It For The XP, tagline A family chore app that plays like a SNES-era RPG.

Copy rules: short sentences, no exclamation marks, no invented stats, no crypto, the three voices stay in the game (the site speaks plainly). Every image has alt text naming the screen.

2. Imagery

The README's phone screenshots (.github/readme/*.jpg, 390ร—844) are uploaded once to the site's media library with a stable slug (doit-shot-<name>) and alt text; the script reuses an existing item with that slug instead of uploading again. Used: hometown, battle, victory, temple-map, beast-log, boss, small-key, my-home. No stock images, no AI placeholders (Magic Hat's hero falls back to picsum when mh_hero_image is empty; the static pattern avoids that path).

3. The template override

A wp_template post, slug front-page, theme xophz-magic-hat, created or updated through POST /wp/v2/templates (requires edit_theme_options):

<!-- wp:template-part {"slug":"header","area":"header","tagName":"header"} /-->
<main class="mh-front-page-main" style="width:100%;position:relative;z-index:1;">
	<!-- wp:post-content {"layout":{"type":"default"}} /-->
</main>
<!-- wp:template-part {"slug":"footer","area":"footer","tagName":"footer"} /-->

It is the theme's own templates/front-page.html minus the dynamic hero line. Deleting the override returns the theme's template.

4. The publish script

tools/site/publish-doit.mjs (Node 20, no dependencies beyond node: modules), run as node tools/site/publish-doit.mjs --site https://doit.forthexp.com [--dry-run] [--rollback]:

  1. Reads credentials from DOIT_WP_ENV_FILE (default ../Xophz-COMPASS/.env.local): DOIT_WP_USER, DOIT_WP_APP_PASSWORD. For the local site a second pair LOCAL_WP_USER / LOCAL_WP_APP_PASSWORD is read when --site is http://localhost.
  2. Uploads each screenshot (POST /wp/v2/media, multipart, slug, alt_text, title), skipping slugs that already exist (GET /wp/v2/media?slug=).
  3. Renders tools/site/doit-front-page.html, replacing {{media:<name>}} with the uploaded URL and {{media-id:<name>}} with the id (the image block needs both), and {{app}} with the app URL.
  4. Creates or updates the page by slug (GET /wp/v2/pages?slug=home&status=any, then POST/PUT), status publish, comments closed.
  5. Creates or updates the template override (section 3).
  6. Sets show_on_front, page_on_front, title, description via POST /wp/v2/settings.
  7. Sets the previous front page to draft when it differs from home (remembered in the report).
  8. Prints a one-screen report: what was created, updated or skipped, and the page URL. --dry-run prints the plan and the rendered markup length and sends nothing. --rollback restores the previous front page from the report file (tools/site/.doit-publish-report.json, gitignored) and republishes it; it does not touch the theme.

Errors: any non-2xx stops the run with the site's code and message; nothing is retried. A missing credential stops before any request.

The pure parts (placeholder rendering, the link and alt checks) live in tools/site/markup.mjs, imported by the script and by the jest spec tests/unit/siteMarkup.spec.ts (add a transform rule in tests/jest/ if jest refuses the .mjs). Tests, pure functions only: placeholder rendering, the "no invented digits" check (the rendered page contains no number followed by "users", "achievements" or "tasks"), every href in the markup is absolute or starts with / or #, every <img> has non-empty alt. The script's REST calls are not unit-tested; the rehearsal is their test.

5. Rehearsal and verification

  1. Mint a local Application Password with WP-CLI; put it in .env.local under LOCAL_WP_*.
  2. node tools/site/publish-doit.mjs --site http://localhost.
  3. Open http://localhost/ in the browser pane at 390ร—844 and at 1280 wide: screenshots into tests/e2e/screenshots/site/. Checklist: no horizontal scroll; the hero reads without scrolling on the phone; Play now and How it works reachable with a thumb; the iframe slide shows the app's title screen; every link answers 200 (the script checks each href with a HEAD after publishing); light and dark both legible.
  4. The owner looks at the rehearsal. Only then: --site https://doit.forthexp.com, same checklist on the live URL, then the owner activates Magic Hat.

6. Rollback

node tools/site/publish-doit.mjs --site https://doit.forthexp.com --rollback republishes the old front page and points page_on_front back; the owner switches the theme back in Appearance. The media and the home page stay (harmless).

7. Follow-ups, not in this spec

  • The Compass site-control endpoint (compass/v1/site: themes, theme-mods, plugin updates, rewrites), after which the theme switch and this script become one run.
  • forthexp.com on Magic Hat with the plugin's page.
  • A live "quests in the library" number from xp/v1 once the game reports into the engine.
  • Pricing on the page once the catalogue is live and the billing decision is made.
โš ๏ธ **GitHub.com Fallback** โš ๏ธ