agentleFS
MartinOliveroMartinOlivero/saas-builder/skills/architecture-primer/SKILL.md

architecture-primer

Skill4 starsChanged 32 days agoMITView on GitHub

This skill should be used when the user wants to design, plan, or decide the architecture of a system, app, or platform from scratch. Trigger phrases include "how do I structure this", "what architecture should I use", "how does this scale", "monolith or microservices", "what database", "what stack", "design the system", "how do I handle X users". Inspired by the System Design Primer. It runs a discovery phase, applies a decision tree, and outputs concrete architecture decisions with trade-offs.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Never propose an architecture before completing discovery.

    line 14
  2. Distinctive:

    When do you need the MVP live?

    line 29
  3. Distinctive:

    Always deliver these five sections, in this order:

    line 60
  4. Distinctive:

    Measure before optimizing: No premature optimization without data.

    line 83

≈ “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

Architecture Primer

This skill turns a vague "how should I build this?" into concrete, justified architecture decisions. It is based on the System Design Primer, adapted to favor shipping over over-engineering.

Analogy: do not design a 10-lane highway before knowing if 10 cars or 10 million cars will use it. Measure the traffic first, then build the road.

PHASE 1 — Discovery (mandatory before any decision)

Never propose an architecture before completing discovery. Ask questions 2-3 at a time, in plain language, in these three blocks. Skip any question the user already answered.

Block A — Scale

  • How many users do you expect at launch? And in 12 months?
  • Are users in one region or several countries?
  • Is usage steady, or does it spike (e.g. launches, business hours, campaigns)?

Block B — Nature of the system

  • Does it read more than it writes, or the other way around?
  • What happens if it goes down for 1 hour — is it critical?
  • Does the data need immediate consistency, or is a short delay acceptable?

Block C — Context

  • Is there a technical team, or just you?
  • Roughly what monthly infrastructure budget is realistic?
  • When do you need the MVP live?

PHASE 2 — Decision tree

Apply these rules using the discovery answers. Each rule has a default; deviate only with a concrete reason.

Monolith vs Microservices

  • Team under 5 people → monolith, always.
  • MVP or under 6 months to ship → monolith, always.
  • Over 100k daily active users → evaluate microservices for the parts that actually hurt.
  • Rule: start monolith, split when it hurts. Premature microservices add ops cost with no benefit.

SQL vs NoSQL

  • Relational data needing integrity → PostgreSQL.
  • Flexible documents, horizontal scale → MongoDB.
  • Cache / sessions / real-time → Redis.
  • Full-text search → Elasticsearch.
  • Rule: PostgreSQL by default; switch only with a concrete reason.

Cache

  • Same query repeats a lot → Redis.
  • Data that rarely changes but is read often → CDN or Redis.
  • Data unique per user on every request → no cache (it would not hit).

Message queue

  • Tasks that can run later (emails, notifications, exports) → yes.
  • Spikes that could overwhelm the database → yes (absorb the burst).
  • Everything synchronous and simple → no (added complexity not worth it).

PHASE 3 — Required output

Always deliver these five sections, in this order:

  1. Executive summary — 3 lines, plain language.
  2. Architecture decisions — each as:
    • Decision: what was chosen
    • Why: the reason, tied to a discovery answer
    • Trade-off: what is given up
  3. Recommended stack — concrete tools and services.
  4. Mermaid diagram of the components, e.g.:
    graph TD
      User[User] --> CDN[CDN]
      CDN --> App[Monolith API]
      App --> DB[(PostgreSQL)]
      App --> Cache[(Redis)]
      App --> Queue[Queue] --> Worker[Background Worker]
  5. Risks and review triggers — what could break, and the concrete signal (e.g. "revisit when writes exceed 500/s" or "split the billing service when the team passes 8 engineers").

Principles that are never violated

  • Do not over-engineer the MVP. The MVP's job is to validate, not to scale.
  • Availability beats perfection. A system that is up and imperfect beats a perfect one that is down.
  • Measure before optimizing. No premature optimization without data.
  • The team matters. The best architecture is the one the team can actually maintain.

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.