astro-setup

astro-setup is a skill for Claude Code, Codex from asmyshlyaev177/state-in-url. It costs 102 tokens per session (1,950 once invoked), scanned A, original, MIT.

A setup guide for keeping application state in the URL in Astro sites, including React or Preact islands and pages without a client framework. Astro is a web framework that can render pages on the server and add interactive components called islands.

In plain words
What is it for?
Use it to add URL-backed filters or other typed state to Astro pages with useUrlState, encodeState, and decodeState.
Why use it?
It shows how to share state between islands, render matching server output, and read or write URL state when Astro has no client-side router by default.

Skill for Claude CodeCodex

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import { FILTERS_STATE } from '../state';.

Good fit Use it to add URL-backed filters or other typed state to Astro pages with useUrlState, encodeState, and decodeState.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/asmyshlyaev177/state-in-url
agentmods
npx agentmods add skills/asmyshlyaev177/state-in-url/astro-setup

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 astro-setup

README.md
[![agentmods](https://agentmods.dev/badge/skills/asmyshlyaev177/state-in-url/astro-setup/github.svg)](https://agentmods.dev/skills/asmyshlyaev177/state-in-url/astro-setup)
Your own site
<a href="https://agentmods.dev/skills/asmyshlyaev177/state-in-url/astro-setup"><img src="https://agentmods.dev/badge/skills/asmyshlyaev177/state-in-url/astro-setup/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 astro-setup

Your own site · 80×15
<a href="https://agentmods.dev/skills/asmyshlyaev177/state-in-url/astro-setup"><img src="https://agentmods.dev/badge/skills/asmyshlyaev177/state-in-url/astro-setup.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 102 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,950 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.00102 $0.01950
Opus 5.5 $0.00041 $0.00780
Sonnet 5.5 $0.00020 $0.00390
Haiku 4.5 $0.00010 $0.00195

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

Security

Grade A, and why

astro-setup 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 1mo 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.

skills/astro-setup/SKILL.md · 205 lines

How it starts

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

This skill builds on state-in-url/feature-state-hook. Read it first for the module-scoped default-state rule.

state-in-url — Astro

Two shapes of Astro project, two tools:

Project Use Runs
React islands (@astrojs/react) useUrlState from state-in-url/astro In the island, on the server render and in the browser
Preact islands (@astrojs/preact, compat: true) the same useUrlState the same, through preact/compat
No client framework decodeState / encodeState from state-in-url/encodeState In .astro frontmatter, per request

Astro has no client-side router by default. The hook writes the URL with window.history (replaceState by default, pushState with replace: false) and reads it back on back/forward, on its own writes, and on any other pushState/replaceState on the page.

Setup: React islands

// src/state.ts — module scope, one object, imported by every island that shares it
type FiltersState = { sort: 'name' | 'date'; page: number };
export const FILTERS_STATE: FiltersState = { sort: 'name', page: 1 };
// src/components/Filters.tsx
import { useUrlState } from 'state-in-url/astro';

import { FILTERS_STATE } from '../state';

export function Filters({ searchParams }: { searchParams?: Record<string, string> }) {
  const { urlState, setUrl } = useUrlState(FILTERS_STATE, { searchParams });
  return <button onClick={() => setUrl({ page: urlState.page + 1 })}>Next</button>;
}
---
// src/pages/index.astro
import { Filters } from '../components/Filters';

// A plain object: island props are serialized, URLSearchParams is not.
const searchParams = Object.fromEntries(Astro.url.searchParams);
---

<Filters client:load searchParams={searchParams} />

The page must be rendered on demand — output: 'server', or export const prerender = false on the page — and either way an adapter must be configured (@astrojs/node, @astrojs/vercel, …); on Astro's default static output the build fails. Only then does Astro.url.searchParams hold the request's query. A prerendered page has no request, so searchParams is {} and the island fills its state in the browser after hydration.

Read the full file on GitHub · 205 lines

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. 1mo ago Changed 5acd5ec5538f
  2. 1mo ago Changed 9741b38808bc
  3. 2mo ago First seen · 205 lines · 102 tokens per session scan A 3d40c06d535f

Subscribe to this mod's changes

astro-setup is a skill published in the GitHub repository asmyshlyaev177/state-in-url (419 stars, last pushed 1mo ago), licensed MIT. It adds 102 tokens to every session and 1,950 once invoked, about $0.0004 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-22.

Related

astro-setup compared with skills from other repositories

astro-setup next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
astro-setupasmyshlyaev177/state-in-urlSkill4191mo agoMITA102Claude Code, Codex
reskinCopilotKit/CopilotKitSkill39ktodayMITA154Claude Code
copilotkit-channelsCopilotKit/CopilotKitSkill39ktodayMITA112Claude Code
setup-slack-channelCopilotKit/CopilotKitSkill39ktodayMITA206Claude Code
a2ui-catalogCopilotKit/CopilotKitSkill39ktodayMITA190Claude Code
copilotkit-cliCopilotKit/CopilotKitSkill39ktodayMITA87Claude Code
a2ui-coreCopilotKit/CopilotKitSkill39ktodayMITA18Claude Code