
Design postgis tables
Guides an agent in designing PostGIS spatial tables, types, SRIDs and indexes
Design postgis tables is an open-source agent skill for databases. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- None
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 1.9K
- Last commit
- License
- Apache-2.0
- Listing updated
Similar skills
About Design postgis tables
This skill gives an AI coding agent a reference for modeling location data in PostgreSQL with the PostGIS extension. It covers when to pick GEOMETRY versus GEOGRAPHY, which spatial column types suit points, lines and polygons, how to choose a coordinate reference system, and which index type fits a given query pattern.
The skill walks the agent through a short set of scoping questions about geographic extent, query patterns, units, scale and dimensionality before proposing a schema. It supplies example table definitions for points of interest, parcels, GPS tracks and service zones, along with performance guidance such as preferring ST_DWithin over ST_Distance filters and validity and SRID constraints.
It expects PostgreSQL 15 or later with PostGIS installed. The skill is a single SKILL.md with no bundled scripts; the code it describes is SQL.
When your agent uses it
Comprehensive PostGIS spatial table design reference covering geometry types, coordinate systems, spatial indexing, and performance patterns for location-based applications
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
From a static check of its 1 file (17 KB) on GitHub on 4 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the pg plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add timescale/pg-aiguide
/plugin install pg@aiguideOr copy only this skill to ~/.claude/skills/design-postgis-tables:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/design-postgis-tables &&
cp -R "$tmp/skills/design-postgis-tables" ~/.claude/skills/design-postgis-tables &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/design-postgis-tables inside it instead.
Copy the skill folder to ~/.agents/skills/design-postgis-tables to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/design-postgis-tables &&
cp -R "$tmp/skills/design-postgis-tables" ~/.agents/skills/design-postgis-tables &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/design-postgis-tables inside it instead.
Copy the skill folder to ~/.cursor/skills/design-postgis-tables to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/design-postgis-tables &&
cp -R "$tmp/skills/design-postgis-tables" ~/.cursor/skills/design-postgis-tables &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/design-postgis-tables inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/timescale/pg-aiguide.git --path skills/design-postgis-tablesOr copy the folder to ~/.gemini/skills/design-postgis-tables yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/design-postgis-tables:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/timescale/pg-aiguide.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/design-postgis-tables &&
cp -R "$tmp/skills/design-postgis-tables" ~/.copilot/skills/design-postgis-tables &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/design-postgis-tables inside it instead.
Get the folder:
git clone --depth 1 https://github.com/timescale/pg-aiguide.gitThen copy pg-aiguide/skills/design-postgis-tables into your agent's skills folder as design-postgis-tables. Agents that support SKILL.md read one folder per skill.
What it does
- Geometry and geography choice
- Explains when to store data as GEOMETRY in a projected system or as GEOGRAPHY for global spherical distances.
- Spatial column types
- Covers point, line, polygon and collection types, including 3D and measure variants.
- SRID guidance
- Describes common coordinate systems such as WGS84, Web Mercator and UTM zones and when to transform between them.
- Spatial index selection
- Compares GiST, BRIN and SP-GiST indexes and when each is appropriate.
- Example table schemas
- Provides worked SQL designs for POIs, parcels, GPS tracking and service coverage zones.
- Data validation patterns
- Shows constraints for geometry validity, SRID consistency and coordinate ranges.
Good for
- Design a PostGIS schema for storing store locations with radius search
- Choose between geometry and geography for a global GPS tracking table
- Pick an SRID for regional parcel boundaries stored in a projected system
- Add spatial indexes and check that queries use them
- Add constraints that keep geometries valid and coordinates in range
Design postgis tables FAQ
What does the skill need to run?
It targets PostgreSQL 15 or later with the PostGIS extension, as stated in its compatibility field.
Does Design postgis tables execute any scripts or change my database?
No scripts are included. It is a reference that guides the agent in writing SQL for table design.
What questions does Design postgis tables ask before designing a table?
It asks about geographic scope, primary query patterns, distance and area units with required accuracy, expected scale and append-only behaviour, and whether 3D or measure values are needed.
How do I install Design postgis tables in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/design-postgis-tables to use it in all your projects, or to .claude/skills/design-postgis-tables in one project. Or install the pg plugin, which includes it: /plugin marketplace add timescale/pg-aiguide, then /plugin install pg@aiguide.
Does Design postgis tables run scripts?
No. It is instructions only, with no scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Design postgis tables?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Design postgis tables?
The closest alternatives to Design postgis tables are Design postgres tables, Postgres, PostgreSQL optimization, Data layer patterns edho ferdian and SQL optimization.
Where this comes from
- Description: from the skill's own SKILL.md.
More from timescale/pg-aiguide

Guides an agent through PostgreSQL table design, types, constraints and indexing
- Open source
- 1.9K GitHub stars
- Databases

Scores existing PostgreSQL tables to find which should become TimescaleDB hypertables
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through converting PostgreSQL tables into TimescaleDB hypertables safely
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through pgvector setup, HNSW indexing and tuning for semantic search
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through PostgreSQL schema design, indexing, search, TimescaleDB
- Open source
- 1.9K GitHub stars
- Databases

Guides an agent through planning, testing and running PostgreSQL schema migrations safely
- Open source
- 1.9K GitHub stars
- Databases



