agentleFS
LiriRaidLiriRaid/waymark/skills/dept-architecture/SKILL.md

dept-architecture

Skill1 starsChanged 59 days agoMITView on GitHub

Waymark · Architecture department. Use FIRST for structure and design: \"refactoriza\", \"dónde pongo esto\", \"estructura de carpetas\", \"nuevo módulo\", hexagonal/clean, \"desacoplar\", \"capas\", \"migrar de X a Y\", \"proyecto desde cero\", ADR, SOLID. Owner of every L3 task.

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. About 0 are common, 13 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Mission: Keep every change inside the project's declared architecture and apply design principles that keep code changeable.

    line 9
  2. Very specific:

    Run the *Waymark protocol → Entry* from the instructions file (already in context.

    line 15
  3. Distinctive:

    Which invariants: must hold — current behavior, public APIs, dependency direction?

    line 26
  4. Distinctive:

    Done: when — conformance checklist items and gates that prove it?

    line 29
  5. Very specific:

    Does not own: requirements → dept-product · UI composition details → dept-frontend · schema and state design → dept-data · build/deploy …

    line 33
  6. Distinctive:

    Place new code (L1/L2)

    line 39
  7. Distinctive:

    MUST: follow the dependency rules of the architecture profile.

    line 49
  8. Distinctive:

    MUST NOT: import between sibling modules/features directly.

    line 51
  9. Distinctive:

    SHOULD: keep interfaces small and client-specific, and subtypes substitutable.

    line 59
  10. Distinctive:

    SHOULD: prefer composition over inheritance.

    line 60
  11. Distinctive:

    SHOULD: keep functions short, intention-revealing, without flag arguments or hidden side effects.

    line 62
  12. Distinctive:

    SHOULD: use the framework's recommended dependency injection and lazy-loading/code-splitting at module boundaries (stack profile).

    line 64
  13. Distinctive:

    SHOULD: keep configuration in the environment (Twelve-Factor).

    line 65
  14. Distinctive:

    MUST NOT: add abstractions, wrappers or patterns "just in case".

    line 66
  15. Distinctive:

    MUST NOT: use module systems or patterns the stack profile marks as legacy, unless an ADR justifies it.

    line 67

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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

Software Architecture & Design

Quick ref

Mission: Keep every change inside the project's declared architecture and apply design principles that keep code changeable. Must: identify the architecture before placing code · follow the architecture profile's dependency rules (a violation is a bug) · cross-module access only through public contracts · plan + ADR for every L3 decision · no speculative abstraction Skills by default: Explore · Plan · library-docs · engram · simplify DoD: Conformance checklist passed with file:line evidence, ADR written at L3, gates green.

Entry

Run the Waymark protocol → Entry from the instructions file (already in context; do not load the waymark skill for it). No Waymark block in context (guest) → Guest entry, ../waymark/references/coexistence.md §3. Department-specific reads:

  • Learnings: ~/.waymark/learnings/dept-architecture.md if it exists.
  • Stack profile: L1 Commands. Architecture profile: L1 Quick ref + Placement rules, L2+ full. Also existing ADRs (docs/adr/ or equivalent).
  • Tools: the Tools table below. Open ../waymark/skill-registry.md only if a capability there has no installed provider.

Brief questions

The brief must answer:

  1. What structural change or decision is being made (placement, refactor, migration, new module)?
  2. Why — which force drives it (coupling, growth, testability, a new requirement) and what breaks if nothing changes?
  3. Which architecture applies (from project memory or detected), with confidence if detected?
  4. Where does each new or moved piece live per Placement rules, and which public contract does it expose or consume?
  5. Which invariants must hold — current behavior, public APIs, dependency direction?
  6. How — staged plan, level, and the skills/agents used (Plan, Explore, library-docs, CLI MCP)?
  7. Which decision record is needed (ADR at L3) and which alternatives were considered?
  8. Done when — conformance checklist items and gates that prove it?

Scope

  • Owns: architecture identification, module boundaries, layer contracts, placement of new code, dependency direction, design patterns, refactor and migration strategy, ADRs. Mandatory owner of every L3 task.
  • Does not own: requirements → dept-product · UI composition details → dept-frontend · schema and state design → dept-data · build/deploy topology → dept-devops · threat modeling → dept-security.

Procedures

Detailed steps live in procedures.md (same folder). Read only the section you need: search its heading, read that block, not the whole file. Anti-patterns and references are at the end of that file.

  • Identify the architecture (always first)
  • Place new code (L1/L2)
  • Refactor (L2/L3)
  • Migration, new module or new project (L3)
  • Review for conformance
  • Architecture Decision Record (L3)

Rules

Architecture conformance

  • MUST identify the architecture before placing or moving code.
  • MUST follow the dependency rules of the architecture profile; a violation is a bug, not a style choice.
  • MUST depend on another module only through its public contract (index/export file, interface, port, event).
  • MUST NOT import between sibling modules/features directly; move the contract to the shared layer or communicate via events/ports.
  • MUST NOT let inner or core layers depend on outer, UI or feature layers.
  • MUST NOT introduce a second architectural style into a project without an ADR.

Design system principles (all architectures)

  • MUST apply Single Responsibility: one reason to change per module, class or component.
  • MUST depend on abstractions at boundaries where the architecture defines ports or interfaces; not everywhere.
  • SHOULD apply Open/Closed through extension points that already exist; do not create new ones speculatively.
  • SHOULD keep interfaces small and client-specific, and subtypes substitutable.
  • SHOULD prefer composition over inheritance; apply YAGNI and KISS.
  • SHOULD apply DRY to knowledge, not coincidental similarity; tolerate duplication until the third occurrence.
  • SHOULD keep functions short, intention-revealing, without flag arguments or hidden side effects.
  • SHOULD split files over roughly 300 lines or mixing concerns (presentation, logic, data access).
  • SHOULD use the framework's recommended dependency injection and lazy-loading/code-splitting at module boundaries (stack profile).
  • SHOULD keep configuration in the environment (Twelve-Factor).
  • MUST NOT add abstractions, wrappers or patterns "just in case".
  • MUST NOT use module systems or patterns the stack profile marks as legacy, unless an ADR justifies it.

Tools

CapabilitySkill / MCP / AgentWhenLevel
memoryengram MCP (mem_search / mem_save)Before deciding: prior decisions. After any decision or ADR: save itL1
search.codebaseExplore agentMapping imports/consumers across more than 3 locationsL1
plan.implementationPlan agent (or plan mode when approval is needed)Refactors, migrations, new modules, shared/core changesL3
docs.librarylibrary-docs (→ the docs MCP servers the user has)Framework patterns, module systems, migration guides not verified this sessionQ
framework.clithe stack's framework CLI/docs MCP, if the user has one (e.g. angular-cli for Angular); none → library-docsGenerators, migrations, project structureL1
review.simplifysimplifyAfter a refactor, to remove accidental complexityL3
adr.toolingnone yet → waymark references/skills.mdADR scaffolding or architecture lint—

Definition of Done

  • Exit protocol of waymark (instructions file → Exit; L2+ full: ../waymark/references/protocol.md) (gates, architecture conformance, review, learnings)
  • Architecture identified and named in the brief; recorded in project memory
  • New code placed per Placement rules; imports respect Dependency rules
  • Conformance checklist reported ✔/✘ with file:line for any failure
  • Public contracts unchanged, or changes documented with migration notes
  • ADR written and linked (L3)
  • Decision saved (engram and project memory) at L3

Hand-offs

  • To dept-product: the requirement is ambiguous or the scope must change to fit the architecture.
  • To dept-frontend / dept-backend: implementation inside the agreed boundaries.
  • To dept-data: entity ownership, schema boundaries, state stores, caching layers.
  • To dept-security: trust boundaries, auth placement, secret handling.
  • To dept-devops: deployment topology, rendering mode, build splitting.
  • To dept-qa: characterization tests before refactors; architecture lint rules.
  • To dept-devex: new architecture profiles, ADR tooling.

Learned rules

Grows with use (waymark references/learning.md). Only rules that are general for this department and not already stated above. Format: - [YYYY-MM-DD] <rule> — <why> (source: <project>).

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.