Extend PocketBase with custom hooks and routes in JS or Go. An agent skill from spinspire/pocketbase-sveltekit-starter.

MITAuto-check: notesBackend & APIs

Install Pb Extend

skills CLI
$ npx skills add spinspire/pocketbase-sveltekit-starter --skill pb-extend -a claude-code

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

GitHub CLI
$ gh skill install spinspire/pocketbase-sveltekit-starter pb-extend --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/spinspire/pocketbase-sveltekit-starter.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/pb-extend .claude/skills/pb-extend && 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
pb-extend
GitHub stars
511
Token cost
~689 tokens
SKILL.md length
117 words
Files
1
Skills in repo
8
Repo updated
First seen
Licence
MIT

At a glance

Extend PocketBase with custom hooks and routes in JS or Go. An agent skill from spinspire/pocketbase-sveltekit-starter.

  • User wants to add custom API routes
  • SKILL.md covers JS Hooks (pb_hooks/), Go Hooks (migrations/), Custom Routes and Key Hook Events, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Modify PocketBase behavior

What it does

Pb Extend is an agent skill from spinspire/pocketbase-sveltekit-starter. Extend PocketBase with custom hooks and routes in JS or Go. Use when user wants to add custom API routes, modify PocketBase behavior, or add server-side logic.

Its SKILL.md is about 690 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 Backend & APIs, covering Backend development. The repository describes itself as: a starter project to build a SvelteKit frontend with PocketBase backend. The licence is MIT.

When your agent uses it

  • User wants to add custom API routes
  • Modify PocketBase behavior
  • Add server-side logic

Example prompts

  • “/pb-extend”

Requirements

  • Pre-approved tools (allowed-tools): Bash

What it can do on your machine

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

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Bash

    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 javascript and go).

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

  • Network

    Links to these hosts (documentation or services it may open):

    • pocketbase.io

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

Context cost

Pb Extend loads about 689 tokens when it runs. Until then it costs about 42 tokens; SKILL.md has 117 words of instructions outside code blocks.

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

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.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Bash

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 spinspire/pocketbase-sveltekit-starter at commit 66f6dee, republished under its MIT licence (© spinspire). 117 words, ~689 tokens.

Download SKILL.mdSave it as .claude/skills/pb-extend/SKILL.md (or your agent's skills folder).
name
pb-extend
description
Extend PocketBase with custom hooks and routes in JS or Go. Use when user wants to add custom API routes, modify PocketBase behavior, or add server-side logic.
allowed-tools
Bash
license
MIT
authors
SpinSpire Team

PocketBase Extending

Reference: https://pocketbase.io/docs/js-overview/ | https://pocketbase.io/docs/go-overview/

Extend PocketBase with custom hooks and routes in JS or Go.

JS Hooks (pb_hooks/)

Drop *.pb.js files in pb_hooks/:

javascript
// pb_hooks/myhook.pb.js
/// <reference path="../pb_data/types.d.ts" />

router.api.post('/custom-route', async (e) => {
  const body = e.request.body
  // ... process
  return e.json({ result: 'ok' })
})

// On record create
onRecordCreateRequest((e) => {
  if (!e.record.get('email').endsWith('@company.com')) {
    return e.badRequest('Use company email')
  }
  return e.next()
})

Rules:

  • Always call e.next() / e.Next() in hooks
  • Variables outside handlers are undefined at runtime
  • Use require() for shared config (CJS only, no ESM)

Go Hooks (migrations/)

Versioned migrations in migrations/:

go
package migrations

import (
  "github.com/pocketbase/pocketbase/migrations"
  "github.com/pocketbase/pocketbase/tools/types"
)

func init() {
  migrations.Register(func(app *pocketbase.App) error {
    // Custom logic
    return nil
  }, func(app *pocketbase.App) error {
    // Rollback logic
    return nil
  })
}

Custom Routes

javascript
// Add to pb_hooks
router.api.post('/api/myapp/send-email', async (e) => {
  const data = await e.request.json()
  await sendEmail(data.to, data.subject)
  return e.json({ sent: true })
}, middleware.RequireAuth())

Key Hook Events

EventPurpose
onRecordCreateRequestBefore record creation
onRecordUpdateRequestBefore record update
onRecordDeleteRequestBefore record deletion
OnRecordEnrichShape response (incl. realtime)
OnRecordRequestHTTP-only response shaping
OnBeforeServeModify router before serving

Migrations

System fields: Collections created via migration files must include created and updated system fields.

Auto-migrate: Collections changed via Admin UI auto-generate migrations in pb_migrations/

Manual JS migration:

javascript
// pb_migrations/1700000000_seed_data.js
migrate((up, down) => {
  up((db) => {
    db.createCollection('categories', { /* ... */ })
  })
  down((db) => {
    db.dropCollection('categories')
  })
})

Useful Settings

javascript
// Read at runtime
const settings = require('../pb_settings/config.js')

// Access app in hooks
router.use(async (e) => {
  const app = e.app
  // ...
})

© spinspire, MIT. 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 .agents/skills/pb-extend of spinspire/pocketbase-sveltekit-starter.

Open the folder on GitHubat commit 66f6dee

Compare with similar skills

Pb Extend 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.

Pb Extend compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Pb Extend this skillspinspire/pocketbase-sveltekit-starter511—~689Automated safety check: NotesMIT
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
Node Backend Development Guidelinesdiet103/claude-code-infrastructure-showcase10k2 repos~2kAutomated safety check: PassMIT
Laravel Best Practicesanonaddy/anonaddy4.9k13 repos~1.2kAutomated safety check: PassMIT
Laravel Actionscoollabsio/coolify63k—~2.4kAutomated safety check: PassApache-2.0

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • Node Backend Development Guidelines

    diet103/claude-code-infrastructure-showcase

    Sets layered architecture and coding rules for Node.js, Express and TypeScript microservices, covering routes, controllers, services, repositories, Prisma, Sentry and Zod.

    10k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Laravel Best Practices

    anonaddy/anonaddy

    Apply this skill whenever writing, reviewing, or refactoring Laravel PHP code.

    4.9k GitHub starsUsed in 13 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Laravel Actions

    coollabsio/coolify

    Build, refactor, and troubleshoot Laravel Actions using lorisleiva/laravel-actions.

    63k GitHub stars~2.4k tokensUpdated today
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    162 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed

More from spinspire/pocketbase-sveltekit-starter

All 8 skills in this repo
  • Bun Runtime

    spinspire/pocketbase-sveltekit-starter

    Bun as runtime, package manager, bundler, and test runner. An agent skill from spinspire/pocketbase-sveltekit-starter.

    511 GitHub starsUsed in 5 repos~653 tokens
    Auto-check: notes
  • Pb API

    spinspire/pocketbase-sveltekit-starter

    Operate PocketBase via its REST API. An agent skill from spinspire/pocketbase-sveltekit-starter.

    511 GitHub stars~562 tokensUpdated 1 mo ago
    Auto-check: notes
  • Pwa

    spinspire/pocketbase-sveltekit-starter

    A skill your agent uses when the user asks to make a site installable, turn it into a PWA, add a service worker, add a web app manifest, enable "add to home screen", or support offline.

    511 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Frontend Design

    spinspire/pocketbase-sveltekit-starter

    Create distinctive, production-grade frontend interfaces with high design quality and accessible markup.

    511 GitHub starsUsed in 1 repo~2.6k tokens
    Auto-check passed
  • Code Reuse

    spinspire/pocketbase-sveltekit-starter

    A skill your agent uses when building a UI component, PocketBase hook, page, or app feature and there is proven code to copy from the reference repos.

    511 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check: notes
  • Docker

    spinspire/pocketbase-sveltekit-starter

    Docker Compose conventions — short service names, no root, no host ports in base compose, override files for local customisations.

    511 GitHub stars~1.1k tokensUpdated 1 mo ago
    Auto-check: notes

Categories

Questions about Pb Extend

What does Pb Extend do?

Extend PocketBase with custom hooks and routes in JS or Go. An agent skill from spinspire/pocketbase-sveltekit-starter. Pb Extend is an agent skill from spinspire/pocketbase-sveltekit-starter. Extend PocketBase with custom hooks and routes in JS or Go.

When should I use Pb Extend?

Pb Extend fits situations like: user wants to add custom API routes; modify PocketBase behavior; add server-side logic.

How do I install Pb Extend in Claude Code?

Run `npx skills add spinspire/pocketbase-sveltekit-starter --skill pb-extend -a claude-code`. Or copy the skill folder (.agents/skills/pb-extend in spinspire/pocketbase-sveltekit-starter) into .claude/skills/pb-extend in your project. Claude Code loads it when a task matches its description.

How do I install Pb Extend in Codex?

Run `npx skills add spinspire/pocketbase-sveltekit-starter --skill pb-extend -a codex`. Or copy the skill folder (.agents/skills/pb-extend in spinspire/pocketbase-sveltekit-starter) into .agents/skills/pb-extend in your project. Codex loads it when a task matches its description.

Can I use Pb Extend 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 spinspire/pocketbase-sveltekit-starter --skill pb-extend -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/pb-extend, .gemini/skills/pb-extend, .github/skills/pb-extend and .opencode/skills/pb-extend in your project.

What does Pb Extend need to run?

SKILL.md names no scripts, command-line tools or credentials: Pb Extend is instructions for the agent only. Its frontmatter pre-approves these tools: Bash.

Does Pb Extend access the network?

SKILL.md names 1 domain. As links in the text: pocketbase.io. This is read from the text; nothing was executed.

Is Pb Extend safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Pb Extend use?

Pb Extend is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Pb Extend use?

About 689 tokens (SKILL.md is roughly 2.8k 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 Pb Extend?

Skills that share tags, products or a category with Pb Extend: Configuring Horizon (coollabsio/coolify, 63k stars), Fortify Development (coollabsio/coolify, 63k stars), Node Backend Development Guidelines (diet103/claude-code-infrastructure-showcase, 10k stars) and Laravel Best Practices (anonaddy/anonaddy, 4.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Pb Extend?

spinspire (a GitHub organization) maintains it in spinspire/pocketbase-sveltekit-starter, which has 511 GitHub stars. The repository holds 8 skills in this directory. The repository was last updated on August 22, 2026.

Source: spinspire/pocketbase-sveltekit-starter on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.