pocketbase-automation-and-hooks
1
总安装量
1
周安装量
#76394
全站排名
安装命令
npx skills add https://github.com/anirudh-777/pocketbase-skills --skill pocketbase-automation-and-hooks
Agent 安装分布
kilo
1
amp
1
cline
1
pi
1
opencode
1
cursor
1
Skill 文档
PocketBase Automation and Hooks
Overview
Use this skill to implement event-driven behavior in PocketBase with predictable side effects.
When to Use
- Record lifecycle hooks and validations
- Realtime subscription flows
- File upload/delete lifecycle behavior
- Webhook or downstream event integration
Workflow
- Define event contract:
- Trigger source (create/update/delete/auth event)
- Required payload fields
- Side effects and idempotency expectations
- Implement hook logic:
- Keep hooks deterministic and fast
- Reject invalid state transitions early
- Avoid long blocking network operations inside critical path
- Realtime design:
- Subscribe to minimal channels/topics
- Handle reconnect and duplicate event delivery
- Unsubscribe on teardown
- File handling:
- Enforce allowed mime types and max size
- Apply naming and retention policies
- Clean up orphaned file references
- Observability:
- Log event identifiers and error context
- Track retries and dead-letter behavior for async side effects
- Handoff:
- API consumers ->
pocketbase-api-and-sdk - Operational hardening ->
pocketbase-operations
References
Common Mistakes
- Non-idempotent hooks causing duplicate side effects
- Heavy network calls in synchronous lifecycle hooks
- Realtime listeners not unsubscribed in long-running clients