Yellow Wing Roasters — Master Technical Debt & Optimization Roadmap (TODO.md)

This document is the authoritative evaluation and backlog for the Yellow Wing Roasters Jekyll codebase. It consolidates the re-evaluation of:

  1. DRY_OPTIMIZATION_RECOMMENDATIONS.md
  2. AGENTS.md & .agents/rules/coding-principles.md
  3. .agents/skills/ywr-coding-guidelines/SKILL.md
  4. Operational tracking from TODO.txt (Email confirmation automation)

1. Executive Summary & Health Scorecard

Over the recent refactoring cycles, major architectural consolidations were achieved:

However, deep re-evaluation reveals critical areas that still require immediate attention:


2. Re-Evaluation of DRY_OPTIMIZATION_RECOMMENDATIONS.md

2.1 Liquid Templates & Layouts


2.2 CSS & SASS Consolidations


2.3 Data Centralization (_data/ & _config.yml)


2.4 JavaScript Modularization


2.5 Defensive Coding & Silent Fallback Elimination


2.6 Repository Hygiene


3. Re-Evaluation Against Coding Principles (AGENTS.md, coding-principles.md, SKILL.md)

Principle 1: Config-Driven Over Hardcoded (Fail Rather Than Guess)

“I’d rather a failure than a default value that doesn’t make sense.”

File Line(s) Violation Status / Remediation
gift.markdown 415 default_sub_sizes = "12oz,1lb,2lb,5lb" fabricated string array RESOLVED: Sizes derived dynamically from r.price and s.sizes
_custom/bring-your-own-burner.md 84–88 Static <option> tags for 12oz, 1lb, 2lb, 5lb RESOLVED: Rendered via _includes/bag-size-options.html driven by _data/bag_sizes.yml
js/flights.js 28, 72, 73 options.price \|\| 38, options.pricePerBag \|\| 10, minBags \|\| 4 RESOLVED: Direct reads from frontmatter options without fallback numbers
js/flights.js 140 Hardcoded mascot audubon-cardinal-transparent.png RESOLVED: Reads mascot from flight frontmatter
js/order-checkout.js 65–66 params.get('size') \|\| '12oz', params.get('grind') \|\| 'Whole Bean' RESOLVED: Reads from catalog entry sizes and window.YWR_DEFAULT_GRIND
js/roast-detail.js 21 var defaultFreq = config.defaultFreq \|\| 'Monthly'; RESOLVED: Deleted dead phantom variable and unused parameter

Principle 2: Simple & Direct Lookups (No Defensive Guessing, No Phantom Variables)

File Line(s) Violation Status / Remediation
gift.markdown 421 r_sub.price \| default: r.price RESOLVED: Standard roasts only declare price:; reads r.price directly
gift.markdown 173–200 roast.descriptor \| default: roast.subtitle \| default: 'Blend' RESOLVED: Direct roast.descriptor read
_layouts/roast.html 250 sub_config.price \| default: roast_prices RESOLVED: Reads roast_prices directly
_layouts/roast.html 275 5-level fallback ladder for highPrice in Schema.org RESOLVED: Reads roast_prices[sizes.last] directly
js/cart-data.js 63 site.data.roast_levels[lvl_num] \| default: site.data.roast_levels[lvl_num_str] RESOLVED: Direct integer lookup in roast_levels.yml

Principle 3: Natural Runtime Exceptions (No Manual Guard Boilerplate)

File Line(s) Violation Status / Remediation
js/order-checkout.js 29 if (!form \|\| !emptyEl \|\| !itemsEl) return; RESOLVED: Removed silent guard; let form.addEventListener throw if missing
js/flights.js 79 if (!addBtn \|\| !countEl) return; RESOLVED: Removed silent return; let DOM operations throw TypeError
js/byob-burner.js 34 if (!originSelect) return; RESOLVED: Removed silent return
js/gift-order.js 183 if (!customMenu \|\| !customTrigger) return; RESOLVED: Removed silent return and defensive ternaries
js/manage-subscriptions.js 59 if (!lookupForm \|\| ... \|\| !resultsSection) return; RESOLVED: Removed silent return
js/manage-subscriptions.js 44 Silent catch (e) {} RESOLVED: Added console.error('saveMockDb: Failed to save mock subscriptions:', e)
js/order-checkout.js 638–639 Silent catch (e) {} around storage removal RESOLVED: Added console.warn if storage removal throws

Principle 4: Ask Rather Than Fall Back on Missing Data


4. Email Automation & Operational Gaps (from TODO.txt)


5. Master Prioritized Implementation Checklist

Phase 1: Critical Architectural & Coding Principle Fixes (Immediate)

Phase 2: JavaScript Hardening & Fast-Fail (Short-Term)

Phase 3: Layouts & Template DRYing (Medium-Term)

Phase 4: CSS Consolidation & Repository Hygiene (Polishing)

Phase 5: Operational & Email Automation (Features)