marketing-global-effects

marketing-global-effects is a cursor rule for Cursor from dmenchaca/webflow-to-react. It costs 0 tokens per session (508 once invoked), scanned A, original, MIT.

A project rule for keeping browser-wide effects in one React root component. It covers shared behavior such as touch detection, tooltips, keyboard shortcuts, iframe resizing, and animations.

In plain words
What is it for?
Use it when adding or reviewing React hooks that affect the whole page or a shared container, including their setup and cleanup.
Why use it?
It prevents shared event listeners from being scattered across page sections, where they are harder to trace and may leak when components are removed.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when adding or reviewing React hooks that affect the whole page or a shared container, including their setup and cleanup.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/dmenchaca/webflow-to-react/marketing-global-effects
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/dmenchaca/webflow-to-react

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for marketing-global-effects

README.md
[![agentmods](https://agentmods.dev/badge/rules/dmenchaca/webflow-to-react/marketing-global-effects/github.svg)](https://agentmods.dev/rules/dmenchaca/webflow-to-react/marketing-global-effects)
Your own site
<a href="https://agentmods.dev/rules/dmenchaca/webflow-to-react/marketing-global-effects"><img src="https://agentmods.dev/badge/rules/dmenchaca/webflow-to-react/marketing-global-effects/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for marketing-global-effects

Your own site · 80×15
<a href="https://agentmods.dev/rules/dmenchaca/webflow-to-react/marketing-global-effects"><img src="https://agentmods.dev/badge/rules/dmenchaca/webflow-to-react/marketing-global-effects.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 508 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00508
Opus 5.5 $0.00000 $0.00203
Sonnet 5.5 $0.00000 $0.00102
Haiku 4.5 $0.00000 $0.00051

Measured 3mo ago against content hash 6076ae7e5bea, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

marketing-global-effects scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

rules/marketing-global-effects.mdc · 42 lines

What it actually says

Global effects live in MarketingSiteRoot

This project replaced Webflow's jQuery-based runtime with React hooks. All cross-cutting side effects (touch detection, tooltips, iframe resize, keyboard shortcuts, Rive animations) are centralized in MarketingSiteRoot.tsx on a single container ref.

Do

  • Add new global-effect hooks to src/hooks/ with a useFoo naming pattern.
  • Wire them in MarketingSiteRoot next to the existing hooks.
  • Keep hooks idempotent and have them clean up on unmount (return teardown from useEffect).
  • Accept a containerRef if the hook needs DOM scope; use document-scoped listeners only when truly global.
  • Give MarketingSiteRoot's div className="contents" so the wrapper doesn't affect layout.

Don't

  • Don't attach global event listeners (window.addEventListener) from inside section components — it's hard to trace, easy to leak.
  • Don't replicate the same effect across multiple sections. Promote to MarketingSiteRoot.
  • Don't forget cleanup — React 19 + StrictMode will surface leaks by double-invoking effects in dev.

Typical hooks in this project

  • useTouchClass — toggles .touch on root based on (pointer: coarse).
  • useKeyboardShortcuts(containerRef) — global hotkeys scoped to the marketing tree.
  • useTestimonialIframeResize — listens for postMessage to resize embedded iframes.
  • useRelumeTooltips — attaches shadcn tooltips to legacy Relume tooltip markup.
  • useRiveAnimations(containerRef) — plays Rive artboards with IntersectionObserver.

Section-level vs global

Use case Where it lives
A scroll reveal for one section The section itself (AnimatedBlock / whileInView)
Local tab/accordion state The section itself
Tooltip detection across the tree MarketingSiteRoot hook
Keyboard shortcuts that navigate sections MarketingSiteRoot hook
Iframe resize for testimonial widget MarketingSiteRoot hook
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3mo ago First seen · 42 lines · 0 tokens per session scan A 6076ae7e5bea

Subscribe to this mod's changes

marketing-global-effects is a cursor rule published in the GitHub repository dmenchaca/webflow-to-react (26 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 508 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

marketing-global-effects compared with cursor rules from other repositories

marketing-global-effects next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
marketing-global-effectsdmenchaca/webflow-to-reactCursor rule265mo agoMITA0Cursor
test-file-locationJNTMTMTM/eIslandCursor rule362todayGPL-3.0A144Cursor
react-componentsbishopZ/2026-BoilerplateCursor rule254mo agoMITA0Cursor
CreateStorybookStoriesjhancock532/bristol-social-groupsCursor rule69d agononeA18Cursor
NewComponentjhancock532/bristol-social-groupsCursor rule69d agononeA16Cursor
windsurfrulesAPIParkLab/APIParkCursor rule1.8k1mo agoApache-2.0A521Windsurf
tanstack-start-guidejahands/promptsCursor rule191mo agoMITA17Cursor