agentleFS
SWEStashSWEStash/swe-workflow-skills/skills/architecture-design/SKILL.md

architecture-design

Skill1 starsChanged 6 days agoMITView on GitHub

Guide architectural and structural decisions using Architecture Decision Records (ADRs) — new services, pattern choices, database selection, component boundaries, state management, costly-to-reverse decisions. Triggers: how should I architect, which pattern, design decision, should I use X or Y, system design, ADR, component design, architectural trade-off. Owns internal-structure decisions — build vs buy/adopt a vendor or OSS capability → build-vs-buy.

32 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use results-report, daily-coding 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.
  • Galaxy-DawnSkill

    results-report

    This skill should be used when the user asks to "write an experiment report", "summarize experimental results", "do experiment retrospection", "write a results report", "写实验总结报告", "写实验复盘", or mentions turning completed experiment artifacts into a structured, decision-oriented research report. It assumes strict analysis should come from `results-analysis` first.

    Also in 3 projects that use this

  • Clay-HHKSkill

    daily-coding

    Daily coding assistant that auto-triggers when writing/modifying code, providing a core checklist.

    Also in 3 projects that use this

  • Clay-HHKSkill

    kaggle-learner

    This skill should be used when the user asks to "learn from Kaggle", "study Kaggle solutions", "analyze Kaggle competitions", or mentions Kaggle competition URLs. Provides access to extracted knowledge from winning Kaggle solutions across NLP, CV, time series, tabular, and multimodal domains.

    Also in 3 projects that use this

  • kharlamenkodevSkill

    bug-detective

    Also in 4 projects that use this

  • Google CloudSkill

    citation-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 4 projects that use this

  • MicrosoftSkill

    web-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 4 projects that use this

  • +2 more from Clay-HHK

The file

We split this skill into the rules it gives an agent

7 rules. 0 are common, 6 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 6

    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
  1. Distinctive:

    If a system is already running, establish what it already provides before proposing a new service, module, boundary, or pattern.

    line 14
  2. Distinctive:

    When you can't inspect, name what you would check and continue under stated assumptions.

    line 35
  3. Distinctive:

    If the user's question is too broad, help narrow it by asking:

    line 49
  4. Distinctive:

    Avoid presenting a straw-man option just to make the preferred one look better.

    line 75
  5. Distinctive:

    Document which principles favor which option.

    line 90
  6. Very specific:

    When the decision is whether a capability should be built at all versus bought or adopted (vendor/SaaS/OSS, TCO, lock-in, exit costs), use …

    line 111
  7. Distinctive:

    If the analysis reveals multiple independent decisions bundled together, split them into separate ADRs.

    line 115

“Common” is measured: kept by at least 6 in 10 of the 26 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.

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

Architecture Design

Help the user make well-reasoned architectural decisions and document them in Architecture Decision Records (ADRs). Good architecture is about managing trade-offs explicitly, not finding perfect solutions.

Workflow

Step 0: Inventory What Already Exists

If a system is already running, establish what it already provides before proposing a new service, module, boundary, or pattern. Map the current state directly from the codebase — don't infer it from the requirements, the docs, or memory. Docs describe the system someone intended; the code is the one you have.

Cover both:

  • Artifacts — existing services, modules, and seams that already own, or could own, the responsibility in question. Search by capability, not just by name: the component that does this may be called something else entirely.
  • Written decisions — the ADR log, established conventions, and prior audit findings. A decision already made and recorded is not yours to re-litigate silently; supersede it explicitly or work within it.

Exit condition — one line, then keep going in the same response: "<existing component> already handles <responsibility>; it does / does not serve this because <reason>."

This step is not a gate on delivering. Greenfield — nothing built yet, or nothing you can reach — closes it in one line: say so and go straight to Step 1. When you can't inspect, name what you would check and continue under stated assumptions. Never answer a design question with inventory and questions alone; carry the options, the recommendation, and the trade-offs in the same reply.

This constrains the input, not the choice. A new component is a fine outcome; an unexamined one isn't.

Step 1: Frame the Decision

Identify the exact decision to be made. A good architectural question is specific and scoped:

  • Too broad: "How should I design the backend?"
  • Right scope: "Should user authentication be a separate microservice or a module within the monolith?"

If the user's question is too broad, help narrow it by asking:

  • What triggered this decision? (new feature, scaling issue, tech debt)
  • What are the constraints? (team size, timeline, existing stack)
  • What's the blast radius? (which parts of the system are affected)

Step 2: Explore the Context

Understand the current state before proposing changes:

  • Current architecture: the Step 0 finding — what exists today, established from the code rather than assumed. If you can't state it, Step 0 isn't done.
  • Quality attributes that matter: Performance? Scalability? Developer experience? Maintainability? Deployment simplicity?
  • Team context: Team size, expertise, on-call burden
  • Growth trajectory: Expected scale in 6-12 months (not 5 years — YAGNI)

Step 3: Generate Options

Present 2-4 viable options. For each option:

  1. Name it clearly (e.g., "Separate Auth Service" vs "Auth Module in Monolith")
  2. Describe the approach in 2-3 sentences
  3. Analyze trade-offs against the quality attributes identified in Step 2
  4. Estimate complexity (implementation effort, operational overhead)
  5. Identify reversibility — how hard is it to change this decision later?
  6. Name any new library it brings in, with dependency-management's Step 1 verdict (own module, adopt, or ask the user) in the option itself. The ADR records why each library is worth the coupling.

Avoid presenting a straw-man option just to make the preferred one look better.

Step 4: Apply Design Principles

Evaluate each option through these lenses:

  • KISS: Which option is simplest to implement and operate?
  • YAGNI: Which avoids building for hypothetical future needs?
  • Functional Independence: Which gives the cleanest boundaries and lowest coupling?
  • Separation of Concerns: Which isolates responsibilities clearly?
  • DRY: Which avoids duplication of logic or data?
  • SOLID: Does the design respect Open/Closed, Liskov Substitution, Interface Segregation, and Dependency Inversion? See references/solid-principles.md.
  • Clean Architecture: Does the dependency direction point inward? Are business rules protected from infrastructure details? See references/clean-architecture.md.
  • Component boundaries: Are components cohesive (CCP, CRP) and acyclic (ADP)? Do dependencies flow toward stability (SDP)? See references/component-principles.md.

Document which principles favor which option. Conflict between principles is expected — that's why it's a decision, not a formula.

See references/principles.md for deeper guidance on applying KISS, YAGNI, coupling, and separation of concerns to architecture decisions.

Step 5: Make a Recommendation

State the recommended option clearly, with reasoning. Structure it as:

  1. Recommendation: Option X
  2. Primary reason: The most compelling argument (one sentence)
  3. Key trade-off accepted: What you're giving up and why it's acceptable
  4. Conditions that would change this decision: Future triggers to revisit

Step 6: Document the ADR

Produce an ADR using the template at templates/adr.md. Save it in the project's decision log (e.g., docs/decisions/NNN-decision-title.md).

ADRs are immutable records. If a decision is superseded, create a new ADR that references the old one — don't edit the original.

For visual architecture documentation (system diagrams, runtime flows, infrastructure topology), see the architecture-documentation skill.

When the decision is whether a capability should be built at all versus bought or adopted (vendor/SaaS/OSS, TCO, lock-in, exit costs), use build-vs-buy — it produces the same ADR-style record, but for sourcing rather than structure.

When to Split Decisions

If the analysis reveals multiple independent decisions bundled together, split them into separate ADRs. For example, "How should we handle caching?" might split into:

  • ADR-001: Cache invalidation strategy
  • ADR-002: Cache storage technology
  • ADR-003: Cache warming approach

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.