agentleFS
Luis85Luis85/agentic-workflow/.claude/skills/domain-context/SKILL.md

domain-context

Skill0 starsChanged 6 months agoMITView on GitHub

Maintain living domain context map at docs/CONTEXT.md (or docs/contexts/) — system overview, users, bounded contexts, relationships. Lazily created. Triggers "domain model", "context map", "bounded context".

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

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    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:

    After Pocock's domain-model skill and Evans's bounded-context concept.

    line 9
  2. Very specific:

    New term coined?: Write inline to Core concepts.

    line 75
  3. Very specific:

    New invariant discovered?: Write a draft entry to Invariants and flag for the orchestrator — return a one-line [CONTEXT-CONFIRM] new …

    line 77
  4. Very specific:

    Update Last updated and by in the file you actually wrote to (not the wrong layout's file).

    line 79
  5. Very specific:

    Run a grill session focused on the current state of CONTEXT.md:

    line 84
  6. Distinctive:

    Update inline as decisions resolve.

    line 87
  7. Very specific:

    Lazy creation: Don't pre-scaffold docs/CONTEXT.md.

    line 91
  8. Distinctive:

    Additive updates: Don't rewrite history; document changes in workflows or ADRs.

    line 92
  9. Distinctive:

    Plain language: Avoid framework names, design patterns, or implementation details.

    line 93
  10. Very specific:

    One source of truth: If a concept appears here and in docs/glossary/, the glossary is authoritative for definitions.

    line 94

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

After Pocock's domain-model skill and Evans's bounded-context concept. docs/CONTEXT.md is a single page that tells any new agent (or human) what the system is about. It evolves additively across workflows.

File layout

Single-context project

docs/CONTEXT.md

Multi-context project (microservices, multi-product, etc.)

docs/CONTEXT-MAP.md          # the relationships between contexts
docs/contexts/<name>.md      # one file per bounded context

The orchestrator decides single vs multi by counting distinct domains in docs/steering/product.md. Default is single until evidence suggests otherwise.

CONTEXT.md format

# Domain context

_Last updated: <YYYY-MM-DD> by <agent>_

## What the system is

One paragraph. Plain language. The shape of the thing, not its features.

## Users and their goals

Bulleted list. Who uses it, what they're trying to do, what success looks like.

## Bounded contexts

| Context | Owns | Talks to | Doesn't talk to |
|---|---|---|---|
| <name> | <data + behavior> | <other contexts> | <forbidden> |

(Single-context projects can omit this section.)

## Core concepts

Short glossary of the load-bearing nouns. **Bold** the term, then a one-line definition. Cross-link to the per-term files in [`docs/glossary/`](../../../docs/glossary/) for fuller definitions.

## Invariants

Numbered list of things that must always be true. These are non-negotiable; violations are bugs.

## Open questions

Bulleted list. Things the team hasn't resolved yet. Each links to a workflow or ADR if applicable.

Procedure

When invoked from a stage agent (typical)

Stage agents run inside subagent contexts and cannot call AskUserQuestion (per the orchestrator contract in .claude/skills/orchestrate/SKILL.md). High-confidence, low-risk updates can be written inline; anything that needs human confirmation must be deferred to the main thread.

  1. Detect mode and target file. Single-context vs. multi-context is determined by what already exists on disk:
    • If docs/CONTEXT-MAP.md exists, this repo is in multi-context mode. Determine which bounded context the agent's update belongs to (cite it explicitly — if the agent didn't, ask via the [CONTEXT-CONFIRM] flag pattern below). The target file is docs/contexts/<name>.md for context-scoped updates, or docs/CONTEXT-MAP.md for cross-context relationships. Never write to docs/CONTEXT.md in multi-context mode — it should not exist.
    • Else if docs/CONTEXT.md exists, this repo is in single-context mode; that file is the target.
    • Else (no context file exists yet), default to single-context mode and scaffold docs/CONTEXT.md from the template above. To switch later to multi-context, the architect files an ADR migrating the file (lazy migration: docs/CONTEXT.md → docs/CONTEXT-MAP.md plus a per-context split).
  2. Diff what the agent reports against the current map:
    • New term coined? Write inline to Core concepts.
    • Open question resolved? Move from Open questions to wherever the answer landed (typically Core concepts or Invariants).
    • New invariant discovered? Write a draft entry to Invariants and flag for the orchestrator — return a one-line [CONTEXT-CONFIRM] new invariant: <text> line in the agent's summary. The orchestrator will run a single AskUserQuestion in the main thread and finalize.
    • Context boundary changed? Same flag pattern — write the proposed change inline (or stage it as a code-fenced block in the agent's summary) and return [CONTEXT-CONFIRM] boundary change: <text> for the orchestrator to confirm. Do not call AskUserQuestion from the subagent.
  3. Update Last updated and by in the file you actually wrote to (not the wrong layout's file).
  4. Append a dated one-line entry to the active feature's workflow-state.md ## Hand-off notes free-form section noting which context file was updated (no frontmatter additions — the schema is fixed).

When invoked directly by the user

Run a grill session focused on the current state of CONTEXT.md:

  • Walk each section asking "is this still true? is this still complete?"
  • Update inline as decisions resolve.

Rules

  • Lazy creation. Don't pre-scaffold docs/CONTEXT.md. Wait until something needs to land in it.
  • Additive updates. Don't rewrite history; document changes in workflows or ADRs.
  • Plain language. Avoid framework names, design patterns, or implementation details. The map is about the domain, not the system that serves it.
  • One source of truth. If a concept appears here and in docs/glossary/, the glossary is authoritative for definitions; CONTEXT.md cross-links and uses the term. Per ADR-0010 the glossary is one file per term.
  • Don't dump. A 5-page CONTEXT.md is a sign the domain isn't actually understood. Keep it ≤2 pages.

Relationship to steering files

docs/steering/product.md is prescriptive ("we are building X for Y"). docs/CONTEXT.md is descriptive ("here is what the system actually is and the terms we use about it"). They co-exist; updates to one don't auto-propagate to the other.

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.