agentleFS
gonun13gonun13/agent-skills/skills/software-architecture/SKILL.md

software-architecture

Skill0 starsChanged 2 months agoMITView on GitHub

Measures a codebase against twelve architecture principles and either refactors toward them, documents where it falls short, or runs one principle's pass that you pick. Use when asked to refactor toward better structure, review or document a system's architecture, or check whether something is well shaped.

30 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use llm-app-patterns, backend-engineering 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.
  • xfstudioSkill

    llm-app-patterns

    Production-ready patterns for building LLM applications. Covers RAG pipelines, agent architectures, prompt IDEs, and LLMOps monitoring. Use when designing AI applications, implementing RAG, building agents, or setting up LLM observability.

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    backend-engineering

    Expert backend application engineering: layered architecture, domain services, validation, transactions, caching boundaries, background jobs, and framework idioms (e.g. Laravel/Node) without leaking business rules into controllers. Use when implementing or refactoring server-side features, services, form requests/DTOs, policies, queues, or integrating persistence with APIs.

    Also in 3 projects that use this

  • AJBcodingSkill

    sql-optimization-patterns

    Master SQL query optimization, indexing strategies, and EXPLAIN analysis to dramatically improve database performance and eliminate slow queries. Use when debugging slow queries, designing database schemas, or optimizing application performance.

    Also in 3 projects that use this

  • weirdgmeSkill

    backend-dev-guidelines

    Comprehensive backend development guide for Node.js/Express/TypeScript microservices. Use when creating routes, controllers, services, repositories, middleware, or working with Express APIs, Prisma database access, Sentry error tracking, Zod validation, unifiedConfig, dependency injection, or async patterns. Covers layered architecture (routes → controllers → services → repositories), BaseController pattern, error handling, performance monitoring, testing strategies, and migration from legacy patterns.

    Also in 3 projects that use this

  • ruvnetSkill

    github-workflow-automation

    Advanced GitHub Actions workflow automation with AI swarm coordination, intelligent CI/CD pipelines, and comprehensive repository management

    Also in 3 projects that use this

  • AnthropicSkill

    documentation

    Write and maintain technical documentation. Trigger with "write docs for", "document this", "create a README", "write a runbook", "onboarding guide", or when the user needs help with any form of technical writing — API docs, architecture docs, or operational runbooks.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 5 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 26 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If that does not resolve, say so once and work from the index below alone.

    line 24
  2. Distinctive:

    document: when the operator asked for a review or a write-up rather than changes.

    line 50
  3. Distinctive:

    narrowed: when the operator named principles by number or title: run refactor or document over only those.

    line 52
  4. Very specific:

    Read what the project has already decided: spec/, ADRs, AGENTS.md, CLAUDE.md, README, docs/.

    line 60
  5. Distinctive:

    Document mode changes nothing, so it skips the run.

    line 65
  6. Distinctive:

    Never trade behaviour for shape.

    line 95
  7. Very specific:

    Do not widen the change you were asked for.

    line 97
  8. Very specific:

    No new dependencies, services, caches, or abstractions.

    line 103

“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

Software architecture

Goal

The codebase measurably closer to the twelve principles below, or a ranked account of where it is not — every claim tied to a principle file and a path:line, and every change proven behaviour-preserving by the project's own checks.

Context

Find the principle files first. Each one carries the principle, why it holds, what it looks like in practice, how to tell it is being violated, and a ## Pass section giving what to look for, what a safe fix is, and where to stop. Nothing is loaded for you: they are in principles/ inside the skill directory — the path given at the top of this prompt, or the folder holding this SKILL.md.

If that does not resolve, say so once and work from the index below alone. That is the degraded mode: still useful, but cite the index rather than inventing detail, and never invent a thirteenth principle.

The index. One file per principle, numbered in reading order. The numbering is not a ranking — a real decision usually turns on two or three at once.

FilePrincipleReach for it when
01-separation-of-concerns.mdOne concern, one place.A small change opens files in four layers.
02-single-responsibility.mdOne reason to change per component.Something has grown an "and", or has no clear owner.
03-encapsulation-through-contracts.mdWhat is public is a promise.Callers depend on internals, or something cannot be renamed.
04-dependency-inversion.mdBusiness rules must not import frameworks.An upgrade breaks domain logic, or the ORM entities are the model.
05-explicit-dependencies.mdDeclared and passed in, never reached for.A test needs a global patched, or a deploy fails on a missing setting.
06-loose-coupling-high-cohesion.mdThe two questions at every boundary.Deciding whether to split something, or why a split is not helping.
07-bounded-contexts-and-clear-ownership.mdOne meaning per term, one owner per area.A word means different things to different people.
08-data-ownership-and-data-contracts.mdOne writer per dataset.Shared databases, schema migrations, and who may delete.
09-design-for-failure.mdTimeouts, retries, idempotency.Anything with a network in it, or a slow dependency.
10-observability-is-architecture.mdCorrelation and structured events, designed in.Asking how this will be diagnosed in production.
11-prefer-simplicity.mdComplexity has to be earned.Before adding a service, a cache, an abstraction, or an option.
12-record-decisions-and-guardrails.mdWrite the reason down, then make it checkable.A decision is worth not having again.

Steps

  1. Pick the mode and state it in one line before touching anything:

    • refactor by default.
    • document when the operator asked for a review or a write-up rather than changes.
    • narrowed when the operator named principles by number or title: run refactor or document over only those.

    In plan mode, survey and judge as usual; the refactor you would make, or the document you would save, is the plan.

  2. Survey. In every mode. Say what the scope is — the whole tree, a directory, or a change (git diff, a branch) — before reading. Then:
    • Read what the project has already decided: spec/, ADRs, AGENTS.md, CLAUDE.md, README, docs/. A departure that was chosen deliberately and written down is an answer, not a finding.
    • In refactor mode, learn the build, test and lint commands and run them once before the first edit, so you know which failures you inherited. Document mode changes nothing, so it skips the run.
  3. Read the principle files in scope — all twelve, or only the ones selected — before judging anything. Every finding cites the file it came from.
  4. Refactor. One principle at a time, in index order, smallest safe change first, inside that file's Safe fix and never past its Stop at. Take the cheap gains: a file the work is already touching is the cheapest chance that file has of coming closer to these. Re-run the project's checks after each principle and confirm the result matches step 2 — a behaviour change is a bug, not a refactor. Anything past Stop at is written up as a proposal instead of done.
  5. Document. The same survey with no edits: rank the gaps by what leaving them costs, each with path:line, the principle file, the symptom from that file's "How to tell it is being violated", and the size of the fix. Save it to spec/decisions/NNNN-<short-title>.md if that tree exists, otherwise docs/architecture-review.md.
  6. Narrowed runs step 4 or 5 over the chosen principles only, and says which principles were not examined.
  7. Name the conflicts. Where two principles pulled opposite ways, say which one gave way and why. Two principles disagreeing is the normal case, not a contradiction to report; that sentence is the reasoning, and it is the part a reader months from now needs.

Constraints

  • Never trade behaviour for shape. Every refactor is behaviour-preserving, and the project's own checks are what prove it.
  • Do not widen the change you were asked for. Past a Stop at, propose — say what you would do and why, and let whoever is deciding decide.
  • Shape only. These principles settle nothing about language, library, naming, formatting, test framework, deployment target or process.
  • A recorded decision that departs from a principle has answered the question. What these outrank is a preference nobody wrote down.
  • No new dependencies, services, caches, or abstractions. 11-prefer-simplicity.md applies to this skill's own output.

Done when

The mode and scope were stated; every principle in scope was either applied or explicitly deferred with a reason; after a refactor, the project's build, test and lint commands give the same result they gave in step 2; and nothing was changed past a Stop at.

Output

Open with one line: the mode, the scope, and which principles were examined.

Then one section per principle that produced something, in index order:

  • Refactor — what changed, as path:line, and why it was safe.
  • Document — the gap, as path:line, the symptom, and the size of the fix.

Close with:

  • Left alone — what sat past a Stop at, or was blocked, and what would settle it.
  • Conflicts — where two principles pulled opposite ways, which gave way, and why.
  • Not examined — principles out of scope, when narrowed.

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.