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.
git clone --depth 1 https://github.com/hassan4702/feathers-pluginnpx agentmods add skills/hassan4702/feathers-plugin/feathers-hooksWrote 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.
[](https://agentmods.dev/skills/hassan4702/feathers-plugin/feathers-hooks)<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>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.
| Model | Per session | Once 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 |
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.
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:
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.
- 8d ago First seen · 95 lines · 135 tokens per session scan A 02513d3cb065
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.
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.
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"…
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.
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.
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.
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.