6.6 KiB
10 — Agent Execution Breadcrumbs
Step-by-step ordered checklist for an agent executing a .wpress migration to Stack A. Each step has: input, command, expected output, verification. Complete each before next.
Pre-flight
- .wpress file confirmed at
$PROJECT/.planning/*.wpress - python3 --version >= 3.8
- docker compose version confirmed
- DOMAIN and PROJECT env vars set
Step 1 — Extract archive
INPUT: $WPRESS (path to .wpress file)
CMD:
python3 $SOPS/wp-divi-pipeline-to-am-stack/scripts/extract_wpress.py "$WPRESS" "$PROJECT/.planning/wpress-extract/"
VERIFY:
ls $PROJECT/.planning/wpress-extract/
Expected: database.sql and wp-content/ present
BLOCK: If database.sql missing, .wpress format differs — check extract_wpress.py logs.
Step 2 — Analyze database
INPUT: $PROJECT/.planning/wpress-extract/database.sql
CMD:
python3 $SOPS/wp-divi-pipeline-to-am-stack/scripts/analyze_db.py "$PROJECT/.planning/wpress-extract/" "$PROJECT/.planning/data/"
VERIFY:
cat $PROJECT/.planning/data/pages.json | python3 -m json.tool | head -20
cat $PROJECT/.planning/data/site-info.json
Expected: page objects with slug + title visible; divi_version: 4 or 5
BLOCK: If pages.json empty, check table prefix detection in analyze_db.py output.
Step 3 — Extract nav menus
INPUT: $PROJECT/.planning/wpress-extract/database.sql
CMD:
python3 $SOPS/wp-divi-pipeline-to-am-stack/scripts/extract_nav.py "$PROJECT/.planning/wpress-extract/" "$PROJECT/.planning/data/"
VERIFY:
cat $PROJECT/.planning/data/nav.json | python3 -m json.tool
Expected: array of {label, href, display_order, is_cta} objects. At least 3 items.
NOTE: is_cta=1 for "Book", "Get Started", "Contact", "Sign Up" type items.
Step 4 — Extract page content
INPUT: $PROJECT/.planning/data/pages.json + wpress-extract/
CMD: (choose based on Divi version from Step 2)
Divi 5:
python3 $SOPS/wp-divi-pipeline-to-am-stack/scripts/extract_divi5.py "$PROJECT/.planning/data/pages.json" "$PROJECT/.planning/data/content/"
Divi 4:
python3 $SOPS/wp-divi-pipeline-to-am-stack/scripts/extract_divi4.py "$PROJECT/.planning/data/pages.json" "$PROJECT/.planning/data/content/"
VERIFY:
ls $PROJECT/.planning/data/content/
cat $PROJECT/.planning/data/content/home.json | python3 -m json.tool | head -40
Expected: one .json file per page (home.json, about.json, etc.); sections array with type fields visible.
Step 5 — Extract media
INPUT: $PROJECT/.planning/wpress-extract/wp-content/uploads/
CMD:
python3 $SOPS/wp-divi-pipeline-to-am-stack/scripts/extract_media.py "$PROJECT/.planning/wpress-extract/" "$PROJECT/.planning/data/" "$PROJECT/assets/images/"
VERIFY:
ls $PROJECT/assets/images/ | head -10
cat $PROJECT/.planning/data/media-manifest.json | python3 -m json.tool | head -20
Expected: .webp files present; media-manifest.json shows original_url → /assets/images/x.webp mapping.
Step 6 — Stage seed_databases.py skeleton
INPUT: All .json files in $PROJECT/.planning/data/content/ + nav.json + media-manifest.json
CMD:
python3 $SOPS/wp-divi-pipeline-to-am-stack/scripts/stage_seed.py "$PROJECT/.planning/data/" "$PROJECT/build/seed_databases.py" --domain "$DOMAIN"
VERIFY:
python3 -c "import ast; ast.parse(open('$PROJECT/build/seed_databases.py').read()); print('syntax OK')"
grep "def seed_pages" $PROJECT/build/seed_databases.py
Expected: seed_databases.py is valid Python; contains seed_pages, seed_nav functions.
NOTE: Content stubs are in place. Human/agent reviews + fills in prose before running.
Step 7 — Review and fill content
MANUAL: Open $PROJECT/build/seed_databases.py
For each page's sections_json:
- Confirm
hero_h1andhero_leadmatch the brand (not raw Divi copy-paste) - Confirm each section has correct type (see 09-stack-a-output.md mapping)
- Replace any em-dashes (—) with commas or periods
- Replace any Divi shortcode residue (
[et_pb_,vc_, etc.) - Ensure no "Netherlands" or location-specific copy if site is global
- Confirm nav items in
seed_nav()match final site IA - Verify all image paths are
/assets/images/{name}.webp - Verify all CTAs point to correct slugs (
/about,/contact, etc.)
Step 8 — Run seed_databases.py
CMD:
cd $PROJECT && python3 build/seed_databases.py
VERIFY:
ls -lh src/api/data/
Expected: Output line shows counts > 0: seeded: pages=N nav=N blog=N .... Database files exist.
BLOCK: Any count=0 means that seeder function has an error — fix before continuing.
Step 9 — Scaffold PHP templates
CMD: Copy reference templates from vibrantyou.yoga as starting point:
VYOGA="/home/sirdrez/arisingmedia-websites/vibrantyou.yoga"
cp $VYOGA/src/api/router.php $PROJECT/src/api/router.php
cp $VYOGA/src/api/contact.php $PROJECT/src/api/contact.php
cp $VYOGA/src/api/templates/static.php $PROJECT/src/api/templates/static.php
cp $VYOGA/src/api/templates/home.php $PROJECT/src/api/templates/home.php
cp $VYOGA/src/api/components/_header.php $PROJECT/src/api/components/_header.php
cp $VYOGA/src/api/components/_footer.php $PROJECT/src/api/components/_footer.php
cp -r $VYOGA/assets/css $PROJECT/assets/
cp -r $VYOGA/assets/js $PROJECT/assets/
cp $VYOGA/Dockerfile $PROJECT/
cp $VYOGA/docker-compose.yml $PROJECT/
cp -r $VYOGA/infra $PROJECT/
VERIFY:
php -l $PROJECT/src/api/router.php
Expected: No syntax errors detected
NOTE: Update brand name, colors, and any site-specific logic in templates.
NOTE: _header.php reads from nav.sqlite — no hardcoded nav needed.
Step 10 — Build and test
CMD:
cd $PROJECT && docker compose build --no-cache && docker compose up -d
VERIFY:
sleep 5
curl -I http://localhost:8000/
curl -s http://localhost:8000/ | grep -i "title\|h1" | head -3
Expected: HTTP 200; site name visible in page.
Step 11 — Protection + SEO check
CMD:
bash /home/sirdrez/arisingmedia-websites/.am-webdesign-sops/tools/verify-protection.sh http://localhost:8000
VERIFY: Exit 0, no FAIL lines
Step 12 — Lighthouse + cleanup
MANUAL:
- Open Firefox:
firefox http://localhost:8000/ - Run Lighthouse (DevTools > Lighthouse)
TARGET:
- Performance >= 90
- SEO >= 95
- Accessibility >= 90
CLEANUP:
cd $PROJECT && docker compose down