AGENT SKILL

domain-model

Build and sharpen a repository's domain model. Use when discussing codebase terminology, writing or editing a CONCEPTS.md, or recording, editing or deleting a decision record.

License 许可
Apache-2.0
所属仓库
lyngon/devkit
最近更新
2026-11-14
Stars
★ 0
Forks
0

01 前言 Front Matter

name
domain-model
description
Build and sharpen a repository's domain model. Use when discussing codebase terminology, writing or editing a CONCEPTS.md, or recording, editing or deleting a decision record.

02 资源文件 2

03 SKILL.md 正文

Domain modeling

Actively build and sharpen the repository's domain model as you design. This is the active discipline: challenging terms, inventing edge-case scenarios, and writing the glossary and decisions down the moment they crystallise. Merely reading CONCEPTS.md for vocabulary is not this skill; that is a one-line habit any skill can do. This skill is for when you are changing the model, not just consuming it.

File structure

Most repositories have a single context:

/
├── CONCEPTS.md
├── docs/
│   └── decisions/
│       ├── orders-are-event-sourced.md
│       └── postgres-holds-the-write-model.md
└── <packages>

If the root CONCEPTS.md has a ## Contexts section, the repository has several contexts and the root file is a map pointing to where each one lives:

/
├── CONCEPTS.md                       ← the map
├── docs/
│   └── decisions/                    ← repository-wide decisions
├── <package owning Ordering>/
│   ├── CONCEPTS.md
│   └── docs/decisions/               ← context-specific decisions
└── <package owning Billing>/
    ├── CONCEPTS.md
    └── docs/decisions/

With the Lyngon structure

The package that owns a context is its core library, libs/<ctx>/; adapters and apps of the context have no glossary of their own.

Create files lazily: only when you have something to write. If no CONCEPTS.md exists, create one when the first term is resolved. If no docs/decisions/ exists, create it when the first decision record is needed.

During the session

Challenge against the glossary

When the user uses a term that conflicts with the existing language in CONCEPTS.md, call it out immediately. "Your glossary defines 'cancellation' as X, but you seem to mean Y. Which is it?"

Sharpen fuzzy language

When the user uses vague or overloaded terms, propose a precise canonical term. "You're saying 'account': do you mean the Customer or the User? Those are different things."

Discuss concrete scenarios

When domain relationships are being discussed, stress-test them with specific scenarios. Invent scenarios that probe edge cases and force the user to be precise about the boundaries between concepts.

Cross-reference with code

When the user states how something works, check whether the code agrees. If you find a contradiction, surface it: "Your code cancels entire Orders, but you just said partial cancellation is possible. Which is right?"

Update CONCEPTS.md inline

When a term is resolved, update CONCEPTS.md right there. Don't batch these up: capture them as they happen. Use the format in CONCEPTS-FORMAT.md, unless the repository has docs/conventions/concepts.md, which overrides it.

CONCEPTS.md should be totally devoid of implementation details. Do not treat it as a spec, a scratch pad, or a repository for implementation decisions. It is a glossary and nothing else.

Offer a decision record by the admission test

Offer to record a decision only when it passes this test:

Write it down only when a competent agent, seeing just the files it opened, would plausibly contradict it, wrongly, with nothing failing. When a check can fail instead, write the check.

If it does not pass, skip the record. Use the format in DECISION-RECORD-FORMAT.md, unless the repository has docs/conventions/decision-record.md, which overrides it.

04 同仓库更多 Skills

lyngon
lyngon/devkit

unslop

Remove AI writing patterns from prose and give it a voice. Use whenever writing or editing non-code text (docs, READMEs, decision records, posts, commit messages, PR descriptions), before handing it over, and on request: "unslop", "humanize", "make this sound human", "clean up this writing", "edit for voice", "de-AI this text".

★ 0
lyngon
lyngon/devkit

technical

Layered technical-writing standard: Diátaxis structure, Google developer style sentences, STE instruction rules, Global English syntax. Use before writing or reviewing docs, RFCs, readmes, PR descriptions, or commit messages, every time, however small the document.

★ 0
lyngon
lyngon/devkit

simpler

Restate the last message in plain human language, with no jargon. Use when the reader did not follow the last message and says so: "bro", "say that simpler", "in plain words", "no jargon".

★ 0
lyngon
lyngon/devkit

init

Set up a fresh repository, or adopt an existing one, to Lyngon conventions. Interviews the owner relentlessly about purpose, failure modes, audiences, stack and constraints, then writes INTENT.md, .claude/CLAUDE.md, README.md, CONCEPTS.md, decision records, devenv, git hooks, CI and every package in the kind-first Lyngon layout. User-invoked only.

★ 0
lyngon
lyngon/devkit

add-package

Create a package in a Lyngon repository in the directory its kind decides (apps/, libs/, contracts/, tools/, infra/), with README.md, devenv.nix and the layer lint, and register it in its workspace and devenv. Use whenever a new app, service, CLI, library, adapter, contract, schema, tool, infra module or environment is needed, including when one feature needs several packages. Never create a package by hand.

★ 0
lyngon
lyngon/devkit

index

The index of Lyngon's principles, one line per principle saying when it applies and what it demands, each with a file under references/. Invoke before work that takes judgment, such as a design choice, a refactor, a bug fix, a test, a measurement, a script, a document or a question to the owner; then read the file of each principle that applies.

★ 0