Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/muhammadusmangm/claude-code-best-practices/add-handlernpx skills add MuhammadUsmanGM/claude-code-best-practices --skill add-handlergit clone --depth 1 https://github.com/MuhammadUsmanGM/claude-code-best-practicesWrote 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/muhammadusmangm/claude-code-best-practices/add-handler)<a href="https://agentmods.dev/skills/muhammadusmangm/claude-code-best-practices/add-handler"><img src="https://agentmods.dev/badge/skills/muhammadusmangm/claude-code-best-practices/add-handler.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 | $0.00052 | $0.00754 |
| Opus 5 | $0.00026 | $0.00377 |
| Sonnet 5 | $0.00010 | $0.00151 |
| Haiku 4.5 | $0.00005 | $0.00075 |
Grade A, and why
add-handler 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 4d 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 — 84 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Add Handler
Add a new HTTP handler across the layers the project already uses. Don't invent a layer that isn't there.
Steps
- Clarify once (if not given): method + path, what it does, and the response shape.
- Read one existing handler in
internal/api/and its matching test and service function. Mirror the style: error handling, context usage, response helpers. - Edit files in this order:
internal/model/<resource>.go— domain type, if new.internal/store/<resource>.go— store method signature on the interface and the concrete implementation. Stop here if the operation doesn't need storage.internal/service/<resource>.go— the service function. Takes a context, returns the domain type and an error. Nohttpimports.internal/api/<resource>.go— the handler. Decodes input, calls the service, maps errors to status codes, encodes output.internal/api/<resource>_test.go— a table-driven test exercising happy path and one input-validation failure.
- Wire the route in the router setup (usually
cmd/<service>/main.goorinternal/api/router.go) only if adding a new path. - Run
go build ./...thengo test ./internal/api/...and report the outcome.
Default shape
// internal/api/widgets.go
func (s *Server) createWidget(w http.ResponseWriter, r *http.Request) {
var in WidgetCreate
if err := json.NewDecoder(r.Body).Decode(&in); err != nil {
http.Error(w, "invalid body", http.StatusBadRequest)
return
}
widget, err := s.svc.CreateWidget(r.Context(), in)
if err != nil {
s.writeErr(w, err) // maps domain errors to status codes
return
}
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusCreated)
_ = json.NewEncoder(w).Encode(widget)
}
// internal/api/widgets_test.go
func TestCreateWidget(t *testing.T) {
cases := []struct {
name string
body string
wantStatus int
}{
{"happy", `{"name":"gizmo"}`, http.StatusCreated},
{"empty name", `{"name":""}`, http.StatusBadRequest},
}
for _, tc := range cases {
t.Run(tc.name, func(t *testing.T) {
// ...
})
}
}
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.
- 4d ago First seen · 84 lines · 52 tokens per session scan A 21c779f2364f
add-handler is a skill published in the GitHub repository MuhammadUsmanGM/claude-code-best-practices (76 stars, last pushed 2mo ago), licensed MIT. It adds 52 tokens to every session and 754 once invoked, about $0.0003 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-30.
Other skills, from other repositories
weather-fetcher
Instructions for fetching current weather temperature data for Dubai, UAE from Open-Meteo API.
claude-md-review
Audit a CLAUDE.md file for the patterns that actually degrade Claude Code's output — vagueness, unnamed files, stale facts, and bloat. Use when asked to review, audit, improve, shrink, or fix a CLAUDE.md, and when a project's results feel inconsistent or Claude keeps rediscovering the same context.
best-practices
Searchable knowledge base of 152+ programming best practices across 30+ languages and frameworks. BM25-powered search over curated resources from industry leaders (Google, Airbnb, Uber, Mozilla, Shopify, OWASP).
JavaScript Tooling
Development tools, linting, and testing for JavaScript projects.
common-product-requirements
Standardize PRD discovery and drafting for product scope, user outcomes, requirement IDs, and acceptance criteria. Use when creating PRD, product requirements, feature specification, or acceptance criteria plan.
common-security-standards
Enforce universal security protocols for safe, resilient software. Use when implementing authentication, encryption, authorization, input validation, secret management, or any security-sensitive feature across any language or framework.