feathers-hooks

feathers-hooks is a skill for Claude Code from hassan4702/feathers-plugin. It costs 135 tokens per session (1,147 once invoked), scanned A, original, MIT.

A guide to FeathersJS v5 hooks, which are pieces of middleware that run before, after, around, or when a service method fails.

In plain words
What is it for?
Use it when adding or registering Feathers hooks for authentication, authorization, validation, timing, data loading, logging, or error handling.
Why use it?
It lets shared behavior stay outside service code and run consistently for tasks such as access checks, validation, logging, and side effects.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is import type { HookContext, NextFunction } from '../declarations'.

Part of the feathersjs plugin — 4 skills, 1 agent shipped together

Good fit Use it when adding or registering Feathers hooks for authentication, authorization, validation, timing, data loading, logging, or error handling.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/hassan4702/feathers-plugin
agentmods
npx agentmods add skills/hassan4702/feathers-plugin/feathers-hooks

Made for: Claude Code.

Or install feathersjs, the plugin that ships this one along with the rest of its 4 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for feathers-hooks

README.md
[![agentmods](https://agentmods.dev/badge/skills/hassan4702/feathers-plugin/feathers-hooks.svg)](https://agentmods.dev/skills/hassan4702/feathers-plugin/feathers-hooks)
Your own site
<a href="https://agentmods.dev/skills/hassan4702/feathers-plugin/feathers-hooks"><img src="https://agentmods.dev/badge/skills/hassan4702/feathers-plugin/feathers-hooks.svg" alt="Measured on agentmods" height="20"></a>
Per session 135 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,147 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00135 $0.01147
Opus 5 $0.00068 $0.00574
Sonnet 5 $0.00027 $0.00229
Haiku 4.5 $0.00014 $0.00115

Measured 8d ago against content hash 02513d3cb065, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

feathers-hooks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/feathers-hooks/SKILL.md · 95 lines

How it starts

The opening of the file, as written. The whole thing — 95 lines — stays where its author put it; the contents beside it link to each section on GitHub.

FeathersJS Hooks

Hooks are transport-independent middleware registered around / before / after / error of service methods, without touching the service code. They run in registration order; if one throws, the remaining hooks and the service call are skipped and the error propagates.

Two hook shapes

Around hooks wrap the call and receive (context, next). They must await next() to run the rest of the chain. Everything before await next() happens on the way in; everything after happens on the way out. Use these for timing, transactions, error wrapping, and the schema resolvers.

import type { HookContext, NextFunction } from '../declarations'
import { logger } from '../logger'

export const logRuntime = async (context: HookContext, next: NextFunction) => {
  const start = Date.now()
  await next()
  logger.info(`${context.method} on ${context.path} took ${Date.now() - start}ms`)
}

before / after / error hooks receive only (context) — no next. Use these for the common cases.

import type { HookContext } from '../declarations'

export const setTimestamp = async (context: HookContext) => {
  context.data = { ...context.data, createdAt: Date.now() }
  return context
}

A before hook that throws blocks the method. An after hook can transform context.result. Always return context.

The hook context

Read-only: context.app (call other services via context.app.service('users')), context.service, context.path, context.method, context.type.

Writable: context.params — includes context.params.query (query filter), context.params.provider ('rest' | 'socketio', undefined for internal calls — use this to distinguish external from internal requests), and context.params.user (the authenticated user, if any). Also context.id, context.data (on create/update/patch), context.error (in error hooks), and context.result (after await next() or in after hooks).

Registering hooks

Hooks are wired in the service's configure file (src/services/<name>/<name>.ts) via app.service(path).hooks({...}). The object is keyed by type, then by method, with all running before method-specific hooks:

Read the full file on GitHub · 95 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 95 lines · 135 tokens per session scan A 02513d3cb065

Subscribe to this mod's changes

feathers-hooks is a skill published in the GitHub repository hassan4702/feathers-plugin (2 stars, last pushed 3mo ago), licensed MIT. It adds 135 tokens to every session and 1,147 once invoked, about $0.0007 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

fec-data-fetching

A frontend guide for handling data that comes from a server, including typed requests, caching, refreshing, pagination, and updates. Server state means data owned by an API rather than by a page’s local controls.

bovinphang/frontend-craft · 76 tokens

arch-design

System-design thinking before any doc or code: goals/non-goals, back-of-envelope numbers, components and contracts, failure modes, operability, security, trade-offs. Use for "design this system", "architecture for X", "trade-offs for X", "how should we architect", "API design", "data model for", "service boundaries"…

heliohq/ship · 109 tokens

fec-api-integration

A guide for connecting front-end code to back-end APIs, including typed clients, authentication, errors, uploads, and live connections such as SSE or WebSockets.

bovinphang/frontend-craft · 120 tokens

fec-react-project-standard

A guide for organizing medium-sized or large React and TypeScript projects. It defines boundaries between pages, business features, shared components, hooks, services, state, APIs, and utilities.

bovinphang/frontend-craft · 101 tokens

fec-source-driven-development

A development practice that bases frontend decisions on the current project, official documentation, source code, and tests. It is especially concerned with behavior that changes between versions.

bovinphang/frontend-craft · 76 tokens

fec-doc-sync

A workflow for keeping front-end project documentation aligned with the code and configuration that actually exist. It checks sources such as package files, routes, API clients, schemas, tests, continuous-integration settings, deployment files, and environment examples.

bovinphang/frontend-craft · 98 tokens