Global Sites Directory 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 static, internationalized directory for browsing selected popular websites by country/category and products by parent company.

Architecture: A UMD data module owns all catalog records and pure query helpers. A separate browser controller renders two local-filtered views and saves only UI choices in localStorage. The Jekyll page contains stable DOM hooks and loads the data module before the controller.

Tech Stack: Jekyll Markdown, vanilla JavaScript, browser localStorage, existing sitei18n event, CSS Grid, Node.js built-in assert.

Spec: docs/superpowers/specs/2026-09-05-global-sites-directory-design.md

Global Constraints


File Structure

Task 1: Create and test the catalog module

Files: Create tests/global-sites.test.js, assets/js/global-sites-data.js.

Interfaces: Export countries, categories, companies, sites, companyProducts, filterSites({ countryId, categoryId, query }), productsForCompany(companyId), and isSafeUrl(url). The browser receives the same API as window.GlobalSitesData.

Task 2: Add page markup and translation copy

Files: Create tools/global-sites.md; modify assets/js/i18n.js.

Interfaces: The page exposes [data-global-sites], [data-country-select], [data-category-tabs], [data-sites-results], [data-company-select], and [data-company-tree]. The page loads global-sites-data.js before global-sites.js.

Task 3: Implement interactions and responsive presentation

Files: Create assets/js/global-sites.js; modify assets/css/style.css.

Interfaces: Save { countryId, categoryId, query, companyId, view } under globalSitesDirectoryState. Consume GlobalSitesData.filterSites, productsForCompany, and isSafeUrl.

Files: Modify index.md, tools.md; verify all files from Tasks 1–3.