architecture-design
Skill439 starsChanged 8 months agoMITView on GitHub
Use when designing new systems or significant features, evaluating architectural trade-offs, choosing between structural approaches, or when a task requires understanding system-wide design before writing code
We split this skill into the rules it gives an agent
21 rules. 0 are common, 20 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 24 edited versions we read keep these.
20
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 36
If fewer than 4 items are known and the user has not dismissed the unknowns, ask before proceeding.
- Distinctive: line 42
Before proposing anything, gather the checklist above.
- Distinctive: line 46
Every architecture has trade-offs.
- Distinctive: line 54
Never present only one option.
- Distinctive: line 63
Don't hedge everything — make a call.
- Distinctive: line 71
After completing the output, list any open questions that remain.
- Distinctive: line 74
(user): only the user can answer this (business requirements, organizational constraints, budget decisions).
- Distinctive: line 81
If a user-assigned question is blocking, state it clearly: "I need your answer on [question] before I can finalize this design."
- Distinctive: line 86
When constraints are unavailable, do not refuse to proceed — proceed transparently:
- Distinctive: line 90
Document that the design must be revisited: "If actual [constraint] differs significantly from this assumption, revisit [specific aspect of …
- Distinctive: line 97
When combining patterns, follow these composition rules:
- Distinctive: line 99
REST + event-driven: Use REST for synchronous CRUD operations (user requests a resource, expects an immediate response).
- Distinctive: line 162
No Kubernetes. No existing message queue infrastructure.
- Distinctive: line 194
No new infrastructure — PostgreSQL already exists
- Distinctive: line 202
Does not scale beyond ~50k-100k notifications/day without query optimization
- Very specific: line 238
Instead of pushing notifications, serve a /notifications SSE endpoint.
- Distinctive: line 243
No background worker or queue required
- Distinctive: line 248
Does not handle offline users (notifications missed if user is not connected)
- Distinctive: line 250
Not suitable when guaranteed delivery is needed for offline users
- Distinctive: line 272
If the app grows to 500k+ notifications/day, migrate to Option B at that point.
- Distinctive: line 292
Should failed email deliveries be retried?
“Common” is measured: kept by at least 6 in 10 of the 24 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Architecture Design
Overview
Design before you build. Architecture decisions are expensive to change. Understand constraints, explore options, validate trade-offs, then decide.
When to Use
- Starting a new system or significant new component
- Evaluating whether to build vs. use existing solutions
- Making decisions that will affect multiple parts of the system
- Choosing between fundamentally different structural approaches
- Designing APIs, data models, or service boundaries
Constraints Checklist (gather before proposing options)
Complete this checklist before presenting any architectural options. Do not propose options without knowing the constraints — options that ignore constraints are not options, they are guesses.
- Scale: users / requests / data volume per day
- Consistency: eventual vs. strong (specify which operations require which)
- Latency: acceptable p50 and p99 in milliseconds
- Team: size, existing stack, deployment platform
- Cost: hard budget ceiling if any
Termination criterion: Proceed when 4 out of 5 items are checked, OR when the user explicitly says "don't know" or "doesn't matter" for the remaining unchecked items.
If fewer than 4 items are known and the user has not dismissed the unknowns, ask before proceeding. Unknown constraints produce designs that must be redesigned later.
The Process
1. Understand constraints Before proposing anything, gather the checklist above. Record what is known and what is assumed.
2. Identify core trade-offs Every architecture has trade-offs. Name them explicitly:
- Consistency vs. availability
- Simple vs. scalable
- Build vs. buy
- Monolith vs. services
- Synchronous vs. asynchronous
3. Propose 2-3 options Never present only one option. For each:
- Describe the approach in 2-3 sentences
- List pros and cons
- State the constraints it satisfies (and which it doesn't)
- Give a complexity estimate
4. Recommend with reasoning State your recommendation clearly. Explain WHY given the specific constraints. Don't hedge everything — make a call.
5. Document the decision Record: what was decided, what was rejected, and why. This is the most important thing to write down.
Open Questions Resolution Process
After completing the output, list any open questions that remain. For each open question, assign it to exactly one of:
- (user): only the user can answer this (business requirements, organizational constraints, budget decisions). Do not proceed if any user-assigned question is unanswered.
- (deep-research skill): answerable by researching current technical documentation, benchmarks, or compatibility information
- (implementation discovery): answerable only by building a spike or prototype; acceptable to proceed and revisit
If a user-assigned question is blocking, state it clearly: "I need your answer on [question] before I can finalize this design."
Uncertainty Guidance
When constraints are unavailable, do not refuse to proceed — proceed transparently:
- State your assumption explicitly: "I am assuming [X] because [reason]."
- Design for the stated assumption: produce a complete design based on it.
- Document that the design must be revisited: "If actual [constraint] differs significantly from this assumption, revisit [specific aspect of the design]."
Assumptions are acceptable. Hidden assumptions are not.
Patterns Composition Guidance
When combining patterns, follow these composition rules:
REST + event-driven: Use REST for synchronous CRUD operations (user requests a resource, expects an immediate response). Use events for async side effects (notifications, audit logs, cache invalidation, search index updates). Do not use events for operations where the caller needs an immediate, consistent result.
CQRS + event-driven: Commands (writes) emit events. Query models are rebuilt from events. Acceptable eventual consistency window must be defined before adopting this — if users expect to see their own writes immediately, event lag will cause visible bugs.
Repository pattern + any persistence layer: The repository interface is defined by the domain, not the database. Changing the underlying storage should not require changing the domain logic.
Architecture Principles
YAGNI — Don't build for hypothetical future needs. Simple first — The simplest thing that could work is usually right. Explicit over implicit — Clear dependencies beat magic. Stateless where possible — Stateful systems are harder to scale and reason about. Fail fast — Validate inputs at boundaries, not deep in the call stack.
Common Patterns Reference
| Pattern | Use When |
| REST API | CRUD over resources, external-facing APIs |
| Event-driven | Decoupling producers/consumers, async workflows |
| CQRS | Read/write loads differ significantly |
| Repository pattern | Abstracting data access from business logic |
| Circuit breaker | Calling unreliable external services |
| Saga pattern | Distributed transactions across services |
| BFF (Backend for Frontend) | Multiple clients with different data needs |
Output Format
Present as:
- Constraints — what must be true
- Options — 2-3 approaches with trade-offs
- Recommendation — clear choice with reasoning
- Decision record — what was decided and what was rejected
- Open questions — what still needs to be resolved, each assigned to (user | deep-research skill | implementation discovery)
Worked Example
The following is a complete design session demonstrating correct application of this skill.
Scenario: "Design a notification service for a SaaS app"
Constraint gathering
Checklist filled:
- Scale: 5,000 active users. Approximately 50,000 notifications per day (mix of in-app alerts, email digests, and real-time activity updates). Peak load: ~500 notifications per minute during business hours.
- Consistency: Eventual. Users can tolerate a notification arriving 1-5 seconds after the triggering event. No financial or compliance requirement for guaranteed delivery.
- Latency: In-app notifications: p50 < 500ms, p99 < 2s acceptable. Email: best-effort, no hard SLA.
- Team: 2 backend engineers. Existing stack: Node.js, PostgreSQL, AWS (EC2 + RDS). No Kubernetes. No existing message queue infrastructure.
- Cost: Not specified. (User said "don't know.")
4/5 checked, user dismissed remaining item. Termination criterion met. Proceeding.
Trade-offs identified
Primary tension: sync vs. async delivery
- Synchronous delivery (within the same request that triggers the notification) is simple but couples notification latency to the main request path. A slow email provider slows down the user-facing action.
- Asynchronous delivery (decouple via queue or polling) is more resilient but adds infrastructure and operational complexity.
Secondary tension: reliability vs. simplicity
- Guaranteed delivery requires persistent queues, acknowledgement, and retry logic.
- Best-effort delivery (acceptable given no compliance requirement) allows simpler implementations.
Option A: Direct DB polling
The application writes notification records to a PostgreSQL notifications table when events
occur. A background worker process polls the table every 2 seconds for undelivered notifications
and dispatches them via email/in-app channels. Marks records as delivered after successful send.
Pros:
- No new infrastructure — PostgreSQL already exists
- Trivially debuggable: notification state is a table row
- Survives process restarts without losing notifications
- 2 engineers can own and operate it without specialist knowledge
Cons:
- Polling introduces up to 2 seconds of added latency (acceptable given p99 < 2s requirement)
- PostgreSQL write load increases slightly (append-only
notificationstable) - Does not scale beyond ~50k-100k notifications/day without query optimization
Constraints satisfied: scale (5k users, 50k/day), consistency (eventual), team (no new infra), cost (zero marginal cost). Constraints not satisfied: would need redesign above ~100k notifications/day.
Complexity estimate: Low. 1 database table, 1 background worker process, 1-2 days to implement.
Option B: Message queue + workers
Introduce a message queue (AWS SQS or RabbitMQ). Application services publish notification events to the queue. A pool of worker processes consumes the queue and dispatches notifications. Queue provides durability, retry, and dead-letter handling.
Pros:
- Scales to 1M+ notifications/day without re-architecture
- Decoupled: notification workers fail independently of the main app
- Built-in retry and dead-letter queue for failed deliveries
Cons:
- New infrastructure: queue service must be provisioned, monitored, and operated
- Local development requires running a queue locally (Docker or mock)
- Adds operational surface area for a 2-engineer team
- 1-2 weeks to implement correctly including error handling and DLQ monitoring
Constraints satisfied: scale (headroom to 1M+/day), consistency (eventual). Constraints not satisfied: team (adds infra burden); cost (SQS has per-message cost at volume).
Complexity estimate: High. New infrastructure dependency, operational runbook required.
Option C: Webhooks / Server-Sent Events (client-pull)
Instead of pushing notifications, serve a /notifications SSE endpoint. The frontend
subscribes on load and receives events in real time. Email notifications sent synchronously
within the triggering request.
Pros:
- No background worker or queue required
- Real-time in-app delivery without polling
Cons:
- SSE connections held open per active user (connection management overhead)
- Does not handle offline users (notifications missed if user is not connected)
- Email sent synchronously degrades main request performance if email provider is slow
- Not suitable when guaranteed delivery is needed for offline users
Constraints satisfied: latency (real-time when connected). Constraints not satisfied: consistency (offline users miss notifications), reliability (no guaranteed delivery).
Complexity estimate: Medium. SSE implementation is straightforward; offline delivery gap is a product-level deficiency.
Recommendation: Option A
Given the constraints — 5k users, 50k notifications/day, 2-engineer team, no compliance requirement for guaranteed delivery, no message queue infrastructure — Option A (DB polling) is the correct choice.
Rationale:
- The scale is well within what PostgreSQL can handle as a notification backing store.
- The 2-second polling interval satisfies the p99 < 2s requirement.
- The team avoids introducing and operating new infrastructure.
- The implementation is observable (table rows), debuggable, and reversible.
- If the app grows to 500k+ notifications/day, migrate to Option B at that point. Do not build for that scale now (YAGNI).
Decision record
Decided: Option A — DB polling with PostgreSQL notifications table and background worker.
Rejected: Option B (message queue) — premature complexity. No current requirement justifies the operational burden for a 2-engineer team at this scale.
Rejected: Option C (SSE/webhooks) — does not provide guaranteed delivery for offline users. Acceptable only if the product accepts "notifications are best-effort and only visible when logged in," which was not stated.
Open questions
- Should failed email deliveries be retried? If yes, how many times and with what backoff? Assign to: (user) — product decision. Do not proceed with email implementation until answered.
- Which email provider (SendGrid, SES, Postmark)? Assign to: (user) — depends on existing vendor relationships and cost.
- Does the PostgreSQL polling query need a partial index on
(delivered_at IS NULL)? Assign to: (implementation discovery) — measure query time after table has 100k rows, add index if needed.
Other versions30 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 30
- Galaxy-Dawn/claude-scholar★ 5.9ksame name
- bkywksj/knowledge-base★ 337same name
- shawnpang/startup-founder-skills★ 331same name
- thomast1906/github-copilot-agent-skills★ 203same name
- GenerativeAgents/claude-code-book-chapter8★ 114same name
- kumaran-is/claude-code-onboarding★ 35same name
- Vepricov/claude-brainlab★ 35same name
- bmad-labs/skills★ 19same name
- Maudeunfledged834/startup-founder-skills★ 8same name
- 05-deepak-patidar/claude-skills★ 4same name
20 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
Used alongsideProjects with it also use observability-design, bug-detective and 9 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
gclmSkillobservability-design
Design logs, metrics, traces, alerts, and debugging signals so systems can be operated and diagnosed before incidents expose blind spots.
Also in 3 projects that use this
kharlamenkodevSkillbug-detective
Also in 3 projects that use this
Clay-HHKSkillml-paper-writing
Write publication-ready ML/AI papers for NeurIPS, ICML, ICLR, ACL, AAAI, COLM. Use when drafting papers from research repos, structuring arguments, verifying citations, or preparing camera-ready submissions. Includes LaTeX templates, reviewer guidelines, and citation verification workflows.
Also in 3 projects that use this
Google CloudSkillcitation-verification
Verify that citations in a document resolve to real records and that claimed titles match. Use before trusting a document's reference list.
Also in 3 projects that use this
MicrosoftSkillweb-design-reviewer
This skill enables visual inspection of websites running locally or remotely to identify and fix design issues. Triggers on requests like "review website design", "check the UI", "fix the layout", "find design problems". Detects issues with responsive design, accessibility, visual consistency, and layout breakage, then performs fixes at the source code level.
Also in 3 projects that use this
xfstudioSkillcode-review-excellence
Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use when reviewing pull requests, establishing review standards, or mentoring developers.
Also in 3 projects that use this
In this repository19 other files it gives its agents.
- brainstormingSkill
- browser-agentSkill
- confidence-checkSkill
- deep-researchSkill
- dependency-managementSkill
- dispatching-parallel-agentsSkill
- executing-plansSkill
- finishing-a-development-branchSkill
- performance-optimizationSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- security-reviewSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- using-superantigravitySkill
- verification-before-completionSkill
- writing-plansSkill
- writing-skillsSkill
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
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.

