docs: define CHRNX theme design

This commit is contained in:
chrnx committed 2026-08-11 13:28:34 -05:00
commit b59e976a26
6 files changed
+1468

No files matched your search

@@ -0,0 +1,375 @@
# CHRNX Alter Ego Assets Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Create and approve six transparent topic portraits that extend the existing CHRNX musician into one coherent visual character.
**Architecture:** Treat `assets/images/the-no-names-musician-cutout.png` as the identity and style reference. Generate one subject per approved topic on a flat chroma-key background, remove the key locally, validate alpha and dimensions, then obtain one human approval for the complete set. Keep all work non-destructive and preserve the existing music source, chroma intermediate, and cutout.
**Tech Stack:** Built-in `image_gen`, local `remove_chroma_key.py`, Python 3.13, Pillow, pytest, PNG/RGBA.
---
## Scope and execution order
Run this plan after Task 1 of the theme plan initializes the local Git repository. Finish the approval checkpoint in Task 8 before the theme plan references the six new files in templates or patterns.
Version one creates exactly:
- `assets/images/alter-ego-code.png`
- `assets/images/alter-ego-literature.png`
- `assets/images/alter-ego-research.png`
- `assets/images/alter-ego-podcasts.png`
- `assets/images/alter-ego-life.png`
- `assets/images/alter-ego-gaming.png`
Do not create the deferred historical-assassin variant. Never overwrite:
- `assets/images/the-no-names-collage.jpeg`
- `assets/images/the-no-names-musician-chroma.png`
- `assets/images/the-no-names-musician-cutout.png`
## Shared generation invariants
Every prompt must include these constraints:
```text
Image 1 is the identity and style reference. Preserve the same illustrated person: facial structure, asymmetrical black hair, triangular headband, distressed screen-print linework, collage grain, body proportions, and orange-black-cream-teal palette. Change only wardrobe, props, and pose required by the topic. One person only. No brand logos, franchise insignia, copyrighted costume replicas, readable code, readable book text, watermark, or extra limbs.
Place the complete subject on a perfectly flat solid #FF00FF chroma-key background. The background must contain no shadow, gradient, texture, reflection, floor, or lighting variation. Keep generous padding and a crisp continuous silhouette. Do not use #FF00FF in the subject.
```
Use the built-in image tool, not the CLI fallback. After each generation, copy the selected output into `tmp/imagegen/`, remove the key with:
```bash
python /Users/chrnx/.codex/skills/.system/imagegen/scripts/remove_chroma_key.py \
--input tmp/imagegen/<topic>-chroma.png \
--out assets/images/alter-ego-<topic>.png \
--auto-key border \
--soft-matte \
--transparent-threshold 12 \
--opaque-threshold 220 \
--despill
```
If hair or textured edges fail chroma removal, stop and ask before using the CLI true-transparency fallback. Do not silently change models.
### Task 1: Asset contract and automated validation
**Files:**
- Create: `tests/assets/test_alter_ego_assets.py`
- Create: `scripts/build-alter-ego-contact-sheet.py`
- Create: `tmp/imagegen/.gitkeep`
- Modify: `.gitignore`
- [ ] **Step 1: Add the failing asset inventory test**
```python
from pathlib import Path
from PIL import Image
ROOT = Path(__file__).resolve().parents[2]
EXPECTED = (
"alter-ego-code.png",
"alter-ego-literature.png",
"alter-ego-research.png",
"alter-ego-podcasts.png",
"alter-ego-life.png",
"alter-ego-gaming.png",
)
def test_alter_ego_inventory_is_complete():
missing = [
name
for name in EXPECTED
if not (ROOT / "assets" / "images" / name).is_file()
]
assert not missing, f"missing: {', '.join(missing)}"
def test_alter_ego_assets_have_useful_transparency():
for name in EXPECTED:
image = Image.open(ROOT / "assets" / "images" / name)
assert image.mode == "RGBA"
assert image.width >= 1000
assert image.height >= 1200
alpha = image.getchannel("A")
low, high = alpha.getextrema()
assert (low, high) == (0, 255)
corners = ((0, 0), (image.width - 1, 0), (0, image.height - 1), (image.width - 1, image.height - 1))
assert all(alpha.getpixel(point) == 0 for point in corners)
opaque = sum(value >= 250 for value in alpha.getdata())
coverage = opaque / (image.width * image.height)
assert 0.18 <= coverage <= 0.80
```
- [ ] **Step 2: Run the inventory test and verify red**
Run:
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
```
Expected: FAIL naming all six missing PNG files.
- [ ] **Step 3: Add the contact-sheet script**
Implement a Pillow script that reads the six files in `EXPECTED` order, composites each over both `#0D1117` and `#F6F2E9`, labels the topic outside the artwork, and writes `docs/visual-reviews/alter-ego-v1.png`. It must fail with a clear message if any input is missing.
- [ ] **Step 4: Ignore disposable chroma sources**
Add `tmp/imagegen/*.png` to `.gitignore`, but keep `tmp/imagegen/.gitkeep`. Final RGBA assets remain tracked.
- [ ] **Step 5: Commit the validation contract**
```bash
git add .gitignore tmp/imagegen/.gitkeep tests/assets/test_alter_ego_assets.py scripts/build-alter-ego-contact-sheet.py
git commit -m "test: define alter ego asset contract"
```
### Task 2: Code portrait
**Files:**
- Create: `assets/images/alter-ego-code.png`
- [ ] **Step 1: Inspect the identity reference**
Use `view_image` on `assets/images/the-no-names-musician-cutout.png` before generation.
- [ ] **Step 2: Generate the code variant**
Use the shared invariants plus:
```text
Use case: stylized-concept
Asset type: CHRNX Code section portrait
Subject: the same person as a nocturnal full-stack programmer, seated three-quarter view at a worn desk, one hand on a compact keyboard, the other holding a pencil over a notebook; abstract terminal windows, dependency graph lines, and data nodes integrated into the clothing and silhouette as non-readable collage marks
Wardrobe: dark overshirt and plain black T-shirt; preserve the triangular headband
Mood: focused, overstimulated, awake too late; intelligent without corporate polish
Composition: portrait orientation, complete upper body and both hands visible, isolated silhouette
```
- [ ] **Step 3: Remove chroma and inspect both themes**
Run the shared removal command with `<topic>=code`. Composite it temporarily over `#0D1117` and `#F6F2E9`; inspect hair, fingers, keyboard, and chair edges.
- [ ] **Step 4: Run the targeted test**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
```
Expected: still FAIL for five missing assets; no failure for `alter-ego-code.png`.
- [ ] **Step 5: Commit**
```bash
git add assets/images/alter-ego-code.png
git commit -m "feat: add CHRNX code alter ego"
```
### Task 3: Literature portrait
**Files:**
- Create: `assets/images/alter-ego-literature.png`
- [ ] **Step 1: Generate with the shared invariants**
```text
Use case: stylized-concept
Asset type: CHRNX Literature section portrait
Subject: the same person as an original gothic writer at a small desk, holding a fountain pen over an unreadable manuscript, with one raven perched on the chair back and loose ink strokes forming abstract page shapes
Wardrobe: black nineteenth-century-inspired coat simplified into modern grunge layers; preserve the triangular headband
Mood: introspective, macabre, literary; evoke public-domain gothic atmosphere without reproducing Edgar Allan Poe's face or a specific portrait
Composition: portrait orientation, upper body, both hands, pen, manuscript, and raven inside the silhouette boundary
```
- [ ] **Step 2: Remove chroma and inspect**
Use `<topic>=literature`. Reject extra fingers, readable manuscript text, duplicated ravens, or a face that no longer matches the reference.
- [ ] **Step 3: Run the targeted test and commit**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
git add assets/images/alter-ego-literature.png
git commit -m "feat: add CHRNX literature alter ego"
```
Expected: only four assets remain missing.
### Task 4: Research portrait
**Files:**
- Create: `assets/images/alter-ego-research.png`
- [ ] **Step 1: Generate with the shared invariants**
```text
Use case: stylized-concept
Asset type: CHRNX Research section portrait
Subject: the same person as an independent game-AI researcher, holding one chess piece above a compact board while abstract decision trees, probability curves, and emotion-state nodes appear as unreadable collage marks around the torso
Wardrobe: dark cardigan over plain shirt; preserve the triangular headband
Mood: rigorous, curious, human; no laboratory coat and no science-fiction holograms
Composition: portrait orientation, upper body, both hands and chessboard visible, isolated silhouette
```
- [ ] **Step 2: Remove chroma, inspect, test, and commit**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
git add assets/images/alter-ego-research.png
git commit -m "feat: add CHRNX research alter ego"
```
Expected: only three assets remain missing.
### Task 5: Podcast portrait
**Files:**
- Create: `assets/images/alter-ego-podcasts.png`
- [ ] **Step 1: Generate with the shared invariants**
```text
Use case: stylized-concept
Asset type: CHRNX Podcasts section portrait
Subject: the same person hosting at a broadcast microphone with closed-back headphones resting partly over the asymmetrical hair, one hand adjusting a compact mixer, simple waveform marks woven into the jacket texture
Wardrobe: dark casual overshirt; preserve the visible triangular headband
Mood: conversational, intelligent, relaxed with friends; no radio-station branding
Composition: portrait orientation, upper body, both hands, microphone and compact mixer visible, one person only
```
- [ ] **Step 2: Remove chroma, inspect, test, and commit**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
git add assets/images/alter-ego-podcasts.png
git commit -m "feat: add CHRNX podcast alter ego"
```
Expected: only two assets remain missing.
### Task 6: Life portrait
**Files:**
- Create: `assets/images/alter-ego-life.png`
- [ ] **Step 1: Generate with the shared invariants**
```text
Use case: stylized-concept
Asset type: CHRNX Life section portrait
Subject: the same person at a kitchen table with a cold coffee, open notebook, one game controller pushed aside, a pet paw just entering the bottom edge as a non-identifying detail
Wardrobe: soft worn hoodie; preserve the triangular headband
Mood: warm, tired, funny, ordinary; fatherhood implied through lived-in responsibility but no children, family photos, names, school objects, addresses, or identifiable private details
Composition: portrait orientation, upper body and both hands visible, isolated silhouette
```
- [ ] **Step 2: Remove chroma, inspect privacy, test, and commit**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
git add assets/images/alter-ego-life.png
git commit -m "feat: add CHRNX life alter ego"
```
Expected: only the gaming asset remains missing.
### Task 7: Gaming portrait
**Files:**
- Create: `assets/images/alter-ego-gaming.png`
- [ ] **Step 1: Generate with the shared invariants**
```text
Use case: stylized-concept
Asset type: CHRNX Gaming section portrait
Subject: the same person as an original gothic creature hunter carrying a practical leather whip and a short weathered sword, with abstract castle arches and a crescent shape integrated only as collage texture inside the clothing
Wardrobe: original dark travel coat and boots with no copied costume geometry; preserve the triangular headband
Mood: determined, nocturnal, dangerous but not gory; broad vampire-hunter archetype only
Composition: portrait orientation, three-quarter full body, both hands and complete original weapons visible, isolated silhouette
Avoid: Belmont likeness, Assassin's Creed hood, hidden blade, franchise symbols, game logos, copied armor, recognizable castle layouts
```
- [ ] **Step 2: Remove chroma and inspect IP boundaries**
Reject any recognizable franchise emblem, costume, face, weapon design, or architecture.
- [ ] **Step 3: Run the complete asset test and commit**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
git add assets/images/alter-ego-gaming.png
git commit -m "feat: add CHRNX gaming alter ego"
```
Expected: PASS, six files validated.
### Task 8: Contact sheet and human approval gate
**Files:**
- Create: `docs/visual-reviews/alter-ego-v1.png`
- Modify: any rejected asset, one at a time
- [ ] **Step 1: Build the contact sheet**
```bash
uv run --with pillow python scripts/build-alter-ego-contact-sheet.py
```
Expected: one sheet showing every portrait on dark and light surfaces.
- [ ] **Step 2: Inspect the sheet and all originals**
Use `view_image` on the sheet, then on each full-resolution PNG. Check identity, hands, props, transparent edges, headband continuity, palette, and topic clarity.
- [ ] **Step 3: Present the set to the user and pause**
Ask for approval of the complete set. Do not let the theme reference unapproved variants.
- [ ] **Step 4: Apply revisions individually**
For each rejected portrait, run one targeted image edit that restates identity invariants and changes only the named defect. Re-run the asset test and rebuild the contact sheet after every revision round.
- [ ] **Step 5: Commit the approved review artifact**
```bash
git add assets/images/alter-ego-*.png docs/visual-reviews/alter-ego-v1.png
git commit -m "docs: approve CHRNX alter ego set"
```
### Task 9: Final asset verification
- [ ] **Step 1: Run the complete asset suite fresh**
```bash
uv run --with pillow --with pytest pytest tests/assets/test_alter_ego_assets.py -q
```
Expected: PASS with no missing file, alpha, corner, dimension, or coverage failure.
- [ ] **Step 2: Verify originals were preserved**
```bash
shasum -a 256 assets/images/the-no-names-collage.jpeg assets/images/the-no-names-musician-chroma.png assets/images/the-no-names-musician-cutout.png
```
Expected hashes from the design baseline:
```text
8f4a37c6b59067ccba566c1cc58ba62689623634a86ca2f5b2302354417fdd0c assets/images/the-no-names-collage.jpeg
256dc5ac69cffcd807ebaeec304c62543f97f1ccf3fea4ff244ee48bb401bace assets/images/the-no-names-musician-chroma.png
f7800c1577134a92376c38f40cc0426111a1984ce9694c421b4f7e6e3503aed4 assets/images/the-no-names-musician-cutout.png
```
- [ ] **Step 3: Confirm a clean local commit state**
```bash
git status --short
```
Expected: no uncommitted asset-plan changes.
@@ -0,0 +1,820 @@
# CHRNX WordPress Theme Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Build a fast, accessible WordPress block theme for the bilingual CHRNX journal, including editorial discovery, projects, The No Names, podcasts, and durable light/dark preference.
**Architecture:** Use a native block theme with `theme.json` v3, HTML templates, PHP patterns, and focused dynamic blocks for queries, metadata, settings, and controls that core blocks cannot express. Keep content in standard posts and pages; use three single-value taxonomies for topic, language, and podcast show. Develop against a pinned local WordPress 6.9.6 environment, use PHP unit tests for content/query behavior, and use Playwright for rendered behavior.
**Tech Stack:** WordPress 6.9.6, PHP 8.3 in `@wordpress/env` 11.12.0, Node.js LTS for project tooling, `@wordpress/scripts` 34.0.0, Playwright 1.62.1, WordPress Coding Standards 3.x, CSS, SVG, WOFF2.
---
## Preconditions and boundaries
- The current directory has `NO_GIT_METADATA`. Task 1 initializes a local repository only; it creates no remote and publishes nothing.
- Colima 0.10.3 and Docker 29.6.2 are installed, but Colima is stopped and Docker is available at `/opt/homebrew/opt/docker/bin/docker`. Prefix Docker-dependent commands with `PATH="/opt/homebrew/opt/docker/bin:$PATH"`.
- No local PHP or Composer binary is available. Run PHP, Composer, PHPCS, PHPUnit, and WP-CLI inside `wp-env`.
- Do not connect to `chrnx.dev`, Buzzsprout, DistroKid, or any production database during implementation.
- Run the alter-ego asset plan after Task 1 and complete its human approval gate before Task 6 uses those topic portraits.
- Official implementation references:
- <https://developer.wordpress.org/themes/core-concepts/theme-structure/>
- <https://developer.wordpress.org/themes/global-settings-and-styles/introduction-to-theme-json/>
- <https://developer.wordpress.org/themes/core-concepts/templates/>
- <https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/>
- <https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/>
## File map
```text
style.css Theme metadata and tiny compatibility layer
theme.json Design tokens, typography, layout, block defaults
functions.php Version constant and focused includes only
inc/setup.php Theme supports, menus, image sizes
inc/assets.php Local fonts, CSS, frontend/editor scripts
inc/taxonomies.php Topic, language, show registration and defaults
inc/editor.php Single-value editor panels and save validation
inc/podcast-meta.php Episode post meta, sanitization, editor controls
inc/settings.php Subscribe page setting and validated URL helper
inc/queries.php Pure query/selection services
inc/blocks.php Dynamic-block registration
inc/theme-preference.php Early no-flash preference bootstrap
blocks/featured-stories/ Sticky primary plus diverse secondary stories
blocks/journal-stream/ URL-filtered chronological list
blocks/latest-podcast/ Latest eligible podcast card
blocks/podcast-meta/ Episode number, duration, participants, fallback link
blocks/topic-hero/ Approved alter-ego image mapped to current topic
blocks/related-posts/ Related post query and cards
blocks/subscribe-cta/ CTA omitted unless configured page is published
blocks/theme-toggle/ Accessible light/dark/system control
assets/css/base.css Resets, tokens not expressible in theme.json, prose
assets/css/layout.css Shell, grids, responsive rules
assets/css/components.css Cards, badges, buttons, forms, empty states
assets/js/editor-taxonomies.js Radio UI for single-value taxonomies
assets/js/editor-podcast.js Episode metadata controls for podcast posts
assets/js/theme-toggle.js User preference state and control behavior
assets/fonts/ Zen Maru Gothic 500/700 plus OFL license
assets/icons/chrnx-cat.svg Compact cat mark
assets/icons/chrnx-wordmark.svg Full mark and accessible wordmark
parts/header.html Sticky site header
parts/footer.html Compact site footer
templates/*.html Core block templates
patterns/*.php Editable homepage, project, music, podcast patterns
tests/php/ WP_UnitTestCase tests
tests/js/ Pure JS tests
tests/e2e/ Playwright behavior and accessibility tests
tests/fixtures/ Synthetic WP content only
scripts/seed-test-content.sh Idempotent WP-CLI fixture setup
scripts/verify-theme-package.mjs Archive/content validation
```
### Task 1: Initialize the local project and reproducible environment
**Files:**
- Create: `.gitignore`
- Create: `.nvmrc`
- Create: `package.json`
- Create: `composer.json`
- Create: `phpcs.xml.dist`
- Create: `phpunit.xml.dist`
- Create: `.wp-env.json`
- Create: `playwright.config.mjs`
- Create: `tests/smoke/project-config.test.mjs`
- Create: `README.md`
- [ ] **Step 1: Initialize Git locally and record the approved design baseline**
```bash
git init -b main
git add docs/superpowers/specs docs/superpowers/plans assets/images
git commit -m "docs: define CHRNX theme design"
```
Expected: a local `main` branch with no remote.
- [ ] **Step 2: Write the failing project-config test**
```js
// tests/smoke/project-config.test.mjs
import assert from 'node:assert/strict';
import { readFile } from 'node:fs/promises';
import test from 'node:test';
test('tooling is pinned and wp-env maps this repo as chrnx', async () => {
const pkg = JSON.parse(await readFile('package.json', 'utf8'));
const env = JSON.parse(await readFile('.wp-env.json', 'utf8'));
assert.equal(pkg.devDependencies['@wordpress/env'], '11.12.0');
assert.equal(pkg.devDependencies['@wordpress/scripts'], '34.0.0');
assert.equal(pkg.devDependencies['@playwright/test'], '1.62.1');
assert.equal(pkg.devDependencies.lighthouse, '13.4.1');
assert.equal(env.core, 'https://wordpress.org/wordpress-6.9.6.zip');
assert.equal(env.phpVersion, '8.3');
assert.equal(env.mappings['wp-content/themes/chrnx'], '.');
});
```
- [ ] **Step 3: Run the test and verify red**
```bash
node --test tests/smoke/project-config.test.mjs
```
Expected: FAIL because `package.json` and `.wp-env.json` do not exist.
- [ ] **Step 4: Create project manifests**
Use this `package.json` contract:
```json
{
"name": "chrnx-wordpress-theme",
"version": "0.1.0",
"private": true,
"engines": { "node": ">=22 <27" },
"scripts": {
"build": "wp-scripts build",
"start": "wp-scripts start",
"env:start": "wp-env start --update",
"env:stop": "wp-env stop",
"env:activate": "wp-env run cli wp theme activate chrnx",
"composer": "wp-env run cli --env-cwd=wp-content/themes/chrnx composer",
"phpcs": "npm run composer -- exec phpcs -- -q",
"test:smoke": "node --test tests/smoke/*.test.mjs",
"test:js": "wp-scripts test-unit-js --runInBand",
"test:php": "wp-env run cli --env-cwd=wp-content/themes/chrnx phpunit -- --configuration=phpunit.xml.dist",
"test:e2e": "playwright test",
"lint:js": "wp-scripts lint-js assets/js tests/js scripts",
"lint:css": "wp-scripts lint-style 'assets/css/**/*.css' 'blocks/**/*.css'",
"lint:md": "wp-scripts lint-md-docs docs README.md",
"test": "npm run test:smoke && npm run lint:js && npm run lint:css && npm run phpcs && npm run test:js && npm run test:php && npm run test:e2e"
},
"devDependencies": {
"@playwright/test": "1.62.1",
"@wordpress/env": "11.12.0",
"@wordpress/scripts": "34.0.0",
"axe-playwright": "2.2.2",
"lighthouse": "13.4.1"
}
}
```
Use `.wp-env.json` with schema, pinned core/PHP, `autoPort: false`, port `8888`, `WP_DEBUG`, `SCRIPT_DEBUG`, and the explicit `wp-content/themes/chrnx` mapping. Do not add lifecycle scripts that reset content.
`.gitignore` must include `.superpowers/`, `node_modules/`, `vendor/`, `dist/`, `.wp-env.override.json`, `test-results/`, `playwright-report/`, `.DS_Store`, and disposable `tmp/imagegen/*.png` files. Keep the approved design spec, plans, and final assets tracked.
Use `composer.json` with `wp-coding-standards/wpcs:^3.0`, `dealerdirect/phpcodesniffer-composer-installer:^1.0`, and the required Composer plugin permission. Configure `phpcs.xml.dist` for `WordPress-Core` plus `WordPress-Extra`, PHP files only, text domain `chrnx`, and prefix `chrnx_`.
- [ ] **Step 5: Run the smoke test and install dependencies**
```bash
node --test tests/smoke/project-config.test.mjs
npm install
npx playwright install chromium firefox webkit
```
Expected: smoke PASS; `package-lock.json` created; Chromium, Firefox, and WebKit executables installed.
- [ ] **Step 6: Start the local runtime without altering production**
```bash
colima start
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run env:start
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run composer -- install
```
Expected: WordPress available at `http://localhost:8888`; Composer dependencies installed inside the mapped theme.
- [ ] **Step 7: Commit**
```bash
git add .gitignore .nvmrc package.json package-lock.json composer.json phpcs.xml.dist phpunit.xml.dist .wp-env.json playwright.config.mjs tests/smoke README.md
git commit -m "chore: scaffold CHRNX theme tooling"
```
### Task 2: Establish the block-theme foundation and design tokens
**Files:**
- Create: `style.css`
- Create: `theme.json`
- Create: `functions.php`
- Create: `inc/setup.php`
- Create: `inc/assets.php`
- Create: `assets/css/base.css`
- Create: `assets/fonts/zen-maru-gothic-latin-500.woff2`
- Create: `assets/fonts/zen-maru-gothic-latin-700.woff2`
- Create: `assets/fonts/OFL.txt`
- Create: `templates/index.html`
- Create: `tests/smoke/theme-contract.test.mjs`
- Create: `tests/php/bootstrap.php`
- Create: `tests/php/test-theme-setup.php`
- [ ] **Step 1: Write failing token and setup tests**
The Node test must assert:
- `style.css` declares `Theme Name: CHRNX`, `Text Domain: chrnx`, `Requires at least: 6.9`, and `Requires PHP: 8.1`.
- `theme.json` has schema, `version: 3`, content width `720px`, wide width `1120px`, and exact dark/light design tokens from the spec.
- both WOFF2 files and `OFL.txt` exist.
- `templates/index.html` includes header, main query/content, and footer blocks.
The PHP test must assert `add_theme_support('title-tag')`, `post-thumbnails`, `responsive-embeds`, `editor-styles`, and the `chrnx-card` image size.
- [ ] **Step 2: Run tests and verify red**
```bash
node --test tests/smoke/theme-contract.test.mjs
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php
```
Expected: FAIL because the theme foundation is absent.
- [ ] **Step 3: Add the minimal theme**
`functions.php` must only define `CHRNX_VERSION` and require focused files:
```php
<?php
define( 'CHRNX_VERSION', '0.1.0' );
foreach ( array( 'setup', 'assets', 'taxonomies', 'editor', 'podcast-meta', 'settings', 'queries', 'blocks', 'theme-preference' ) as $module ) {
$path = get_theme_file_path( "inc/{$module}.php" );
if ( file_exists( $path ) ) {
require_once $path;
}
}
```
Use `theme.json` v3 for palette, spacing, font sizes, content widths, block gap, link focus behavior, and default block styles. Keep CSS for selectors and states that `theme.json` cannot represent cleanly.
- [ ] **Step 4: Copy and verify the licensed fonts**
```bash
cp /Users/chrnx/projects/expressive-tea/green-tea-site/public/fonts/zen-maru-gothic-latin-500.woff2 assets/fonts/
cp /Users/chrnx/projects/expressive-tea/green-tea-site/public/fonts/zen-maru-gothic-latin-700.woff2 assets/fonts/
cp /Users/chrnx/projects/expressive-tea/green-tea-site/public/fonts/OFL.txt assets/fonts/
file assets/fonts/*
```
Expected: two WOFF2 files and one text license. Register both with `font-display: swap` and local URLs.
- [ ] **Step 5: Run tests, PHPCS, and activate**
```bash
node --test tests/smoke/theme-contract.test.mjs
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run phpcs
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run env:activate
```
Expected: PASS and active theme `chrnx`.
- [ ] **Step 6: Commit**
```bash
git add style.css theme.json functions.php inc assets/css/base.css assets/fonts templates/index.html tests
git commit -m "feat: establish CHRNX block theme foundation"
```
### Task 3: Implement single-value editorial metadata
**Files:**
- Create: `inc/taxonomies.php`
- Create: `inc/editor.php`
- Create: `inc/podcast-meta.php`
- Create: `assets/js/editor-taxonomies.js`
- Create: `assets/js/editor-podcast.js`
- Create: `tests/php/test-taxonomies.php`
- Create: `tests/php/test-podcast-meta.php`
- Create: `tests/js/editor-taxonomies.test.js`
- Create: `tests/js/editor-podcast.test.js`
- [ ] **Step 1: Write failing registration tests**
Assert that `chrnx_topic`, `chrnx_language`, and `chrnx_show`:
- attach only to `post`;
- are public and REST-visible;
- expose stable rewrite slugs;
- register the exact topic/language defaults;
- accept at most one term per post after normalization;
- leave missing metadata readable rather than assigning terms automatically.
Also assert the podcast metadata contract:
- `chrnx_episode_number`: integer, minimum `0`;
- `chrnx_episode_duration`: sanitized display string such as `1:18:23`;
- `chrnx_episode_participants`: REST-visible array of sanitized nonempty names;
- `canonical_episode_url`: sanitized HTTPS URL, empty when invalid;
- all four keys attach only to posts and use `auth_callback` requiring `edit_post`;
- fields render only when the post has `chrnx_topic=podcasts`.
- [ ] **Step 2: Run tests and verify red**
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php -- --filter Taxonomies
npm run test:js -- --runTestsByPath tests/js/editor-taxonomies.test.js tests/js/editor-podcast.test.js
```
Expected: FAIL because the taxonomies and editor helpers are absent.
- [ ] **Step 3: Register the content model**
Use a shared registration helper and these terms:
```php
$topics = array(
'research' => 'Research',
'code' => 'Code',
'literature' => 'Literature',
'music' => 'Music',
'podcasts' => 'Podcasts',
'life' => 'Life',
'gaming' => 'Gaming',
);
$languages = array( 'en' => 'English', 'es' => 'Español' );
$shows = array( 'silicon-ranch' => 'Silicon Ranch' );
```
Create terms on `after_switch_theme` only when absent. Never rewrite legacy categories or assign a default to old posts.
- [ ] **Step 4: Add the editor radio panels**
Enqueue a no-JSX script using WordPress globals. Remove the native taxonomy panels with `removeEditorPanel`, render one radio group per taxonomy through `PluginDocumentSettingPanel`, and call `editPost({ [taxonomyRestBase]: [termId] })`. A “Not set” choice sends an empty array. Guard against non-post editors and missing terms.
On `set_object_terms`, normalize accidental multi-term writes to the first valid term ordered by term ID. Add an admin notice when normalization occurs.
- [ ] **Step 5: Register and edit episode metadata**
Use `register_post_meta()` with explicit REST schemas and sanitizers. `chrnx_episode_participants` uses this schema:
```php
array(
'type' => 'array',
'items' => array( 'type' => 'string' ),
)
```
`canonical_episode_url` accepts only `https` after `esc_url_raw()`. The editor script adds number, duration, participants, and canonical URL controls to a `PluginDocumentSettingPanel` only when the selected topic slug is `podcasts`; it writes through `editPost( { meta: ... } )`. Participants use one name per line in the editor and persist as an array. Never store Buzzsprout embed HTML in post meta.
- [ ] **Step 6: Run tests and commit**
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php -- --filter 'Taxonomies|Podcast_Meta'
npm run test:js -- --runTestsByPath tests/js/editor-taxonomies.test.js tests/js/editor-podcast.test.js
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run phpcs
git add inc/taxonomies.php inc/editor.php inc/podcast-meta.php assets/js/editor-taxonomies.js assets/js/editor-podcast.js tests/php/test-taxonomies.php tests/php/test-podcast-meta.php tests/js/editor-taxonomies.test.js tests/js/editor-podcast.test.js
git commit -m "feat: add CHRNX editorial metadata"
```
### Task 4: Build query services and dynamic editorial blocks
**Files:**
- Create: `inc/queries.php`
- Create: `inc/blocks.php`
- Create: `inc/settings.php`
- Create: `blocks/featured-stories/block.json`
- Create: `blocks/featured-stories/render.php`
- Create: `blocks/featured-stories/style.css`
- Create: `blocks/journal-stream/block.json`
- Create: `blocks/journal-stream/render.php`
- Create: `blocks/journal-stream/style.css`
- Create: `blocks/latest-podcast/block.json`
- Create: `blocks/latest-podcast/render.php`
- Create: `blocks/latest-podcast/style.css`
- Create: `blocks/podcast-meta/block.json`
- Create: `blocks/podcast-meta/render.php`
- Create: `blocks/topic-hero/block.json`
- Create: `blocks/topic-hero/render.php`
- Create: `blocks/related-posts/block.json`
- Create: `blocks/related-posts/render.php`
- Create: `blocks/subscribe-cta/block.json`
- Create: `blocks/subscribe-cta/render.php`
- Create: `tests/php/test-editorial-queries.php`
- Create: `tests/php/test-block-rendering.php`
- Create: `tests/php/test-settings.php`
- [ ] **Step 1: Write failing feature-selection tests**
Create posts with multiple sticky dates/topics and assert:
1. newest sticky post is primary;
2. other sticky posts return to chronological eligibility;
3. secondaries prefer topics distinct from primary and each other;
4. date order fills any remaining slot;
5. fewer than three posts returns a shorter array without placeholders;
6. drafts, private posts, and empty titles are excluded.
- [ ] **Step 2: Write failing podcast and filter tests**
Assert that:
- latest podcast requires `chrnx_topic=podcasts` and a registered `chrnx_show` term;
- a podcast post missing `chrnx_show` remains in Journal results but not podcast surfaces;
- Silicon Ranch queries require `chrnx_show=silicon-ranch`;
- `chrnx_topic`, `chrnx_language`, page number, and search filters are sanitized and preserved in generated URLs;
- malformed values are ignored, not passed to SQL.
Assert related/subscription/topic behavior:
- related posts exclude the current post, prefer the same `chrnx_topic`, then shared tags, then recent posts, with no duplicates;
- a configured Subscribe page renders only while its post status is `publish`;
- an unset, deleted, draft, or non-page `chrnx_subscribe_page_id` yields no CTA markup;
- each topic maps to the exact approved alter-ego filename; unknown/missing topic yields no portrait;
- podcast metadata rendering omits unknown fields, renders participants as text, and uses `canonical_episode_url` only as an HTTPS fallback link.
- [ ] **Step 3: Run the tests and verify red**
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php -- --filter 'Editorial_Queries|Block_Rendering|Settings'
```
Expected: FAIL with missing query functions/blocks.
- [ ] **Step 4: Implement pure query helpers first**
Expose focused functions:
```php
chrnx_get_featured_story_ids( int $limit = 3 ): array
chrnx_get_journal_query_args( array $request ): array
chrnx_get_latest_podcast_id(): int
chrnx_get_show_query_args( string $show_slug, int $page = 1 ): array
chrnx_get_related_post_ids( int $post_id, int $limit = 3 ): array
chrnx_get_topic_art_asset( string $topic_slug ): string
chrnx_get_subscribe_url(): string
```
Return IDs/query arguments, not markup. Cache only within the request; avoid persistent transients in version one.
- [ ] **Step 5: Render escaped, semantic blocks**
Use `<article>`, real heading levels controlled by block context, `get_permalink()`, `wp_get_attachment_image()`, escaped badges, and a CSS-generated fallback when no featured image exists. The latest-podcast block renders a card/link only; the Buzzsprout player stays inside the single episode content. `podcast-meta` renders number, duration, participants, and an HTTPS fallback link without duplicating an embed. `related-posts` delegates all selection to the query helper.
- [ ] **Step 6: Add validated subscription configuration and topic-art mapping**
Register `chrnx_subscribe_page_id` on the existing Settings > Reading screen with `wp_dropdown_pages()`. Sanitize it to `0` unless it references a Page the current administrator may edit. `chrnx_get_subscribe_url()` returns a permalink only for a published page. The dynamic `subscribe-cta` block returns an empty string otherwise.
Map each topic slug to one fixed asset basename in `chrnx_get_topic_art_asset()`. The `topic-hero` block uses the current queried taxonomy term or an explicit validated `topic` attribute; it never accepts arbitrary file paths.
- [ ] **Step 7: Run tests and commit**
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php -- --filter 'Editorial_Queries|Block_Rendering|Settings'
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run phpcs
git add inc/queries.php inc/blocks.php inc/settings.php blocks tests/php
git commit -m "feat: add editorial query blocks"
```
### Task 5: Implement the theme shell, durable preference, and CHRNX mark
**Files:**
- Create: `inc/theme-preference.php`
- Create: `blocks/theme-toggle/block.json`
- Create: `blocks/theme-toggle/render.php`
- Create: `assets/js/theme-toggle.js`
- Create: `assets/icons/chrnx-cat.svg`
- Create: `assets/icons/chrnx-wordmark.svg`
- Create: `parts/header.html`
- Create: `parts/footer.html`
- Create: `assets/css/layout.css`
- Create: `tests/js/theme-preference.test.js`
- Create: `tests/e2e/theme-preference.spec.mjs`
- Create: `tests/e2e/navigation.spec.mjs`
- [ ] **Step 1: Write failing preference tests**
Cover precedence:
```text
saved light/dark choice > prefers-color-scheme > dark fallback
```
Test explicit `system` removal, invalid stored values, storage denial, toggle accessible name, no initial flash, and persistence across reloads.
- [ ] **Step 2: Write failing navigation tests**
At desktop and mobile, assert header landmarks, skip link, visible focus, menu open/close, Escape close, focus restoration, 44px targets, and correct destinations for Journal, Projects, Music, Podcasts, and About.
- [ ] **Step 3: Run tests and verify red**
```bash
npm run test:js -- --runTestsByPath tests/js/theme-preference.test.js
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e -- tests/e2e/theme-preference.spec.mjs tests/e2e/navigation.spec.mjs
```
Expected: FAIL because the shell and control are absent.
- [ ] **Step 4: Implement the no-flash bootstrap and control**
Print a minimal inline script at `wp_head` priority `0` that sets `document.documentElement.dataset.theme` before styles paint. Store only explicit `light` or `dark`; selecting system removes the key. Listen to system changes only while no explicit choice exists. Content/navigation remain functional without JavaScript.
- [ ] **Step 5: Draw the compact and full SVG marks**
Create code-native SVGs: front-facing rounded purple cat head, two pointed ears, terminal-like eyes, no raster text. Verify the compact mark at 32px and wordmark in both themes. Present both to the user and pause for the required visual approval before header integration.
- [ ] **Step 6: Add approved header/footer**
Use core Navigation/Search blocks, the dynamic toggle block, stable CSS `position: sticky`, no scroll animation, and no permanent sidebar.
- [ ] **Step 7: Run tests and commit**
```bash
npm run test:js -- --runTestsByPath tests/js/theme-preference.test.js
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e -- tests/e2e/theme-preference.spec.mjs tests/e2e/navigation.spec.mjs
git add inc/theme-preference.php blocks/theme-toggle assets/js/theme-toggle.js assets/icons parts assets/css/layout.css tests
git commit -m "feat: add CHRNX shell and theme preference"
```
### Task 6: Add page templates and editable patterns
**Dependency:** Complete and approve the alter-ego asset plan before this task references `alter-ego-*.png`.
**Files:**
- Create: `templates/home.html`
- Create: `templates/single.html`
- Create: `templates/page.html`
- Create: `templates/archive.html`
- Create: `templates/search.html`
- Create: `templates/404.html`
- Create: `patterns/home-intro.php`
- Create: `patterns/home-projects.php`
- Create: `patterns/home-music.php`
- Create: `patterns/about.php`
- Create: `patterns/project-detail.php`
- Create: `patterns/music-landing.php`
- Create: `patterns/music-release.php`
- Create: `patterns/podcast-landing.php`
- Create: `patterns/podcast-show.php`
- Create: `patterns/podcast-episode.php`
- Create: `tests/smoke/templates.test.mjs`
- Create: `tests/php/test-patterns.php`
- [ ] **Step 1: Write failing template/pattern tests**
Assert that every required template has one header, one `<main>`, one footer, no sidebar, and valid block comments. Assert every pattern has a valid PHP header, `chrnx` text domain, escaped dynamic values, and no production URLs/placeholders.
For music, assert approved public facts and exact draft states from the spec. For podcast patterns, assert structure and editor instructions only—no invented hosts, biographies, cover art, or listening links.
- [ ] **Step 2: Run tests and verify red**
```bash
node --test tests/smoke/templates.test.mjs
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php -- --filter Patterns
```
Expected: FAIL naming missing files.
- [ ] **Step 3: Build templates from small pattern/block units**
`home.html` order:
1. header;
2. identity intro;
3. `chrnx/featured-stories`;
4. `chrnx/journal-stream`;
5. selected projects;
6. The No Names preview;
7. `chrnx/latest-podcast`;
8. short About preview;
9. `chrnx/subscribe-cta`;
10. footer.
`single.html` uses an approximately `70ch` content column, metadata, optional featured image, post content, `chrnx/podcast-meta` when eligible, `chrnx/related-posts`, and `chrnx/subscribe-cta`. Archive/search templates expose topic/language filters, include `chrnx/topic-hero` on known topic archives, and provide useful empty states.
- [ ] **Step 4: Add public music starter copy**
Use `assets/images/the-no-names-collage.jpeg` and the approved music cutout. Include The No Names tagline, the three draft release cards, the studio-project statement, and plain AI/human-voice disclosure. Hide all platform destinations until editors add real URLs. Never scan or expose `/Users/chrnx/projects/suno` at runtime.
Map approved portraits into section surfaces:
- Code, Literature, Research, Life, and Gaming topic archives use `chrnx/topic-hero`.
- The No Names pattern uses `the-no-names-musician-cutout.png`.
- Podcast landing/show patterns use `alter-ego-podcasts.png` as optional decorative art.
- Individual posts without featured images continue to use CSS topic treatments, not the portrait files.
- [ ] **Step 5: Add structural podcast patterns**
Provide clearly labeled editor slots for description, hosts, cover, destinations, latest episode query, and archive. Do not print editorial instructions on the frontend after content is replaced. The episode pattern contains slots/checklist for show term, number, duration, participants, `canonical_episode_url`, one optional embed, and show notes.
- [ ] **Step 6: Run tests and commit**
```bash
node --test tests/smoke/templates.test.mjs
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php -- --filter Patterns
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run phpcs
git add templates patterns tests
git commit -m "feat: add CHRNX templates and editorial patterns"
```
### Task 7: Finish visual states, responsive behavior, and accessibility
**Files:**
- Create: `scripts/seed-test-content.sh`
- Create: `tests/fixtures/posts.json`
- Create: `tests/fixtures/pages.json`
- Create: `assets/css/components.css`
- Modify: `assets/css/base.css`
- Modify: `assets/css/layout.css`
- Modify: `theme.json`
- Create: `tests/e2e/layout.spec.mjs`
- Create: `tests/e2e/accessibility.spec.mjs`
- Create: `tests/e2e/content-edge-cases.spec.mjs`
- [ ] **Step 1: Define and seed the edge-case fixtures**
Create an idempotent WP-CLI script and synthetic JSON fixtures for long titles, missing metadata, no image/excerpt, unbroken code, one/two-story homepage states, empty searches, malformed filters, a podcast post missing `chrnx_show`, a podcast with canonical fallback but no embed, and a published/unpublished Subscribe page. Run the script twice and assert post/page counts and slugs do not change on the second run.
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run env:activate
PATH="/opt/homebrew/opt/docker/bin:$PATH" npx wp-env run cli --env-cwd=wp-content/themes/chrnx bash scripts/seed-test-content.sh
PATH="/opt/homebrew/opt/docker/bin:$PATH" npx wp-env run cli --env-cwd=wp-content/themes/chrnx bash scripts/seed-test-content.sh
```
Expected: both runs exit `0`; the second reports existing fixture slugs and creates nothing.
- [ ] **Step 2: Write failing visual-behavior tests**
Cover 375x812, 768x1024, 1440x900, and 2560x1440. Test long titles, missing image/excerpt/topic/language, unbroken code, fewer than three stories, empty search/filter, missing podcast metadata, blocked embed fallback, and reduced motion.
- [ ] **Step 3: Write failing accessibility tests**
Use Playwright plus `axe-playwright` for WCAG 2.2 AA automated checks. Add manual assertions for landmark uniqueness, heading sequence, names, focus, skip link, keyboard-only operation, and no hidden focus inside a closed menu.
- [ ] **Step 4: Run tests and verify red**
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e -- tests/e2e/layout.spec.mjs tests/e2e/accessibility.spec.mjs tests/e2e/content-edge-cases.spec.mjs
```
Expected: FAIL until states and styles exist.
- [ ] **Step 5: Implement the approved visual system**
Use the exact tokens from the spec, warm paper light mode, local Zen Maru headings, system body copy, limited monospace metadata, 44px controls, fluid spacing/type, CSS fallback artwork, responsive images, and `prefers-reduced-motion`. Keep decorative art outside the accessibility tree and meaningful images accurately described.
- [ ] **Step 6: Run tests, lint, and commit**
```bash
npm run lint:css
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e -- tests/e2e/layout.spec.mjs tests/e2e/accessibility.spec.mjs tests/e2e/content-edge-cases.spec.mjs
git add scripts/seed-test-content.sh tests/fixtures assets/css theme.json tests/e2e
git commit -m "feat: complete responsive accessible theme states"
```
### Task 8: Seed realistic synthetic fixtures and run browser compatibility
**Files:**
- Modify: `playwright.config.mjs`
- Create: `tests/e2e/full-site.spec.mjs`
- [ ] **Step 1: Extend synthetic fixtures for the full-site matrix**
Create no real family data and no production podcast claims. Include:
- sticky posts across several topics/languages;
- old Jinko-era block content;
- posts missing images, excerpts, and CHRNX metadata;
- one synthetic Silicon Ranch episode with a fake canonical `example.invalid` URL and no live embed;
- music/project/About pages created from patterns;
- malformed filter URLs and a no-results query.
Rerun the idempotent seeder so the newly added fixtures exist before browser tests:
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npx wp-env run cli --env-cwd=wp-content/themes/chrnx bash scripts/seed-test-content.sh
```
Expected: new fixture slugs created once; all earlier fixture slugs reported as already present.
- [ ] **Step 2: Run the full browser matrix**
```bash
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e -- --project=chromium
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e -- --project=firefox
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e -- --project=webkit
```
Expected: PASS in all three engines with screenshots/traces only on failure.
- [ ] **Step 3: Commit**
```bash
git add scripts/seed-test-content.sh tests/fixtures tests/e2e/full-site.spec.mjs playwright.config.mjs
git commit -m "test: add CHRNX full-site fixtures"
```
### Task 9: Performance, packaging, and final verification
**Files:**
- Create: `scripts/verify-theme-package.mjs`
- Create: `scripts/verify-lighthouse.mjs`
- Create: `scripts/build-theme-archive.sh`
- Create: `tests/smoke/package.test.mjs`
- Create: `screenshot.png`
- Modify: `README.md`
- Modify: `package.json`
- [ ] **Step 1: Write the failing package test**
The verifier must reject archives containing `.git`, `.superpowers`, `node_modules`, `vendor`, tests, tmp files, source chroma intermediates, OS metadata, absolute paths, or missing required theme files. It must require final fonts, license, approved SVGs, approved alter-ego PNGs, templates, patterns, and PHP modules.
- [ ] **Step 2: Run and verify red**
```bash
node --test tests/smoke/package.test.mjs
```
Expected: FAIL because the build/verification scripts and archive are absent.
- [ ] **Step 3: Capture the distributable theme screenshot**
```bash
npx playwright screenshot \
--viewport-size="1200,900" \
--wait-for-timeout=1000 \
http://localhost:8888 \
screenshot.png
file screenshot.png
```
Expected: `screenshot.png` is a 1200x900 PNG showing the seeded CHRNX homepage without browser chrome, open menus, cookie banners, or test overlays.
- [ ] **Step 4: Add deterministic packaging**
Build `dist/chrnx-theme-0.1.0.zip` from an explicit allowlist, then inspect every archive member. Do not package `.superpowers` mockups or `assets/images/the-no-names-musician-chroma.png`; package the full approved collage and final transparent cutout.
Run the build before verification:
```bash
bash scripts/build-theme-archive.sh
node scripts/verify-theme-package.mjs dist/chrnx-theme-0.1.0.zip
```
Expected: archive created, then verifier exits `0` and prints the validated member count.
- [ ] **Step 5: Run performance checks**
Against seeded wp-env pages, run local Lighthouse 13.4.1 on mobile and desktop. Record results in `docs/verification/0.1.0.md`. Required gates:
- no failed accessibility audit;
- CLS <= 0.1;
- no external font request;
- no theme-added tracker/cookie request;
- no console error;
- no layout overflow at tested widths.
Treat Lighthouse scores as evidence, not a design target; investigate individual failures.
Use Playwright's installed Chromium explicitly:
```bash
CHROME_PATH="$(node -e "console.log(require('playwright').chromium.executablePath())")" \
npx lighthouse http://localhost:8888 \
--chrome-flags="--headless --no-sandbox" \
--only-categories=performance,accessibility,best-practices,seo \
--output=json \
--output-path=docs/verification/lighthouse-mobile.json
CHROME_PATH="$(node -e "console.log(require('playwright').chromium.executablePath())")" \
npx lighthouse http://localhost:8888 \
--preset=desktop \
--chrome-flags="--headless --no-sandbox" \
--only-categories=performance,accessibility,best-practices,seo \
--output=json \
--output-path=docs/verification/lighthouse-desktop.json
node scripts/verify-lighthouse.mjs \
docs/verification/lighthouse-mobile.json \
docs/verification/lighthouse-desktop.json
```
`verify-lighthouse.mjs` must fail on any accessibility audit failure, CLS above `0.1`, or runtime/console error recorded by Lighthouse. The Playwright network test separately fails on remote font, tracker, or theme-added cookie requests.
- [ ] **Step 6: Run the complete fresh verification suite**
```bash
npm run test:smoke
npm run lint:js
npm run lint:css
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run phpcs
npm run test:js
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:php
PATH="/opt/homebrew/opt/docker/bin:$PATH" npm run test:e2e
bash scripts/build-theme-archive.sh
node scripts/verify-theme-package.mjs dist/chrnx-theme-0.1.0.zip
git diff --check
git status --short
```
Expected: every command exits `0`; Git shows only intentionally uncommitted verification notes, if any.
- [ ] **Step 7: Commit the verified package inputs and report evidence**
```bash
git add scripts tests/smoke screenshot.png README.md package.json package-lock.json docs/verification
git commit -m "chore: verify CHRNX theme package"
git status --short
```
Expected: clean worktree. Do not create a remote, push, deploy, activate on production, or publish Silicon Ranch data.
@@ -0,0 +1,273 @@
# CHRNX WordPress Theme Design
**Date:** 2026-08-11
**Status:** Approved in conversation
**Site:** <https://chrnx.dev>
## Purpose
Build a custom WordPress theme for CHRNX, a varied personal journal. The site presents one person's connected life: software development, independent research, fatherhood, music, gaming, pets, and daily observations. It leads visitors toward reading, then projects, the author profile, and subscription—in that order.
The theme replaces the current Jinko/Jinko Child presentation without rewriting existing posts, pages, or media.
## Editorial Position
CHRNX is a personal publication, not a portfolio disguised as a blog. Its variety is intentional. Code, research, music, life, and gaming act as discovery paths within one journal rather than separate microsites.
The site supports English and Spanish without duplicating every post. Each post uses the language that best serves the subject and the author's voice. English will often suit technical and research work; Spanish will often suit music and personal writing. This is an editorial tendency, not a rule.
The public profile leads with the author's work and ideas. Autism appears as human context in the longer profile, not as a marketing hook. The site may state that the author is a father of three, but it excludes children's names, faces, schools, routines, locations, and other identifying details by default.
## Visitor Priorities
The interface supports these goals in order:
1. Read publications.
2. Discover projects.
3. Learn about the author.
4. Subscribe.
Subscription remains visible but never interrupts reading with a modal, takeover, or forced gate.
Subscription prompts are ordinary links to the existing published `/subscribe/` page. The theme provides no signup form or email-provider integration. If the Subscribe page is unavailable or the editor removes its configured navigation destination, the theme omits the prompt instead of rendering a dead control.
## Information Architecture
The primary navigation contains:
- **Journal:** the complete archive, with topic, language, and search filters.
- **Projects:** technical projects, research work, papers, status, links, and related writing.
- **Music:** the band, songs, releases, lyrics, credits, embedded players, and studio notes.
- **Podcasts:** active shows, hosts, episodes, show notes, and listening destinations.
- **About:** the professional profile first, followed by personal context and verified links.
- **Search:** a keyboard-accessible site search.
- **Theme control:** light, dark, and system behavior through one compact control.
The homepage contains:
1. A concise identity statement.
2. One featured story and two secondary stories from different facets when possible.
3. A chronological stream of recent posts with topic and language filters.
4. Selected projects.
5. A preview of the music section.
6. The latest published podcast episode, when one exists.
7. A short author introduction.
8. A restrained subscription prompt.
The theme registers two single-value post taxonomies with radio-button controls in the editor:
- `chrnx_topic`: Research, Code, Literature, Music, Podcasts, Life, or Gaming.
- `chrnx_language`: English (`EN`) or Spanish (`ES`).
Podcast episode posts also use the single-value `chrnx_show` taxonomy. The initial term is `silicon-ranch`; a future personal show receives a term only when it has a public name and episode. Optional episode metadata stores episode number, duration, participants, and `canonical_episode_url` for cards and fallback links. The audio player itself exists only as an editor-inserted embed block inside the episode content; metadata never stores a second player or embed code.
Specific subjects remain standard WordPress tags. The custom taxonomy records remain in the database if the site changes themes. A post missing either value remains readable and uses neutral metadata; activation does not rewrite legacy categories. Editors may assign taxonomy values to old posts gradually.
## Visual Direction
The selected direction is **Taller nocturno**, softened for personal and long-form writing.
The dark palette uses:
- Night background: `#0D1117`
- Raised panel: `#161B22`
- Primary CHRNX violet: `#7C6CF0`
- Signal green: `#5FB88A`
- Main dark-mode text: `#E6EDF3`
- Muted dark-mode text: `#8B949E`
The light palette uses warm paper rather than clinical white:
- Paper background: `#F6F2E9`
- Raised surface: `#FFFDF7`
- Dark ink: `#25221F`
- Muted text: `#625C54`
- Light-mode violet: `#674CA4`
- Light-mode green: `#327854`
- Border: `#DED6C7`
The violet preserves continuity with the current CHRNX identity. Green serves as a secondary signal and a subtle connection to Green Tea. Accent colors communicate interaction and classification; they do not decorate every surface.
Zen Maru Gothic, served locally in weights 500 and 700, sets the wordmark and headings. System UI fonts set body copy for speed and sustained readability. A system monospace stack appears only in metadata and small technical details.
The logo evolves the current purple gaming cat into a simpler CHRNX cat mark. The current production asset at `wp-content/uploads/2024/04/cropped-gaming-logo-generator-featuring-a-mad-cat-illustration-523o-2880.png` supplies the visual reference. The new compact SVG keeps a front-facing purple cat head, two pointed ears, a rounded lower silhouette, and restrained terminal-like eyes. The full SVG pairs that mark with a text wordmark set independently, never outlined as raster text. The compact mark must remain legible at 32 CSS pixels. Creating both SVG assets belongs to the theme implementation, with one explicit visual-approval checkpoint before they replace the current logo.
### Recurring CHRNX Alter Ego
A recurring illustrated alter ego connects major sections without replacing post-specific artwork. Each variant preserves the same face, asymmetrical hair, triangular headband, distressed collage texture, and orange-black-teal base palette. Version one includes exactly one approved transparent PNG per topic:
- `assets/images/the-no-names-musician-cutout.png`: Music; the approved grunge musician with guitar and microphone.
- `assets/images/alter-ego-code.png`: Code; nocturnal programmer with code, terminals, and graphs.
- `assets/images/alter-ego-literature.png`: Literature; gothic writer with manuscript, ink, and raven imagery.
- `assets/images/alter-ego-research.png`: Research; chess, data, and emotion-modeling diagrams.
- `assets/images/alter-ego-podcasts.png`: Podcasts; host with studio microphone and headphones.
- `assets/images/alter-ego-life.png`: Life; a quieter everyday portrait that depicts no children or identifying family details.
- `assets/images/alter-ego-gaming.png`: Gaming; an original gothic creature hunter without copied costumes, logos, or named franchise characters.
The implementation creates the six missing variants from the approved music persona and presents them together for one explicit visual-approval checkpoint before the theme references them. A historical stealth variant inspired by the broad assassin archetype is deferred; it may become post-specific art later. Use the approved topic illustrations for section headers, not for every post. CSS-generated topic treatments remain the default fallback for individual posts without featured images. This keeps the character recognizable without turning the journal into a themed gallery.
The approved music source art is stored at `assets/images/the-no-names-collage.jpeg`. Its isolated website derivative is `assets/images/the-no-names-musician-cutout.png`; `assets/images/the-no-names-musician-chroma.png` preserves the removable-background intermediate. The theme must not modify or overwrite the source image.
## Homepage Layout
The approved homepage combines a magazine opening with an editorial stream.
The opening uses a `1 + 2` arrangement: one large featured story and two smaller stories. This gives research, music, and personal writing immediate visual presence. Below it, a chronological list protects the central reading experience and gives posts without custom artwork equal access to readers.
Editors select the primary feature with WordPress's native sticky-post behavior. If several posts are sticky, the most recently published sticky post leads; other sticky posts return to normal chronological placement. An eligible story is a public, published standard post with a nonempty title. The two secondary slots select the newest eligible non-primary posts, first preferring topics different from the primary and each other, then filling any remaining slot by publication date regardless of topic. When fewer than three eligible posts exist, the layout collapses without empty slots.
Posts may provide a featured image. Without one, the theme renders a deterministic topic-based visual treatment; it does not create or upload synthetic media.
## Templates and Components
### Header
The compact header contains the mark, primary navigation, search, and theme control. It uses CSS `position: sticky` at the top on all supported viewports, keeps a stable compact height, and uses no scroll-triggered animation. The mobile menu traps no keyboard focus and restores focus to its trigger when closed.
### Single Post
The single-post template uses a reading column near `70ch`. It displays title, primary topic, language, publication date, estimated reading time, and an optional featured image. It has no permanent sidebar. Related posts and a quiet subscription prompt follow the article.
### Archives and Search
Archive and search templates favor scannable lists. They support topic and language filters and preserve filter state in the URL. Empty results explain what happened and provide a direct path back to the complete journal.
### Projects
Project pages use reusable block patterns for status, summary, links, technologies, publications, and related posts. Initial content can include Expressive Tea, Ailed, and published research. Project content remains standard WordPress page content.
### Music
The music landing page presents **The No Names** as the active band: Mexican Spanish grunge from Sinaloa, built around dirty guitars, physical low end, raw studio dynamics, and a voice that moves from restraint to rupture. The public tagline is “Grunge mexicano para cerebros que no se callan.” The page describes the work as a studio project—estudio crudo, cero live—without concert imagery or promises of live performance.
The opening combines the full collage art with the isolated musician. Below it, release cards represent the real production state:
- *El Hermoso Caos que habita en mi cabeza*: 13-track debut album, draft/in production.
- *Ando Bien Arriba*: six-track bright mirrored EP, draft/in production.
- *Aquí se Rompió una Jerga*: six-track dark mirrored EP, draft/in production.
The page may disclose the production model in plain language: generative AI anchored in Chrnx's real human voice. It avoids AI hype and fictional band mythology. The local project at `/Users/chrnx/projects/suno/bands/the-no-names/` is the editorial source of truth during content preparation; the public site exposes only approved bios, concepts, art, credits, lyrics, and release states. It never exposes stems, raw audio, prompt recipes, voice-model details, internal checklists, or draft lyrics by directory discovery.
Release destinations remain hidden until official URLs exist. After DistroKid distribution, the same cards accept Spotify, Apple Music, YouTube Music, and Bandcamp links without a layout change. A failed or blocked player leaves a clear external link. Music and lyrics remain standard WordPress content, so changing themes does not erase them.
### Podcasts
The podcast landing page presents **Silicon Ranch** as the active group show. It includes a show description, cover art, hosts, latest episode, episode archive, and official listening destinations. Each episode uses a standard WordPress post with `chrnx_topic=podcasts` and `chrnx_show=silicon-ranch`; the post contains humanized show notes and, when available, one editor-inserted Buzzsprout embed block. `canonical_episode_url` supplies the external fallback link and card destination.
The theme does not scrape or automatically import the RSS feed in version one. An editor publishes a companion WordPress post for each episode, preserving editorial control, search visibility, and reliable fallbacks. The homepage queries the latest published standard post where `chrnx_topic=podcasts` and `chrnx_show` has any registered show term. The Silicon Ranch page requires `chrnx_show=silicon-ranch`. A podcast-topic post missing `chrnx_show` remains in the Journal but appears in neither podcast surface until corrected. If no eligible episode exists, the homepage omits the podcast module.
A future personal podcast remains absent from public navigation and pages until it has a name, concept, artwork, and at least one published episode. The underlying `chrnx_show` model supports it without redesign. Generated art must not reproduce the appearance of Silicon Ranch co-hosts without their approval and reference images.
### About
The About page opens with work and ideas: independent research, software development, emotion modeling, game AI, open source, and published work. It then introduces the author as autistic, a father of three, a musician, a gamer, a pet-friendly person, and an amateur data scientist. The page links to arXiv:2603.05352 and other claims only through verified destinations.
### Footer
The footer provides topic links, selected projects, music, podcasts, social destinations, privacy and contact pages, and one short personal line. It avoids duplicate navigation walls and oversized subscription forms.
## Theme and Production-Content Boundary
The implementation delivers theme code, local fonts, approved image assets, templates, and insertable block patterns. It does not connect to or mutate the production WordPress database, create pages on activation, publish posts, or import content.
The theme ships these preconfigured editorial patterns as editable starter content:
- The No Names music landing page with the approved public copy and current draft release states in this specification.
- Music release card.
- Structural podcast landing page with editor instructions, no public placeholder claims.
- Structural Silicon Ranch show page with slots for approved description, hosts, cover art, and listening destinations.
- Podcast episode body and metadata checklist.
- Project detail page.
The podcast patterns do not ship invented descriptions, host biographies, cover art, or platform links. During the later editorial step, the editor sources those fields from the then-current official Buzzsprout/show profiles and user-approved show materials. Acceptance tests use clearly synthetic fixture content in a disposable WordPress environment. After staging activation, the editor creates or selects the real WordPress pages, inserts the approved patterns, verifies links and public copy, and publishes them as a separate editorial step.
## WordPress Foundation and Publishing Flow
The deliverable is a native block theme built with `theme.json`, block templates, template parts, and reusable patterns. It uses minimal PHP and JavaScript for behavior that core blocks cannot express cleanly. It does not depend on Elementor or another proprietary page builder.
A normal publishing flow is:
1. Create or edit a standard WordPress post.
2. Select one primary topic and any relevant tags.
3. Set the post language to `EN` or `ES`.
4. Add an optional featured image.
5. Mark the post sticky only when it should lead the homepage.
6. Preview, then publish.
Existing content must render before any optional editorial cleanup. The theme will not perform destructive migrations. Project, music, and podcast layouts use block patterns that editors can insert and change through WordPress.
For a podcast episode, the editor also selects a `chrnx_show` term, enters any known episode metadata and `canonical_episode_url`, writes the show notes, and optionally inserts one Buzzsprout embed block in the content. The theme never publishes or imports an episode automatically.
## Theme Preference Flow
Theme selection follows this order:
1. A visitor's saved light or dark choice.
2. The operating system's `prefers-color-scheme` value.
3. Dark mode as the technical fallback.
An early inline script applies the resolved value before the main stylesheet paints, preventing a light/dark flash. The visible control updates the page, persists explicit choices, and allows the visitor to return to system mode.
## Responsive Behavior
Mobile layouts prioritize reading rather than shrinking the desktop grid. The featured `1 + 2` area becomes a clear stack, navigation becomes a compact menu, and controls retain touch targets of at least 44 CSS pixels. Typography, spacing, and artwork use fluid ranges with tested maximums.
## Accessibility and Privacy
The theme targets WCAG 2.2 AA for contrast, keyboard use, focus visibility, structure, controls, and reduced motion. Headings follow document order. Icon-only controls have accessible names. Motion responds to `prefers-reduced-motion`.
The theme adds no analytics, trackers, cookies, remote fonts, or external requests by itself. External media loads only on pages where an editor embeds it. Family privacy follows the editorial rule in this document.
## Performance
The theme serves local WOFF2 font files with `font-display: swap`. Body text uses system fonts. Images use WordPress responsive image features, explicit dimensions, and lazy loading below the first viewport. Scripts remain small, scoped, and deferred unless they must set the initial theme preference.
The design avoids a JavaScript client framework. WordPress and CSS render core navigation, archives, posts, projects, music, and podcast pages.
## Failure States
- Missing featured image: render a topic-based fallback treatment.
- Missing topic or language metadata: show neutral metadata and keep the post readable.
- Fewer than three eligible featured stories: collapse the feature grid without placeholders.
- Empty search or filter: explain the result and link to the complete journal.
- Blocked or unsupported media embed: keep the title and external destination visible.
- Missing podcast metadata or player: keep the episode title and show notes visible; omit unknown fields and dead controls.
- Unreleased music destination or future podcast: hide the control or section instead of showing disabled promotional UI.
- Long titles, unbroken code, legacy blocks, or missing excerpts: wrap or derive presentation without clipping content.
- JavaScript unavailable: content and navigation remain usable; theme preference falls back to CSS system preference.
## Verification
Before delivery, verify:
- Homepage, archive, search, single post, project, music, podcast, About, and 404 templates.
- Current production posts, including old entries and posts without images or excerpts.
- Mobile and desktop viewports in Chromium, WebKit, and Firefox.
- Light, dark, system, saved preference, and no-JavaScript behavior.
- Keyboard navigation, focus restoration, skip links, headings, landmarks, and accessible names.
- Automated contrast and accessibility checks, followed by manual keyboard review.
- Reduced-motion behavior.
- Responsive images, font loading, layout shift, and local Lighthouse results.
- Search, topic filters, language filters, empty states, and malformed query values.
- Suno or supported media embeds plus blocked-player fallbacks.
- Buzzsprout episode embeds, missing-player fallbacks, show filters, and homepage omission when no podcast episode exists.
- The No Names release cards against the approved public statuses; no draft-only files or internal production metadata exposed.
- Original and derivative music art at desktop and mobile sizes, including transparent-edge inspection on light and dark surfaces.
- Theme activation on a staging copy before any production switch.
## Out of Scope
- Publishing the theme to WordPress.org or a public marketplace.
- Rewriting or translating existing posts.
- Automatically generating article images.
- Migrating production data destructively.
- Creating Spotify or DistroKid releases before the album exists.
- Scraping or automatically importing podcast RSS feeds in version one.
- Publishing a placeholder personal podcast before it has a public identity and episode.
- Creating or publishing production WordPress pages and posts during theme activation.
- A second gaming alter-ego variant based on a historical stealth archetype.
- Adding analytics, advertising, memberships, comments redesign, or an email service without a separate decision.
## Success Criteria
The theme succeeds when a first-time visitor can identify CHRNX as a varied personal publication, start reading without friction, discover projects, The No Names, and Silicon Ranch, understand the author's work and humanity, and choose a durable light or dark preference. Existing content remains readable, the author can publish posts and podcast companions through normal WordPress controls, and the site stays fast and accessible on mobile and desktop.