agentleFS
CsHengCsHeng/agent-skills/skills/architecture-patterns/SKILL.md

architecture-patterns

Skill3 starsChanged 8 days agoMITView on GitHub

Use for architecture design decisions: service boundaries, monolith vs microservices, layering, dependency injection, module contracts, and integration patterns.

34 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use python-resource-management, error-handling-patterns and 10 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.
  • Aver005Skill

    python-resource-management

    Python resource management with context managers, cleanup patterns, and streaming. Use when managing connections, file handles, implementing cleanup logic, or building streaming responses with accumulated state.

    Also in 3 projects that use this

  • xfstudioSkill

    error-handling-patterns

    Master error handling patterns across languages including exceptions, Result types, error propagation, and graceful degradation to build resilient applications. Use when implementing error handling, designing APIs, or improving application reliability.

    Also in 6 projects that use this

  • CodeWithBehnamSkill

    python-type-safety

    Python type safety with type hints, generics, protocols, and strict type checking. Use when adding type annotations, implementing generic classes, defining structural interfaces, or configuring mypy/pyright.

    Also in 3 projects that use this

  • xfstudioSkill

    python-testing-patterns

    Implement comprehensive testing strategies with pytest, fixtures, mocking, and test-driven development. Use when writing Python tests, setting up test suites, or implementing testing best practices.

    Also in 6 projects that use this

  • Aver005Skill

    python-project-structure

    Python project organization, module architecture, and public API design. Use when setting up new projects, organizing modules, defining public interfaces with __all__, or planning directory layouts.

    Also in 3 projects that use this

  • AJBcodingSkill

    python-performance-optimization

    Profile and optimize Python code using cProfile, memory profilers, and performance best practices. Use when debugging slow Python code, optimizing bottlenecks, or improving application performance.

    Also in 4 projects that use this

  • +2 more from Aver005
  • +4 more from xfstudio

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 30 edited versions we read keep these.

  • 3

    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. Very specific:

    Read references/architecture-pattern-catalog.md for the pattern families relevant to the proven constraint.

    line 14
  2. Distinctive:

    Prefer an existing boundary or a reversible local extension when it satisfies the approved goal.

    line 22
  3. Distinctive:

    Treat security, compliance, data-loss, and externally mandated reliability requirements as hard constraints rather than optional benefits …

    line 25
  4. Very specific:

    When shaping module interfaces, test seams, domain terminology, or caller contracts, read references/interface-and-domain-language.md.

    line 30
  5. Very specific:

    When the decision concerns handlers, services, repositories, framework isolation, inward dependency direction, or cross-boundary tests, …

    line 32
  6. Distinctive:

    Keep interfaces small and behavior-bearing, and create seams for proven variation or caller-visible test contracts.

    line 34

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

Choose the smallest sufficient architecture justified by current demand, a constrained resource, ownership, and an observable upgrade trigger. Treat patterns as options with lifecycle costs.

Selection Workflow

  1. State the protected behavior, current demand evidence, constrained resource, hard requirements, and decision horizon.
  2. For a new or materially changed persisted architecture boundary, read references/architecture-decision-economics.md and compare the status quo, the smallest sufficient option, and a structural investment.
  3. Read references/architecture-pattern-catalog.md for the pattern families relevant to the proven constraint.
  4. Define the selected option's relevant dependency direction, state and data ownership, caller contracts, and evidence. Detail the failure containment, rollout, or recovery dimensions the boundary actually exercises.
  5. Record the chosen option, material rejected alternatives, lifecycle-cost owner, and observable upgrade trigger.

Selection Rules

  • Choose a maintainable option for the declared decision horizon, and add a larger pattern when its trigger is observed while delay preserves a safe migration path. Apply development-standards (Business Feedback Before Supporting Machinery) for sequencing a thin real business path ahead of support machinery.
  • Introduce richer domain models, layers, or coordination for actual rules and coupling; simple use cases stay direct.
  • Prefer an existing boundary or a reversible local extension when it satisfies the approved goal.
  • Require demand or constraint evidence before adding distribution, asynchronous coordination, new infrastructure, speculative seams, or independent operational surfaces.
  • Assign operational cost and decision authority to an explicit owner, place responsibility where the repository, team, runtime, language, or provider ecosystem has the lowest relative opportunity cost, and call out costs shifted to callers, operators, or future maintainers.
  • Treat security, compliance, data-loss, and externally mandated reliability requirements as hard constraints rather than optional benefits in a scorecard.
  • Decide with causal evidence, explicit discard reasons, and measurable triggers.

Interface And Domain Boundaries

When shaping module interfaces, test seams, domain terminology, or caller contracts, read references/interface-and-domain-language.md.

When the decision concerns handlers, services, repositories, framework isolation, inward dependency direction, or cross-boundary tests, read references/clean-boundaries.md.

Keep interfaces small and behavior-bearing, and create seams for proven variation or caller-visible test contracts.

Decision Result

When this skill owns an architecture decision, lead with the selected option and show only the evidence for why it fits current demand and the constrained resource, why simpler and more structural alternatives were rejected or deferred, who owns state, failure handling, lifecycle cost, and future evolution, which executable oracle protects the boundary, and what observable trigger justifies the next increment.

Reuse Before Taking Ownership

For a material open choice at a boundary, run the reuse check in design-change (Design) and development-standards (Local Dependency Selection) first. This Skill owns the boundary and economic comparison that follow: identify the missing responsibility, prefer a thin integration over duplicating mature state, protocol, or lifecycle machinery, and compare total lifecycle cost in references/architecture-decision-economics.md. Bespoke work may win on demonstrated reliability, licensing or platform fit, integration, or performance; state the actual gap and ownership tradeoff, after checking the project, host, and ecosystem for the capability.

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.