agentleFS
pahlevikunpahlevikun/levistack/skills/architecture/super-architecture/SKILL.md

super-architecture

Skill0 starsChanged 19 days agoMITView on GitHub

Detect, choose, build, evaluate, migrate and document software architecture. Use to name the architecture of an existing codebase, pick one for a new system, scaffold or write code in a given style (layered, onion, hexagonal or ports and adapters, clean, COLA, vertical slice, CQRS, event sourcing, event-driven, client-server, domain-driven, functional core, microkernel, microservices, modular monolith, pipeline, serverless, service-based, space-based), check dependency direction and layer violations, plan a strangler-fig migration, or write C4 docs and architecture blueprints. For a standalone ADR use write-adr. One skill with granular job, style and stack guides; it loads only what the task needs.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    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:

    Do this first and do not announce it.

    line 44
  2. Very specific:

    Is there code?: If yes, run node scripts/arch-scan.mjs detect <dir> and read its evidence, then open two or three files on the main request …

    line 46
  3. Very specific:

    When write-adr invoked this skill for an unresolved choice, return the recommendation and evidence to it.

    line 62
  4. Distinctive:

    Right-size: Use the simplest structure that keeps the rules intact.

    line 126
  5. Very specific:

    Verify before claiming: Use the verify gate: run the scan and tests, read the output, then say what holds.

    line 134

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “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

Super Architecture

One skill, three axes. Call it once. It works out the job, then loads only the style and stack guides that job needs, plus the shared core principles.

AxisFolderAnswers
Jobjobs/What are we doing: detect, select, build, evaluate, migrate, document
Stylestyles/In-process structure, modeling, read/write flow, deployable shape, extensibility
Stackstacks/How it looks in this language and framework, and how to enforce it
Corecore/The principles every style shares

New style, stack or job: add one folder or file and one row in styles/README.md or the matching table below. Nothing else changes.

Step 0: detect the job and the context

Do this first and do not announce it.

  1. Is there code? If yes, run node scripts/arch-scan.mjs detect <dir> and read its evidence, then open two or three files on the main request path. Never name a style from folder names alone; confirm the dependency direction from imports.
  2. Is it greenfield? Gather only what is missing: team size and experience, business-rule complexity, stack, how often infrastructure changes, number of entry points (HTTP, CLI, queue, gRPC), test requirements, deployable shape (one process or many), traffic pattern.
  3. Pick the job from the table, state it in one line, and load its guide.

Jobs

The user wants to...JobGuide
Know what architecture exists, where code belongs, find layer violationsdetectjobs/detect.md
Choose an architecture, CQRS level or service splitselectjobs/select.md
Create a service, feature or scaffold in a stylebuildjobs/build.md
Assess health, maturity or debt of an existing designevaluatejobs/evaluate.md
Move from one structure to another, or strangle a legacy onemigratejobs/migrate.md
Write C4 diagrams or an architecture blueprintdocumentjobs/document.md

For a standalone ADR request, use write-adr. When an architecture selection also needs a decision record, pass the chosen option and evidence to write-adr. When write-adr invoked this skill for an unresolved choice, return the recommendation and evidence to it; do not call it again from this pass.

Common chains: greenfield is select, build, document. Legacy is detect, evaluate, migrate, then verify. Review is detect, then evaluate with a short report.

Styles

Two independent axes. Pick one in-process structure, add domain-driven only when the business has a language to model, and pick a deployable shape when the unit of deploy matters. Full catalog with grouping: styles/README.md.

StylePick whenAvoid whenGuide
Layered (DDD four-layer or n-tier)Simple domain, small team, moving from three-tierSwapped infrastructure, dense rules, many entry pointslayered
OnionDomain-centric core, high test coverage, changing infrastructureCRUD-heavy apps, teams new to abstractiononion
Hexagonal (ports and adapters)Several entry points, volatile integrations, complex rules, TDDTiny single-entry CRUD, throwaway prototypeshexagonal
CleanLarge teams, strict module isolation, long-lived systemsSmall teams, quick MVPsclean
COLA (diamond)Java and Spring Boot enterprise teams that want scaffolding and a validatorNon-Java stackscola
Vertical sliceFeature-heavy products where change should stay in one placeA tiny script, or heavy shared domain logic across all featuresvertical-slice
Functional coreRules tangled with I/O; you want pure, fast testsMeasured immutability cost, no appetite for the splitfunctional-core
Domain-drivenReal rules a domain expert can argue about; composes with a structureCRUD over a form; no business vocabularydomain-driven
CQRSRead and write needs differ sharplySimple CRUD where reads equal writescqrs
Event sourcingAudit trail, temporal queries, replayNo audit need, first CQRS attemptevent-sourcing
Event-drivenDecoupled services, async workflows, streamingA single process with simple call chainsevent-driven
PipelineETL, streaming analytics, isolated transform stagesInteractive request/response, shared mutable statepipeline
Client-serverUI and logic across a network trust boundaryOne process, no contract to versionclient-server
Modular monolithTeam autonomy without distributed operationsTiny apps, or already independently deployed servicesmodular-monolith
Service-basedFew coarse deployables; shared DB still realisticOne team; or full data autonomy already fundedservice-based
MicroservicesIndependent deploy and scale; platform already fundedSmall team, no SRE, strong cross-cut consistencymicroservices
ServerlessBursty event work; pay-per-executionLong-running, sticky state, tight cold-start SLOserverless
Space-basedOne database cannot hold the trafficLow traffic; strong cross-partition consistencyspace-based
Plugin and extensionThird parties or other teams extend a stable hostA closed applicationplugin
MicrokernelMinimal kernel, sandboxed versioned pluginsClosed app, or all features must be coremicrokernel
Game and real-timeState machines, pooling, event buses, data-driven contentOrdinary request/response servicesgame

Styles combine. A typical modern service is hexagonal or vertical-slice at the top level, with CQRS inside the slices that need it, inside a modular monolith or a single process. Each guide has a "Combines with" section.

Stacks

StackGuide
TypeScript and Nodestacks/typescript.md
Java and Kotlin (Spring)stacks/java-kotlin.md
Gostacks/go.md
PHP (Symfony)stacks/php.md
.NETstacks/dotnet.md
Pythonstacks/python.md
Dart and Flutterstacks/dart-flutter.md

Core principles

Load the matching file when a job needs more than the summary here.

TopicFile
Dependency direction, ports, composition root, crossing boundariescore/dependency-rule.md
Right-sizing: simple by default, thresholds to upgradecore/right-sizing.md
Entities, value objects, aggregates, bounded contextscore/domain-modeling.md
Components, cohesion and coupling, humble objectscore/components-and-boundaries.md
Naming, folder layout, screaming structurecore/naming-and-layout.md
Testing per layer and architecture testscore/testing-architecture.md
Quality attributes, trade-offs, system designcore/quality-attributes.md
Anti-pattern catalog with symptoms and fixescore/anti-patterns.md

Rules that hold in every style

  1. Follow the project first. Detect before prescribing. Do not rewrite a working structure to match a favorite pattern; move one slice at a time.
  2. Right-size. Use the simplest structure that keeps the rules intact. Upgrade when a measurable pain appears, not in anticipation.
  3. Dependencies point inward. The inside defines the abstractions it needs; the outside implements them.
  4. The core knows no framework. Domain and use-case code import no web, ORM, queue or SDK types. Adapters stay thin. One composition root wires everything.
  5. Name business intent. PlaceOrder, not updateOrder. Folders should show what the system does before they show what it is built with.
  6. One aggregate per transaction. Inside an aggregate, consistency is immediate. Between aggregates, use IDs and events.
  7. Abstract only where it pays. A port needs volatility, a test seam or a team boundary. Share code only after two real consumers prove identical meaning.
  8. Make claims checkable. Back structure with scan output, architecture tests and diagrams derived from the code, each with file paths.
  9. Record the decision with its trade-off through write-adr when requested or required by repository convention.
  10. Verify before claiming. Use the verify gate: run the scan and tests, read the output, then say what holds.

Output by job

Detect returns a style, a confidence, evidence with paths, deviations and violation candidates. Select returns one recommendation, its reasons, what would change it, and an ADR. Build returns the structure and code plus the check that proves the boundaries hold. Evaluate returns a scored report and a prioritized roadmap. Migrate returns phases, a rollback path and the first slice. Document returns diagrams and records grounded in paths.

Related skills

  • codebase-learner: you need facts about the current system first.
  • super-tech-blueprint: the style is chosen and the stack is not.
  • challenge-me: stress-test the choice before you commit to it.
  • safe-refactor: move an existing codebase toward the chosen style, one safe step at a time.
  • super-nodejs: build the chosen style in a Node service.

Done when

  • The job, style and stack were named, and only the guides they need were opened.
  • Recommendations fit the detected project, or state why they deviate.
  • Dependency direction was checked with scripts/arch-scan.mjs check or an architecture test, and the result was read.
  • Any decision is recorded with its trade-off, and any claim names the file it came from.

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.