Domain knowledge builder skill - triggered when working with unfamiliar domains, researching new technologies, or when the user asks to build knowledge about a topic. Researches deeply from the web and official docs, organizes into structured knowledge files, supports importing documentation files, and distinguishes between GLOBAL knowledge (cross-project) and PROJECT-specific knowledge.
You are building domain-specific knowledge. Knowledge has TWO scopes:
| Scope | Location | When to Use |
|---|---|---|
| Global | .claude/knowledge/domains/<topic>.md | Reusable across ALL projects |
| Project | projects/<project>/knowledge/<topic>/ | Specific to ONE project (client-specific) |
/knowledge build, /knowledge update, /knowledge add/design when the domain is unfamiliarWhen building knowledge, ALWAYS determine the scope:
--global or --project: use that.Where should I save this knowledge?
1. Global - For ALL projects (standard tech/protocols like HL7, OPC-UA, JWT)
2. Project - For this project only (client-specific APIs, internal systems)
For any new topic, run multiple searches:
WebSearch "<topic> official documentation"WebSearch "<topic> programming guide tutorial"WebSearch "<topic> architecture overview"WebSearch "<topic> API reference"WebSearch "<topic> integration with other systems"WebSearch "<topic> best practices 2026"WebSearch "<topic> common problems solutions"For each important URL found:
WebFetch <url> - read the pageStructure into the standard format:
Global scope:
.claude/knowledge/domains/<topic>.md
Project scope:
projects/<project>/knowledge/<topic>/
<topic>.md # Structured knowledge (auto-generated)
docs/ # User-provided documentation
<file>.pdf # Original PDFs, datasheets
<file>.md # API docs, notes
urls.md # Bookmarked URLs for reference
Always include the scope in the knowledge file's frontmatter:
# Knowledge: [Topic]
**Built**: [date]
**Scope**: Global | Project (<project-name>)
**Sources**: [list of URLs consulted]
After saving, draw any diagrams IN THE CHAT as ASCII / Unicode box-drawing (see Rule 20). Mermaid stays in the .md file.
so the user can see the architecture without opening files.
When user provides documentation files:
projects/<project>/knowledge/<topic>/docs/projects/<project>/
knowledge/
<topic>/
<topic>.md # Structured knowledge (auto-generated)
docs/ # User-provided documentation
kuka-krl-manual.pdf # PDF manuals
plc-datasheet.pdf # Datasheets
api-reference.md # API docs
notes.md # User notes
urls.md # Bookmarked URLs for reference
When user says "here's the documentation for X" or provides a file:
Once knowledge exists, it's used automatically:
/design: architecture decisions reference domain knowledge
(project-specific first, then global)/implement: use APIs and code patterns from knowledge/schema: domain-specific data structuresPromote (project → global): when you built something as project-specific but
realize it's reusable, run /knowledge promote <topic>. The skill will:
.claude/knowledge/domains/Copy (global → project): when you want to customize a global file for a specific
project, run /knowledge copy <topic> --to <project>. The skill will:
Generate diagrams to visualize domain concepts. Always use proper formatting with a title comment and clear node labels:
%% Industrial Automation - Communication Architecture
graph TB
subgraph Field["Field Layer"]
Sensors[IoT Sensors]
Robots[KUKA Robots]
end
subgraph Control["Control Layer"]
PLC[Siemens S7 PLC]
SCADA[SCADA System]
end
subgraph Enterprise["Enterprise Layer"]
MES[MES System]
ERP[ERP System]
end
Sensors -->|MQTT| PLC
Robots -->|EtherNet/IP| PLC
PLC -->|OPC-UA| SCADA
SCADA -->|REST API| MES
MES -->|Message Queue| ERP
Render these IN THE CHAT as well as saving to the file.