agentleFS
HashLipsHashLips/agent-skills/skills/capability-architecture/SKILL.md

capability-architecture

Skill29 starsChanged 7 months agoMITView on GitHub

Design software systems around capabilities, clear boundaries, and layered responsibilities to reduce coupling and improve long-term maintainability, security, and observability at trust boundaries. Use when designing new architecture, refactoring for modularity, defining module contracts, evaluating system structure, or hardening authorization, data handling, and operational visibility across frontend, backend, or service-based applications.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    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:

    When designing or refactoring architecture:

    line 23
  2. Distinctive:

    Keep dependency direction inward toward domain logic.

    line 38
  3. Distinctive:

    Keep presentation and transport layers thin.

    line 39
  4. Distinctive:

    Keep infrastructure replaceable through adapters.

    line 40
  5. Distinctive:

    Keep logs structured and safe with correlation context and without secret leakage.

    line 47
  6. Distinctive:

    Avoid framework/database leakage into domain logic.

    line 56
  7. Distinctive:

    Document known anti-pattern risks and mitigations.

    line 57
  8. Distinctive:

    Use this skill when:

    line 76

≈ “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

Capability Architecture

Design systems that remain adaptable, modular, and maintainable by organizing software around capabilities, boundaries, contracts, and layered responsibilities.

Core Rules

Always separate:

  • what the system does
  • how it is displayed
  • how it is stored
  • how it is called

This keeps business logic portable and prevents tight coupling to frameworks, transport, and infrastructure.

Workflow

When designing or refactoring architecture:

  1. Identify business capabilities
  2. Define module boundaries per capability
  3. Establish explicit contracts between modules
  4. Define security and trust boundaries per capability (identity, authorization, sensitive data, validation)
  5. Define observability boundaries per capability (logs, metrics, traces, correlation)
  6. Assign responsibilities by layer
  7. Isolate external systems behind adapters
  8. Prevent cross-layer and cross-module leakage
  9. Compose the system from capability modules

Non-Negotiable Rules

  • Organize by capabilities, not technical artifact type.
  • Keep dependency direction inward toward domain logic.
  • Keep presentation and transport layers thin.
  • Keep infrastructure replaceable through adapters.
  • Communicate between modules through contracts only.
  • Introduce shared abstractions only after reuse is proven.
  • Enforce authorization at capability entry points, not only one outer transport layer.
  • Validate untrusted input at trust boundaries; keep domain/application logic on safe explicit inputs.
  • Classify sensitive data and secrets; keep secret handling in infrastructure, not domain rules.
  • Define capability-level observability signals at entry, success, and failure boundaries.
  • Keep logs structured and safe with correlation context and without secret leakage.

Output Contract

Architectures produced with this skill should:

  • Define clear capability ownership.
  • Define boundaries and contracts for interactions.
  • Show explicit layer responsibility split.
  • Avoid framework/database leakage into domain logic.
  • Document known anti-pattern risks and mitigations.
  • State trust boundaries, authorization expectations, and sensitive data handling per capability where relevant.
  • Define observability expectations (events, metrics, trace points, correlation IDs) per capability where relevant.

Reference Index

  • Core separation principle; read first to ground all decisions: references/architecture-principles.md
  • Layer responsibilities and boundaries; read when assigning logic to domain/application/infrastructure/presentation: references/layering-model.md
  • Capability ownership model; read when defining module structure and ownership: references/capability-modules.md
  • Contract-first interaction rules; read when defining interfaces, commands, queries, or events: references/boundary-contracts.md
  • Dependency direction and coupling constraints; read when validating imports and layer isolation: references/coupling-rules.md
  • Reuse progression strategy; read before extracting shared abstractions: references/reuse-guidelines.md
  • Common failure patterns and mitigations; read during reviews and refactors: references/anti-patterns.md
  • Security at boundaries (authz, validation, secrets, sensitive data); read when defining contracts, entry points, or threat-sensitive capabilities: references/security.md
  • Observability at boundaries (logging, metrics, traces); read when defining operational visibility and debugging paths for capabilities: references/observability.md
  • Step-by-step architecture workflow; read when executing a new design from scratch: references/implementation-process.md

When To Use This Skill

Use this skill when:

  • Designing new system architecture.
  • Refactoring an existing codebase for modularity.
  • Structuring frontend, backend, or service-based systems.
  • Defining contracts and boundaries across modules.
  • Enforcing long-term maintainability practices.
  • Aligning security controls with capability boundaries and contracts.
  • Designing reliable operational visibility for capability behavior in production.

This skill is framework-agnostic and pairs well with framework-specific implementation skills.

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.