|
| 1 | +--- |
| 2 | +title: "Expert Instruction Meta-Guide" |
| 3 | +description: "A meta-guide to help contributors write high-quality, role-based expert instruction files for building LLM personas or system instructions." |
| 4 | +--- |
| 5 | + |
| 6 | +> ✅ **Purpose** |
| 7 | +> This document is a meta-guide to help contributors craft high-quality, role-based expert instruction files. These serve as ground truth for building LLM personas, system instructions, or engineering knowledge bases. |
| 8 | +> |
| 9 | +> If you're not sure what an expert is or why we need one, please take a moment to read this document: [Experts](../../experts.mdx) |
| 10 | +
|
| 11 | +> 📌 **Guiding Philosophy** |
| 12 | +> An expert guidelines document isn't just a cheat sheet—it's a codified persona of excellence. It should: |
| 13 | +> |
| 14 | +> - Establish authority in the domain. |
| 15 | +> - Provide principles and practice—not just instructions. |
| 16 | +> - Be structured, consistent, and extensible. |
| 17 | +> - Serve both humans and LLMs—making it chunkable, parseable, and RAG-ready. |
| 18 | +
|
| 19 | +--- |
| 20 | + |
| 21 | +### 🧩 1. Structure of an Expert File |
| 22 | + |
| 23 | +Here's a canonical format: |
| 24 | + |
| 25 | +```markdown |
| 26 | +## You are HAI, a specialized expert in [DOMAIN] with deep knowledge of [TOOLING/SUBDOMAINS]. |
| 27 | + |
| 28 | +## [DOMAIN]-Specific Guidelines |
| 29 | + |
| 30 | +### 1. [Thematic Group Title] |
| 31 | + |
| 32 | +Content, code blocks, rationale, and rules here. |
| 33 | + |
| 34 | +### 2. [Next Area of Concern] |
| 35 | + |
| 36 | +Repeat with clarity. |
| 37 | +... |
| 38 | + |
| 39 | +### X. [CI/CD | Security | Best Practices] |
| 40 | + |
| 41 | +Close with extensibility and enforcement sections. |
| 42 | +``` |
| 43 | + |
| 44 | +✅ **Keep it consistent across personas:** |
| 45 | + |
| 46 | +- Always start with a role declaration |
| 47 | +- Always follow with a domain-specific guidelines heading |
| 48 | +- Break content into clearly scoped thematic sections |
| 49 | +- Use markdown + code fences to support syntax highlighting |
| 50 | +- Highlight both "How" and "Why" |
| 51 | + |
| 52 | +--- |
| 53 | + |
| 54 | +## 🏗️ 2. Before You Begin |
| 55 | + |
| 56 | +**Ask These Questions:** |
| 57 | + |
| 58 | +| Question | Purpose | |
| 59 | +| ----------------------------------------------- | ----------------------------------------- | |
| 60 | +| What persona am I writing as? | DevOps expert, React guru, etc. | |
| 61 | +| Who is the target reader? | Beginner? Intermediate? Contributor? LLM? | |
| 62 | +| What are the core pillars of this domain? | Structure, testing, versioning, etc. | |
| 63 | +| What tools or frameworks dominate this space? | e.g., Next.js, Terraform, Playwright | |
| 64 | +| What is considered bad practice in this domain? | Helps define the edges of expertise | |
| 65 | +| How can I include reusable code patterns? | Makes doc practical and referenceable | |
| 66 | + |
| 67 | +--- |
| 68 | + |
| 69 | +## 🧠 3. What Makes It Expert-Level |
| 70 | + |
| 71 | +| Trait | Description | |
| 72 | +| -------------------- | ----------------------------------------------------------- | |
| 73 | +| Opinionated | Don’t be afraid to prescribe best practices. Experts guide. | |
| 74 | +| Battle-Tested Advice | Include guidance reflecting real-world scenarios. | |
| 75 | +| Code-First | Add idiomatic examples with syntax and patterns. | |
| 76 | +| Explains Trade-offs | Prefer “X over Y because…” vs simply “use X”. | |
| 77 | +| Modular | Sections should be pluggable, referenceable, and swappable. | |
| 78 | +| LLM-Friendly | Structured, token-efficient, chunkable. | |
| 79 | + |
| 80 | +--- |
| 81 | + |
| 82 | +## ✍️ 4. Writing Checklist |
| 83 | + |
| 84 | +Use this as a repeatable checklist: |
| 85 | + |
| 86 | +✅ **Role Setup** |
| 87 | + |
| 88 | +- Name the expert clearly. |
| 89 | +- Define the domain explicitly. |
| 90 | +- Mention specializations. |
| 91 | + |
| 92 | +✅ **Core Sections (pick and tailor)** |
| 93 | + |
| 94 | +- Project Structure |
| 95 | +- Setup & Initialization |
| 96 | +- Configuration Management |
| 97 | +- CI/CD Integration |
| 98 | +- Security Guidelines |
| 99 | +- Testing Methodologies |
| 100 | +- Environment Handling (Dev/Staging/Prod) |
| 101 | +- Versioning & Upgrade Strategies |
| 102 | +- Deployment or Scaling Patterns |
| 103 | +- Common Pitfalls / Anti-Patterns |
| 104 | +- Performance Best Practices |
| 105 | +- Observability & Logging |
| 106 | + |
| 107 | +✅ **Content Style** |
| 108 | + |
| 109 | +- Context or explanation for every code block. |
| 110 | +- Instructions with action verbs. |
| 111 | +- Consistent terminology. |
| 112 | +- Links to RFCs, standards, or docs. |
| 113 | + |
| 114 | +--- |
| 115 | + |
| 116 | +## ⚙️ 5. Format Guidelines |
| 117 | + |
| 118 | +| Element | Usage | |
| 119 | +| -------------- | -------------------------------------------------- | |
| 120 | +| ## | Top-level role or section headers | |
| 121 | +| ### | Subsections by theme | |
| 122 | +| ```language | Always use language tags (e.g., lua, go, ts, bash) | |
| 123 | +| ✅ / ⚠️ / ❌ | Use emojis sparingly for clarity | |
| 124 | +| Tables | For comparisons, options, trade-offs | |
| 125 | +| Bullet Lists | When ordering is irrelevant | |
| 126 | +| Numbered Lists | When process/order matters | |
| 127 | + |
| 128 | +--- |
| 129 | + |
| 130 | +## 🧬 6. Reusability for LLMs & Knowledge Graphs |
| 131 | + |
| 132 | +To make the docs ready for automation: |
| 133 | + |
| 134 | +- Ensure each section is self-contained |
| 135 | +- Use consistent headings for chunking |
| 136 | +- Minimize overly verbose narrative — clarity wins |
| 137 | +- Prefer `term: definition` format for glossary-type items |
| 138 | +- Group example-first where possible |
| 139 | + |
| 140 | +--- |
| 141 | + |
| 142 | +## 🧪 7. Example Meta Templates |
| 143 | + |
| 144 | +Example role primers: |
| 145 | + |
| 146 | +```markdown |
| 147 | +## You are HAI, a DevOps Reliability Expert specializing in Kubernetes-based microservice deployments at scale on AWS and GCP. |
| 148 | + |
| 149 | +## DevOps-Specific Guidelines |
| 150 | + |
| 151 | +### 1. Cluster Configuration |
| 152 | + |
| 153 | +... |
| 154 | + |
| 155 | +### 2. Autoscaling & Cost Controls |
| 156 | + |
| 157 | +... |
| 158 | +``` |
| 159 | + |
| 160 | +```markdown |
| 161 | +## You are HAI, an LLM Product Engineer focused on Retrieval-Augmented Generation pipelines using LangChain, Weaviate, and OpenAI APIs. |
| 162 | + |
| 163 | +## LLM Engineering Guidelines |
| 164 | + |
| 165 | +### 1. Chunking & Indexing Strategies |
| 166 | + |
| 167 | +... |
| 168 | + |
| 169 | +### 2. Prompt Engineering Principles |
| 170 | + |
| 171 | +... |
| 172 | +``` |
| 173 | + |
| 174 | +--- |
| 175 | + |
| 176 | +## 🧭 8. Final Tips |
| 177 | + |
| 178 | +- Start with a skeleton using the checklist above |
| 179 | +- Avoid repeating generalities — focus on sharp, unique knowledge |
| 180 | +- Think of each section as a “tile” of expertise — someone should be able to take just one tile and apply it |
| 181 | +- Think in terms of portable intelligence, not just documentation |
| 182 | + |
| 183 | +Now that you know how to write an expert, why not contribute? Please refer to the below guide to contribute to HAI. |
| 184 | + |
| 185 | +--- |
| 186 | + |
| 187 | +## 🤝 How to Contribute Experts to the GitHub Repository |
| 188 | + |
| 189 | +**1. Clone the Repository** |
| 190 | + |
| 191 | +Start by cloning the repository to your local machine: |
| 192 | + |
| 193 | +```bash |
| 194 | +git clone https://github.com/presidio-oss/cline-based-code-generator |
| 195 | +``` |
| 196 | + |
| 197 | +**2. Navigate to the Experts Directory** |
| 198 | + |
| 199 | +Once you've cloned the repository, navigate to the src/experts directory: |
| 200 | + |
| 201 | +```bash |
| 202 | +cd src/experts |
| 203 | +``` |
| 204 | + |
| 205 | +**3. Create Your Own Expert Folder** |
| 206 | + |
| 207 | +Each expert should have its own dedicated folder. The folder name should match the name of the expert. For example, if you're contributing a Golang expert, create a folder called golang. |
| 208 | + |
| 209 | +Inside this folder, create two files: |
| 210 | + |
| 211 | +- prompt.md: The content file that will contain the instructions or prompt for the expert. |
| 212 | + |
| 213 | +- icon.svg: The SVG icon that represents the expert. Make sure to keep the icon file small and optimized for use in the UI. |
| 214 | + |
| 215 | +Example folder structure: |
| 216 | + |
| 217 | +```plaintext |
| 218 | +src/experts/ |
| 219 | + ├── golang/ |
| 220 | + │ ├── prompt.md |
| 221 | + │ └── icon.svg |
| 222 | + └── ... |
| 223 | +``` |
| 224 | + |
| 225 | +**4. Create an Issue** |
| 226 | + |
| 227 | +Before submitting your contribution, create an issue to track the addition of the new expert. The issue format should be as follows: |
| 228 | + |
| 229 | +- Format: `[Expert]: Expert Name` |
| 230 | +- Example: `[Expert]: Golang` |
| 231 | + |
| 232 | +Make sure to tag the issue with the Expert label for easy identification. |
| 233 | + |
| 234 | +**5. Raise a Pull Request** |
| 235 | + |
| 236 | +After you've made your changes, raise a pull request (PR) to merge your contributions into the main repository. |
| 237 | + |
| 238 | +When creating the pull request, please follow these standards: |
| 239 | + |
| 240 | +- Pull Request Title Format: `[Experts]: Expert Name expert` |
| 241 | +- Example: `[Experts]: Golang expert` |
| 242 | +- Link the Pull Request with the Issue: Make sure to link the pull request to the issue you created earlier. This helps in tracking the progress of the contribution and ensures the expert is properly documented and tracked. |
| 243 | + |
| 244 | +**6. Review and Merge** |
| 245 | +Once your PR is raised, we will review your contribution. If everything is in order, it will be merged into the repository. If there are any issues, we will provide feedback to help you get your contribution ready for merging. |
| 246 | + |
| 247 | +**Thank You!** |
0 commit comments