# postgis copilot pro

> A specialist PostGIS engineering assistant for safe spatial SQL, CRS decisions, troubleshooting, query-plan analysis, and production guidance.

postgis copilot pro is a free AI agent skill on Agensi by Yacine Mohamed. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Yacine Mohamed](https://www.agensi.io/creators/yacine-mohamed)
- Version: 1.0
- Last updated: 2026-11-21
- Security: scan passed (2026-11-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/postgis-copilot-pro
- Tags: postgis, postgresql, gis, spatial-sql

## About this skill

Writing correct spatial SQL is error-prone and debugging coordinate system mismatches can halt production pipelines. This skill provides expert-level PostGIS guidance to ensure your queries are performant, spatially accurate, and safe for execution.

### What it does
- **SQL Generation** produces parameterized, read-only spatial queries with explicit aliases and qualified names.
- **Error Diagnosis** troubleshoots common failures like mixed SRIDs, invalid topologies, and function signature mismatches.
- **CRS Management** handles coordinate transformations versus metadata assignments using `ST_Transform` and `ST_SetSRID` correctly.
- **Performance Review** analyzes query plans and recommends GiST indexing or spatial predicate optimizations.
- **Schema Advice** provides geometry typmod recommendations and constraints based on your specific data model.

### How it works
1. Provide a natural language description of your spatial task or a snippet of your existing schema.
2. The agent identifies the relevant predicates, units, and SRID requirements, asking clarifying questions where the schema is ambiguous.
3. Review the generated SQL block, which includes explanations of spatial choices and validation checks.
4. For performance issues, provide an `EXPLAIN` output for a detailed analysis of index usage and bounding-box tests.

### Frameworks & tools
PostgreSQL and PostGIS.

### Why this beats prompting it yourself
Generic LLMs often confuse geometry and geography types or hallucinate SRID units. This skill follows a strict operating contract that prioritizes read-only safety, spatial correctness, and explicit assumption-labeling to prevent silent data corruption or slow table scans.

### Use cases
- Convert complex spatial business logic into optimized SQL joins and predicates.
- Fix "geometry contains mixed SRIDs" errors without guessing coordinate systems.
- Optimize slow spatial queries by identifying missing GiST indexes or inefficient predicates.
- Design production-ready schemas with proper geometry constraints and typmods.

### Known limitations
Does not connect to or execute queries on your live database directly. Performance claims are theoretical until verified by your specific hardware and dataset via `EXPLAIN ANALYZE`.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the postgis copilot pro skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific PostGIS challenges does this skill address?

This skill helps you generate optimized spatial SQL, debug SRID mismatches, and troubleshoot performance issues. It is specifically designed to handle the nuances of PostGIS geometry vs. geography types that generic models often confuse.

### Is this skill compatible with my specific AI agent or platform?

The skill is designed to work with any AI agent or platform that supports system-prompt customization or skill integration. It focuses on generating standard PostgreSQL/PostGIS syntax compatible with all modern versions of the extension.

### Does PostGIS Copilot Pro require direct access to my live database?

No, the agent operates in a sandbox environment and does not have direct access to your database. It generates and reviews SQL code based on the schema or EXPLAIN plans you provide, ensuring your data remains private and secure.

### How does the skill handle coordinate system and SRID troubleshooting?

The skill provides expert guidance on SRID transformations, helping you choose between `ST_Transform` for coordinate changes and `ST_SetSRID` for metadata fixes. It asks clarifying questions about your data's origin to ensure you use the correct projection for your geographic area.

### What is included in my purchase of PostGIS Copilot Pro?

Upon purchase, you receive the specialized agent configuration, including its operating contract and spatial reasoning logic. You also get lifetime access to updates as new PostGIS functions and optimization techniques are released.

### Can I use this skill to optimize an existing slow-running spatial query?

Yes, you can provide the output of a PostgreSQL `EXPLAIN` or `EXPLAIN ANALYZE` command. The skill will analyze the plan to identify missing GiST indexes, inefficient spatial predicates, or unnecessary table scans.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
