Agent skill

Datapages State

by romshark in romshark/datapages

Add per-tab Datapages State[T], initialize and use it in handlers, dispatch state-scoped events, and configure the live instance limit.

MITAuto-check passedBackend & APIs

Install Datapages State

skills CLI
$ npx skills add romshark/datapages --skill datapages-state -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install romshark/datapages datapages-state --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/romshark/datapages.git skills-src && mkdir -p .claude/skills && cp -r skills-src/internal/generator/agentdocs/data/skills/datapages-state .claude/skills/datapages-state && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
datapages-state
GitHub stars
113
Token cost
~806 tokens
SKILL.md length
391 words
Files
1
Skills in repo
15
Repo updated
First seen
Licence
MIT

At a glance

Add per-tab Datapages State[T], initialize and use it in handlers, dispatch state-scoped events, and configure the live instance limit.

  • Tasks that involve Backend development
  • SKILL.md covers Events for one tab and Limit
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Datapages State is an agent skill from romshark/datapages. Add per-tab Datapages State[T], initialize and use it in handlers, dispatch state-scoped events, and configure the live instance limit. Activate when a Datapages page needs server-side values that belong to one browser tab.

Its SKILL.md is about 810 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs, covering Backend development. The repository describes itself as: A Datastar Go web frontend framework. The licence is MIT.

When your agent uses it

  • Tasks that involve Backend development

Example prompts

  • “/datapages-state”

What it can do on your machine

Read from SKILL.md and the folder at commit 87d5a44. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are go).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Datapages State loads about 806 tokens when it runs. Until then it costs about 60 tokens; SKILL.md has 391 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~60
When it runs · the whole SKILL.md, loaded when a task matches
~806

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from romshark/datapages at commit 87d5a44, republished under its MIT licence (© romshark). 391 words, ~806 tokens.

Download SKILL.mdSave it as .claude/skills/datapages-state/SKILL.md (or your agent's skills folder).
name
datapages-state
description
Add per-tab Datapages State[T], initialize and use it in handlers, dispatch state-scoped events, and configure the live instance limit. Activate when a Datapages page needs server-side values that belong to one browser tab.

Per-tab state

Read datapages first for the build loop, hard rules and naming conventions.

Declare T as an exported, package-level struct in the app package. State[T] rejects pointers, anonymous structs and types from other packages. A page is stateful when one of its actions, On handlers or stream hooks takes datapages.State[T].

Every stateful handler on a page must use the same T. An app-level action may take State[T] only when the calling page uses that type. A mismatch returns 409 with Datapages-Retry: reconnect. Keep actions used by pages with different state types stateless.

go
type StateIndex struct{ Filter string }

func (PageIndex) StreamOpen(
	r *http.Request, state datapages.State[StateIndex],
) error {
	state.Values.Filter = "all"
	return nil
}

GET cannot take state. The server allocates state when the tab connects its SSE stream. A stateful page gets a stream even when it has no stream hooks or event handlers. The server runs stateful handlers for one tab serially. They can read and write state.Values without another mutex.

A disconnect deletes the instance. A reconnect starts with a zero value. Initialize it in StreamOpen from the URL or signals when needed.

GET may return datapages.EnableBackgroundStreaming(true) to keep the stream and state active while the tab is hidden. This also disables the default refresh when the tab becomes visible. datapages.DisableRefreshAfterHidden(true) disables that refresh without preserving the stream or state. Only pages with a stream refresh after being hidden. Returning either value from a page without a stream is an error.

Do not retain state.Values after the handler returns. Do not capture it in a goroutine or a component that renders later. Copy the required fields instead.

State exists in one server process. Route a tab's stream and actions to the same server with Datapages-Instance as the routing key. The instance ID script is inline: a Content-Security-Policy must allow script-src 'unsafe-inline' or set a nonce through WithCSPNonce. See datapages-server.

Show full SKILL.md (100 more words)Show less

Events for one tab

A stateful handler may take stateID string with State[T]. Put the value in an event's datapages.SubjectStateID field to address that tab:

go
// EventFilterChanged is "filter.changed"
type EventFilterChanged struct {
	Tab datapages.SubjectStateID
}

It must be the event's only subject field and cannot have a signal tag. A page that handles the event must use state. That page cannot also handle a user-addressed or signal-scoped event. stateID selects the event recipient. It does not provide access to the state value.

Limit

Each server allows datapages.DefaultMaxConcurrentInstances live instances by default. Change the limit with datapages.WithStateConfig(datapages.StateConfig{MaxConcurrentInstances: n}). When the server reaches the limit, a new stream receives 503 with Retry-After.

© romshark, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in internal/generator/agentdocs/data/skills/datapages-state of romshark/datapages.

Open the folder on GitHubat commit 87d5a44

Compare with similar skills

Datapages State next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Datapages State compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Datapages State this skillromshark/datapages113—~806Automated safety check: PassMIT
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
Node Backend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2kAutomated safety check: PassMIT
Laravel Best Practicesanonaddy/anonaddy4.9k13 repos~1.2kAutomated safety check: PassMIT
Laravel Actionscoollabsio/coolify63k—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • Node Backend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Sets layered architecture and coding rules for Node.js, Express and TypeScript microservices, covering routes, controllers, services, repositories, Prisma, Sentry and Zod.

    10k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Laravel Best Practices

    anonaddy/anonaddy

    Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code.

    4.9k GitHub starsUsed in 13 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Laravel Actions

    coollabsio/coolify

    Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions.

    63k GitHub stars~2.4k tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed

More from romshark/datapages

All 15 skills in this repo
  • Datapages

    romshark/datapages

    Apply the Datapages framework rules, build loop and naming conventions, and select the relevant task skill.

    113 GitHub stars~1.9k tokensUpdated yesterday
    Auto-check passed
  • Datapages Events

    romshark/datapages

    Datapages real-time events: event types and subjects, dispatchers, On handlers, per-user and signal-bound subject fields, and the StreamOpen and StreamClose hooks.

    113 GitHub stars~1.4k tokensUpdated yesterday
    Auto-check passed
  • Datapages Sessions

    romshark/datapages

    Add Datapages authentication: define and read the Session type, open and close sessions, configure CSRF protection and choose a session manager.

    113 GitHub stars~1.1k tokensUpdated yesterday
    Auto-check passed
  • Review Criteria

    romshark/datapages

    Classify Datapages findings by reach and severity and write review-.md reports.

    113 GitHub stars~1.2k tokensUpdated yesterday
    Auto-check passed
  • Git Commits

    romshark/datapages

    Write Datapages commit messages, including the breaking-change marker and the BREAKING block.

    113 GitHub stars~960 tokensUpdated yesterday
    Auto-check passed
  • Datapages Actions

    romshark/datapages

    Write Datapages action handlers (POST, PUT, PATCH, DELETE, QUERY): parameters, return values, Datastar signals, SSE patching, HTTP error status codes and the RecoverError hook.

    113 GitHub stars~1.5k tokensUpdated yesterday
    Auto-check passed

Categories

Questions about Datapages State

What does Datapages State do?

Add per-tab Datapages State[T], initialize and use it in handlers, dispatch state-scoped events, and configure the live instance limit. Datapages State is an agent skill from romshark/datapages. Add per-tab Datapages State[T], initialize and use it in handlers, dispatch state-scoped events, and configure the live instance limit.

When should I use Datapages State?

Datapages State fits situations like: tasks that involve Backend development.

How do I install Datapages State in Claude Code?

Run `npx skills add romshark/datapages --skill datapages-state -a claude-code`. Or copy the skill folder (internal/generator/agentdocs/data/skills/datapages-state in romshark/datapages) into .claude/skills/datapages-state in your project. Claude Code loads it when a task matches its description.

How do I install Datapages State in Codex?

Run `npx skills add romshark/datapages --skill datapages-state -a codex`. Or copy the skill folder (internal/generator/agentdocs/data/skills/datapages-state in romshark/datapages) into .agents/skills/datapages-state in your project. Codex loads it when a task matches its description.

Can I use Datapages State in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add romshark/datapages --skill datapages-state -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/datapages-state, .gemini/skills/datapages-state, .github/skills/datapages-state and .opencode/skills/datapages-state in your project.

What does Datapages State need to run?

SKILL.md names no scripts, command-line tools or credentials: Datapages State is instructions for the agent only.

Does Datapages State access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Datapages State safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Datapages State use?

Datapages State is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Datapages State use?

About 806 tokens (SKILL.md is roughly 3.2k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Datapages State?

Skills that share tags, products or a category with Datapages State: Configuring Horizon (coollabsio/coolify, 63k stars), Fortify Development (coollabsio/coolify, 63k stars), Node Backend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars) and Laravel Best Practices (anonaddy/anonaddy, 4.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Datapages State?

romshark (a GitHub user) maintains it in romshark/datapages, which has 113 GitHub stars. The repository holds 15 skills in this directory. The repository was last updated on October 7, 2026.

Source: romshark/datapages on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.