build-theme
Skill1 starsChanged 5 months agoMITView on GitHub
Build a new NUMU V3 storefront theme end-to-end with the current toolchain — @numueg/theme-cli (scaffold/dev/validate), @numueg/theme-plugin (federated vite build), @numueg/theme-sdk 0.10+ (hooks/components/soft-nav), @numueg/theme-kit (headless helpers). Use when creating a theme, adding sections to one, or porting a design into the NUMU theme engine.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- aunetx/deezer-linuxtheir own version, first seen Oct 8, 2026
- path-to-ai-com/ptai-ecom-toolkittheir own version, first seen Oct 6, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- aunetx/deezer-linux★ 631same name
- path-to-ai-com/ptai-ecom-toolkit★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository11 other files it gives its agents.
- ask-terminalSkill
- command-paletteSkill
- deploy-doctorSkill
- github-activitySkill
- llm-endpointSkill
- numu-AOV-themesSkill
- numu-store-founderSkill
- og-imageSkill
- scroll-reveal-kitSkill
- seo-kitSkill
- theme-toggleSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 59
If a helper is missing from the kit, add it TO the kit (PR + release), don't fork it locally.
- Very specific: line 63
Navigation: always <Link to="/products/foo"> from the SDK.
- Very specific: line 66
Never use next/link, window.location, or raw <a> for internal paths.
- Very specific: line 68
NEVER hand-divide /100 or hardcode "EGP"/"ج.م" — multi-currency is live.
- Very specific: line 90
Every user-facing string ships en + ar.
- Very specific: line 111
If the theme renders its own header/footer chrome via section groups, the manifest flag renders_global_sections (plugin ≥0.6.0 emits it) …
- Very specific: line 119
Commit to V3-themes on a feature branch → PR → merge to main (triggers the R2 deploy + registry seed for test + prod).
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Building a NUMU V3 Theme
The four packages and their roles — never blur them:
| Package | Role | Reaches the theme how |
@numueg/theme-cli (≥0.7.0) | scaffold, dev server, validate, publish | dev dependency, numu-theme bin |
@numueg/theme-plugin (≥0.6.0) | vite build → dist/theme.js + import-map.json + manifest | numuTheme({ federate: true }) in vite.config |
@numueg/theme-sdk (≥0.10.0) | React runtime: hooks, components, contexts | externalized — the host storefront serves it via import map; the bundle never inlines it |
@numueg/theme-kit (≥0.1.0) | React-free helpers: settings guards, i18n pick, money, image | inlined into the bundle at build; pure functions, no runtime coupling |
1. Scaffold
npx @numueg/theme-cli init <theme-name> # or: numu-theme initThe scaffold already includes: all required templates, the standard 5-color + 2-font
settings_schema.json block (wired to --theme-* CSS vars), Header/Footer +
~15 sections, vite.config with numuTheme({ federate: true }), bilingual patterns.
Non-negotiable rule: component filename = schema section type. A section whose
schema type is featured_collection lives in src/sections/featured_collection.tsx.
The registry is built by filename convention; a mismatch = section silently never renders.
2. Dependencies
// package.json — the split matters
"dependencies": { "@numueg/theme-kit": "^0.1.0" }, // inlined
"devDependencies": { "@numueg/theme-sdk": "^0.10.0", // externalized at build
"@numueg/theme-plugin": "^0.6.0",
"@numueg/theme-cli": "^0.7.0" }3. Settings access — theme-kit, never hand-rolled guards
Merchant settings arrive as untyped JSON. Do NOT write local asString/localized
helpers (that was the pre-kit copy-paste era). Import from the kit:
import {
localized, // localized(locale, en, ar) — ar-aware picker
asString, asNumber, asBool, asArray, asRecord, // type guards w/ fallbacks
asImageUrl, asImageAlt, // image-setting readers
readBlocks, pickItems, // block-container readers
formatMoney, centsToMajor, // money formatting
asImageTransform, applyImageTransform, // focal-point/crop transforms
} from "@numueg/theme-kit";
const title = asString(s.title) || localized(locale, "New arrivals", "وصل حديثاً");If a helper is missing from the kit, add it TO the kit (PR + release), don't fork it locally.
4. SDK usage — what each new feature gives you for free
- Navigation: always
<Link to="/products/foo">from the SDK. Since 0.10 it soft-navigates (client-side transition, no reload/remount) when the host supports it and falls back to a full nav otherwise. Programmatic:requestNavigate(href). Never usenext/link,window.location, or raw<a>for internal paths. - Money:
<Money amount={...} currency={order.currency}>or kitformatMoney. NEVER hand-divide/100or hardcode"EGP"/"ج.م"— multi-currency is live. ⚠ Pitfall:variant.price.amountis cents;product.priceis major units. - Global sections:
useSectionGroup("header")/"footer"returns the ordered instances fromthemeSettings.section_groups; render them through your own registry. Themes that do this render their chrome on EVERY route consistently. - Template overrides:
usePage().templatecarriesproduct.<suffix>etc. The host resolvestemplate_suffix(Shopify OS 2.0-style variants) — render whatever template key you're handed; never hardcode "the product template". - Data:
useCachedResource(key, fetcher)for theme-custom data (SWR-style dedup + cross-instance sync). Catalog basics come fromuseShop/useProduct/useCollection/ useProducts/useCart/useCustomer/useNavigation/useSearch. - Variants:
useVariantSelection(product)— it publishes the live picker axes to the selection registry soaddItemlabels cart lines ("Black, L") even for legacy products. Custom add-to-cart buttons:publishVariantSelection/readVariantSelection. - Checkout/account:
useCheckout,useShippingRates,useOrders,useCustomerAddresses,useReorder,useGiftCardBalance— themes own these UIs. - Rich text from merchants: SDK
<RichText>only (sanitizes). NeverdangerouslySetInnerHTML. - Entry:
defineThemeEntry(ThemeRoot)— givesmount(client) +createApp(SSR string render). Both must work: SSR parity is validated.
5. i18n / RTL — bilingual is mandatory
Every user-facing string ships en + ar. Fixed chrome strings: const t = useT()-style
via SDK useLocale, or kit localized(locale, en, ar). Merchant content: bilingual
settings (heading_en/heading_ar or i18n maps) read with localized. Layout must
survive dir="rtl" — use logical CSS properties (margin-inline-start, not margin-left).
6. Validate + dev loop
numu-theme dev # local dev server against a store
numu-theme check # schema/manifest validation (single-source: SDK /validation)
numu-theme lint # section conventions
npm run build # vite + plugin → dist/theme.js, import-map.json, manifestBuild output must show federate: true and the current sdk_compat_minor in
dist/import-map.json, with react/@numueg/theme-sdk externalized (grep dist/theme.js
for from"react" — it must be an import, not inlined source).
- The host gates on
sdk_compat_minor: a bundle built against a NEWER SDK minor than the host runtime serves is refused with a clear error. Build against the published SDK version the storefront runtime serves. - If the theme renders its own header/footer chrome via section groups, the manifest
flag
renders_global_sections(plugin ≥0.6.0 emits it) tells the host not to double-render fallback chrome.
7. Ship
- Bump
theme.jsonversion — the marketplace seed is idempotent by slug+version; an unbumped version silently overwrites in place and merchants never see an update. - Commit to
V3-themeson a feature branch → PR → merge tomain(triggers the R2 deploy + registry seed for test + prod). - Stores are never auto-switched — merchants adopt the new version from the hub.
Pitfalls checklist (each one has bitten us)
- filename = schema type for every section
- no local guard helpers — kit imports only
- no
/100, no hardcoded currency strings;<Money currency={...}>everywhere variant.price.amount= cents,product.price= major- SDK
<Link>for ALL internal nav (soft nav is free; raw<a>forfeits it) - header/footer read from
useSectionGroup, not hardcoded - render
page.templateas handed (template overrides) - bilingual en/ar + RTL-safe CSS on every section
<RichText>for merchant HTML- SSR parity:
createApprenders without window/document access at module top level theme.jsonversion bumped before merge- built against the SDK minor the host runtime currently serves
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

