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 2mo 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.
- 2mo 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 3d 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.
set-up-a-database compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| set-up-a-databaseoscarsterling/clelp-skills | Skill | 0 | 3d ago | MIT | A | 23 | Claude Code |
| alloydb-basicsgoogle/skills | Skill | 26k | today | Apache-2.0 | A | 72 | Claude Code, Codex |
| postgresql-table-designwshobson/agents | Skill | 43k | 2d ago | MIT | A | 37 | Claude Code |
| db-repairgarrytan/gbrain | Skill | 34k | today | MIT | A | 96 | Claude Code |
| volcengine-rds-postgresqlbytedance/agentkit-samples | Skill | 496 | yesterday | Apache-2.0 | A | 63 | Claude Code, Codex |
| dsqlawslabs/agent-plugins | Skill | 957 | yesterday | Apache-2.0 | A | 247 | Claude Code |
| postgresdbericrisco/rsc-harness | Skill | 707 | 2d ago | MIT | A | 91 | Claude Code, Codex |