mpa-url-state-bridge

mpa-url-state-bridge is a skill for Claude Code, Codex from humanerd-drew/opencode-drewgent. It costs 62 tokens per session (1,997 once invoked), scanned A, original, MIT.

A web development pattern that stores interface state, such as open menus or tabs, in the page URL. It keeps that state when users move between pages, refresh, share a link, or use the back button.

In plain words
What is it for?
Keeping modals, sidebars, tabs, login panels, filters, and focused items consistent across page changes. It is intended for Svelte 5 multi-page applications.
Why use it?
Traditional multi-page apps reset temporary interface state during navigation. URL-based state makes the same view restorable and shareable without changing its appearance or behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Keeping modals, sidebars, tabs, login panels, filters, and focused items consistent across page changes. It is intended for Svelte 5 multi-page applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/humanerd-drew/opencode-drewgent/mpa-url-state-bridge
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.

Any agent
npx skills add humanerd-drew/opencode-drewgent --skill mpa-url-state-bridge
Clone the repo
git clone --depth 1 https://github.com/humanerd-drew/opencode-drewgent

Made for: Claude Code, Codex.

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 mpa-url-state-bridge

README.md
[![agentmods](https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/mpa-url-state-bridge.svg)](https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/mpa-url-state-bridge)
Your own site
<a href="https://agentmods.dev/skills/humanerd-drew/opencode-drewgent/mpa-url-state-bridge"><img src="https://agentmods.dev/badge/skills/humanerd-drew/opencode-drewgent/mpa-url-state-bridge.svg" alt="Measured on agentmods" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,997 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.00062 $0.01997
Opus 5 $0.00031 $0.00999
Sonnet 5 $0.00012 $0.00399
Haiku 4.5 $0.00006 $0.00200

Measured 3d ago against content hash 5fe69dfcd433, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

mpa-url-state-bridge 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 3d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (templates/url-state-bridge.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/software-development/mpa-url-state-bridge/SKILL.md · 175 lines

How it starts

The opening of the file, as written. The whole thing — 175 lines — stays where its author put it; the contents beside it link to each section on GitHub.

MPA URL State Bridge

왜 필요한가

MPA의 진짜 약점: 페이지 이동 = 모든 state 초기화.

  • 모달 열려있다가 /input/로 가면 닫힘
  • 사이드바 열려있다가 /dashboard/로 가면 닫힘
  • 새로고침하면 모두 리셋
  • URL 공유 시 같은 상태로 열리지 않음

SPA의 장점(연속성)을 URL에 매핑하면 이걸 다 해결함. 단, 시각/기능은 1픽셀도 바뀌면 안 됨.

대전제 (drew의 마이그레이션 원칙)

디자인과 기능은 건드리지 않는다. State만 URL에 동기화한다.

이게 깨지면 안 됨:

  • 모달/사이드바의 동작, 위치, 애니메이션, 색상, z-index, focus 관리
  • 외부 API 호출 흐름 (login, history load, payment verify 등)
  • disabled/loading 상태 관리
  • 키보드/ESC/click outside 닫기 등 인터랙션

URL 동기화는 순수하게 state 저장 위치만 옮기는 일.

핵심 패턴 (Svelte 5)

1. URL 헬퍼 (어디서든 import 가능)

type UrlKeys = 'menu' | 'history' | 'login' | 'legend' | 'historyTab' | 'historyQ' | 'focused'

function readUrlState(): Record<UrlKeys, string | null> {
  if (typeof window === 'undefined') return {} as Record<UrlKeys, string | null>
  const p = new URLSearchParams(window.location.search)
  return {
    menu: p.get('menu'),
    history: p.get('history'),
    login: p.get('login'),
    // ... 모든 key
  }
}

function setUrlState(key: UrlKeys, value: string | null, opts: { history?: 'push' | 'replace' } = {}) {
  if (typeof window === 'undefined') return
  const url = new URL(window.location.href)
  if (value === null || value === '' || value === '0' || value === 'false') {
    url.searchParams.delete(key)
  } else {
    url.searchParams.set(key, value)
  }
  const method = opts.history === 'push' ? 'pushState' : 'replaceState'
  window.history[method](null, '', url.toString())
}

2. State는 $state로, 노출값은 $derived로

// ❌ 직접 변경 가능한 state (deprecated)
let menuOpen = $state(false)
function openMenu() { menuOpen = true }

// ✅ URL이 source of truth, 노출값만 derived
let urlState = $state(readUrlState())
window.addEventListener('popstate', () => { urlState = readUrlState() })

let menuOpen = $derived(urlState.menu === '1')

function openMenu() { setUrlState('menu', '1') }
function closeMenu() { setUrlState('menu', null) }
function toggleMenu() { setUrlState('menu', menuOpen ? null : '1') }

3. template은 $derived 변수 그대로 사용

Read the full file on GitHub · 175 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 3d ago First seen · 175 lines · 0 tokens per session scan A 5fe69dfcd433

Subscribe to this mod's changes

mpa-url-state-bridge is a skill published in the GitHub repository humanerd-drew/opencode-drewgent (2 stars, last pushed 1mo ago), licensed MIT. It adds 62 tokens to every session and 1,997 once invoked, about $0.0003 per session on Opus 5. 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-09-03.

Related

Other skills, from other repositories

chakra-ui-builder

Build responsive, accessible UI components and layouts using Chakra UI v3, install or configure Chakra UI in new and existing projects, and design scalable themes using tokens, semantic tokens, recipes, and slot recipes. Use this skill whenever a user asks to build, create, or generate any UI component, page, form…

chakra-ui/chakra-ui · 214 tokens

frontend-visual-qa

Audits already-rendered web, landing-page, HTML deck/slide, browser tool/game, dashboard/admin, design-system, and desktop UIs using real-browser or native-app journeys, inspected screenshots, DOM geometry, responsive or projection viewports, and a bundled Playwright sweep. Use after UI implementation to find…

daymade/claude-code-skills · 145 tokens

prototype-web

A clickable, high-fidelity web product prototype with navigation, a hero section, feature cards, steps, social proof, and optional pricing. It is designed to resemble a finished landing page while remaining a prototype.

nexu-io/html-anything · 24 tokens

waitlist-page

A simple waitlist page for collecting email addresses from people interested in a new product or early-access release.

nexu-io/html-anything · 25 tokens

animation-principles

Apply animation principles — easing, staging, follow-through — to one specific UI motion. Use when tuning how an animation feels. For product-wide duration and easing tokens use motion-system (design-systems); for a full interaction spec use micro-interaction-spec.

Owl-Listener/designer-skills · 59 tokens

refactoring-ui

Audit and fix visual hierarchy, spacing, color, and depth in web UIs. Use when the user mentions "my UI looks off" (or amateur/unprofessional), "fix the design", "Tailwind styling", "color palette", "visual hierarchy", "design system", "spacing scale", or "component styling". Also trigger when building consistent…

wondelai/skills · 132 tokens