| name | writing-hashql-diagnostics |
| description | HashQL diagnostic writing patterns using hashql-diagnostics crate. Use when creating error messages, warnings, Labels, Messages, Severity levels, Patches, Suggestions, or improving diagnostic quality in HashQL code. |
| license | AGPL-3.0 |
| metadata | {"triggers":{"type":"domain","enforcement":"suggest","priority":"high","keywords":["diagnostic","hashql-diagnostics","Label","Message","Severity","Patch","Suggestions"],"intent-patterns":["\\b(create|write|add|improve)\\b.*?\\bdiagnostic\\b","\\b(error|warning)\\b.*?\\bmessage\\b"]}} |
HashQL Diagnostic Writing
Provides HASH-specific patterns for writing high-quality diagnostics using the hashql-diagnostics crate, ensuring messages are helpful, actionable, and follow consistent style conventions.
Core Principles
Diagnostics should be helpful, not just correct:
✅ DO:
- Start messages with lowercase
- Use backticks for code elements:
expected `bool`, found `String`
- Make messages actionable and specific
- Use "invalid" not "illegal"
- Keep help messages as imperatives: "add type annotations"
❌ DON'T:
- End messages with punctuation (unless multi-sentence)
- Use apologetic language ("sorry", "unfortunately")
- Write vague messages ("something went wrong")
- Capitalize message starts (unless code identifier)