Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx skills add thapaliyabikendra/ai-artifacts --skill postgresql-query-generationgit clone --depth 1 https://github.com/thapaliyabikendra/ai-artifactsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/thapaliyabikendra/ai-artifacts/postgresql-query-generation)<a href="https://agentmods.dev/skills/thapaliyabikendra/ai-artifacts/postgresql-query-generation"><img src="https://agentmods.dev/badge/skills/thapaliyabikendra/ai-artifacts/postgresql-query-generation/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/thapaliyabikendra/ai-artifacts/postgresql-query-generation"><img src="https://agentmods.dev/badge/skills/thapaliyabikendra/ai-artifacts/postgresql-query-generation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00101 | $0.01880 |
| Opus 5 | $0.00051 | $0.00940 |
| Sonnet 5 | $0.00020 | $0.00376 |
| Haiku 4.5 | $0.00010 | $0.00188 |
Grade A, and why
postgresql-query-generation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 220 lines — stays where its author put it; the contents beside it link to each section on GitHub.
PostgreSQL Query Generation
Generate production-ready PostgreSQL queries for any .NET project using Entity Framework Core. This skill automatically discovers your domain structure and generates optimized SQL with proper relationships, multi-tenancy, soft delete filters, and ABP Framework conventions.
Quick Start
# Interactive mode (output to stdout)
python scripts/generate_query.py --interactive
# Generate query - automatically saves .sql file in current directory
python scripts/generate_query.py --query "get all applications with workflow stages"
# Generate query with custom output filename
python scripts/generate_query.py --query "get all applications" --output my_query.sql
# Only discover domain (output schema as JSON)
python scripts/generate_query.py --discover-only --output schema.json
What It Does
- Discovers domain entities by scanning C# entity files
- Analyzes relationships (foreign keys, navigation properties)
- Detects project conventions (multi-tenancy, soft delete, audit fields)
- Generates optimized queries with proper JOINs and WHERE clauses
- Adapts to any domain (ABP, custom DDD, layered monoliths)
Capabilities
Automatic Discovery
- Scans
src/*/Domain/Entities/**/*.csfor entity classes - Inherits properties from base classes (FullAuditedAggregateRoot, SetupEntity, etc.)
- Detects foreign keys by
{EntityName}Idpattern - Identifies navigation properties (ICollection, T)
- Maps C# types to PostgreSQL types automatically
Query Patterns Supported
- ✅ Multi-entity JOIN queries
- ✅ Many-to-many relationships via join tables
- ✅ Hierarchical/self-referencing (recursive CTE)
- ✅ JSONB querying (
@>,?,jsonb_path_query) - ✅ Window functions (ROW_NUMBER, FIRST_VALUE, etc.)
- ✅ Pagination with COUNT
- ✅ Permission/security queries with complex joins
- ✅ Aggregations and GROUP BY
- ✅ Full-text search (ILIKE)
- ✅ Bulk operations (INSERT/UPDATE with CASE)
Project-Specific Patterns
- ABP Framework: Auto-detects TenantId, IsDeleted, CreationTime audit fields
- Multi-tenancy: Always adds
TenantId = @tenantIdfilter - Soft delete: Adds
IsDeleted = falsefilter - JSONB fields: Optimized queries for InitialData, FormData, JsonSchema, etc.
- Naming conventions: Uses quoted identifiers (e.g.,
"SystemName")
What ships with it
9 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- assets/example-queries.sql 5.9 KB
- references/entity-discovery.md 9.7 KB
- references/query-examples.md 19 KB
- references/query-patterns.md 14 KB
- references/troubleshooting.md 12 KB
- references/type-mappings.md 7.5 KB
- scripts/__pycache__/generate_query.cpython-313.pyc 32 KB
- scripts/generate_query.py 27 KB runs code
- scripts/get_all_applications_with_1774248867.sql 375 B
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 8d ago First seen · 220 lines · 101 tokens per session scan A bca91834ca29
postgresql-query-generation is a skill published in the GitHub repository thapaliyabikendra/ai-artifacts (24 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 101 tokens to every session and 1,880 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
azure-postgres-ts
Connect to Azure Database for PostgreSQL Flexible Server from Node.js/TypeScript using the pg (node-postgres) package. Use for PostgreSQL queries, connection pooling, transactions, and Microsoft Entra ID (passwordless) authentication. Triggers: "PostgreSQL", "postgres", "pg client", "node-postgres", "Azure PostgreSQL…
butterbase
AI-native, open-source backend-as-a-service with a built-in Model Context Protocol server. Postgres, auth, storage, functions, AI gateway.
supabase
Use when doing ANY task involving Supabase. Triggers: Supabase products (Database, Auth, Edge Functions, Realtime, Storage, Vectors, Cron, Queues); client libraries and SSR integrations (supabase-js, @supabase/ssr) in Next.js, React, SvelteKit, Astro, Remix; auth issues (login, logout, sessions, JWT, cookies…
supabase-cli
This skill should be used when user asks to "use supabase CLI", "supabase init", "supabase start", "run migrations", "deploy edge functions", "manage Supabase project", or works with the supabase command-line tool for local development and project management.
supabase-js
This skill should be used when user asks to "use supabase-js", "query Supabase database", "supabase auth", "supabase storage", "supabase realtime", "supabase edge functions", or works with the @supabase/supabase-js JavaScript/TypeScript SDK.
supabase-node
Express/Hono with Supabase and Drizzle ORM.