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

Your own site · 80×15
<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="Reviewed on agentmods" width="80" 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.5 $0.00025 $0.00799
Sonnet 5.5 $0.00012 $0.00399
Haiku 4.5 $0.00006 $0.00200

Measured 3mo ago against content hash 5fe69dfcd433, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-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 3mo 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. 3mo 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 (3 stars, last pushed 4mo ago), licensed MIT. It adds 62 tokens to every session and 1,997 once invoked, about $0.0002 per session on Opus 5.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

mpa-url-state-bridge compared with skills from other repositories

mpa-url-state-bridge next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mpa-url-state-bridgehumanerd-drew/opencode-drewgentSkill34mo agoMITA62Claude Code, Codex
anti-slop-designsickn33/agentic-awesome-skillsSkill51ktodayMITA34Claude Code
chakra-ui-builderchakra-ui/chakra-uiSkill41kyesterdayMITA214Claude Code, Codex
visual-ralphYeachan-Heo/oh-my-codexSkill34k2d agoMITA52Codex
prototype-webnexu-io/html-anythingSkill17k5d agoApache-2.0A24Claude Code, Codex
open-design-setupcompozy/compozySkill2.9ktodayMITA67Claude Code, Codex
edit-sitemicrosoft/power-platform-skillsSkill1.2ktodayMITA104Claude Code