agentleFS
augments-labsaugments-labs/sdlc-skills/skills/design/data-model/SKILL.md

data-model

Skill1 starsChanged 4 months agoMITView on GitHub

Defines domain concepts, relationships, state transitions, and invariants before implementation. Use when any of them needs to be introduced, changed, or removed, including stateless rules and pricing engines. Skip when those semantics stay unchanged or are already settled for this task.

5 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use api-contract and design-system.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • damienlaineSkill

    api-contract

    This skill should be used when the user asks about "API contract", "api-contract.md", "shared interface", "TypeScript interfaces", "request response schemas", "endpoint design", or needs guidance on designing contracts that coordinate backend and frontend agents.

    Also in 3 projects that use this

  • AnthropicSkill

    design-system

    Audit, document, or extend your design system. Use when checking for naming inconsistencies or hardcoded values across components, writing documentation for a component's variants, states, and accessibility notes, or designing a new pattern that fits the existing system.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 5 edited versions we read keep these.

  • 1

    Distinctive

    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:

    Skip: when domain concepts, relationships, transitions, and invariants are unchanged or already settled for this task.

    line 13
  2. Very specific:

    Write the immutable section to .sdlc-skills/designs/{{YYYY-MM-DD}}-{{topic}}.md or the user-set path, preserving approved sections around …

    line 49
  3. Very specific:

    Ask through the harness's user-input action when one exists, else print this block.

    line 68

“Common” is measured: kept by at least 6 in 10 of the 5 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

Data Model

Model the domain before the code that manipulates it. A domain model is more than columns — it's the concepts, how they relate, the transitions they may make, and the invariants that must always hold. That is true whether or not any of it is ever stored.

When to use

  • The work introduces or changes domain concepts — persistent entities, or the in-memory ones a stateless engine computes over (pricing, rules, workflow).
  • Skip when domain concepts, relationships, transitions, and invariants are unchanged or already settled for this task. Existing concepts can still need remodeling; adding no new entity is not a skip.

Step 1: Model the domain

Open assets/data-model-section.md before the steps below fill it in.

  1. Name one concept per entity in the domain's language: what it represents, the words experts use. This vocabulary is a deliverable consumed downstream without redefinition.
  2. List each entity's attributes with type and meaning. Write null semantics and allowed enumeration values, not just the column.
  3. Map relationships: cardinality, ownership, what cascades on delete.
  4. Draw state transitions per concept with a lifecycle. An undrawn transition is one the code permits by accident.
  5. Per invariant that must never break, name the constraint, transaction boundary, test, or reconciliation enforcing it, and who owns failures.

Step 2: Lenses, storage, evidence

  1. Apply each of the template's eight operational lenses that matches the risk. Omitted lens → a skip record with that row's fields. Never drop one as "inapplicable" without it.
  2. Anything persists → note denormalized or cached data with source of truth, update boundary, drift repair. Existing-model change → fill the classification block. On the ordinary route → define migration, mixed-version, rollback. Any answer off the ordinary route → record domain constraints; migration-strategy owns the contract.
  3. Trace representative reads, writes, transitions, concurrent operations, deletion, existing-data migration. Record the runnable query and result when one exists. Otherwise name the future gate and owner; never pretend it ran.

Step 3: Write and present

  1. Write the immutable section to .sdlc-skills/designs/{{YYYY-MM-DD}}-{{topic}}.md or the user-set path, preserving approved sections around it. Fill the header: identity, predecessor, approval rule, the location of its ledger (append-only, outside the design), stable ID delta.
  2. Present:

    {{Section}} {{path}} — version {{identity (per template)}}
    {{summary lines}}
    
    1. Approve and hand off to planning
    2. Request changes
    3. Reject
    4. Cancel
    
    Recommendation: {{option}} — {{one sentence}}.

    Ask through the harness's user-input action when one exists, else print this block; end the turn; clarifying-intent owns what closes it.

  3. Option 1, and every design section the work needs is approved → REQUIRED SUB-SKILL: invoke writing-plans against this version.

Gotchas

  • The eight operational lenses in Step 2 are counted, and an omitted one needs its own skip record — but the lenses themselves live in the template, not in this file. Working from memory instead of the template's list is how a lens gets skipped with no skip record, because nothing here tells you which eighth lens you forgot.
  • Cardinality has a steady-state value and a momentary one — during creation, before a required relationship holds, and during deletion, when a cascade fires into one. Step 1's cardinality mapping doesn't separate the two, so documenting only the steady state leaves the code free to do anything at those edges without that being a documented deviation.

See references/worked-example.md when a full domain needs modeling end to end at this level of rigor: null semantics, momentary vs lifetime cardinality, state transitions, invariants, denormalization.

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.