agentleFS
imMamdouhaboammarimMamdouhaboammar/get-fable/skills/fable-architecture/SKILL.md

fable-architecture

Skill6 starsChanged 3 months agoMITView on GitHub

Evaluate project specifications at inception (Step One), deterministically assess Scale & Load, Domain Decoupling, and Resource Intensity vectors, and automatically enforce a distributed Microservices Architecture when warranted, preventing monolith scaffolding.

1 other project uses a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If any single vector $\ge 7.0$ OR composite score $\ge 6.0$:

    line 65
  2. Distinctive:

    Ensure API Gateway is instantiated as Service #1 using Category B (TypeScript/NestJS).

    line 72
  3. Very specific:

    When allowMonolith: false, any attempt to generate a single-directory application or shared database is an immediate invariant violation.

    line 87
  4. Very specific:

    Every internal East-West RPC service interface must be defined via a strict .proto IDL before implementing client or server code.

    line 88
  5. Distinctive:

    If a sub-service requires managing hundreds of thousands of persistent WebSocket connections, real-time messaging orchestration, or …

    line 91
  6. Distinctive:

    Every microservice owns its private data persistence layer.

    line 100

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Fable Architecture: Microservices Enforcement Engine

Evaluate project specifications at inception (Step One) to deterministically decide whether scale, throughput, concurrency, domain complexity, or workload heterogeneity warrant a distributed Microservices Architecture. When triggered, hard-constrain all primary coding agents and downstream subagents to strictly operate within a decoupled, microservices-driven execution paradigm, assign curated language-framework pairs by core competency, and enforce standard inter-service communication protocols.


Mission

Intercept project specifications before any directory scaffolding or implementation begins to deterministically evaluate whether Scale & Load, Domain Decoupling, or Resource Intensity warrant a distributed architecture. When thresholds are tripped, hard-lock the agent workforce from scaffolding a monolith (allowMonolith: false), enforce decoupled microservices with curated polyglot language-framework stacks, and mandate dual-transport networking: North-South REST HTTP/JSON (OpenAPI 3.1) vs. East-West gRPC (Protocol Buffers) or Message Broker (RabbitMQ / Kafka).


Activate When

  • Project specification describes high concurrency ($\ge 5,000$ concurrent users/connections, $>10,000$ RPS/TPS).
  • Specification defines $\ge 2$ decoupled operational domains (Identity/Auth, Billing/Stripe, Transcoding, AI Inference, Analytics, Messaging).
  • Workload contains mixed CPU-bound kernels (heavy math, transcoding, cryptography) and I/O-bound pipelines (API Gateway, CRUD).
  • User explicitly requests microservice evaluation, distributed architecture design, or polyglot stack assignment.
  • Step One prompt evaluation hook detects architectural trigger thresholds.

Do Not Activate When

  • Project is a simple command-line script, utility, or single-file tool (fable-execute).
  • Project is an isolated single-domain CRUD prototype or static blog where scale remains within monolithic boundaries.
  • Task is only a localized bug fix or single-module refactoring (fable-tdd or fable-simplify).
  • Broad work is already decomposed and only requires standard step-by-step planning (fable-plan).

Situation Classification

CategoryCore CompetencyLanguageFramework OptionsPrimary WorkloadSubagent Role
Category AHigh-Concurrency APIs & Distributed NetworkingGo (Golang)Fiber, Gin, Go-KitStateless routing, millions of messages/sec, edge proxyingdistributed-network-engineer
Category BI/O Intensive, Rapid API Gateway & OrchestrationTypeScriptNestJS, Fastify (Node.js) or Elysia (Bun)Public API Gateway, BFF, CRUD, rapid business logicgateway-orchestrator / crud-engineer
Category CHigh-Performance Computational Kernels & SystemsRustAxum, Actix-webHeavy math, cryptography, video transcoding, raw binarysystems-kernel-engineer
Category DArtificial Intelligence, Data Engineering & MLPythonFastAPI (with PyTorch/TensorFlow)LLM routing, predictive modeling, embeddings, ML pipelinesai-inference-engineer
Category EUltra-High Concurrency, Fault-Tolerant Real-Time SystemsElixirPhoenix (with LiveView)Hundreds of thousands of persistent WebSockets, real-time messaging orchestration, zero-downtimerealtime-systems-engineer

Protocol

Stage 1: Inception 3-Vector Evaluation

Evaluate incoming specification across 3 discrete vectors:

  1. Vector 1: Scale & Load (0–10 score): Detect high concurrency ($\ge 5k$), throughput targets, latency SLAs.
  2. Vector 2: Domain Decoupling (0–10 score): Detect operational domain boundaries (auth, billing, gateway, compute, ai, messaging, realtime).
  3. Vector 3: Resource Intensity (0–10 score): Detect mixed CPU-bound vs. I/O-bound bottlenecks.
  4. Calculate composite score: $(0.35 \times \text{Scale}) + (0.40 \times \text{Domain}) + (0.25 \times \text{Resource})$.

Stage 2: Verdict & Monolith Lockout

  • If any single vector $\ge 7.0$ OR composite score $\ge 6.0$:
    • Set verdict: 'microservices' and allowMonolith: false.
    • Scaffolding a monolithic application is strictly locked out.
  • Otherwise:
    • Set verdict: 'monolith' and allowMonolith: true.

Stage 3: Polyglot Stack Assignment & Decomposition

  • Ensure API Gateway is instantiated as Service #1 using Category B (TypeScript/NestJS).
  • For each identified operational domain, assign dedicated service stack from Categories A–E.
  • Guarantee at least 2 distinct domain worker services alongside the Gateway.

Stage 4: Communication Standards Contract

  • North-South: REST HTTP/JSON with OpenAPI 3.1 schemas and TLS 1.3.
  • East-West: gRPC with Protocol Buffers (proto/) or Message Broker (Kafka/RabbitMQ). Prohibit internal HTTP/JSON.

Stage 5: Output Architecture Manifest

  • Generate structured TOON manifest microservices_manifest.toon and companion docker-compose.yml.

Decision Rules

  • When allowMonolith: false, any attempt to generate a single-directory application or shared database is an immediate invariant violation.
  • Every internal East-West RPC service interface must be defined via a strict .proto IDL before implementing client or server code.
  • Heavy CPU computation must never run on the Node.js event loop; always route to Category C (Rust) or Category D (Python).
  • High throughput stateless message streams must be routed to Category A (Go) distributed networking services.
  • If a sub-service requires managing hundreds of thousands of persistent WebSocket connections, real-time messaging orchestration, or zero-downtime fault tolerance, auto-select Category E: Elixir (Phoenix/LiveView).
  • External clients must never directly call internal East-West gRPC services; all client traffic enters via API Gateway.

Invariants

  • Monolith scaffolding is locked out whenever any vector $\ge 7.0$ or composite $\ge 6.0$.
  • Internal service-to-service communication strictly prohibits un-typed HTTP/JSON when microservices are enforced.
  • Every microservice owns its private data persistence layer; shared relational tables across service boundaries are forbidden.
  • Architecture manifests are serialized in valid TOON format before product scaffolding begins.

Failure Taxonomy

Inappropriate Monolith Scaffolding

Agent attempts to build a single repo with monolithic controllers despite tripped scale/domain thresholds. Resolution: Hard intercept, reject directory structure, trigger fable-architecture re-decomposition.

East-West Transport Downgrade

Internal services communicating over plain HTTP/JSON REST instead of gRPC. Resolution: Generate .proto IDL contract in proto/ and wire gRPC transport bindings.

CPU Event Loop Starvation

Placing video transcoding or heavy cryptography in Node.js/TypeScript. Resolution: Extract CPU-intensive logic into a dedicated Rust Category C microservice.

Domain Boundary Bleed

Multiple business domains accessing the same database schema directly. Resolution: Enforce service boundary with private datastore and gRPC interface.


Anti-Patterns

  • Generating a monolith to "keep it simple" when concurrency is $\ge 50,000$ RPS.
  • Sharing a single PostgreSQL database across all services with cross-domain foreign keys.
  • Using untyped HTTP/JSON for internal backend-to-backend communication.
  • Embedding deep learning model inference in a Go or TypeScript CRUD service.
  • Skipping API Gateway and exposing internal gRPC ports directly to public clients.

Completion Criteria

  • 3-vector evaluation is completed and recorded with discrete scores and composite score.
  • Architecture manifest (microservices_manifest.toon) is emitted with explicit services table.
  • Monolith lockout state (allowMonolith: false) is established if thresholds are tripped.
  • Communication contract strictly enforces North-South REST vs. East-West gRPC/Brokers.
  • Specialized subagent roles and polyglot stacks are assigned for each decomposed service.

Progressive Resources

  • Vector scoring guide: references/vector-scoring.md
  • Tech stack matrix: references/tech-stack-matrix.md
  • Communication standards: references/communication-standards.md
  • Subagent role distribution: references/subagent-role-distribution.md
  • Example walkthroughs: examples/fintech-scale-walkthrough.md, examples/ai-media-pipeline-walkthrough.md
  • Templates: templates/microservices-manifest.toon, templates/docker-compose.microservices.yml, templates/service-contract.proto
  • Validation script: scripts/evaluate-architecture.py

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.