skills/architecture/SKILL.md
Plan how a system is structured — which layers, modules, or contexts exist and how code is laid out — driven by the forces at play, not by a fixed pattern. The default is to add no extra structure; structure is introduced only when complexity calls for it, and the chosen shape (Clean Architecture, DDD, DCI, or another) is judged in the moment. Use this skill when following a recorded structure in docs/architecture.md, or when deciding the structural shape for a non-trivial feature, a new module, or a restructuring — especially after a design-forces memo recommends a layered or partitioned structure.
npx skillsauth add elct9620/ai-coding-skills architectureInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill owns structural planning — how the system is organised. Two neighbouring concerns are different kinds of problem and stay separate:
A design-forces memo, when one exists, is the input to this skill: it carries the force signals that decide whether and what to structure. Principles (KISS, SOLID, DRY, YAGNI, fail-fast) are how every structure is implemented, never something a structure replaces.
Start from the position that the feature needs no architectural ceremony beyond what the framework already gives you. A framework is itself an architecture; following its grain plainly is a legitimate, often correct, answer. Structure earns its place only when forces make the absence of it more expensive than the cost of adding it.
Resist mapping a framework to a named style by reflex ("Rails, so DCI"; "Spring, so layers"). That is mechanical correspondence wearing a different hat — it bypasses the judgement that makes structure fit. The framework's nature is one input to the force judgement, not a lookup that pre-decides the answer.
docs/architecture.md is a deliberately cheap, maintainable signal. When it exists and covers the area being touched:
No fresh analysis — this is what makes a structural decision persist across features instead of being re-litigated every time.
When there is no record covering this area, or a revisit trigger has fired, the question is not "is docs/architecture.md missing?" — it is "is this now complex enough to need structural planning?"
Read the force signals — from the design-forces memo if present, otherwise a light read of the same lenses. Rule complexity, change rate, blast radius, and team fragmentation push toward structure; delivery pressure and code maturity pull back.
Forces are quiet → stay with the default: framework as-is, no extra structure.
Forces are loud → they surface as a concrete symptom. Recognise it, then read the technique that answers it (the reference explains how):
references/clean-architecture.mdreferences/ddd.mdreferences/dci.mdThese are starting points, not a menu; they compose, and a symptom matching none means reasoning from forces and principles directly.
After committing, record the decision so Mode A applies next time (see Recording below).
Pick once per package; it decides whether the source is the documentation or whether signatures must carry intent. Feeds the principles Commenting rules.
| Module type | Audience | Public symbols | |-------------|----------|----------------| | Application | Operators, end users | Source is the documentation | | Library / shared module | Other developers via IDE | Signatures carry doc comments stating intent | | Monorepo with both | Both | Decide per package, not per file |
A fresh Mode B decision should leave a trace, so the next feature reads it instead of re-deciding. Match the weight of the record to the weight of the decision:
docs/architecture.md (~6–10 lines): name in this project's vocabulary / when to apply / shape / canonical example / forces it resolves / revisit-if.docs/architecture.md when the choice sets a project-wide default (e.g. "layered with an inward dependency rule").docs/decisions/ only when the decision is large-blast-radius, multi-team, or hard to reverse.If docs/architecture.md does not exist and a structure was chosen, create it with the style declaration, a directory→structure mapping, and the dependency guidelines for the chosen technique.
| Criterion | Pass |
|-----------|------|
| Record respected | An existing structure in docs/architecture.md is followed without re-analysis; a fresh decision leaves a record sized to it (Patterns entry, style declaration, or ADR) |
| Structure earned | Default is no extra structure; it is added only on a loud force named as a symptom — never from a missing doc or a framework→style reflex |
| Boundaries follow the model | Context/module partitioning aligns with aggregate boundaries from domain-modeling |
| Dependency direction sound | If a layered/CA technique was chosen, dependencies point inward; no circular references |
| Principles as baseline | KISS / SOLID / DRY / YAGNI treated as how the structure is built, never as something it defers |
development
Surface design forces and lay out the option space — including framework defaults, scaffolds, and deferring — before committing to Clean Architecture, DDD, or any heavier pattern. Produces a Design Analysis Memo at the start of /write, /refactor, or non-trivial /fix. Make sure to use this skill whenever the user starts a non-trivial feature, restructures code, or asks "do we really need Clean Architecture / DDD / pattern X here".
development
Write tests using TDD (Red-Green-Refactor) and AAA pattern. Use for every new feature, behavior change, or bug fix. Covers unit, integration, and E2E test selection. Make sure to use this skill whenever the user asks to add tests, fix a bug (tests should come first), implement a feature with test coverage, or asks about what kind of tests to write — even for small one-line changes or trivial-looking fixes.
development
Prevent security vulnerabilities through threat modeling, trust boundary analysis, and defense in depth. Use when writing code that crosses trust boundaries, handles authentication or authorization, processes external input, manages secrets, or stores sensitive data. Make sure to use this skill whenever the user works on login flows, processes data from external sources, builds interfaces between systems, manages credentials, or writes code that moves data across trust zones — even for seemingly simple changes like accepting a new parameter or calling an external service.
development
Design database schemas and API contracts at system boundaries. Use when creating or modifying database tables, API endpoints, or data serialization formats. Make sure to use this skill whenever the user adds database migrations, designs REST/GraphQL APIs, creates DTOs, defines request/response shapes, or works on data serialization — even for adding a single column or endpoint.