Sponsored byOutsenseAI that finds your next clients
SponsorGROUOutbound, LinkedIn content and leads for B2B teamsSponsorOutsenseAI that finds your next clientsAd+Your tool hereSeen by people installing AI tools@Weekly picksThe best new tools, one email a week

pb-collections

Skill by davila7

Guides an AI assistant through collection and schema design for PocketBase. It covers collection types, field types and zero defaults, relations, cascade delete, indexes and auth options. It is for developers building PocketBase backends.

  • Score 91
  • 34k stars
  • MIT
  • Updated
Works withClaude CodeClaude apps Antigravity CLI

Install pb-collections

Built from the published package, never by AI.

git clone --depth 1 https://github.com/davila7/claude-code-templates /tmp/claude-code-templates && mkdir -p ~/.claude/skills && cp -r /tmp/claude-code-templates/cli-tool/components/skills/pocketbase/pb-collections ~/.claude/skills/pb-collections

Run in your terminal. Claude Code loads skills from ~/.claude/skills automatically.

Step-by-step: install pb-collections in Claude Code

Skills can run scripts on your machine. Some need an API key: check the README.

About

pb-collections is an agent skill that guides an AI assistant through collection and schema design in PocketBase. It covers the three collection types (base, auth and view), a reference table of field types with their Go types and zero default values, and field modifiers such as required, unique, presentable, hidden and autogenerate. It also explains relation patterns, including one-to-many, many-to-many, back-relations, cascade delete and self-referencing relations, along with index guidance and auth options for OAuth2, OTP, MFA and password login.

The skill is written for developers who are creating PocketBase collections, adding fields or setting up relations. It stresses that all field types default to their zero value rather than null, with json as the only type that can be null. It ends with best practices such as preferring select over bool, using relation fields instead of text for foreign keys, and naming collections in lowercase snake_case.

Written from the project's SKILL.md and checked against it.

What it can do

  • Collection type guidanceExplains base, auth and view collections and their system fields.
  • Field type referenceLists PocketBase field types with Go types, zero defaults and notes.
  • Field modifiersCovers required, unique, presentable, hidden and autogenerate modifiers.
  • Relation patternsDescribes one-to-many, many-to-many, back-relations and self-referencing relations.
  • Cascade deleteExplains cascadeDelete on relation fields and its default behavior.
  • Index guidanceCovers unique, composite and partial indexes in collection settings.
  • Auth optionsDescribes OAuth2, OTP, MFA and password auth settings for auth collections.

Try asking

  • Design a PocketBase collection schema for a blog with posts and comments.
  • Set up a many-to-many relation between posts and tags in PocketBase.
  • Which PocketBase collection type should I use for an aggregated comments count view?

Good to know

  • View collections are read-only and support only list and view API rules.
  • System fields of auth collections cannot be deleted.
  • By default a relation with cascadeDelete set to false is set to an empty string when the referenced record is deleted.

Security check

A

No download-and-run commands, hidden instructions or signs of sending keys out were found.

Checked automatically: cli-tool/components/skills/pocketbase/pb-collections/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work

Inside the skill

  • SKILL.md5 KB

Alternatives to pb-collections

All alternatives →
hugging-face-datasetssickn33
94

Creates, configures and manages datasets on the Hugging Face Hub, including SQL-based querying and transformation. Built for people who edit dataset content and metadata directly, alongside the HF MCP server.

AAA Skill 50k
db-repairgarrytan
94

Diagnoses and repairs gbrain's Postgres access when a command or MCP result shows a GBRAIN_DB_ACCESS marker, or when the operator reports the brain database is down. It runs the hardcoded gbrain db-repair ladder and verifies the result with a re-probe.

AAA Skill 34k
alloydb-basicsgoogle
94

Manages clusters, instances, and backups for AlloyDB for PostgreSQL. Built for creating, configuring, and administering AlloyDB databases, not general PostgreSQL or Cloud SQL instances.

AAA Skill 26k
clickhouse-logs-queriessupabase
94

Writes, reviews and migrates Supabase logs queries against the ClickHouse logs table served by the logs.all.otel endpoint. Built for developers who write Logs Explorer SQL or convert older BigQuery logs queries.

AAA Skill 116k
fix-slow-queriespaperclipai
94

Diagnoses and fixes slow Paperclip PostgreSQL queries using Cloud and Neon evidence, local benchmarks, regression tests, and a pull request with passing checks. Built for engineers working on Paperclip.

AAA Skill 119k
prisma-8prisma
94

Guides AI assistants through Prisma 8 projects built on @prisma/orm-postgres, @prisma/orm-sqlite, or @prisma/orm-mongo. It covers data contracts, migrations, typed queries and runtime setup for developers on Prisma 8.

AAA Skill 48k

Compare with hugging-face-datasets, db-repair or alloydb-basics

pb-collections: common questions

What is the zero default behavior in PocketBase fields?

The source says all field types default to their zero value, not null. Only json fields can be null.

When should I use a view collection in PocketBase?

The source says view collections are read-only and backed by a SQL SELECT query. They are useful for aggregations, joins and computed views.

How do relation fields return IDs?

The source says maxSelect of 1 returns a string ID, while maxSelect greater than 1 or 0 returns an array.

How do I install pb-collections?

Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.

Is pb-collections free?

The code is published under the MIT licence. The service it connects to may have its own pricing.

Is pb-collections safe to use?

It scores 91 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.

What are alternatives to pb-collections?

Similar skills: hugging-face-datasets, db-repair, alloydb-basics, clickhouse-logs-queries.

pb-collections Install

Add to stack

Loading.