db-schema

Convert business questions about Omni CRM into schema-aware PostgreSQL SELECT queries.

Updated Feb 3, 2026
One-click install
npx skills add https://github.com/michaelayoade/dotmac_crm --skill db-schema-michaelayoade
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-schema
Source: https://github.com/michaelayoade/dotmac_crm/tree/main/.claude/skills/db-schema
Command: npx skills add https://github.com/michaelayoade/dotmac_crm --skill db-schema-michaelayoade

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the problem of not knowing how Omni CRM data is structured, which tables relate to which entities, and how to write correct, safe queries that match business concepts across domains.

Core Features & Use Cases

  • Schema-aware database querying: Helps you translate a business question into PostgreSQL SELECT queries with correct joins and domain context across Tickets, Projects, CRM Inbox, CRM Sales, Campaigns, Workforce, and Network/Fiber.
  • Cross-domain relationship guidance: Uses an entity relationship map (people/subscribers/tickets/projects/work_orders/crm_conversations) and PostGIS awareness to support analytics that span multiple functional areas.
  • Production-safe query practices: Enforces read-only execution via the omni-db MCP server and provides safety rules (no writes, soft-delete filtering guidance, and LIMIT usage expectations).

Quick Start

Ask a question like: "What are the top 10 subscribers by ticket count for the last 30 days, including subscriber number and customer name?"

Frequently Asked Questions about db-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write PostgreSQL queries for Omni CRM analytics without knowing the table relationships?

Schema-aware SQL querying translates business questions into correct PostgreSQL SELECT queries by mapping Omni CRM entity relationships across Tickets, Projects, CRM Inbox, and Workforce domains. It uses a schema reference to ensure accurate cross-domain joins for analytics and reporting.

Can I run PostGIS proximity queries across subscribers and fiber network entities in Omni CRM?

Yes, schema-aware SQL querying supports PostGIS proximity and aggregation analytics across network and fiber entities. It correctly joins spatial data with subscriber and work order tables to produce geographic insights using safe, read-only PostgreSQL SELECT statements.

What's the best way to generate SLA and compliance reports from Omni CRM tickets?

Generating SLA and compliance reports requires schema-aware SQL queries that join ticket data with workforce and CRM entities. The approach applies soft-delete filtering and correct enum handling to ensure production-safe, accurate SELECT queries for reporting metrics.

Does schema-aware SQL querying enforce read-only safety when accessing the Omni CRM database?

Yes, schema-aware SQL querying enforces read-only execution via the omni-db MCP server using a restricted DSN. It strictly limits operations to SELECT queries, preventing database writes while providing guidance on soft-delete filtering and LIMIT usage for safe analytics.

How do I join people, subscribers, and work orders across different functional areas in Omni CRM?

Cross-domain relationship guidance maps people, subscribers, tickets, and work orders entities to enable correct PostgreSQL joins. Schema-aware querying translates these complex relationships into safe SELECT statements, bridging CRM, workforce, and network domains for comprehensive analytics.