Cms
Use whenever writing, reviewing, or debugging code inside the `cms/` Remix/React merchant-admin app of BSS Fraud Blocker — the pure-UI layer with no fraud decisions and no RabbitMQ. Trigger on any task touching `cms/app/**` or `cms/extensions/**`: Remix routes/loaders/actions, page components, React Query hooks (`useQuery`/`useMutation`), the `Repository`-based service layer, the single `shop` Redux slice + sagas, Polaris components or the `components/common/` react-hook-form controllers, Shopify AppBridge auth (`idToken()`), multilang/i18n (`react-i18next`, `app/locales/<locale>/<namespace>.json`, the `LanguageSwitcher`), or Shopify extensions (checkout/delivery/payment Functions, theme extension, web pixel, storefront scripts) — even when phrased casually as "add a field to this settings form", "why isn't this mutation refreshing the table", "add a new service for X", "add a translated string", or "tweak the checkout-rule Shopify Function". Covers the real, code-verified routes-vs-pages split, the service-layer barrel-export gotcha (5 of 13 services aren't re-exported), the single-Redux-slice pattern, the 16 existing form controllers, the i18n locale-resolution order and namespace layout, naming conventions, the auth/token pattern, webhook *registration* only (no processing), and a "Never Do" guardrail list. Do NOT use for `api` (NestJS backend CRUD/RabbitMQ/Mongoose) or `tracker` (storefront intake/rule-eval/bot-detection write path) — those have their own skills and neither lives in `cms`; also skip for generic Remix/React/Polaris questions unrelated to this repo's `cms` app.From its SKILL.md
npx -y skills add thanhhai0311/fraud-md --skill cmsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
9.2 KB, as published. Nobody here has run it
CMS Service — Coding Skill
Stack: Remix 2.16, React 18, Shopify Polaris, Redux Toolkit + Redux Saga, React Query 5, react-hook-form, TypeScript strict, pnpm
MCP Tools for cms work
Reach for these automatically — don't wait to be asked, and don't guess Polaris APIs from memory when a tool can verify them in one call:
- Before writing or editing any Polaris component usage (props, sub-components, patterns you're not 100% sure of), call
mcp__shopify-dev-mcp__validate_component_codeblockson the JSX you're about to write, ormcp__shopify-dev-mcp__search_docs_chunksfirst if you need to find the right component/prop. Polaris's API surface changes across versions — verifying against real docs is cheap and catches prop typos/renamed components before they become a lint/runtime error the user has to report back. - Before extending a shared service, hook, or component (anything in
service/,hooks/,components/common/), use CodeGraph (codegraph_search→codegraph_callers/codegraph_context) to see every real usage site first, instead of a grep+read loop. This matters especially here because of the barrel-export gotcha (seereferences/service-layer.md) — CodeGraph will show you the actual import path callers use, so you don't have to guess whether a service is barrel-exported or must be imported directly. - Before touching a Shopify Function extension (
checkout-validation/,hide-risk-delivery/,hide-risk-payment/), check whethermcp__shopify-dev-mcp__learn_shopify_apihas current guidance for that Function API target (cart.validations.generate.run, etc.) rather than relying on this doc's snapshot of the API shape.
Scripts (deterministic checks — run instead of hand-verifying)
node .claude/skills/cms/scripts/check-i18n-keys.mjs cms/app/locales— after touching any translation key, diffs every locale's namespace JSON againstenand reports missing/extra keys. Seereferences/i18n.md.node .claude/skills/cms/scripts/check-barrel-exports.mjs cms/app/service— after adding/renaming a service, reports which*.service.tsclasses aren't re-exported fromapp/service/index.ts. Seereferences/service-layer.md.
Directory Layout
cms/app/
├── routes/ # Remix file-based routes (mostly thin wrappers, some own real loaders/actions — see references/routes.md)
├── pages/ # Page-level components — loader, UI, mutations (see references/pages.md)
│ ├── analytics/ checkout-rules/ dashboard/ helpCenter/ orders/ rules/ settings/ tag-rules/ visitors/
├── components/ # Feature-organized reusable UI (see references/components.md)
│ ├── common/ # 16 generic react-hook-form + Polaris controller wrappers
│ ├── analytics/ badge/ banner/ block-page/ button/ checkout-rule/ dashboard/ dndKit/
│ ├── filter/ language/ modal/ order/ resource/ rule/ setting/ skeleton/ table/ tag-rules/ thirtyPart/ visitor/
├── service/ # API client layer (Repository base class) — index.ts barrel is PARTIAL, see references/service-layer.md
├── redux/ # Global state: actions/, reducers/, sagas/, types/ — one slice only: shop (see references/redux.md)
├── hooks/ # Custom hooks: auth fetch, socket, settings, customization-scope consent
├── i18n/ # i18next config, locale-storage (localStorage), locale-match (BCP47 → supported locale) — see references/i18n.md
├── locales/ # <locale>/<namespace>.json — 20 locales × 10 namespaces, see references/i18n.md
└── configs/ # fetch.config.ts (Repository base class)
cms/extensions/
├── checkout-validation/ # Shopify Function — cart.validations.generate.run
├── hide-risk-delivery/ # Shopify Function — cart.delivery-options.transform.run (has real tests)
├── hide-risk-payment/ # Shopify Function — cart.payment-methods.transform.run (has real tests)
├── web-pixel/ # Analytics pixel — posts to a hardcoded prod URL, not env-driven
├── theme-extension/ # Liquid blocks + snippets + minified assets
├── fingerprint/ # Vendored bot-detection/fingerprinting source (BotD, fingerprintjs) — compiles into theme-extension assets
└── scripts/ # Storefront runtime logic (10+ helper modules) — webpack builds script.min.js, committed to git
checkout-rules is the largest feature area beyond the simple CRUD example: its own condition components (AddressCondition, CountryCondition, EmailCondition, IpCidrCondition, PhoneNumberCondition, ZipCodeCondition, CartValueCondition, NameCondition), FakeOrderConfig, HighRiskOrderConfig, ProtectionModeCard, plus integration with real Shopify Functions and optional-scope consent (see references/extensions.md). dashboard is an onboarding-checklist + chart hybrid (Redux shop.onboarding state). analytics uses two charting libraries side by side: @shopify/polaris-viz and chart.js/react-chartjs-2. settings is a large multi-section form with drag-and-drop rule ordering via app/components/dndKit/. helpCenter currently has no live nav entry (commented out of app.tsx's NavMenu) — treat it as dormant, not a pattern to copy.
Where to look next
This skill's detail lives in references/ — read the one(s) that match the task instead of loading everything:
| Task touches... | Read |
|---|---|
| A Remix route file, loader/action auth pattern | references/routes.md |
A page component, useQuery/useMutation, QueryClient defaults | references/pages.md |
A service in app/service/, the barrel-export gotcha | references/service-layer.md |
The shop Redux slice, a saga, onboarding/feature-flag state | references/redux.md |
A components/common/ form controller, or a feature component | references/components.md |
Shopify AppBridge auth / idToken() | references/auth.md |
A translated string, a new locale/namespace, LanguageSwitcher, or anything under app/i18n//app/locales/ | references/i18n.md |
A Shopify Function, theme extension, web pixel, or storefront script under cms/extensions/ | references/extensions.md |
| Webhook registration, sockets, third-party widgets (Crisp/OpenReplay) | references/integrations.md |
| Naming a new file (route/page/service/redux/component/hook) | references/naming.md |
Never Do
- Never put fraud decision logic in
cms. - Never own RabbitMQ producers or consumers in
cms— it has none, and shouldn't. - Never store tokens in localStorage — always use Shopify AppBridge
idToken(). - Never import
VITE_*env vars from server-side loader code. - Never bypass Polaris UI with raw HTML/CSS for core page structure (CSS Modules for layout tweaks are fine, full custom UI is not).
- Never use Redux for per-page server data — that belongs in React Query.
- Never assume
app/service/index.tsexports every service — 5 of 13 must be imported directly from their own file. - Never assume a route's detail-page loader is session-authenticated just because it forwards a Bearer token — some read the raw header without calling
authenticate.admin; check before copying. - Never hardcode new user-facing copy — add a translation key to every locale's JSON file for that namespace (a missing key silently falls back to
DEFAULT_LOCALEinstead of erroring, so it's easy to ship half-translated). - Never assume a feature namespace has its own nested
commonkey likecheckoutRules.jsondoes — verify the actual JSON file before reusing that pattern (seereferences/i18n.md).