agentleFS
maxi3777maxi3777/claritykit/skills/clarify-data/SKILL.md

clarify-data

Skill0 starsChanged 3 months agoMITView on GitHub

Define what the system knows and what crosses its boundaries — a conceptual entity diagram, field-level ER + YAML contract sheet when persistence exists, endpoint map / cross-boundary sequences when interfaces exist; error taxonomy cross-checked against failure scenarios. Invoke ONLY when the user names clarify-data or clarity-flow enters the data step; never self-activate from a data-model remark.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    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:

    Enter: when the system persists anything OR exposes any interface (API, file format, IPC, import/export, cross-process events).

    line 14
  2. Distinctive:

    Never split one boundary's contract across locations.

    line 24
  3. Distinctive:

    every error an operation can produce ↔ a failure scenario that consumes it (from the behavior step, if run): errors with no consumer get …

    line 68
  4. Distinctive:

    every failure scenario with no named error gets one.

    line 70
  5. Distinctive:

    Run this check before presenting.

    line 71
  6. Very specific:

    All artifacts live in the staging dir (clarity root).

    line 97
  7. Distinctive:

    Every conceptual entity is named something the user actually says (no "ContentAggregationService").

    line 110
  8. Very specific:

    Every maybe/maybe-many field has an approved absent_means.

    line 112

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

clarify-data — entities, fields, and boundaries

Answers: what must the system remember (and who owns each concept), and what exactly crosses every boundary — fields, operations, errors. This is the stage where "may be absent" stops being vague and becomes a decided claim.

Entry / skip

  • Enter when the system persists anything OR exposes any interface (API, file format, IPC, import/export, cross-process events). Almost every real system does.
  • Skip — recorded, never silent — only when stateless AND interface-free (a pure in-memory transform). Say the skip out loud; it is rarer than it feels.

Artifacts (project-level in docs/clarity/data/)

The contract sheet lives at docs/clarity/data/contracts.yaml — UNLESS a contract is owned by exactly one behavior module (e.g. that module's private file format), in which case it may live at docs/clarity/behaviors/<name>/contracts.yaml instead. Never split one boundary's contract across locations.

ArtifactStatusTrigger
conceptual entity diagram (erDiagram, relationships only, NO attribute blocks; entity names + relationship labels in the user's language)necessarythe system persists anything — the user reviews THIS diagram; it forces: what exists, what connects to what, who owns each concept. > ~12 entities → split by domain. Interface-only systems (no persistence): optional — contracts + endpoint map carry the structure
contracts.yaml (the contract sheet below)necessarypersistence or any interface exists
field-level erDiagram (PK/FK, cardinality, attribute blocks)necessarypersistence exists — derived FROM contracts.yaml; implementation-facing, the user need not read it line by line
API endpoint map (flowchart: gateway → modules → routes + purpose)conditionalthe system exposes an API to a client or third party. It answers "which endpoints exist"; field-level request/response detail lives in contracts.yaml, NOT in the diagram
cross-boundary sequenceDiagramconditionaleach external integration with failure/retry semantics: decides timeout, retry policy, idempotency, and what the user sees when the far end is dead
information-flow diagram (flowchart: each class of information — where it comes from, where it is stored, who/what can see it)optionalprivacy / local-first / sync decisions matter; an ER diagram cannot express this
classDiagramoptionalin-memory domain logic (not storage) is genuinely complex

Optional diagrams pass the "which decision does this force" test when proposed; default ≤ 2 per module.

The contract sheet (contracts.yaml)

entities:
  <entity>:                       # user-language concept, matches the conceptual diagram
    owner: <component/boundary>   # who owns its truth
    fields:
      <field>: { type: <type>, cardinality: one|maybe|many|maybe-many,
                 absent_means: <one line — required for maybe / maybe-many> }
operations:                       # per boundary — what crosses it
  <operation>:
    boundary: <api|ipc|file|internal>
    input:  { <field>: <type>, ... }
    output: { <field>: <type>, ... }
    errors: [ <error_id>, ... ]
errors:
  <error_id>:
    meaning: <one line>
    user_sees: <what the user experiences>   # required when the error can surface —
                                             # the validator WARNS; resolve it during
                                             # the cross-check, don't leave it hanging

Optionality is where hidden decisions live. "May be absent" is a behavioral claim about every consumer — each maybe/maybe-many field needs an absent_means answer the user approves (usually via a concrete scenario that exercises the absence).

The error-taxonomy cross-check (both directions, mandatory)

  • every error an operation can produce ↔ a failure scenario that consumes it (from the behavior step, if run): errors with no consumer get cut;
  • every failure scenario with no named error gets one. Run this check before presenting; report the result in one line.

Method

  1. Batch-interview entities and boundaries (what must be remembered? what crosses out? what comes in?). Draw the conceptual entity diagram first and get it approved — it is the cheapest artifact to correct.
  2. Write contracts.yaml per boundary; derive the field-level ER from it (quoted relationship labels; entity names in English or the user's language — both verified to parse on the pinned mermaid).
  3. Conditional/optional artifacts per triggers above.
  4. Error-taxonomy cross-check, then clarity publish (check-then-build). Follow references/mermaid-safe-syntax.md and references/diagram-selection.md (two levels up). %% title: every diagram.
  5. Iterate until approved. Note for hand-off: the implementing agent consumes contracts.yaml as ground truth — it is the artifact this step exists to produce.

Modifying existing artifacts

contracts.yaml is the source of truth; the field-level ER is derived. Change order: edit contracts.yaml → clarity validate → regenerate the field-level ER (never hand-diverge it) → clarity publish. Mutating an existing field's shape is a back-jump-level decision (existing consumers break) — surface it, don't slip it in.

Paths (derived, never chosen)

All artifacts live in the staging dir (clarity root). All tools via the clarity CLI; if not found, retry once after export PATH="$HOME/.local/bin:$PATH", then stop and report — never improvise alternatives.

Presentation contract

The user reviews the conceptual diagram and the error taxonomy ("what the user sees" per failure class) in the conversation; the field-level ER and contracts.yaml are implementation-facing archives. Never "see the yaml" for decisions — surface each decision (ownership, optionality semantics, error surface) as a concrete scenario.

Quality bar

  • Every conceptual entity is named something the user actually says (no "ContentAggregationService").
  • Every maybe/maybe-many field has an approved absent_means.
  • Error cross-check passed in both directions; result stated.
  • Field-level ER is derived from (never contradicts) contracts.yaml.

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.