Agent skill

DB

by plan4better in plan4better/goat

A skill your agent uses when inspecting, debugging, or understanding the GOAT PostgreSQL database — querying projects, layers, users, orgs, teams, roles, jobs, or checking data state during local dev.

GPL-3.0Auto-check: notesDatabases

Install DB

skills CLI
$ npx skills add plan4better/goat --skill db -a claude-code

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

GitHub CLI
$ gh skill install plan4better/goat db --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/plan4better/goat.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/db .claude/skills/db && 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
GitHub stars
167
Token cost
~1.3k tokens
SKILL.md length
398 words
Files
1
Skills in repo
2
Repo updated
First seen
Licence
GPL-3.0

At a glance

A skill your agent uses when inspecting, debugging, or understanding the GOAT PostgreSQL database — querying projects, layers, users, orgs, teams, roles, jobs, or checking data state during local dev.

  • Understanding the GOAT PostgreSQL database — querying projects
  • SKILL.md covers Connection, Schemas, Key Tables & Relationships and Common Queries, plus 1 more section
  • Calls docker; needs POSTGRES_PASSWORD
  • Checking data state during local dev

What it does

DB is an agent skill from plan4better/goat. Use when inspecting, debugging, or understanding the GOAT PostgreSQL database — querying projects, layers, users, orgs, teams, roles, jobs, or checking data state during local dev.

Its SKILL.md is about 1.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Databases. It works with PostgreSQL. The repository describes itself as: WebGIS with Planning Intelligence. The licence is GPL-3.0.

When your agent uses it

  • Understanding the GOAT PostgreSQL database — querying projects
  • Checking data state during local dev

Example prompts

  • “/db”

Requirements

  • Docker

What it can do on your machine

Read from SKILL.md and the folder at commit a181bf4. 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

    Shell commands in SKILL.md call:

    • docker

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

  • Network

    No URLs in SKILL.md. Its commands use docker, which can reach the network depending on how they are called.

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

  • Credentials

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

    • POSTGRES_PASSWORD

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

Context cost

DB loads about 1.3k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 398 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~46
When it runs · the whole SKILL.md, loaded when a task matches
~1.3k

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:16
    source /home/p4b/goat/.env
  • NoteMentions a .env fileSKILL.md:24
    source /home/p4b/goat/.env

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

The full file from plan4better/goat at commit a181bf4, republished under its GPL-3.0 licence (© plan4better). 398 words, ~1,276 tokens.

Download SKILL.mdSave it as .claude/skills/db/SKILL.md (or your agent's skills folder).
name
db
description
Use when inspecting, debugging, or understanding the GOAT PostgreSQL database — querying projects, layers, users, orgs, teams, roles, jobs, or checking data state during local dev.

Database Query

Query the GOAT PostgreSQL database to inspect data, debug issues, and understand state.

Connection

There is no host psql; go through the running Postgres container. The container name changes across setups (goat-db, goat-db18, …), so discover it rather than hardcoding:

bash
source /home/p4b/goat/.env
DBC=$(docker ps --format '{{.Names}}' | grep -E '^goat-db' | head -1)
docker exec -e PGPASSWORD=$POSTGRES_PASSWORD "$DBC" psql -h 127.0.0.1 -U $POSTGRES_USER -d $POSTGRES_DB

One-off query:

bash
source /home/p4b/goat/.env
DBC=$(docker ps --format '{{.Names}}' | grep -E '^goat-db' | head -1)
docker exec -e PGPASSWORD=$POSTGRES_PASSWORD "$DBC" psql -h 127.0.0.1 -U $POSTGRES_USER -d $POSTGRES_DB -c "YOUR SQL HERE"

Schemas

SchemaPurpose
customerEverything: users, orgs, teams, roles/permissions, projects, layers, jobs, workflows
ducklakeDuckLake catalog (managed by geoapi, don't modify directly)

Key Tables & Relationships

The SQLModel definitions in apps/core are the source of truth — introspect when unsure:

sql
SELECT table_name FROM information_schema.tables WHERE table_schema='customer' ORDER BY 1;
\d customer.layer
Identity & sharing (all in customer)
  • user (id uuid) — Keycloak-synced. firstname, lastname, avatar
  • organization (id uuid) — name, avatar; organization_domain, organization_analytics
  • team (id uuid) — belongs to org. name, avatar
  • role (id uuid) — permission roles; RBAC via permission, role_permission, user_role, resource, resource_grant, resource_permission
  • user_team — M2M user ↔ team; invitation — pending org/team invites
  • layer_organization / layer_team / layer_user — layer sharing with role
  • project_organization / project_team / project_user — project sharing with role
Projects & layers (customer)
  • project (id uuid) — user_id, folder_id, layer_order[], basemap, tags[]
  • layer (id uuid) — user_id, folder_id. Key fields: name, type, data_type, tool_type, job_id, feature_layer_type, feature_layer_geometry_type, extent (geometry), properties (jsonb), other_properties (jsonb — holds catalog_item / catalog_materialize for promoted catalog layers), field_config (jsonb, per-column metadata), url, size, in_catalog, tags[], catalog_external_uid, catalog_version
  • layer_project (id int) — M2M layer ↔ project. name, properties (jsonb style config), other_properties, query (jsonb filters), charts, order, layer_project_group_id
  • layer_project_group (id int) — layer groups. project_id, parent_id (self-ref nesting), order
  • folder (id uuid) — user_id, name
  • job (id uuid) — user_id. type, status, payload (jsonb)
  • workflow (id uuid) — project_id, name, config (jsonb), is_default
  • report / report_layout (id uuid) — project_id, name, config (jsonb), is_default
  • project_public — public sharing config: password, config (jsonb snapshot)
  • user_project — user ↔ project with initial_view_state (jsonb)
  • system_setting — per-user: client_theme, preferred_language, unit
  • uploaded_asset — user uploads: s3_key, file_name, mime_type, file_size, asset_type, content_hash
  • cost / credit_usage — credit metering
Show full SKILL.md (117 more words)Show less

Common Queries

sql
-- Projects with layer counts
SELECT p.id, p.name, p.created_at, COUNT(lp.id) AS layer_count
FROM customer.project p
LEFT JOIN customer.layer_project lp ON lp.project_id = p.id
GROUP BY p.id ORDER BY p.created_at DESC;

-- Layers in a project with styles
SELECT lp.id, lp.name, lp.order, l.type, l.feature_layer_type, l.feature_layer_geometry_type
FROM customer.layer_project lp
JOIN customer.layer l ON l.id = lp.layer_id
WHERE lp.project_id = 'PROJECT_UUID'
ORDER BY lp.order;

-- Job status
SELECT id, type, status, created_at, payload->>'tool_type' AS tool
FROM customer.job ORDER BY created_at DESC LIMIT 10;

Important Notes

  • Layer metadata lives in PostgreSQL (customer.layer), layer data lives in DuckLake (managed by geoapi)
  • layer_project.properties = style/rendering config (jsonb); layer_project.query = active filters (jsonb)
  • Scenarios are gone (2026-08-27): the feature, the three tables and project.active_scenario_id were all removed. scenario_feature was the last table using generic columns (integer_attr1..25); nothing in GOAT uses that scheme any more
  • A catalog layer has no owner: layer.user_id and layer.folder_id are NULL for promoted catalog layers. Joins from layer to user must be LEFT joins or those rows vanish
  • A public dashboard reads the project_public.config snapshot, not the live project — re-publish to reflect changes
  • Always use READ-ONLY queries. Never INSERT/UPDATE/DELETE unless explicitly asked
  • Use ST_AsText() or ST_AsGeoJSON() to read geometry columns

© plan4better, GPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/db of plan4better/goat.

Open the folder on GitHubat commit a181bf4

Compare with similar skills

DB 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 compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
DB this skillplan4better/goat167—~1.3kAutomated safety check: NotesGPL-3.0
Find Postgres Bugdigoal/blog8.6k—~4kAutomated safety check: PassGPL-2.0
Diesel Guardayarotsky/diesel-guard121—~3.1kAutomated safety check: PassMIT
Releaserogerpadilla/uql125—~842Automated safety check: PassMIT
Srtd Devt1mmen/srtd105—~2.3kAutomated safety check: PassMIT
SQLx Offline Cache Updaterwindmill-labs/windmill18k—~1.7kAutomated safety check: PassCustom licence

Similar skills

  • Find latent bugs in a local PostgreSQL source tree (RELxxSTABLE branch or HEAD) the way a core hacker does: build a heavily-poisoned debug instance (cassert + cache-discard + -O0/-ggdb3 + core…

    8.6k GitHub stars~4k tokensUpdated 10 days ago
    DatabasesAuto-check passed
  • 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 10 days ago
    DatabasesAuto-check passed
  • Release

    rogerpadilla/uql

    Cut and publish a uql release - review the change, changelog entry, commit, version bump and tag, GitHub Release, npm publish, docs site.

    125 GitHub stars~842 tokensUpdated today
    DatabasesAuto-check passed
  • Srtd Dev

    t1mmen/srtd

    Expert knowledge for developing the SRTD codebase itself. An agent skill from t1mmen/srtd.

    105 GitHub stars~2.3k tokensUpdated 1 mo ago
    DatabasesAuto-check passed
  • SQLx Offline Cache Updater

    windmill-labs/windmill

    Safely regenerates Windmill's SQLx offline query cache after a SQL query changes in Rust, with a mandatory backup step and worktree-specific database checks.

    18k GitHub stars~1.7k tokensUpdated today
    DatabasesAuto-check passed
  • 抓取并汇总"数据库、AI、GitHub、AI 论文"近 1 周新闻,输出图文并茂(含 mermaid 图)的 markdown 周报到当前项目的 markdown/ 目录。覆盖 10 个数据源:postgresweekly.com/issues(自动解析最新 issue…

    8.6k GitHub stars~1.2k tokensUpdated 10 days ago
    DatabasesAuto-check passed

More from plan4better/goat

  • Windmill

    plan4better/goat

    A skill your agent uses when working with GOAT's Windmill instance — running or syncing analytics tools, inspecting job execution, adding a new tool, or checking which f/goat/tools/ scripts exist.

    167 GitHub stars~910 tokensUpdated yesterday
    Auto-check: notes

Works with

Questions about DB

What does DB do?

A skill your agent uses when inspecting, debugging, or understanding the GOAT PostgreSQL database — querying projects, layers, users, orgs, teams, roles, jobs, or checking data state during local dev. DB is an agent skill from plan4better/goat. Use when inspecting, debugging, or understanding the GOAT PostgreSQL database — querying projects, layers, users, orgs, teams, roles, jobs, or checking data state during local dev.

When should I use DB?

DB fits situations like: understanding the GOAT PostgreSQL database — querying projects; checking data state during local dev.

How do I install DB in Claude Code?

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

How do I install DB in Codex?

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

Can I use DB 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 plan4better/goat --skill db -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, .gemini/skills/db, .github/skills/db and .opencode/skills/db in your project.

What does DB need to run?

Going by SKILL.md and its folder, DB needs the command-line tools its instructions call (docker) and credentials named POSTGRES_PASSWORD. Our summary lists: Docker.

Does DB access the network?

SKILL.md contains no URLs. Its commands use docker, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is DB 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 use?

DB is published under the GPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does DB use?

About 1.3k tokens (SKILL.md is roughly 5.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to DB?

Skills that share tags, products or a category with DB: Find Postgres Bug (digoal/blog, 8.6k stars), Diesel Guard (ayarotsky/diesel-guard, 121 stars), Release (rogerpadilla/uql, 125 stars) and Srtd Dev (t1mmen/srtd, 105 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains DB?

plan4better (a GitHub organization) maintains it in plan4better/goat, which has 167 GitHub stars. The repository holds 2 skills in this directory. The repository was last updated on October 7, 2026.

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