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 oscarsterling/clelp-skills --skill set-up-a-databasegit clone --depth 1 https://github.com/oscarsterling/clelp-skillsWrote 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/oscarsterling/clelp-skills/set-up-a-database)<a href="https://agentmods.dev/skills/oscarsterling/clelp-skills/set-up-a-database"><img src="https://agentmods.dev/badge/skills/oscarsterling/clelp-skills/set-up-a-database/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/oscarsterling/clelp-skills/set-up-a-database"><img src="https://agentmods.dev/badge/skills/oscarsterling/clelp-skills/set-up-a-database.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.00023 | $0.02413 |
| Opus 5.5 | $0.00009 | $0.00965 |
| Sonnet 5.5 | $0.00005 | $0.00483 |
| Haiku 4.5 | $0.00002 | $0.00241 |
Grade A, and why
set-up-a-database 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 14d 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 — 82 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Set up a database
Tested on PostgreSQL 17 with a non-superuser postgres migration role. The audit and probe are a worked example for notes; extend them with a behavioral check for every relation, RPC, and storage operation the migration changes.
Phase 0: Scope
- List exposed schemas, changed objects, roles, and intended grants. Without it: an overlooked API path can stay open.
- Record the exact SQL bytes and security review sign-off. Without it: review can cover different code.
Phase 1: Design access
- Name each table's anon readers, signed-in owners, and server-only writers. Without it: roles gain unintended access.
- Put each trust boundary in its own table. Without it: one broad policy can expose data across boundaries.
- Use
owner_id uuid not null default auth.uid()for owned rows. Without it: writes can lack a trustworthy owner. - Authorize from server-set
app_metadataor your own tables, neveruser_metadataorraw_user_meta_data; any expression outside a simple owner pin needs review; signed-in anonymous users also have theauthenticatedrole. Without it: callers can claim privileges they do not own. - Keep service-role keys out of clients and route server-only writes through that role. Without it: public callers can impersonate the server.
- Keep private schemas out of the exposed schema list. Without it: helpers become API endpoints.
- Check that child rows cannot reference another owner's parent. Without it: a valid child owner can attach data to another user's object.
- Cap caller-supplied text and jsonb sizes. Without it: unbounded input can exhaust resources.
Phase 2: Write migration and prepare rollback
Copy examples/good-migration.sql to one migration file, for example migrations/<timestamp>_notes.sql. Review, hash, stage, and apply that exact path. Write examples/rollback.sql before applying.
- Prepare recovery: write
examples/rollback.sqlbefore applying. Without it: a failed deployment has no reviewed reversal. - Enable RLS in the same migration as every exposed table creation. Without it: rows are exposed before protection exists.
- Inventory existing policies before adding one; permissive policies combine with OR. Without it: a new policy can bypass an older restriction.
- Inspect and reconcile effective table privileges, including those inherited through role membership; revoke broad privileges from
public,anon, andauthenticated, then grant only needed operations. Without it: inherited and PUBLIC grants bypass intended access. - Limit INSERT and UPDATE grants to safe columns when callers must not set or change
id,created_at,owner_id, or role fields. Without it: table-wide UPDATE lets callers rewrite privileged fields. - Pin owned-row SELECT, INSERT, UPDATE, and DELETE policies to
(select auth.uid()) = owner_id, including both UPDATE expressions. Without it: users can read or change another owner's rows. - Never use
with check (true)orusing (true)for exposed writes; give each policy an explicit TO role. Without it: a policy with no TO clause applies to public, and callers can claim another owner. - Prefer SECURITY INVOKER; put definers outside exposed schemas, pin
search_path = '', and qualify object names. Without it: privileged code can resolve attacker-controlled names. - Have every SECURITY DEFINER function callable by signed-in users check
auth.uid()itself. Without it: the function may perform privileged work for the wrong user. - Inspect and reconcile an existing function's ACL before granting EXECUTE; CREATE OR REPLACE preserves grants, and revoking from public and anon alone does not exclude other roles. Without it: an old grant can keep the function callable.
- Revoke EXECUTE on each callable function from public and anon, then grant the intended role. Without it: function access is broader than designed.
- Harden defaults with
alter default privileges for role postgres revoke execute on functions from public;andalter default privileges for role postgres in schema public revoke execute on functions from anon, authenticated;, plus table write defaults. Without it: new functions may inherit PUBLIC EXECUTE or direct exposed-role grants. - Use
with (security_invoker = true)for views on Postgres 15 or later, and inspect every view and table they read, including those in non-exposed schemas. Without it: an invoker view can still expose an owner-rights view or unprotected table below it. - Review every function called by an exposed view, including calls through nested views; inspect what its body reads and whether it runs as invoker or definer. Without it: the view audit cannot follow a function body, which reads with caller rights for invokers or owner rights for definers.
- Keep materialized views and foreign tables outside exposed schemas or revoke exposed SELECT. Without it: materialized views cannot use
security_invoker, and RLS cannot filter these reads. - Install extensions into a schema the API does not expose, for example
create extension ... schema extensions, never public. Without it: extension functions such as http or dblink become callable endpoints. - Keep user-data buckets private; pin the first folder to
auth.uid()in SELECT, INSERT, UPDATE USING and WITH CHECK, and DELETE policies onstorage.objects. Without it: a public bucket exposes files, and a SELECT policy checking onlybucket_id = '...'lets every signed-in user read every user's files. - Never revoke on or drop a schema this migration did not create; inventory an existing schema's ACL first. Without it: a feature migration can break unrelated objects.
- Take a backup and test restoring it before Apply. Without it: a backup may be unusable when recovery is needed.
- Review rollback effects and get the data owner's approval before a data-bearing drop. Without it: recovery can destroy data.
What ships with it
8 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.
- examples/bad-anon-insert-with-check-true.sql 251 B
- examples/bad-definer-unpinned.sql 216 B
- examples/bad-rls-off.sql 143 B
- examples/bad-schema-only-default-revoke.sql 197 B
- examples/good-migration.sql 2.7 KB
- examples/post-apply-audit.sql 16 KB
- examples/probe-roles.sql 7.7 KB
- examples/rollback.sql 850 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.
- 14d ago First seen · 82 lines · 23 tokens per session scan A da3fa8b5fff1
set-up-a-database is a skill published in the GitHub repository oscarsterling/clelp-skills (0 stars, last pushed 6d ago), licensed MIT. It adds 23 tokens to every session and 2,413 once invoked, about $0.0001 per session on Opus 5.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-10-04.
Other skills, from other repositories
alloydb-basics
Manages clusters, instances, and backups for AlloyDB for PostgreSQL, and integrates with AlloyDB Model Context Protocol (MCP) tools for automated database operations. Use when creating, configuring, or administering AlloyDB databases. Do NOT use for general PostgreSQL instances (e.g. Cloud SQL) or other GCP databases.
postgresql-table-design
Use this skill when designing or reviewing a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features.
db-repair
Auto-fix gbrain's Postgres access so the brain stays available. When any gbrain command or MCP tool result carries a GBRAINDBACCESS marker (or an operator reports the brain database is down), run the hardcoded gbrain db-repair ladder: diagnose, apply the safe tier, verify. The action is ALWAYS the hardcoded command …
volcengine-rds-postgresql
A tool for operating PostgreSQL databases hosted by Volcano Engine's managed database service. PostgreSQL is a relational database used to store structured application data.
dsql
Build with Aurora DSQL — manage schemas, execute queries, handle migrations, diagnose query plans, diagnose cluster performance, load data, and develop applications with a serverless, distributed SQL database. Covers IAM auth, multi-tenant patterns, MySQL-to-DSQL and PostgreSQL-to-DSQL schema conversion, foreign key…
analyzing-insights-across-teams
Analyze PostHog insights, dashboards, or teams beyond the current project by querying the prod Postgres replicas synced into the dogfood data warehouse (US project 2, "PostHog App + Website"). Use when asked to analyze insights across all teams or projects, another team's insights, or fleet-wide insight/dashboard…