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

dept-architecture

Skill2 starsChanged 6 days agoMITView on GitHub

Architecture. FIRST for structure and design: \"refactoriza\", \"dónde pongo esto\", \"estructura de carpetas\", \"nuevo módulo\", \"migrar de X a Y\", ADR. Owns every L3.

We split this skill into the rules it gives an agent

19 rules. About 0 are common, 18 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    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. Distinctive:

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

    line 25
  3. Distinctive:

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

    line 28
  4. Very specific:

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

    line 32
  5. Distinctive:

    Place new code (L1/L2)

    line 38
  6. Distinctive:

    Follow the dependency rules of the architecture profile.

    line 50
  7. Distinctive:

    Never import between sibling modules/features directly.

    line 52
  8. Distinctive:

    Never let inner or core layers depend on outer, UI or feature layers.

    line 53
  9. Distinctive:

    Never introduce a second architectural style into a project without an ADR.

    line 54
  10. Distinctive:

    Prefer: apply Open/Closed through extension points that already exist.

    line 59
  11. Distinctive:

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

    line 60
  12. Distinctive:

    Prefer composition over inheritance.

    line 61
  13. Distinctive:

    Prefer: apply DRY to knowledge, not coincidental similarity.

    line 62
  14. Distinctive:

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

    line 63
  15. Distinctive:

    Prefer: split files over roughly 300 lines or mixing concerns (presentation, logic, data access).

    line 64
  16. Distinctive:

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

    line 65
  17. Distinctive:

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

    line 66
  18. Distinctive:

    Never add abstractions, wrappers or patterns "just in case".

    line 67
  19. Distinctive:

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

    line 68

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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. Rules: 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 · simplify DoD: Conformance checklist passed with file:line evidence, ADR written at L3.

Entry

Guest (no Waymark block in context) → ../waymark/references/coexistence.md §3. 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).

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

In procedures.md (same folder), one section per task:

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

Rules

Architecture conformance

  • Identify the architecture before placing or moving code, from the repo itself (W convention): a profile is a reference, never the project's rule.
  • A structural change that contradicts the project's convention is never recommended; it is asked in its own window.
  • Follow the dependency rules of the architecture profile; a violation is a bug, not a style choice.
  • Depend on another module only through its public contract (index/export file, interface, port, event).
  • Never import between sibling modules/features directly; move the contract to the shared layer or communicate via events/ports.
  • Never let inner or core layers depend on outer, UI or feature layers.
  • Never introduce a second architectural style into a project without an ADR.

Design system principles (all architectures)

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

Tools

CapabilitySkill / MCP / AgentWhenLevel
memoryWaymark memory: the pack the hook hands over, W memory / tasks, and engram search (or mem_search)Prior decisions and root causes; what you learn goes in the Cierre's Aprendido (the hook saves it to engram)L1
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

  • 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 in the ADR and the Cierre's Aprendido (the hook saves it to engram) 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).

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.