Skills for Real Engineers. Straight from my .agents directory.
timescaledb-hyperfunctions
Agent skill fromtimescale/pg-aiguide
Use this skill when writing analytical SQL over time-series data with the TimescaleDB Toolkit (timescaledb_toolkit extension) hyperfunctions: approximate percentiles, statistical summaries, time-weighted averages, counter/gauge rates, uptime/heartbeat tracking, state durations, OHLC candlesticks, approximate distinct counts, top-N, and downsampling. **Trigger when user asks to:** - Compute percentiles/medians/p95/p99 over large or rolled-up time-series data - Compute rates or deltas from monotonic counters (Prometheus-style) or gauges - Compute time-weighted averages or integrals over irregularly sampled data - Track uptime/downtime from heartbeats, or time spent in each state - Build OHLC/candlestick or VWAP data for financial ticks - Store re-aggregatable summaries in continuous aggregates (two-step aggregation, rollup) - Approximate COUNT DISTINCT, find top-N / most frequent values, or downsample for charts **Keywords:** timescaledb_toolkit, hyperfunctions, percentile_agg, uddsket
How to install timescaledb-hyperfunctions
npx skills add timescale/pg-aiguide# or add only this skill to Claude Code: copy the folder
skills/timescaledb-hyperfunctions/
# into
~/.claude/skills/timescaledb-hyperfunctions/ (all projects)
.claude/skills/timescaledb-hyperfunctions/ (one project)
1# TimescaleDB Toolkit Hyperfunctions23Hyperfunctions are SQL aggregates and accessors from the `timescaledb_toolkit` extension for analysis that plain PostgreSQL aggregates handle badly: percentiles that can be re-aggregated, rates over resetting counters, averages over irregular samples, uptime, state durations, and more.45## Setup67```sql8CREATE EXTENSION IF NOT EXISTS timescaledb_toolkit; -- preinstalled on Tiger Cloud9SELECT extversion FROM pg_extension WHERE extname = 'timescaledb_toolkit';10ALTER EXTENSION timescaledb_toolkit UPDATE; -- after upgrading the package11```1213**Only use functions from the default schema in persistent objects.** Anything in the `toolkit_experimental` schema can change between releases, and `ALTER EXTENSION ... UPDATE` **drops** views, continuous aggregates, and functions that depend on it. All functions in this skill are stable.1415## The Two-Step Pattern (read this first)1617Nearly every hyperfunction works in two steps:18191. An **aggregate** builds a compact summary (`percentile_agg(val)` → `uddsketch`, `time_weight(...)` → `timeweightsummary`, ...).202. An **accessor** extracts a result from the summary (`approx_percentile(0.95, summary)`, `average(summary)`, ...).2122```sql23-- Function-call style24SELECT approx_percentile(0.95, percentile_agg(latency_ms)) FROM requests;2526-- Arrow style (same result, reads left to right, chains multiple accessors)27SELECT percentile_agg(latency_ms) -> approx_percentile(0.95) FROM requests;28```29…
Excerpt shown under the repository's Apache-2.0 license.
More skills in pg-aiguide
Similar skill repositories
An agentic skills framework & software development methodology that works.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
Public repository for Agent Skills
Makes your AI agent think like the laziest senior dev in the room. The best code is the code you never wrote.
An AI skill that provides design intelligence for building professional UI/UX across multiple platforms.
