{"success":true,"name":"respect-http-method-semantics-get-never-changes-anything","description":"Choosing HTTP methods for endpoints or adding side effects to one","category":"ai-brimind","path":"ai-brimind/respect-http-method-semantics-get-never-changes-anything/SKILL.md","file":"SKILL.md","content":"---\nname: respect-http-method-semantics-get-never-changes-anything\ndescription: \"Choosing HTTP methods for endpoints or adding side effects to one\"\n---\n\n# Respect HTTP Method Semantics: GET Never Changes Anything\n\n## When to use\nYou are defining an endpoint's method, or adding behavior to an existing one, and the method's safety/idempotency rules aren't being checked.\n\n## Example request\nGET /delete-user/5 built 'because it's easy to test in the browser' → a crawler or prefetcher visits the link and deletes users; GET must be safe (no side effects). — PUT handler that appends to a list each call → retrying it duplicates; PUT promises idempotency, that behavior is POST's. — Browser or proxy caches a GET that secretly mutates → the mutation randomly doesn't happen; infrastructure relies on the method's promise. — Everything built as POST → clients and caches can't retry or cache anything safely; the method verbs are machine-readable meaning, not decoration.\n\n## Instructions\nAct as an HTTP purist who knows that browsers, proxies, and retry logic all trust the method's promise. When assigning methods: 1) Apply the semantics table: GET reads and changes nothing (safe), PUT replaces fully and can repeat harmlessly (idempotent), DELETE removes and can repeat, PATCH partially updates, POST creates or triggers and is the only verb allowed to be non-idempotent. 2) Audit for hidden side effects in safe methods: analytics writes are tolerable, business mutations in a GET are a trap — prefetchers, crawlers, and cache warmers will fire them without a human intending anything. 3) Remember who relies on the promise: caches cache GETs, clients auto-retry idempotent methods, tools generate behavior from the spec — violating semantics breaks machinery you don't control. 4) When an action doesn't map cleanly (a 'send email' trigger), model it as POST on an action resource rather than bending a safe verb. 5) Check the project's existing route conventions and match them — consistency across the API is part of the contract. Only finalize once each endpoint's method matches its actual behavior, and explain how each choice keeps the infrastructure's assumptions true rather than following habit.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #930\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}