agentleFS
Pouya-MansourniaPouya-Mansournia/ARCHON/skills/06_API/SKILL.md

api-communication-architecture

Skill2 starsChanged 5 months agoMITView on GitHub

API and communication architecture — REST, GraphQL, gRPC, WebSocket, MQTT, webhooks, and messaging/queue systems (RabbitMQ, Kafka, NATS, Celery) with sync vs async decision rules.

The file

Files
SKILL.md

06 — API & Communication Architecture (L2)

Level: L2 — Software Engineering.

Goal

Choose the right communication protocol per interaction (request/response vs. streaming vs. event-driven) and the right messaging backbone when async processing is genuinely needed — protocol and messaging-technology choice should follow from the actual interaction pattern, not from default habit.

Protocol Decision Matrix

ProtocolBest forAvoid when
RESTDefault choice for most public/external APIs — simple, cacheable, universally understoodClient needs to fetch deeply nested/varied data shapes efficiently in one round trip
GraphQLClients with varied, evolving data needs (especially mobile/multiple frontend clients sharing one API)Simple CRUD APIs where REST's simplicity is sufficient — GraphQL adds real server-side complexity (resolver design, N+1 query risk, caching difficulty)
gRPCInternal service-to-service communication needing high performance and strong typing (via Protobuf)Public APIs needing broad client compatibility (browser support is limited without a proxy)
WebSocketReal-time, bidirectional, persistent-connection needs (chat, live collaboration, live dashboards)Simple request/response interactions — adds connection-management complexity for no benefit
MQTTIoT/constrained-device messaging — lightweight, designed for unreliable networksGeneral web/app backend communication — it's purpose-built for device telemetry, not a general API protocol
WebhooksNotifying external systems of events asynchronouslyNeeding a guaranteed, ordered delivery or sub-second latency without the receiver investing in robust retry handling

Messaging / Queue Decision Matrix

TechnologyBest for
RabbitMQGeneral-purpose task queues, complex routing (exchanges/topics), moderate throughput — strong default for most background-job needs
KafkaHigh-throughput event streaming, event replay, multiple independent consumers of the same stream, log-based architectures
NATSLightweight, very low-latency pub/sub and request/reply, especially in cloud-native/microservices and IoT contexts
Redis Queue / BullMQSimple background job queues when Redis is already in the stack and throughput needs are modest
Celery (Python)Python-ecosystem task queue, mature, well-integrated with Django/FastAPI

Decision Rule

Default to synchronous REST for client-facing APIs and a simple queue (RabbitMQ, or Redis-based if Redis is already present) for background jobs. Reach for GraphQL only with a genuine multi-client/varied-query-shape need. Reach for Kafka only with a genuine event-replay or high-throughput multi-consumer need — see skills/00_Core/reference/over-under-engineering.md's "Kafka for small background jobs" trigger.

Reference Files

  • reference/communication-architecture.md — full protocol comparison, API design conventions, sync vs. async decision framework.
  • reference/messaging-event-driven.md — queue/broker deep dive, delivery guarantees, event-driven architecture patterns.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.