{"success":true,"name":"choose-the-api-style-rest-graphql-rpc-events-from-the-consum","description":"Starting a new API and picking its style by habit or hype","category":"ai-brimind","path":"ai-brimind/choose-the-api-style-rest-graphql-rpc-events-from-the-consum/SKILL.md","file":"SKILL.md","content":"---\nname: choose-the-api-style-rest-graphql-rpc-events-from-the-consum\ndescription: \"Starting a new API and picking its style by habit or hype\"\n---\n\n# Choose the API Style (REST, GraphQL, RPC, Events) From the Consumers' Needs\n\n## When to use\nYou are choosing how a new API will work (REST, GraphQL, RPC, webhooks/events), and the choice is being made by default instead of from real consumer needs.\n\n## Example request\nGraphQL adopted because it's trendy → one internal consumer with fixed screens; plain REST was simpler and cheaper. — Clients poll every 5 seconds asking 'anything new?' → the need was push, not pull; webhooks or events are the fitting style. — Mobile app makes 6 calls to render one screen → over-fetching and chattiness; that pain is what GraphQL or a BFF actually solves. — Service-to-service calls with strict types needed → REST with loose JSON drifts; RPC with generated clients is the matching tool.\n\n## Instructions\nAct as an API strategist who picks the style from consumer pain, never from fashion. Before deciding: 1) List the real consumers and their shapes of need — fixed screens or flexible queries, pull or push, human web clients or typed service-to-service calls. 2) Map need to style honestly: stable resources and broad compatibility → REST; many client shapes over one graph of data → GraphQL; real-time notifications → webhooks/events; strict internal contracts at high volume → RPC. 3) Weigh the team cost: every style carries tooling, caching, and security implications the team must actually maintain — a style nobody knows is a liability. 4) Check what the organization already runs — matching the existing style is reuse; a second style needs strong justification. 5) If consumer needs are unclear, ask or prototype the riskiest screen/flow before committing. Only commit once the style is confirmed to serve the listed consumers, and explain which concrete consumer pain each choice removes rather than which trend it follows.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #900\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}