Agent skill

DB Context

by SilvioBaratto in SilvioBaratto/optimizer

Complete knowledge of the optimizer PostgreSQL database: 57 ingestion tables, schema, relationships, live row counts, query patterns, and conventions.

Custom licenceAuto-check: notesDatabases

Install DB Context

skills CLI
$ npx skills add SilvioBaratto/optimizer --skill db-context -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install SilvioBaratto/optimizer db-context --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/SilvioBaratto/optimizer.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/db-context .claude/skills/db-context && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
db-context
GitHub stars
176
Token cost
~6.4k tokens
SKILL.md length
1,952 words
Files
3 (incl. references)
Skills in repo
10
Repo updated
First seen
Licence
Custom licence

At a glance

Complete knowledge of the optimizer PostgreSQL database: 57 ingestion tables, schema, relationships, live row counts, query patterns, and conventions.

  • Works in 9 steps: Table Catalog (53 documented + 2 infra) → Relationship Map → Base Model Pattern → …
  • Tasks that involve Database migrations
  • SKILL.md covers 1. Table Catalog (53…, 2. Relationship Map, 3. Base Model Pattern and 4. Design Patterns, plus 5 more sections
  • Needs FRED_API_KEY

What it does

DB Context is an agent skill from SilvioBaratto/optimizer. Complete knowledge of the optimizer PostgreSQL database: 57 ingestion tables, schema, relationships, live row counts, query patterns, and conventions. Load this skill proactively whenever working with database models (packages/portopt-db/src/portoptdb/models/), repositories (packages/portopt-db/src/portoptdb/repositories/ + ingestion/app/repositories/jobs/), Alembic migrations (packages/portopt-db/alembic/), SQL queries, or any code that reads from or writes to the database. Also load when discussing table…

Its SKILL.md is about 6.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/data-inventory.md` and `references/full-schema.md`).

It sits in Databases, covering Database migrations, SQL and Database schema design. It works with PostgreSQL, SQL and yfinance. The repository describes itself as: Quantitative portfolio construction and optimization platform built on skfolio and scikit-learn.

When your agent uses it

  • Tasks that involve Database migrations
  • Tasks that involve SQL
  • Tasks that involve Database schema design

Example prompts

  • “/db-context”

Requirements

  • Docker
  • A credential in FRED_API_KEY

Workflow steps

9 steps, taken from the step headings in SKILL.md.

  1. Table Catalog (53 documented + 2 infra)
  2. Relationship Map
  3. Base Model Pattern
  4. Design Patterns
  5. Connection & Configuration
  6. Migration Conventions
  7. Common Query Patterns
  8. Adding a New Table
  9. Gotchas

What it can do on your machine

Read from SKILL.md and the folder at commit 63e897b. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python and bash).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • FRED_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

DB Context loads about 6.4k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 166 tokens; SKILL.md has 1,952 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~166
When it runs · the whole SKILL.md, loaded when a task matches
~6.4k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~16k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:300
    Overridable via `.env` (`DATABASE_POOL_SIZE`, …); the running container may show larger values.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

Its licence (Custom licence) doesn't allow us to republish the file, so here is its outline and opening line. It has 1,952 words (~6,434 tokens).

“PostgreSQL 16 (Alpine) in Docker on host port 54320. Connection: postgresql://postgres:postgres@localhost:54320/optimizer_db”

— opening of SKILL.md by SilvioBaratto, Custom licence
name
db-context

Read the full SKILL.md on GitHub

Files

SKILL.md and 2 other files (references) in .claude/skills/db-context of SilvioBaratto/optimizer.

  • SKILL.md
  • references/data-inventory.md
  • references/full-schema.md

Open the folder on GitHubat commit 63e897b

Compare with similar skills

DB Context next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

DB Context compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
DB Context this skillSilvioBaratto/optimizer176—~6.4kAutomated safety check: NotesCustom licence
DatabasesMicrock/ordinary-claude-skills403—~1.9kAutomated safety check: NotesMIT
Supabase Postgres Best Practicessupabase/agent-skills2.7k24 repos~808Automated safety check: PassMIT
Schema Explorationtimescale/pg-aiguide1.9k—~1.1kAutomated safety check: PassApache-2.0
Cursor BYOK Database Schemaleookun/cursor-byok3.2k—~1.3kAutomated safety check: PassMIT
Database Migrations SQL Migrationsrmyndharis/antigravity-skills1.7k3 repos~577Automated safety check: NotesMIT

Similar skills

  • Databases

    Microck/ordinary-claude-skills

    Work with MongoDB (document database, BSON documents, aggregation pipelines, Atlas cloud) and PostgreSQL (relational database, SQL queries, psql CLI, pgAdmin).

    403 GitHub stars~1.9k tokensUpdated 1 mo ago
    DatabasesAuto-check: notes
  • Official

    Gives the agent Postgres rules to consult before writing or changing tables, queries, indexes, RLS policies or migrations, and when diagnosing slow queries.

    2.7k GitHub starsUsed in 24 repos~808 tokens
    DatabasesAuto-check passed
  • Schema Exploration

    timescale/pg-aiguide

    Explore an existing PostgreSQL database before answering questions about its data or writing SQL.

    1.9k GitHub stars~1.1k tokensUpdated today
    DatabasesAuto-check passed
  • Cursor BYOK Database Schema

    leookun/cursor-byok

    Guides SQLite schema changes in the Cursor BYOK server, keeping SQLx migrations, the Rust store, API contracts and fixtures aligned.

    3.2k GitHub stars~1.3k tokensUpdated today
    DatabasesAuto-check passed
  • Database Migrations SQL Migrations

    rmyndharis/antigravity-skills

    SQL database migrations with zero-downtime strategies for PostgreSQL, MySQL, SQL Server

    1.7k GitHub starsUsed in 3 repos~577 tokens
    DatabasesAuto-check: notes
  • Diesel Guard

    ayarotsky/diesel-guard

    Lints Diesel and SQLx Postgres migrations for unsafe schema changes that lock tables or cause downtime, and authors custom Rhai checks.

    121 GitHub stars~3.1k tokensUpdated 9 days ago
    DatabasesAuto-check passed

More from SilvioBaratto/optimizer

All 10 skills in this repo
  • Yfinance

    SilvioBaratto/optimizer

    Load proactively whenever the user works with yfinance or Yahoo Finance data — pulling price history, fetching financials or analyst data, screening stocks / funds / ETFs, streaming real-time…

    176 GitHub stars~4k tokensUpdated today
    Auto-check: notes
  • Fund Orchestration

    SilvioBaratto/optimizer

    Sequence the fund pipeline and delegate to the four subagents (economist, allocator, risk, executor).

    176 GitHub stars~635 tokensUpdated today
    Auto-check passed
  • Optimization Objective Map

    SilvioBaratto/optimizer

    Map a chosen ConstraintSet.objective to the correct optimizer cone / risk-measure and factory config.

    176 GitHub stars~510 tokensUpdated today
    Auto-check passed
  • Macro Regime Read

    SilvioBaratto/optimizer

    Read macro/FRED series from the DB and label the current market regime for the economist.

    176 GitHub stars~403 tokensUpdated today
    Auto-check passed
  • Rebalancing Execution

    SilvioBaratto/optimizer

    Translate approved target weights into paper orders under a no-trade band and an L1 turnover penalty, then place them behind human approval.

    176 GitHub stars~425 tokensUpdated today
    Auto-check passed
  • Risk Limits Check

    SilvioBaratto/optimizer

    Validate a proposed weight vector against the ConstraintSet — drawdown ceilings nu1/nu2/nu3, ESG hard gate, robust uncertainty, and a walk-forward backtest — and BLOCK on any breach.

    176 GitHub stars~468 tokensUpdated today
    Auto-check passed

Categories

Questions about DB Context

What does DB Context do?

Complete knowledge of the optimizer PostgreSQL database: 57 ingestion tables, schema, relationships, live row counts, query patterns, and conventions. DB Context is an agent skill from SilvioBaratto/optimizer. Complete knowledge of the optimizer PostgreSQL database: 57 ingestion tables, schema, relationships, live row counts, query patterns, and conventions.

When should I use DB Context?

DB Context fits situations like: tasks that involve Database migrations; tasks that involve SQL; tasks that involve Database schema design.

How do I install DB Context in Claude Code?

Run `npx skills add SilvioBaratto/optimizer --skill db-context -a claude-code`. Or copy the skill folder (.claude/skills/db-context in SilvioBaratto/optimizer) into .claude/skills/db-context in your project. Claude Code loads it when a task matches its description.

How do I install DB Context in Codex?

Run `npx skills add SilvioBaratto/optimizer --skill db-context -a codex`. Or copy the skill folder (.claude/skills/db-context in SilvioBaratto/optimizer) into .agents/skills/db-context in your project. Codex loads it when a task matches its description.

Can I use DB Context in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add SilvioBaratto/optimizer --skill db-context -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/db-context, .gemini/skills/db-context, .github/skills/db-context and .opencode/skills/db-context in your project.

What does DB Context need to run?

Going by SKILL.md and its folder, DB Context needs credentials named FRED_API_KEY. Our summary lists: Docker; A credential in FRED_API_KEY.

Does DB Context access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is DB Context safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does DB Context use?

DB Context has a licence file (the repository's licence) that doesn't match a standard licence. Read it on GitHub before reusing the skill.

How many tokens does DB Context use?

About 6.4k tokens (SKILL.md is roughly 26k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 9.8k tokens, read only when the agent opens those files.

What are the alternatives to DB Context?

Skills that share tags, products or a category with DB Context: Databases (Microck/ordinary-claude-skills, 403 stars), Supabase Postgres Best Practices (supabase/agent-skills, 2.7k stars), Schema Exploration (timescale/pg-aiguide, 1.9k stars) and Cursor BYOK Database Schema (leookun/cursor-byok, 3.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains DB Context?

SilvioBaratto (a GitHub user) maintains it in SilvioBaratto/optimizer, which has 176 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

Source: SilvioBaratto/optimizer on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.