Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
hashintel avatar

Writing Hashql Diagnostics

  • 2 installs
  • 1.6k repo stars
  • Updated August 5, 2026
  • hashintel/hash

Provides HASH patterns for writing HashQL diagnostics using the hashql-diagnostics crate: Labels, Messages, Severity, Patches, and Suggestions.

About

Guides creating helpful, actionable compiler diagnostics using the hashql-diagnostics crate with consistent style conventions. A developer uses it when writing error messages, warnings, or suggestions in HashQL code.

  • Covers Labels, Messages, Severity, Patches, and Suggestions
  • Emphasizes helpful, actionable, consistent diagnostics

Writing Hashql Diagnostics by the numbers

  • 2 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #101 of 121 Rust skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/hashintel/hash --skill writing-hashql-diagnostics

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs2
repo stars1.6k
Last updatedAugust 5, 2026
Repositoryhashintel/hash

What it does

Provides HASH patterns for writing HashQL diagnostics using the hashql-diagnostics crate: Labels, Messages, Severity, Patches, and Suggestions.

Files

SKILL.mdMarkdownGitHub ↗

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)

Quick Reference

Creating a Diagnostic

use hashql_diagnostics::{Diagnostic, Label, Message, Severity};

let mut diagnostic = Diagnostic::new(category, Severity::Error)
    .primary(Label::new(span, "expected `bool`, found `String`"));

diagnostic.add_label(Label::new(other_span, "expected because of this"));
diagnostic.add_message(Message::help("try using a comparison"));

Severity Levels

SeverityWhen to Use
BugInternal compiler error
FatalUnrecoverable error
ErrorMust be fixed to compile
WarningSuspicious code to review
NoteInformational context

Message Style

// ✅ Good
"cannot find variable `count` in this scope"
"expected `;` after expression"

// ❌ Bad
"Error: Variable not found."  // capitalized, punctuation
"Sorry, there's a type mismatch"  // apologetic

Adding Suggestions

use hashql_diagnostics::{Message, Patch, Suggestions};

let suggestion = Suggestions::patch(Patch::new(span, "corrected_code"));
diagnostic.add_message(
    Message::help("fix the typo").with_suggestions(suggestion)
);

References

  • Comprehensive guidelines - Complete message style guide, span selection, category design, label usage, help vs note, suggestion quality, review checklist
  • HashQL testing skill - For compiletest coverage

Related skills

Rustbackend

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.