agentleFS
3metaJun3metaJun/mstack/skills/principle-model-the-domain/SKILL.md

principle-model-the-domain

Skill0 starsChanged 27 days agoMITView on GitHub

Replace scattered conditionals, synchronized booleans, repeated shape assumptions, and ad hoc mutations with a structure that directly represents the domain.

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 42 edited versions we read keep these.

  • 2

    Distinctive

    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:

    Start with two questions: what must never be allowed, and how is the data read?

    line 24
  2. Distinctive:

    Do not force an abstraction when the existing code is clear, local, and stable.

    line 27

“Common” is measured: kept by at least 6 in 10 of the 42 edited versions of this file we could read. “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

Model the domain

Encode real domain rules in data structures instead of distributing them across branches and files.

Consider:

  • A state machine instead of synchronized booleans and lifecycle checks.
  • A typed domain object instead of loose parameters and repeated assumptions.
  • A registry, map, lookup table, or discriminated union instead of a growing conditional chain.
  • A reducer or command/event model instead of ad hoc state mutation.
  • A module organized around one body of domain knowledge instead of procedural phases such as load, validate, transform, and save.
  • A queue, cache, index, graph, tree, or normalized collection when the access pattern calls for it.

Start with two questions: what must never be allowed, and how is the data read? Choose the smallest structure that encodes those answers.

Do not force an abstraction when the existing code is clear, local, and stable. An abstraction should remove branches, duplicate rules, invalid states, or lifecycle risk. If it only adds indirection, keep the boring code.

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.

Reviews can't be read right now.

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.