explore-domain
Skill2 starsChanged 7 days agoMITView on GitHub
Navigate and explain the existing domain — flows, entities, business rules, events, and code — without modifying anything. USE THIS SKILL when user mentions: explain, what does X do, how does X work, walk me through, what events, event topics, channels, event catalog, what does this service publish, what happens when, trace, find rule, business rule for X, what enforces, onboard, understand the domain, show me the flow, what is [concept], new developer, PO question, or any question seeking to understand existing behaviour without changing it. Has 4 modes: explain (narrative + diagram), list-events (Event catalog), trace-flow (step-by-step from entry point to side effects), find-rule (locate BRs/INVs + where they are enforced in code).
In this repository19 other files it gives its agents.
- AGENTS.mdAGENTS.md
- adr-amendSkill
- adr-createSkill
- adr-review-alternativesSkill
- adr-validateSkill
- agents-maintainerSkill
- audit-docsSkill
- sdlc-guideSkill
- setup-sdlcSkill
- inception-workshopSkill
- prd-workshopSkill
- user-story-mappingSkill
- modify-flowSkill
- reverse-engineer-domainSkill
- create-moduleSkill
- implement-flowSkill
- create-entity-lifecycleSkill
- create-featuresSkill
- create-flow-documentationSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. About 0 are common, 12 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
READ-ONLY INVARIANT: Never create, edit, or delete any file.
- Distinctive: line 51
Before answering anything, gather:
- Distinctive: line 55
Docs index: Check if there is a top-level index (README, SDLC index, etc.) that maps bounded contexts to flows, entities, and rules — use …
- Distinctive: line 66
Before answering, detect who is asking:
- Distinctive: line 96
Search the docs tree for the relevant bounded context, flow doc, entity doc, or business rule doc.
- Distinctive: line 97
Read the relevant doc(s) fully.
- Distinctive: line 231
Search the docs tree for BRs and INVs whose title or description matches the topic.
- Very specific: line 232
Read each matching doc — start at its Traceability section: Enforced by already lists every layer, file and guard with a ✅/⚠️/⏳ status, and …
- Distinctive: line 237
Verify the code actually enforces the rule as documented (right condition, right layer).
- Distinctive: line 259
Code is truth: If a doc and the code disagree, report the discrepancy — don't silently trust the doc.
- Distinctive: line 260
Always cite real file paths: No placeholder paths or assumed locations.
- Distinctive: line 261
Always answer the question: Don't just list docs — synthesize an actual answer for the user.
- Distinctive: line 283
Before ending your turn, verify every item below with concrete evidence (not just a checkmark).
≈ “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.
Files
PROTOCOL: EXPLORE-DOMAIN (EXECUTION LEVEL 3)
<state_machine>
CURRENT_STEP -> REQUIRED_TOOL -> REQUIRED_OUTPUT -> MANDATORY_HALT
Step 0: Discover -> find / read_file (docs index, source layout) -> Bounded context map & entry points -> Continue to Step 1
Step 1: Detect Mode -> classify Audience (PO/Dev) & Mode (4 modes) -> Selected response template (explain/list-events/trace-flow/find-rule) -> Continue to Step 2
Step 2: Verify Code -> read_file / grep (docs + real source files) -> Grounded answer + explicit doc-vs-code discrepancies -> 🛑 HALT TURN (Present answer)
</state_machine>
<execution_invariants>
- WORKFLOW IMMUTABILITY: You may reason freely INSIDE each step to trace domain concepts, events, and rules across the codebase, but you are strictly forbidden from skipping steps (
workflow structure = immutable | step reasoning = flexible). - READ-ONLY INVARIANT: Never create, edit, or delete any file.
- CODE IS TRUTH: Never trust documentation alone — open and read the real source files before citing any class, method, event, or rule enforcement. Surface any doc-vs-code discrepancy explicitly.
- OUTPUT SCHEMA LOCK: Format your response using the exact output block defined for the detected Mode (
explain,list-events,trace-flow,find-rule) and Audience (POvsDeveloper). - ESCAPE HATCH: If the user's question or codebase does not fit any of the 4 modes, do not silently improvise and do not force-fit: declare the deviation in one line and ask. </execution_invariants>
<output_contract>
- OUTPUT_TYPE: Read-only domain explanation in chat (zero file edits)
- SCHEMA_INVARIANCE: Match the exact output section headings and table columns of the selected Mode (
explain[PO or Developer],list-events,trace-flow, orfind-rule). - ESCAPE_HATCH: If a mode subsection (such as
Business rules enforcedorEvents Consumed) has zero matching items in the codebase, preserve the heading and write"None found in [searched paths]". </output_contract>
You are an expert domain guide for this codebase. Your job is to answer questions about the existing system — its flows, entities, business rules, events, and source code — accurately, grounded in the real implementation, without modifying any file.
This skill is read-only. You do not create, edit, or delete any file.
This skill is language- and framework-agnostic. Discover paths, names, and conventions fresh each time — do not assume a specific stack or folder layout.
Step 0: Discover This Repo's Conventions (Do This First, Every Time)
Before answering anything, gather:
- Docs tree: Find where flow/entity/business-rule/invariant documentation lives. Look for a
bounded-contexts/directory or similar. Note the exact folder structure. - Docs index: Check if there is a top-level index (README, SDLC index, etc.) that maps bounded contexts to flows, entities, and rules — use it as your map.
- Source layout: Identify the implementation language and how source is organized
(e.g.
domain/application/infrastructurelayers, feature-first modules, etc.). - Messaging config: Find where topics, queues, channels, producers, and consumers are declared (framework binders/config files, event handler annotations/decorators, pub/sub client setup, or equivalent).
Audience Detection
Before answering, detect who is asking:
| Signal | Audience | Response style |
| "as a PO", "business terms", "non-technical", "explain simply" | Product Owner | Business language. No code paths. Use flow doc narrative. Link to flow docs. |
| "as a developer", "new to the codebase", "onboarding", "where is X in code" | Developer (new) | Explain domain concepts first, then code structure. Include class/file paths. |
| Mentions class/method names, asks about code specifics | Developer (experienced) | Skip basics. Go straight to code paths + relevant docs. |
| No signal | Mixed (default) | Narrative first, then code pointers in a separate section. |
Mode Detection
Detect which mode to use from the user's question. If genuinely ambiguous, ask.
| Mode | User says… | What you do |
explain | "what does X do?", "explain X", "how does X work?", "what is X?" | Narrative + relevant diagram + code pointers |
list-events | "what events does this service emit/consume?", "event topics/queues", "event catalog", "what does this publish?" | Full event catalog |
trace-flow | "what happens when X?", "walk me through event X", "trace X", "sequence when…" | Step-by-step from entry point to all side effects |
find-rule | "is there a rule that…?", "what enforces X?", "find rule for X", "which BR covers?" | Locate matching BRs/INVs + code enforcement location |
Mode: explain
Goal: Give a clear, accurate explanation of a concept, flow, entity, product, or feature.
Steps
- Search the docs tree for the relevant bounded context, flow doc, entity doc, or business rule doc.
- Read the relevant doc(s) fully.
- Verify against source code — find the main class/service/use case/handler that implements it. Docs can be stale; code is truth. Note any discrepancy.
- Compose the answer using the appropriate format for the detected audience.
Output — PO audience
## [Topic]
[2–3 sentence business summary of what this does and why it exists]
### How it works (business view)
[Step-by-step in plain language — no code references]
### Business rules involved
| Rule | What it means |
|------|--------------|
| BR-XXX | ... |
### Related flows
- [Flow name](relative link to flow doc)Output — developer audience
## [Topic]
[1-sentence summary]
### Domain model
[Key entities and their roles]
### Implementation entry point
`path/to/entrypoint.ext` — [what it does]
### Flow
[Mermaid sequence diagram — extract or adapt from the relevant flow doc, or derive from code]
### Business rules enforced
| Rule | Enforced at layer | File |
|------|-------------------|------|
| BR-XXX | domain / application | `path/to/file.ext:line` |
### Notes
[Any discrepancy between doc and code — surface explicitly]Mode: list-events
Goal: Produce a complete catalog of every domain/integration event this service produces and consumes.
Steps
- Find all event consumer entry points (look for message listeners, event subscriptions, route handlers, or channel binding declarations).
- Find all event producer entry points (look for event bus publish calls, message dispatchers, outbox triggers, or output channel bindings).
- For each event class/schema, search the docs tree for the flow that documents it.
- For each event, identify the business condition that triggers production or consumption.
Output
## Event Catalog
### Events Consumed
| Channel / Topic | Event type | Handler class/function | Owning flow | What triggers processing |
|-----------------|-----------|------------------------|------------|--------------------------|
| ... | ... | `path/handler.ext` | [flow link]| ... |
### Events Produced
| Channel / Topic | Event type | Producer class/function | Owning flow | What triggers emission |
|-----------------|-----------|-------------------------|------------|------------------------|
| ... | ... | `path/producer.ext` | [flow link]| ... |
### Gaps
[Events referenced in docs but not found in code, or events in code with no flow doc — list both]Mode: trace-flow
Goal: Walk step-by-step through exactly what happens when a specific trigger occurs — from the entry point to every side effect (DB writes, events published, emails sent, external calls).
Steps
- Identify the entry point: Kafka consumer, HTTP endpoint, or scheduled job.
- Find the handler/controller class that receives it.
- Trace the call chain: infrastructure handler → application use case → domain logic → outbound effects (repository writes, events, external calls).
- Find any flow doc or entity doc that describes this trace; cross-reference.
- Note any discrepancies between docs and code.
Output
## Trace: [trigger description]
### Entry point
`path/to/handler.ext` — consumed from topic/queue `xxx` / HTTP `POST /v1/xxx`
### Step-by-step
| Step | Layer | Class / Function | What happens | Side effect |
|------|-------|------------------|-------------|------------|
| 1 | Infrastructure | `Handler.handle()` | Deserializes event | — |
| 2 | Application | `UseCase.execute()` | Validates input, loads entity from DB | — |
| 3 | Domain | `Entity.doX()` | Applies BR-XXX | Emits DomainEvent |
| 4 | Infrastructure | `Publisher.publish()` | Sends event | Channel: `xxx` |
### Business rules applied
| Step | Rule | Doc |
|------|------|-----|
| 3 | BR-XXX | [relative link] |
### Discrepancies with docs
[None — or list each one explicitly]Mode: find-rule
Goal: Locate which business rules or invariants govern a specific behaviour, and confirm where they are enforced in code.
Steps
- Search the docs tree for BRs and INVs whose title or description matches the topic.
- Read each matching doc — start at its
Traceabilitysection:Enforced byalready lists every layer, file and guard with a ✅/⚠️/⏳ status, andVerified bynames the tests. That table is the starting answer, not a hint;Traces up togives you the journey/flow/feature to show alongside it. - Grep the source for the class/method/function the doc references — or search by the rule's described logic. Grep is how you find what the table missed, not a substitute for reading it.
- Verify the code actually enforces the rule as documented (right condition, right layer). A ✅ row you did not confirm by opening the file is reported as ⚠️, not ✅.
Output
## Rules governing: [topic]
| ID | Name | What it says | Enforced at | File | Status |
|----|------|-------------|-------------|------|--------|
| BR-XXX | ... | ... | domain / application | `path/to/file.ext:line` | ✅ confirmed |
| INV-XXX | ... | ... | domain | `path/to/file.ext:line` | ⚠️ stale — doc says X, code does Y |
### Gaps
[Rules referenced in code comments/tests but not documented; documented rules with no enforcement found]Quality Rules
- Never modify a file. This skill is strictly read-only.
- Code is truth. If a doc and the code disagree, report the discrepancy — don't silently trust the doc.
- Always cite real file paths. No placeholder paths or assumed locations.
- Always answer the question. Don't just list docs — synthesize an actual answer for the user.
- Flag staleness explicitly. Surface every doc–code discrepancy you find, even if minor.
- Verify before citing. Open and read the source file; don't assume a method exists from its name.
Related Skills
| Skill | When to use instead |
modify-flow | You want to change existing behaviour |
create-flow-documentation | You want to document a journey for the first time |
create-entity-lifecycle | You want to document a domain entity for the first time |
audit-docs | You want a systematic sweep of all docs vs. code across bounded contexts |
Version: 1.0
<self_validation_gate> Before ending your turn, verify every item below with concrete evidence (not just a checkmark). If any item cannot be cited with real evidence from this turn, DO NOT produce your final response — fix the violation first:
- Read-Only Evidence: Confirm 0 files were created, modified, or deleted:
<0 edits> - Code Verification Evidence: List the exact source files (
path/to/file.ext:line) opened viaread_fileto verify the docs:<paths> - Mode & Audience Schema Evidence: State the selected Mode (
explain/list-events/trace-flow/find-rule) and Audience (PO/Developer/Mixed):<mode, audience></self_validation_gate>
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
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.

