sails-indexer

sails-indexer is a skill for Claude Code from gear-foundation/vara-skills. It costs 74 tokens per session (3,998 once invoked), scanned A, original, MIT.

A guide for building the read side of a Gear or Vara Sails application. It turns program events into searchable database records and exposes them through a query API, so applications can retrieve prepared data instead of querying the blockchain for every screen.

In plain words
What is it for?
Use it to design or implement event decoding, optional on-chain data enrichment, Postgres read models, and GraphQL APIs for Sails applications.
Why use it?
Direct blockchain queries can be slow and awkward for history, pagination, filters, search, charts, and timelines. An indexer keeps a separate read model that is shaped for those queries.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the vara-skills plugin — 26 skills shipped together

Good fit Use it to design or implement event decoding, optional on-chain data enrichment, Postgres read models, and GraphQL APIs for Sails applications.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/gear-foundation/vara-skills/sails-indexer
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 gear-foundation/vara-skills --skill sails-indexer
Clone the repo
git clone --depth 1 https://github.com/gear-foundation/vara-skills

Made for: Claude Code.

Or install vara-skills, the plugin that ships this one along with the rest of its 26 skills.

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 sails-indexer

README.md
[![agentmods](https://agentmods.dev/badge/skills/gear-foundation/vara-skills/sails-indexer/github.svg)](https://agentmods.dev/skills/gear-foundation/vara-skills/sails-indexer)
Your own site
<a href="https://agentmods.dev/skills/gear-foundation/vara-skills/sails-indexer"><img src="https://agentmods.dev/badge/skills/gear-foundation/vara-skills/sails-indexer/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 sails-indexer

Your own site · 80×15
<a href="https://agentmods.dev/skills/gear-foundation/vara-skills/sails-indexer"><img src="https://agentmods.dev/badge/skills/gear-foundation/vara-skills/sails-indexer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,998 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.00074 $0.03998
Opus 5 $0.00037 $0.01999
Sonnet 5 $0.00015 $0.00800
Haiku 4.5 $0.00007 $0.00400

Measured 11d ago against content hash 0e8dc269b74a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

sails-indexer 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 11d 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/sails-indexer/SKILL.md · 296 lines

How it starts

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

Sails Indexer

Role

Design and implement the read-side backend for a standard Gear/Vara Sails app.

Use this skill when the frontend or integration layer needs history, pagination, filtering, search, aggregates, charts, timelines, or a fast read API that should not be rebuilt from direct chain queries on every screen load.

Treat the indexer as a projection pipeline:

chain/archive -> Sails event decode -> optional on-chain enrichment -> Postgres read model -> thin GraphQL API

Local Handbook

  • ../../references/gear-execution-model.md
  • ../../references/gear-messaging-and-replies.md
  • ../../references/sails-program-and-service-architecture.md
  • ../../references/sails-idl-client-pipeline.md
  • ../../references/sails-cheatsheet.md
  • ../../references/sails-gtest-and-local-validation.md
  • ../../references/scale-binary-decoding-guide.md
  • ../../references/contract-interface-evolution.md
  • ../../references/sails-indexer-patterns.md
  • ../../references/sails-idl-v2-syntax.md — IDL v2 event syntax (throws, @query, service-scoped types)

Standard Defaults

  • Default to an IDL-driven read-side indexer, not a generic command-side backend.
  • Treat the program .idl as the event and route contract for normal Sails decoding work.
  • Default stack: Subsquid-style archive ingestion, PostgreSQL read model, ORM-backed entities, and a thin GraphQL API.
  • Always expose GraphQL as the default read surface for frontend and integration consumers. Do not downgrade the default to REST.
  • Mount a real GraphQL endpoint such as /graphql and make it reachable from local frontend development without browser CORS failures.
  • Prefer one of two frontend-safe API exposure strategies and name the choice explicitly: enable CORS on the indexer API, or serve GraphQL through the frontend dev proxy or same-origin gateway.
  • Use a real ingestion adapter wired to chain or archive sources. Do not leave placeholder, null, or demo adapters in the runtime.
  • Prefer event-driven projections first. Use direct on-chain queries only for initial entity bootstrap or explicit source-of-truth confirmation, and keep them out of hot event-processing paths unless the design justifies the cost.
  • Keep projection logic in processor or handler services. Keep the API layer thin.
  • Model restart, replay, backfill, and duplicate safety as first-class requirements, not as later hardening.
  • Prefer deterministic entity IDs derived from chain facts such as program ID, message ID, block number, extrinsic position, or explicit domain keys.
  • If the repo already has an indexer stack, extend it instead of replacing it with a new framework casually.
  • Treat PostGraphile as a v4-compatible template constraint, not as a product requirement for every indexer. The bundled API template uses the v4 bootstrap/config API (postgraphile(...), PostGraphileOptions, appendPlugins), so keep postgraphile on the 4.x line and postgraphile-plugin-connection-filter on the 2.x line when copying these assets. Do not switch to v5 by changing package versions alone; update the API bootstrap and template config together.
  • Follow the canonical runtime order from ../../references/sails-indexer-patterns.md, especially Start with configuration, not hardcoded endpoints, Build one shared batch processor and export its derived types, Centralize all IDL decoding behind one decoder, Wire the runtime in main.ts, but do not place projection logic there, Give every handler the same lifecycle contract, Process a batch in a stable order, Save in groups and only write what changed, and Expose a thin API layer on top of PostgreSQL.

Read the full file on GitHub · 296 lines

Files

What ships with it

7 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. 11d ago First seen · 296 lines · 74 tokens per session scan A 0e8dc269b74a

Subscribe to this mod's changes

sails-indexer is a skill published in the GitHub repository gear-foundation/vara-skills (17 stars, last pushed 2mo ago), licensed MIT. It adds 74 tokens to every session and 3,998 once invoked, about $0.0004 per session on Opus 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-08-30.

Related

Other skills, from other repositories

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

convex-explain-app

Explain an existing Convex app — data model + relationships, public vs internal functions, auth/ownership model, components, a request→data flow — read from the schema and function surface. Read-only.

openclaw/clawhub · 47 tokens

platform-custom-field-generate

Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from…

forcedotcom/sf-skills · 194 tokens

durable-objects

Build, debug, or review Cloudflare Durable Objects code for persistent state and coordination.

fcakyon/claude-codex-settings · 22 tokens

field-service-sobject-create-configure

Headless 360 REST API deployment step for creating sObject records. Handles describe-based field discovery, required-field derivation, entity-relationship ordering, and composite graph transactions. Use this skill when a designer skill (or a user directly) needs to create sObject records after design confirmation…

forcedotcom/sf-skills · 74 tokens

nornicdb-grpc

Drive NornicDB over gRPC — the Qdrant-compatible surface (Collections, Points, Snapshots) plus the additive NornicSearch service. Use when ingesting via Qdrant SDKs, migrating from Qdrant, or running hybrid text+vector search from a non-Bolt client. Covers connection, RPC catalog, collection→database mapping…

orneryd/NornicDB · 98 tokens