agentleFS
danecwalkerdanecwalker/agentskills/skills/architecture/SKILL.md

architecture

Skill2 starsChanged 4 months agoMITView on GitHub

Design, review, and refactor production-grade file and folder structures plus dependency boundaries for frontend, backend, full-stack, monorepo, modular-monolith, and service-based applications. Use when scaffolding a new application; deciding where code belongs; organizing code by domain or feature; separating apps, packages, infrastructure, tests, generated code, and public APIs; cleaning up a messy repository; defining ownership and module boundaries; planning a safe structural migration; or assessing whether an architecture can scale. Apply framework-native conventions and synthesize public patterns from large engineering organizations without claiming access to their proprietary internal layouts.

136 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use intelligent-routing, bash-linux 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.
  • SKB3002Skill

    intelligent-routing

    Automatic agent selection and intelligent task routing. Analyzes user requests and automatically selects the best specialist agent(s) without requiring explicit user mentions.

    Also in 6 projects that use this

  • xenitV1Skill

    bash-linux

    Bash/Linux terminal patterns. Critical commands, piping, error handling, scripting. Use when working on macOS or Linux systems.

    Also in 8 projects that use this

  • xenitV1Skill

    red-team-tactics

    Red team tactics principles based on MITRE ATT&CK. Attack phases, detection evasion, reporting.

    Also in 8 projects that use this

  • SKB3002Skill

    nextjs-react-expert

    React and Next.js performance optimization from Vercel Engineering. Use when building React components, optimizing performance, eliminating waterfalls, reducing bundle size, reviewing code for performance issues, or implementing server/client-side optimizations.

    Also in 3 projects that use this

  • +8 more from xenitV1

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 118 edited versions we read keep these.

  • 24

    Distinctive

    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:

    Treat the directory tree as a map of runtime boundaries, ownership, and allowed dependencies.

    line 8
  2. Distinctive:

    Keep code with the feature, team, test suite, and deployment unit that change together.

    line 16
  3. Distinctive:

    Keep entry points, routes, controllers, and framework adapters thin.

    line 18
  4. Distinctive:

    Prefer a well-bounded modular monolith until independent deployment, scaling, reliability, security, or ownership requirements justify …

    line 20
  5. Distinctive:

    Use the shallowest tree that preserves meaningful boundaries.

    line 21
  6. Distinctive:

    Read local instructions and architecture records.

    line 30
  7. Distinctive:

    Use a single application repository for one deployable with little reusable code.

    line 42
  8. Distinctive:

    Use a modular monolith for a growing backend with several business capabilities but one practical deployment boundary.

    line 43
  9. Distinctive:

    Use a monorepo when multiple apps or packages require atomic changes, shared tooling, and coordinated dependency management.

    line 44
  10. Distinctive:

    Use multiple repositories or services only when independent lifecycle or access boundaries outweigh coordination cost.

    line 45
  11. Distinctive:

    Read repository-topologies.md before choosing or changing repository topology.

    line 47
  12. Distinctive:

    Read core-principles.md for dependency rules, scale calibration, naming, tests, and enforcement.

    line 63
  13. Distinctive:

    When citing or deliberately borrowing large-company practices, read public-patterns.md.

    line 70
  14. Distinctive:

    When asked for a recommendation, return:

    line 76
  15. Distinctive:

    When asked to change code:

    line 88
  16. Distinctive:

    Update imports, package/build declarations, aliases, tests, fixtures, ownership files, and documentation in the same change.

    line 91
  17. Distinctive:

    Add compatibility exports or adapters when a staged migration needs them.

    line 92
  18. Distinctive:

    Avoid mixing structural moves with unrelated behavior changes.

    line 93
  19. Distinctive:

    Remove obsolete paths only after callers migrate.

    line 94
  20. Distinctive:

    Run the repository's formatter, type checker, tests, build, and architecture rules.

    line 98
  21. Distinctive:

    no unexpected dependency cycles or deep imports into module internals.

    line 100
  22. Distinctive:

    every deployable has an obvious entry point, configuration boundary, health/observability integration, and test path.

    line 105
  23. Distinctive:

    If automated boundary tooling is unavailable, document a simple import rule and add the narrowest lint, build, or test enforcement the …

    line 109
  24. Distinctive:

    Do not approve a structure merely because its tree looks tidy.

    line 124

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

Treat the directory tree as a map of runtime boundaries, ownership, and allowed dependencies. Optimize for the next maintainer finding and changing code safely, not for visual symmetry.

Apply these rules

  • Preserve repository instructions, framework-reserved paths, build-tool conventions, and established domain language unless a change has a concrete payoff.
  • Group product code primarily by business capability or feature. Use technical layers inside a capability when they clarify dependency direction.
  • Give every module one purpose, one public surface, and private implementation details.
  • Make dependencies explicit, acyclic, and enforceable. Do not rely on folders alone.
  • Keep code with the feature, team, test suite, and deployment unit that change together.
  • Promote code to shared space only after genuine reuse and stable semantics exist.
  • Keep entry points, routes, controllers, and framework adapters thin. Put decisions in application or domain modules.
  • Separate generated artifacts, migrations, fixtures, operational configuration, and source code.
  • Prefer a well-bounded modular monolith until independent deployment, scaling, reliability, security, or ownership requirements justify services.
  • Use the shallowest tree that preserves meaningful boundaries. Do not create one-file directories or speculative abstractions.
  • Describe recommendations as a synthesis of public practices. Never present a sample tree as “the Google structure” or “the Meta structure.”

Follow the workflow

1. Discover constraints

For an existing repository:

  1. Read local instructions and architecture records.
  2. Inspect the tree, manifests, workspace/build configuration, import aliases, entry points, routes, persistence code, tests, deployment files, and ownership rules.
  3. Identify the framework's mandatory structure and the repository's current dependency direction.
  4. Find code that changes together, duplicated “shared” code, cross-boundary imports, cycles, oversized directories, and ambiguous names.
  5. Preserve unrelated user changes.

For a greenfield repository, infer only reversible defaults. Ask about a missing constraint only when it would materially change repository topology, deployment boundaries, data ownership, or framework choice.

2. Select a topology

Choose the smallest topology that fits:

  • Use a single application repository for one deployable with little reusable code.
  • Use a modular monolith for a growing backend with several business capabilities but one practical deployment boundary.
  • Use a monorepo when multiple apps or packages require atomic changes, shared tooling, and coordinated dependency management.
  • Use multiple repositories or services only when independent lifecycle or access boundaries outweigh coordination cost.

Read repository-topologies.md before choosing or changing repository topology.

3. Define boundaries before names

For each proposed module, state:

  • responsibility and owning business capability;
  • public API or entry point;
  • private implementation area;
  • owned state, schema, or external integration;
  • allowed incoming and outgoing dependencies;
  • test boundary;
  • runtime and deployment boundary, if any.

Resolve unclear ownership before inventing directories. Use domain terms such as billing, catalog, or identity; avoid vague buckets such as common, helpers, misc, or manager.

Read core-principles.md for dependency rules, scale calibration, naming, tests, and enforcement.

4. Adapt the concrete layout

  • For browser, mobile-web, React, Vue, Angular, Svelte, or route-driven UI work, read frontend.md.
  • For APIs, workers, jobs, modular monoliths, event consumers, or services, read backend.md.
  • For full-stack work, read both references and then place deployables and reusable packages using repository-topologies.md.
  • When citing or deliberately borrowing large-company practices, read public-patterns.md.

Adapt examples to the detected language and framework. Do not force a generic src/ tree over conventions such as Next.js route segments, Rails engines, Django apps, Go packages, Java source sets, or .NET projects.

5. Produce or implement the result

When asked for a recommendation, return:

  1. assumptions and constraints;
  2. the selected topology and why;
  3. an annotated target tree;
  4. allowed and forbidden dependency directions;
  5. public module surfaces and ownership;
  6. testing, configuration, generated-code, and operational placement;
  7. trade-offs and rejected alternatives;
  8. an incremental migration sequence for existing code;
  9. automated enforcement to prevent regression.

When asked to change code:

  1. Move one coherent boundary at a time.
  2. Update imports, package/build declarations, aliases, tests, fixtures, ownership files, and documentation in the same change.
  3. Add compatibility exports or adapters when a staged migration needs them.
  4. Avoid mixing structural moves with unrelated behavior changes.
  5. Remove obsolete paths only after callers migrate.

6. Validate

Run the repository's formatter, type checker, tests, build, and architecture rules. Also verify:

  • no unexpected dependency cycles or deep imports into module internals;
  • production code does not depend on test helpers;
  • shared code does not depend on product features;
  • backend domain/application code does not depend directly on delivery frameworks;
  • frontend shared UI does not own feature workflows;
  • every deployable has an obvious entry point, configuration boundary, health/observability integration, and test path;
  • generated output and secrets are not treated as hand-maintained source;
  • the resulting tree remains navigable without empty placeholder layers.

If automated boundary tooling is unavailable, document a simple import rule and add the narrowest lint, build, or test enforcement the stack supports.

Review rubric

Judge a structure by these questions:

  • Can a new contributor identify where a feature starts within a minute?
  • Can a feature be changed without editing unrelated global buckets?
  • Can module internals change without breaking callers?
  • Does the dependency graph match the intended architecture?
  • Are ownership, state, tests, and operations located near the code they govern?
  • Can a module grow, split, or be extracted without a repository-wide rewrite?
  • Is every shared abstraction backed by real consumers?
  • Does framework upgrade guidance still apply without fighting the layout?

Do not approve a structure merely because its tree looks tidy. Approve it when boundaries are understandable, dependencies are controlled, and routine changes stay local.

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.