docs: define CHRNX theme design
This commit is contained in:
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.
|
||||
Reference in new issue
Block a user