Agent skill · Audited from source
pg-aiguide
skill · timescale/pg-aiguideApache-2.0 licenceAudited 23 Oct 2026 · source c8ed45084a23
Is it safe? With care — CAUTION, grade B (85/100). We read this skill's source at commit c8ed45084a23 and observed filesystem, network and shell access and a hard-coded secret (see the findings). The audit raised 12 findings, 1 critical or high. What it does: Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications
Cite
Cite this page
ModelsAtlas. “pg-aiguide (timescale/pg-aiguide)”. Retrieved 23 Oct 2026. https://modelsatlas.com/skills/timescale/pg-aiguide
Trust audit
Audit 0.4.1 · source read 23 Oct 2026
CAUTION means the audit found things worth knowing before you trust this skill. Grade B is shared by 13,985 of 14,816 audited skills.
What the source does
- FilesystemDeclared4 observations
- NetworkDeclared4 observations
- ShellDeclared5 observations
- DependenciesNot pinnedSome versions float
- SecretsFoundSee the findings; values are never shown
Five audit layers
| Layer | What we check | Result | Findings |
|---|---|---|---|
L0 Provenance | Repo owner, licence, archive status, activity | PASS | 6 |
L1 Static source | Secrets, path traversal, supply chain, hidden code | FAIL | 4 |
L2 Instructions | Prompt injection, authority framing, hidden directives | PASS | 2 |
L3 Inventory | The files and declarations match the source | PASS | 0 |
L4 Sandbox | Run in isolation and watch behaviour | SKIPPED why | 0 |
Gates applied: no behavioural pass.
Findings (12)
HIGHHard-coded secretssecret.db_uri · ingest/utils/db.py:18
return f"…"
- Why
- No further detail recorded for this rule.
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/backfill-strategies.md
skills/postgres/references/backfill-strategies.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/complete-example.md
skills/postgres/references/complete-example.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/design-postgis-tables.md
skills/postgres/references/design-postgis-tables.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/design-postgres-tables.md
skills/postgres/references/design-postgres-tables.md
- Why
- link not followed
- Fix
- —
LOWInventory / provenanceinv.symlink · skills/postgres/references/find-hypertable-candidates.md
skills/postgres/references/find-hypertable-candidates.md
- Why
- link not followed
- Fix
- —
LOWInsecure cryptocrypto.weak_hash · ingest/tiger_docs.py:1055
hash_suffix = hashlib.md5(path.encode()).hexdigest()[:8]
- Why
- No further detail recorded for this rule.
- Fix
- —
LOWFilesystem / pathfs.traversal · src/prompts/index.ts:10
new URL('../../skills/', import.meta.url), // src/prompts/index.ts -> skills (checkout/Docker)- Why
- No further detail recorded for this rule.
- Fix
- —
LOWSupply chainsupply.unpinned · package.json
@openrouter/ai-sdk-provider, @opentelemetry/api, dotenv, gray-matter, migrate, pg, zod, @biomejs/biome
- Why
- 15 dependency range(s) float
- Fix
- pin exact versions or ship a lockfile
LOWPrompt injectionprompt.transfer_instruction · skills/schema-exploration/references/foreign-tables.md:7
`$1` = schema name, `$2` = foreign table name. Server/table options are listed by **name only**: option values and user mappings may contain connection details or credentials. Don't collect or report
- Why
- an instruction to move sensitive data to an outside destination
- Fix
- remove; a skill never needs the user's secrets off the machine
INFOPrompt injectionprompt.authority_framing · README.md:262
> You are a senior software engineer. You are given a task to generate a Postgres schema for an IoT device company.
- Why
- No further detail recorded for this rule.
- Fix
- —
Audit 0.4.1 · source sha c8ed45084a23 · 23 Oct 2026Report an issue or request a re-scan
Provenance
Who published it, and what the verdict is pinned to
- Publishertimescale GitHub organizationOwner of the repository this skill is read from
- Source foldertimescale/pg-aiguideThe exact folder we audited
- LicenceApache-2.0As the repository states it
- Commit pinned for this verdictc8ed45084a23A new audit runs when the source changes
- Repository statusNot archivedLast push 1 day ago
- Sandboxed runNot runSkills are read, not executed; layer L4 is skipped
What it tells the agent
Full source on GitHub ↗Its description: Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications
---
name: design-postgis-tables
description: Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications
license: Apache-2.0
compatibility: Requires PostgreSQL 15+ with the PostGIS extension
metadata:
author: tigerdata
---
# PostGIS Spatial Table Design
## Before You Start (5 Questions)
1. What is the geographic scope (single city/region vs global)?
2. What are your primary query patterns (within-radius, bbox, intersects, nearest-neighbor)?
3. What units do you need for distance/area (meters vs CRS units), and how accurate must they be?
4. What is the expected scale (rows, write rate), and is the data mostly append-only?
5. Do you need 3D (Z) or measures (M), or is 2D enough?
**SQL injection note:** When turning these patterns into application code, use parameterized queries for user-provided values (WKT/WKB, coordinates, IDs, radii). Avoid string-concatenating untrusted input into SQL; for dynamic identifiers, use safe identifier quoting/whitelisting.
## Core Rules
- **Always use PostGIS geometry/geography types** instead of PostgreSQL's built-in geometric types (`POINT`, `LINE`, `POLYGON`, `CIRCLE`). PostGIS types provide true spatial capabilities.
- **Choose between GEOMETRY and GEOGRAPHY** based on your use case: GEOMETRY for projected/local data with Cartesian math; GEOGRAPHY for global data requiring accurate spherical calculations.
- **Always specify SRID** (Spatial Reference Identifier) when creating geometry columns. Use `4326` (WGS84) for GPS/global data, appropriate local projections for regional data.
- **Create spatial indexes** on all geometry/geography columns using GiST (default). Consider BRIN only for very large **GEOMETRY** tables where rows are naturally ordered on disk and you can tolerate coarser filtering.
- **Use constraint-based type enforcement** with `GEOMETRY(type, SRID)` syntax to ensure data integrity.
## Geometry vs Geography
### When to Use GEOMETRY
- **Local/regional data** within a single coordinate system
- **Projected coordinates** (meters, feet) for accurate area/distance calculations
- **Complex spatial operations** (buffering, unions, intersections)
- **Performance-critical queries** (Cartesian math is faster)
- **Data already in a projected CRS** (UTM, State Plane, etc.)
```sql
-- Regional data with projected coordinates (UTM Zone 10N for California)
CREATE TABLE local_parcels (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
parcel_number TEXT NOT NULL,
boundary GEOMETRY(POLYGON, 26910), -- UTM Zone 10N (meters)
area_sqm DOUBLE PRECISION GENERATED ALWAYS AS (ST_Area(boundary)) STORED
);
```
### When to Use GEOGRAPHY
- **Global data** spanning multiple continents/hemispheres
- **GPS coordinates** (latitude/longitude in decimal degrees)
- **Accurate distance calculations** on Earth's surface (great circle)
- **Simple spatial operations** (distance, containment)
- **Data from GPS devices, geocoding services, or web maps**
```sql
-- Global data with geodetic calculations
CREATE TABLE global_offices (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
name TEXT NOT NULL,
city TEXT NOT NULL,
location GEOGRAPHY(POINT, 4326) -- WGS84 (lat/lon)
);
-- Distance in meters (accurate spherical calculation)
SELECT
a.name AS office_a,
b.name AS office_b,
ST_Distance(a.location, b.location) / 1000 AS distance_km
FROM global_offices a
CROSS JOIN global_offices b
WHERE a.id < b.id;
```
### Comparison Table
| Aspect | GEOMETRY | GEOGRAPHY |
| ----------------- | ------------------------------------- | ------------------------- |
| Coordinate system | Any SRID (projected or geodetic) | WGS84 (SRID 4326) only |
| Distance units | CRS units (degrees, meters, feet) | Meters (always) |
| Distance accuracy | Depends on projection | True spheroidal distance |
| Area accuracy | Accurate in projected CRS | Accurate on sphere |
| Function support | Full (300+ functions) | Limited (~40 functions) |
| Performance | Faster (Cartesian math) | Slower (spherical math) |
| Index type | GiST, BRIN, SP-GiST | GiST only |
| Best for | Regional/local data, complex analysis | Global data, GPS tracking |
## Geometry Types
### Point Types
```sql
-- Single location (stores, sensors, events)
location GEOMETRY(POINT, 4326)
-- Multiple discrete locations (multi-branch business)
locations GEOMETRY(MULTIPOINT, 4326)
-- 3D point with elevation
location_3d GEOMETRY(POINTZ, 4326)
-- Point with measure value (linear referencing)
location_m GEOMETRY(POINTM, 4326)
```
**Use POINT for:** Store locations, sensor positions, event coordinates, addresses, POIs
**Use MULTIPOINT for:** Multiple related locations stored as single feature
### Line Types
```sql
-- Single path (road segment, river, route)
path GEOMETRY(LINESTRING, 4326)
-- Multiple paths (road network, transit lines)
network GEOMETRY(MULTILINESTRING, 4326)
-- 3D line with elevation profile
trail_3d GEOMETRY(LINESTRINGZ, 4326)
```
**Use LINESTRING for:** Roads, rivers, pipelines, GPS tracks, routes
**Use MULTILINESTRING for:** Disconnected road segments, river systems
### Polygon Types
```sql
-- Single area (parcel, building footprint, zone)
boundary GEOMETRY(POLYGON, 4326)
-- Multiple areas (archipelago, fragmented habitat)
territories GEOMETRY(MULTIPOLYGON, 4326)
-- 3D polygon (building with height)
footprint_3d GEOMETRY(POLYGONZ, 4326)
```
**Use POLYGON for:** Property boundaries, administrative areas, service zones
**Use MULTIPOLYGON for:** Countries with islands, fragmented regions
### Generic Types
```sql
-- Any geometry type (flexible schema)
geom GEOMETRY(GEOMETRY, 4326)
-- Collection of mixed types
features GEOMETRY(GEOMETRYCOLLECTIExcerpt, first 6,000 characters of SKILL.md, verbatim from the audited commit. It is text from someone else’s repository, quoted so you can judge it before your agent reads it.
Install
Pinned to the audited commit c8ed450
git clone [email protected]:timescale/pg-aiguide.git npx skills add timescale/pg-aiguide --skill postgres npx skills add timescale/pg-aiguide --skill schema-exploration npx skills add timescale/pg-aiguide claude plugin install pg@aiguide
git clone https://github.com/timescale/pg-aiguide git -C pg-aiguide checkout c8ed45084a23
Commands as the repository documents them: shown, never run by us. Our verdict covers commit c8ed45084a23 only.
Works in which agents?
What its own text says, not a test
| Agent | Status | More |
|---|---|---|
| Claude Code | Mentioned in its text, not tested | Skills for Claude Code · About Claude Code |
| Claude Desktop | Mentioned in its text, not tested | Skills for Claude Desktop · About Claude Desktop |
| Codex | Mentioned in its text, not tested | Skills for Codex · About Codex |
| Cursor | Mentioned in its text, not tested | Skills for Cursor · About Cursor |
| Gemini CLI | Mentioned in its text, not tested | Skills for Gemini CLI · About Gemini CLI |
| Windsurf | Mentioned in its text, not tested | Skills for Windsurf · About Windsurf |
Audit history
Every audit, every source change
- !CAUTION B 85 / 100
first audit · source
c8ed45084a23
README badge
For maintainers · shows the latest audit
[](https://modelsatlas.com/skills/timescale/pg-aiguide/)
The badge shows our verdict and grade for this skill, and links back to this page. It changes when the audit does.
Similar skills
All coding & review skills →timescale/pg-aiguide
Use this skill when creating database schemas or tables for Timescale, TimescaleDB, TigerData, or Tiger Cloud, especially for time-series, IoT, metrics, events, or log data. Use this to improve the performance of any…
timescale/pg-aiguide
Use this skill to migrate identified PostgreSQL tables to Timescale/TimescaleDB hypertables with optimal configuration and validation.
timescale/pg-aiguide
Use this skill to analyze an existing PostgreSQL database and identify which tables should be converted to Timescale/TimescaleDB hypertables.
timescale/pg-aiguide
Use this skill for general PostgreSQL table design.
timescale/pg-aiguide
Use this skill for setting up vector similarity search with pgvector for AI/ML embeddings, RAG applications, or semantic search.
timescale/pg-aiguide
Use this skill to implement hybrid search combining BM25 keyword search with semantic vector search using Reciprocal Rank Fusion (RRF).
Add this badge to your README
[](https://modelsatlas.com/skills/timescale/pg-aiguide/)
<a href="https://modelsatlas.com/skills/timescale/pg-aiguide/"><img src="https://modelsatlas.com/skills/timescale/pg-aiguide/badge.svg" alt="ModelsAtlas: CAUTION B"></a>
Questions about pg-aiguide
What does the pg-aiguide skill do?
Is pg-aiguide safe to install?
What can pg-aiguide access on my machine?
Which assistants does pg-aiguide work with?
How current is this page?
Sources
- github.com/timescale/pg-aiguide — the audited source at commit c8ed45084a23 and every finding aboveObserved · 23 Oct 2026
Spotted something wrong? Report a correction · Methodology
Keep going in your AI
Opens with this page as the source. We add nothing else to the prompt.
- What does the pg-aiguide skill do?
- Is pg-aiguide safe to install?
- What can pg-aiguide access on my machine?