Domain Specific Prompt Libraries and Expert Knowledge Encoding
Generic prompts fail in specialized domains. Legal contract analysis needs contract-specific prompts. Medical advice needs medical-specific prompts. I've been building domain prompt libraries: collections of prompts for specific industries, with embedded expert knowledge. Results: non-experts using these prompts produce expert-quality outputs. I'm documenting the library structure.
Knowledge Encoding and Expert Pattern Extraction
Prompt library for legal contract review: 'You are a contract review expert with 20 years of corporate law experience. Review this contract: [CONTRACT]. Check for: (1) liability clauses that are unfair to us, (2) termination clauses with unfair penalties, (3) IP ownership; is it clearly assigned to us?, (4) indemnification; does it protect us?, (5) payment terms; are they standard for this industry? Provide assessments with reasoning. For each issue, recommend fix language.' This prompt encodes expert judgment into a template. A non-lawyer using this produces better contract reviews than they would without it. Domain libraries combine: expert role definition + industry-specific frameworks + checklist of domain concerns + recommended output structure. I built libraries for: legal contracts (6 prompt templates), medical diagnosis support (8 templates), financial analysis (5 templates), software architecting (7 templates). Teams using libraries produce 40% better domain-specific outputs.
Expert knowledge is patterns + checklists. Capture both. The pattern is the expert's approach; the checklist is the expert's concerns. Together, they make a replicable framework.
Domain prompt template structure: [EXPERT ROLE] + [DOMAIN FRAMEWORK] + [CHECKLIST] + [OUTPUT FORMAT]
Expert role: specify years of experience, specialization, success metrics
Domain framework: how experts in this field approach the problem
Checklist: specific concerns and risks unique to this domain
Output structure: what the expert would produce for this domain