Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

datapages

БесплатноБез исполняемых скриптовНе проверен

Apply the Datapages framework rules, build loop and naming conventions, and select the relevant task skill. Use for work in a Datapages app package, template…

romsharkот romshark★ 122 звезды на GitHub

Об этом скилле

Datapages

Write Go handlers and Templ templates. datapages gen generates routing, handler registration, SSE and session code. It also generates the type-safe href and action packages.

Read datapages-architecture first when starting an app or designing a new feature. It explains how to select the required Datapages constructs. Then read the task-specific skills below.

Loop

Write the app model first, then generate its helpers before templates call them:

datapages gen
templ generate # after any .templ change, and never while datapages watch runs
datapages lint
go build ./...

datapages gen reports parse errors and suggested fixes on stderr. Fix the app package and run it again. It also runs go mod tidy. A tidy failure makes the command fail even when code generation succeeded. datapages lint performs the checks without generating files.

An earlier templ generate can produce references to helpers that do not exist yet. Remove those references, run templ generate, then run datapages gen. Restore the references and run templ generate again. After an initial parse failure, the generator may write empty stub helper packages.

Use Templ v0.3.1118, which the generated CI workflow pins. Use datapages watch as the local development server.

Never run templ generate while datapages watch runs

Running templ generate interrupts the development server. datapages watch runs templ in watch mode, which reads application template strings from files in the temporary directory. A separate templ generate deletes those files when it exits. The server cannot render again until the next .templ change recreates them.

Check before generating. datapages watch keeps 1 lock file per module fresh in the datapages-watch directory under the system temporary directory ($TMPDIR on macOS, /tmp on Linux, %TEMP% on Windows). A .lock file written less than 10 seconds ago means a watch is running. The file contains its PID, module directory, and development server host:

ls -lt "${TMPDIR:-/tmp}/datapages-watch" # inspect lock modification times
pgrep -f "datapages watch"               # POSIX process check

The watcher regenerates changed files. Wait for it. To generate manually, stop the watcher first and restart it afterward.

The restriction also applies to commands that invoke templ generate, including wrapper targets in make or Mage.

To restore rendering, save a .templ file or restart the watcher.

Test on a slow or failing network

datapages watch also serves the app through Toxiproxy, with latency, bandwidth limits, timeouts, resets and HTTP errors per endpoint, and a settings page for them. Both listen on ports the OS picks unless watch.toxiproxy.host and watch.toxiproxy.ui-host set them, and watch mode prints their addresses. watch.toxiproxy in datapages.yaml configures it. datapages lint reports an endpoint key of a preset in watch.toxiproxy.presets that is not the net/http.ServeMux pattern of a route, as in GET /post/{slug}/{$}.

Rules

  • Never edit a _gen.go file, anything under datapagesgen/, or a file with a DO NOT EDIT header. Change the source and regenerate.
  • Never hardcode an app-internal URL. href.PageX() for links, action.PageX.Y.POST() for page actions and action.App.Y.POST() for app actions.
  • Never write JavaScript for application logic. Logic is Go on the server, the client is Datastar attributes. Keep interaction state, such as an open menu or a selected tab, in local Datastar signals, whose _ prefix keeps them out of requests. Write JavaScript only where Datastar attributes are impractical: a browser API such as the clipboard, a library such as a map or a rich text editor, or client state that runs ahead of the server, such as typed text the server has not confirmed. Put such JavaScript in a Web Component when it needs more than a 1-statement expression; see datapages-templates.
  • Return application HTML as a Templ datapages.Component. Do not render it into a datapages.File: its bytes bypass Templ's contextual escaping and the Datapages template linter.
  • Never open an SSE stream, set a CSRF header, add the Datastar script or register a service worker by hand. Datapages does all 4.
  • Submit <form> elements through Datastar actions. Browser form submissions do not carry the CSRF token; see datapages-templates.
  • Do not put build-constrained files in the app package. The generator reads its pages, actions and events for the host platform, so a platform-specific declaration can disappear from generated code elsewhere.
  • Prefer 1 HTML fragment that carries its own context over many small patches or over signal updates. The server is the source of truth, signals hold transient client state.

Security

Datapages routes the request, hands the handler its session and escapes what Templ and the href, action and subject helpers write. The rest is on the application code:

  • **Authori
Полный SKILL.md на GitHub

Установить datapages в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл datapages?

Apply the Datapages framework rules, build loop and naming conventions, and select the relevant task skill. Use for work in a Datapages app package, template or server entry point. Read `datapages-architecture` first when starting an app or designing a feature.

Как установить скилл datapages?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл datapages запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить datapages с