agentleFS
jhonatan-oliveiradevjhonatan-oliveiradev/agent-skills/skills/designing-software-boundaries/SKILL.md

designing-software-boundaries

Skill1 starsChanged 3 months agoMITView on GitHub

Use when modules, services, packages, or teams have unclear ownership, cyclic dependencies, shared state, change coupling, or responsibilities that are difficult to evolve independently.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    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:

    Look for things that change together.

    line 13
  2. Distinctive:

    Look for costly coupling. Flag cycles, shared mutable state, cross-module table writes, internal type leakage, broad utility modules, and …

    line 14
  3. Distinctive:

    Test from the outside. Boundary tests should prove observable contracts while allowing internal structure to change.

    line 19
  4. Distinctive:

    Prefer high cohesion inside a boundary and low knowledge across boundaries.

    line 30

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

Designing Software Boundaries

Core principle

A useful boundary groups cohesive responsibility and limits what the rest of the system must know. Draw boundaries from behavior, ownership, state, and change coupling before drawing them from folders or deployment topology.

Boundary workflow

  1. Map the current system through entry points, important workflows, owned data, external integrations, and dependency directions.
  2. Look for things that change together. Features, rules, state, and tests that repeatedly move in the same changeset are evidence of cohesion.
  3. Look for costly coupling. Flag cycles, shared mutable state, cross-module table writes, internal type leakage, broad utility modules, and callers that know implementation details.
  4. Propose a responsibility statement for each boundary: what it owns, what it exposes, and what it explicitly does not own.
  5. Define a narrow public contract. Other modules should depend on stable capabilities, not internal storage, framework objects, or private classes.
  6. Make dependency direction intentional. A boundary may call outward through a contract it owns; avoid bidirectional knowledge and hidden callback chains.
  7. Assign state and write ownership. If two boundaries must coordinate one mutation, make the consistency requirement explicit rather than silently sharing persistence internals.
  8. Test from the outside. Boundary tests should prove observable contracts while allowing internal structure to change.

Boundary quality checks

A proposed boundary is weak when:

  • its responsibilities cannot be summarized without “and” repeatedly;
  • most changes require editing both sides;
  • consumers import internal files or database structures;
  • ownership is ambiguous;
  • runtime communication is much more frequent than the supposed independence warrants;
  • the boundary exists only because the repository has a folder or technical layer with that name.

Prefer high cohesion inside a boundary and low knowledge across boundaries. Do not create a network boundary merely to enforce modularity that can be enforced inside one deployable.

Relation to API boundaries

This method defines structural ownership and dependency boundaries. When a Node.js endpoint also crosses an external trust or authorization boundary, use building-reliable-node-api-boundaries for transport, validation, authorization, retry, and failure semantics.

Verification

For each boundary, trace one normal flow and one change scenario. Confirm that the public contract is sufficient, internal details remain private, ownership is clear, and the change does not require unrelated consumers to understand the implementation.

References

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.