agentleFS
manastalukdarmanastalukdar/ai-devstudio/skills/domain-context/SKILL.md

domain-context

Skill1 starsChanged 7 months agoMITView on GitHub

Create and maintain a CONTEXT.md domain glossary and ADRs for the project — establishes shared vocabulary between developers, domain experts, and AI. Use when starting a new project, refining domain language, or resolving terminology ambiguities.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Create and maintain the project's domain glossary (CONTEXT.md) and architecture decision records (docs/adr/).

    line 10
  2. Very specific:

    Create or update CONTEXT.md at the repo root (or within a bounded context directory for monorepos):

    line 27
  3. Distinctive:

    Only terms specific to this domain — not general programming concepts

    line 66
  4. Very specific:

    When the repo has multiple domains, create CONTEXT-MAP.md at root instead:

    line 72
  5. Very specific:

    Create docs/adr/ only when the first ADR is needed (lazy creation).

    line 96
  6. Very specific:

    When /grill-me, /deepen-modules, or /to-prd resolve terminology:

    line 117
  7. Very specific:

    Update CONTEXT.md immediately with the new term

    line 118
  8. Distinctive:

    Do not create documentation preemptively

    line 120
  9. Very specific:

    Early exit: If CONTEXT.md already exists and no arguments given, reads it and reports gaps — no full rewrite unless explicitly requested.

    line 146

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

Domain Context

Create and maintain the project's domain glossary (CONTEXT.md) and architecture decision records (docs/adr/).

Arguments: $ARGUMENTS - init to create from scratch, update <term> to add/refine a term, adr <decision> to record a decision, or blank to review and improve existing docs

Behavior

1. Detect Existing Structure

# Check what already exists
ls CONTEXT.md CONTEXT-MAP.md docs/adr/ 2>/dev/null
# Find any domain documentation
find . -name "CONTEXT.md" -not -path "*/node_modules/*" 2>/dev/null | head -5

2. CONTEXT.md Format

Create or update CONTEXT.md at the repo root (or within a bounded context directory for monorepos):

# {Context Name}

{One or two sentences: what this context is and why it exists.}

## Language

**Order**:
A customer's request to purchase one or more products.
_Avoid_: Purchase, transaction

**Invoice**:
A request for payment sent to a customer after delivery.
_Avoid_: Bill, payment request

**Customer**:
A person or organization that places orders.
_Avoid_: Client, buyer, account

## Relationships

- An **Order** produces one or more **Invoices**
- An **Invoice** belongs to exactly one **Customer**

## Example Dialogue

> **Dev:** "When a **Customer** places an **Order**, do we create the **Invoice** immediately?"
> **Domain expert:** "No — an **Invoice** is only generated once a **Fulfillment** is confirmed."

## Flagged Ambiguities

- "account" was used to mean both **Customer** and **User** — resolved: these are distinct concepts.

Rules for entries:

  • One preferred term per concept — list others under _Avoid_
  • One sentence max per definition — what it IS, not what it does
  • Only terms specific to this domain — not general programming concepts
  • Express relationships with cardinality where obvious
  • Include an example dialogue showing terms interacting naturally

3. Multiple Bounded Contexts (Monorepos)

When the repo has multiple domains, create CONTEXT-MAP.md at root instead:

# Context Map

## Contexts

- [Ordering](./src/ordering/CONTEXT.md) — receives and tracks customer orders
- [Billing](./src/billing/CONTEXT.md) — generates invoices and processes payments
- [Fulfillment](./src/fulfillment/CONTEXT.md) — manages warehouse picking and shipping

## Relationships

- **Ordering → Fulfillment**: Ordering emits `OrderPlaced` events; Fulfillment consumes them
- **Fulfillment → Billing**: Fulfillment emits `ShipmentDispatched`; Billing generates invoices
- **Ordering ↔ Billing**: Shared types for `CustomerId` and `Money`

Infer which structure applies from the codebase layout.

4. Architecture Decision Records

ADRs live in docs/adr/ with sequential numbering: 0001-slug.md, 0002-slug.md.

Create docs/adr/ only when the first ADR is needed (lazy creation).

ADR template (keep minimal — one paragraph is fine):

# {Short title of the decision}

{1–3 sentences: what's the context, what did we decide, and why.}

Only create an ADR when ALL THREE are true:

  1. Hard to reverse — meaningful cost to changing course later
  2. Surprising without context — a future reader would wonder "why on earth?"
  3. Real trade-off — genuine alternatives existed and one was chosen for specific reasons

ADR-worthy examples: architectural shape, integration patterns between contexts, technology choices with lock-in, deliberate deviations from the obvious path, constraints not visible in the code.

Not ADR-worthy: obvious choices, easily reversible decisions, things the code already makes clear.

5. Updating Inline During Other Skills

When /grill-me, /deepen-modules, or /to-prd resolve terminology:

  • Update CONTEXT.md immediately with the new term
  • Offer an ADR if the decision meets all three criteria above
  • Do not create documentation preemptively

6. Scan for Terminology Drift

# Find terms used inconsistently vs CONTEXT.md preferred vocabulary
# Example: if "Order" is preferred, look for usages of avoided aliases
grep -rn "purchase\|transaction" --include="*.md" --include="*.ts" \
  --include="*.py" . 2>/dev/null | grep -v node_modules | head -20

Report drift and offer to update CONTEXT.md or the code comments.

Examples

/domain-context init
/domain-context update "Order vs Purchase — settle the terminology"
/domain-context adr "use event sourcing for the Orders aggregate"
/domain-context        ← review and improve existing CONTEXT.md

Token Optimization

Expected range: 300–800 tokens (init/update), 100–200 tokens (adr), 200–500 tokens (review)

Early exit: If CONTEXT.md already exists and no arguments given, reads it and reports gaps — no full rewrite unless explicitly requested.

Grep-before-Read: Scans for terminology drift via grep before reading full source files.

Patterns used: Grep-before-Read, early exit, template-based generation, lazy file creation

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.