Building Theme Doctor Tools: Automated Vertical Theme Auditing and Patching
Had a productive session working on honeybun-workers today, specifically building out some much-needed tooling for managing our vertical themes.
The Theme Doctor Is In
I've been dealing with inconsistent vertical themes across our different industries (medspas, plumbers, gyms, etc.) and finally decided to tackle this systematically. Built two new scripts that work together:
audit-vertical.sh - A 5-gate static analyzer that reads your theme and tells you what's broken:
- Gate A: Are you missing required templates? (We need at least 10, warn at 13)
- Gate B: Is your SEO game on point? (OG props, schema markup, canonical URLs)
- Gate C: Do you have base theme files contaminating your vertical?
- Gate D: Are archived templates blocking the real ones?
- Gate E: Are you using our link helpers properly?
patch-vertical.sh - The fixer that runs in dry-run mode by default (because I don't trust myself):
- Copies missing templates from base theme
- Fixes SEO implementation gaps
- Quarantines contamination files (never deletes - I learned this lesson the hard way)
- Restores blocked templates
The results were... eye-opening:
| Vertical | FAIL | WARN | PASS |
|---|---|---|---|
| medspas | 12 | 4 | 9 |
| plumbers | 1 | 8 | 33 |
| gyms | 1 | 8 | 33 |
Medspas is a mess - missing SEO entirely, contamination files everywhere, archived templates blocking real ones. The good news? The patch script knows exactly how to fix all 12 issues.
Design-Driven Components Getting an Upgrade
Also spent time adding layout variants to our plumbers theme. Now the homepage can dynamically switch between different layouts based on DCC settings:
- Hero layouts: editorial (default), split, or fullbleed-video
- About layouts: split-image (default), founder-letter, or proof-wall
- Reviews layouts: cards (default), featured-hero, or masonry
All backwards compatible - defaults match current behavior so nothing breaks.
Motion Fingerprinting
The funnel crawler now extracts motion patterns from competitor sites - detecting animation libraries, easing curves, scroll patterns, and CSS variables. This feeds into our Vertical Factory which generates motion profiles for new verticals.
Made the vertical factory synchronous too because I kept hitting Cloudflare's 30-second timeout. Sometimes the simple fix is the right fix.
Key Lessons
- Separate read and write operations - audit script is read-only, patch script has dry-run default
- Never delete, always quarantine - moved contamination files to
.contamination_quarantine/ - Grep large files directly - don't pipe through variables, just
grep -q "pattern" "$file" - Make changes additive - DCC variants default to existing behavior
Next up: actually applying these patches to medspas and propagating the layout variants to other verticals. The theme doctor tools are ready for production.