Agent skill

Payload Analytics

by textura-agency in textura-agency/next16-claude-starter

Light, consented, cookieless, self-hosted visitor analytics inside the Payload admin — a page-views collection in the CMS's own Postgres written by a same-origin /api/track beacon, an Analytics view…

UnlicenseAuto-check passedLegal & Compliance

Install Payload Analytics

skills CLI
$ npx skills add textura-agency/next16-claude-starter --skill payload-analytics -a claude-code

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

GitHub CLI
$ gh skill install textura-agency/next16-claude-starter payload-analytics --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/textura-agency/next16-claude-starter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/payload-analytics .claude/skills/payload-analytics && 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
payload-analytics
GitHub stars
133
Token cost
~1.4k tokens
SKILL.md length
683 words
Files
1
Skills in repo
16
Repo updated
First seen
Licence
Unlicense

At a glance

Light, consented, cookieless, self-hosted visitor analytics inside the Payload admin — a page-views collection in the CMS's own Postgres written by a same-origin /api/track beacon, an Analytics view…

  • Works in 6 steps: Check the consent flow first. "Accept… → Scaffold; register PageViews in… → Put in SiteDocument` (after the cookie… → …
  • The user wants analytics in the admin
  • SKILL.md covers Decisions — and why, Steps, Prove it and Extending
  • Calls yarn, bash and curl; needs PAYLOAD_SECRET

What it does

Payload Analytics is an agent skill from textura-agency/next16-claude-starter. Light, consented, cookieless, self-hosted visitor analytics inside the Payload admin — a page-views collection in the CMS's own Postgres written by a same-origin /api/track beacon, an Analytics view (visitors, views, average visible time on page, bounce rate, live visitors, a day-by-day chart with a metric switch, top pages, referrers, countries, languages, devices, browsers, systems, 7/30/90-day ranges vs the period before) and a 7-day dashboard card. No third-party script, no new dependency. Use when the user…

Its SKILL.md is about 1.4k 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 Legal & Compliance. It works with PostgreSQL. The repository describes itself as: AI-first Next.js 16 starter for animation-heavy sites, wired with an Obsidian vault & Claude Code hooks. The licence is Unlicense.

When your agent uses it

  • The user wants analytics in the admin
  • A chart of visits
  • A privacy-first alternative to GA on a Payload site

Example prompts

  • “analytics in the admin”
  • “who visited, how many times, from where”
  • “a chart of visits”
  • “/payload-analytics”

Requirements

  • A credential in PAYLOAD_SECRET

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Check the consent flow first. "Accept all" must save analytics: true
  2. Scaffold; register PageViews in payload.config.ts, the dashboard card,
  3. Put in SiteDocument` (after the cookie banner). It
  4. PAYLOAD_SECRET must be set (it salts the hash) and DATABASE_URL reachable —
  5. yarn generate:types → yarn migrate:direct create page_views →
  6. robots.ts already disallows /api/.

What it can do on your machine

Read from SKILL.md and the folder at commit 6c6edf9. 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

    Shell commands in SKILL.md call:

    • yarn
    • bash
    • curl

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

  • Network

    No URLs in SKILL.md. Its commands use yarn and curl, which can reach the network depending on how they are called.

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

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • PAYLOAD_SECRET

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

Context cost

Payload Analytics loads about 1.4k tokens when it runs. Until then it costs about 176 tokens; SKILL.md has 683 words of instructions outside code blocks.

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

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 textura-agency/next16-claude-starter at commit 6c6edf9, republished under its Unlicense licence (© textura-agency). 683 words, ~1,389 tokens.

Download SKILL.mdSave it as .claude/skills/payload-analytics/SKILL.md (or your agent's skills folder).
name
payload-analytics
description
Light, consented, cookieless, self-hosted visitor analytics inside the Payload admin — a page-views collection in the CMS's own Postgres written by a same-origin /api/track beacon, an Analytics view (visitors, views, average visible time on page, bounce rate, live visitors, a day-by-day chart with a metric switch, top pages, referrers, countries, languages, devices, browsers, systems, 7/30/90-day ranges vs the period before) and a 7-day dashboard card. No third-party script, no new dependency. Use when the user wants "analytics in the admin", "who visited, how many times, from where", "a chart of visits", "time on page", or a privacy-first alternative to GA on a Payload site.

Analytics in the admin

What an owner wants from "light analytics": how many people came, what they read and for how long, where from, on what — in the admin they already use. What they must not get: a third-party script on the page, a cookie, or a promise in the privacy policy the site doesn't keep. Kit: bash .claude/skills/payload-cms/scaffold.sh analytics (needs core + admin).

Decisions — and why

#DecisionWhy
A1Self-hosted in the CMS's Postgres (page-views, hidden from the nav), read with plain SQL (readStats)No vendor, no script, no dependency; the data sits beside the content it describes
A2Only with consent: the beacon fires only when consent.analytics === trueThe cookie banner's analytics switch must mean something — and the privacy policy promises it
A3/api/track drops bots (UA regex incl. Lighthouse/headless/monitors), /admin + /api paths, DNT and GPCCounts people, not crawlers or the editor; honours "do not track" even with consent
A4No personal data kept: visitor = sha256(PAYLOAD_SECRET + day + IP + UA) truncated; IP and UA never stored; no cookie of our ownOne person = one visitor per day, unlinkable across days. "Visitors" over a range = sum of daily visitors (what privacy-first tools call visits)
A5Time on page = visible time, banked across visibility changes, sent once on leave (pagehide / hidden / route change), capped at 30 min, written only by the same day-hash, only onceA background tab doesn't inflate it; the id can't be used to rewrite other rows. Views with no clean leave are excluded from the average, not counted as 0
A6Country from the edge header (x-vercel-ip-country / cf-ipcountry), else the Accept-Language region flagged countryApprox and footnotedExact on the host, honest locally
A7Retention = the privacy policy's figure (default 14 months), swept on ~1 % of writesThe policy and the database agree, with no cron
A8Server-rendered view; the chart is one client leaf — plain SVG, no chart library, no animation; hover is a discrete stateNo dependency, no motion-rule exception; lists are plain HTML
A9Countries as a code badge + English name (Intl.DisplayNames)Windows draws flag emoji as bare letters
A10Bounce rate = visitor-days with one view; every KPI compared with the previous period, colour by better/worse (bounce inverted)The four numbers an owner asks about, with direction
Show full SKILL.md (311 more words)Show less

Steps

  1. Check the consent flow first. "Accept all" must save analytics: true (the starter does; an older site saved all categories off). The cookie banner/dialog must have an analytics category, and the privacy policy must say: what is collected (path, referrer host, device class, browser, OS, country, language, visible time), that it's consent-only, no cookie, no IP stored, and the retention. Set RETENTION_DAYS in cms/analytics.ts to the policy's number. If the policy says otherwise, ask before shipping.
  2. Scaffold; register PageViews in payload.config.ts, the dashboard card, the Insights → Analytics nav link and the /analytics view (marked lines).
  3. Put <AnalyticsBeacon /> in SiteDocument (after the cookie banner). It renders nothing and posts nothing until consent.
  4. PAYLOAD_SECRET must be set (it salts the hash) and DATABASE_URL reachable — without either, /api/track answers { counted: false } and nothing breaks.
  5. yarn generate:types → yarn migrate:direct create page_views → yarn migrate:direct → yarn generate:importmap.
  6. robots.ts already disallows /api/.

Prove it

  • Fresh profile, no consent → Network: no /api/track. Reject → none. Accept → one POST per route change, { data: { counted: true, id } }.
  • Switch tabs away and back, then navigate → a second POST { id, seconds } with roughly the visible time only.
  • curl -X POST …/api/track -H 'dnt: 1' … → counted: false; a bot UA → false; { id: <someone else's>, seconds } → false.
  • /admin/analytics shows the views; ranges switch; the chart's hover readout works with mouse; the 7-day card is on the dashboard.
  • Locally the country is approximate and footnoted; on the host it is exact.
  • Lighthouse unchanged (the beacon is idle until consent; Lighthouse never consents) — and Lighthouse runs are not counted (bot regex).
  • select count(*) from page_views where created_at < now() - interval '<retention>' → 0 after sweeps.

Extending

Add a dimension = a column on page-views + a migration + a run(sql…) in readStats + a RankList. Keep the rule: reduce before storing — never store a raw IP, full UA, full referrer URL or anything that identifies a person.

© textura-agency, Unlicense. 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 .claude/skills/payload-analytics of textura-agency/next16-claude-starter.

Open the folder on GitHubat commit 6c6edf9

Compare with similar skills

Payload Analytics 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.

Payload Analytics compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Payload Analytics this skilltextura-agency/next16-claude-starter133—~1.4kAutomated safety check: PassUnlicense
Pixeltablepixeltable/pixeltable1.6k—~216Automated safety check: PassApache-2.0
Altimate Data Warehouse DelegateAltimateAI/data-engineering-skills128—~1.4kAutomated safety check: PassMIT
Managing Databasesrileyhilliard/claude-essentials130—~1.6kAutomated safety check: PassMIT
Using Timeseries Databasesancoleman/ai-design-components525—~1.7kAutomated safety check: PassMIT
Implementing Database Audit Loggingjeremylongshore/tons-of-skills-marketplace2.8k—~2.3kAutomated safety check: PassMIT

Similar skills

  • Pixeltable

    pixeltable/pixeltable

    Build multimodal AI apps with Pixeltable. An agent skill from pixeltable/pixeltable.

    1.6k GitHub stars~216 tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Altimate Data Warehouse Delegate

    AltimateAI/data-engineering-skills

    Delegates dbt and warehouse tasks such as lineage, migrations and cost attribution to the altimate-code CLI agent and relays its answer back.

    128 GitHub stars~1.4k tokensUpdated 2 days ago
    DatabasesAuto-check passed
  • Managing Databases

    rileyhilliard/claude-essentials

    Guides database architecture for PostgreSQL, DuckDB, Parquet, PGVector, and Neo4j.

    130 GitHub stars~1.6k tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • Using Timeseries Databases

    ancoleman/ai-design-components

    Time-series database implementation for metrics, IoT, financial data, and observability backends.

    525 GitHub stars~1.7k tokensUpdated 10 mo ago
    DatabasesAuto-check passed
  • Implementing Database Audit Logging

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to track database changes for compliance and security monitoring.

    2.8k GitHub stars~2.3k tokensUpdated yesterday
    Legal & ComplianceAuto-check passed
  • Scanning Database Security

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with security and compliance.

    2.8k GitHub stars~1.9k tokensUpdated yesterday
    Legal & ComplianceAuto-check passed

More from textura-agency/next16-claude-starter

All 16 skills in this repo
  • Mobile Device QA

    textura-agency/next16-claude-starter

    Make a site behave on real phones — the defects no Lighthouse run or headless scroll test sees, learned from site owners reviewing production sites on an iPhone.

    133 GitHub stars~5k tokensUpdated 4 days ago
    Auto-check: notes
  • Optimize Load

    textura-agency/next16-claude-starter

    Get a page into Lighthouse's green zone on desktop and mobile, for people AND for the robot form crawlers get — build it, audit all four categories (Performance, Accessibility, Best Practices, SEO)…

    133 GitHub stars~4.6k tokensUpdated 4 days ago
    Auto-check: notes
  • Optimize Performance

    textura-agency/next16-claude-starter

    Make a page in this starter actually smooth — build it, scroll it in real Chrome on PC and on an emulated phone, fix what the measurement blames, re-measure to prove it.

    133 GitHub stars~3.7k tokensUpdated 4 days ago
    Auto-check: notes
  • Payload Admin

    textura-agency/next16-claude-starter

    Make a Payload admin feel like part of the site and explain itself — the skin re-tinted from the site's own tokens (calm, light, no added motion), the site's wordmark and favicon, a dashboard…

    133 GitHub stars~1.5k tokensUpdated 4 days ago
    Auto-check passed
  • Payload Cms

    textura-agency/next16-claude-starter

    Put a Payload CMS admin on a site built from this starter — every visible string and content photo editable, derived from the site's own content objects with the code's copy as the fallback, a…

    133 GitHub stars~3.7k tokensUpdated 4 days ago
    Auto-check: notes
  • Aeo Visibility

    textura-agency/next16-claude-starter

    Answer Engine Optimisation — make the site citable by ChatGPT, Claude, Perplexity, Gemini and AI Overviews.

    133 GitHub stars~1.4k tokensUpdated 4 days ago
    Auto-check: notes

Works with

Questions about Payload Analytics

What does Payload Analytics do?

Light, consented, cookieless, self-hosted visitor analytics inside the Payload admin — a page-views collection in the CMS's own Postgres written by a same-origin /api/track beacon, an Analytics view…. Payload Analytics is an agent skill from textura-agency/next16-claude-starter. Light, consented, cookieless, self-hosted visitor analytics inside the Payload admin — a page-views collection in the CMS's own Postgres written by a same-origin /api/track beacon, an Analytics view (visitors, views, average visible time on page, bounce rate, live visitors, a day-by-day chart with a metric switch, top pages, referrers, countries, languages, devices, browsers, systems, 7/30/90-day ranges vs the period before) and a 7-day dashboard card.

When should I use Payload Analytics?

Payload Analytics fits situations like: the user wants analytics in the admin; A chart of visits; A privacy-first alternative to GA on a Payload site.

How do I install Payload Analytics in Claude Code?

Run `npx skills add textura-agency/next16-claude-starter --skill payload-analytics -a claude-code`. Or copy the skill folder (.claude/skills/payload-analytics in textura-agency/next16-claude-starter) into .claude/skills/payload-analytics in your project. Claude Code loads it when a task matches its description.

How do I install Payload Analytics in Codex?

Run `npx skills add textura-agency/next16-claude-starter --skill payload-analytics -a codex`. Or copy the skill folder (.claude/skills/payload-analytics in textura-agency/next16-claude-starter) into .agents/skills/payload-analytics in your project. Codex loads it when a task matches its description.

Can I use Payload Analytics 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 textura-agency/next16-claude-starter --skill payload-analytics -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/payload-analytics, .gemini/skills/payload-analytics, .github/skills/payload-analytics and .opencode/skills/payload-analytics in your project.

What does Payload Analytics need to run?

Going by SKILL.md and its folder, Payload Analytics needs the command-line tools its instructions call (yarn, bash and curl) and credentials named PAYLOAD_SECRET. Our summary lists: A credential in PAYLOAD_SECRET.

Does Payload Analytics access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Payload Analytics 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 Payload Analytics use?

Payload Analytics is published under the Unlicense licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Payload Analytics use?

About 1.4k tokens (SKILL.md is roughly 5.6k 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 Payload Analytics?

Skills that share tags, products or a category with Payload Analytics: Pixeltable (pixeltable/pixeltable, 1.6k stars), Altimate Data Warehouse Delegate (AltimateAI/data-engineering-skills, 128 stars), Managing Databases (rileyhilliard/claude-essentials, 130 stars) and Using Timeseries Databases (ancoleman/ai-design-components, 525 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Payload Analytics?

textura-agency (a GitHub organization) maintains it in textura-agency/next16-claude-starter, which has 133 GitHub stars. The repository holds 16 skills in this directory. The repository was last updated on October 7, 2026.

Source: textura-agency/next16-claude-starter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.