hashintel/hash · Archived

writing-hashql-diagnostics

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.

First seen May 14, 2026

Installation

$ npx skills add hashintel/hash --skill writing-hashql-diagnostics

Stronger alternatives

This repository is archived — consider an actively maintained alternative.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from hashintel/hash · top by installs.

npx skills add hashintel/hash

Browse all from hashintel/hash

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 1.7K
License LICENSE.md
Default branch main
Open issues 12
Status Archived

Skill metadata

Parsed from SKILL.md frontmatter.

LicenseAGPL-3.0
More 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"]}

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,901 B
  • docs SUMMARY.md 249 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 2 installs

SKILL.md

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

Severity When to Use
Bug Internal compiler error
Fatal Unrecoverable error
Error Must be fixed to compile
Warning Suspicious code to review
Note Informational 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](references/guidelines.md) - Complete message style guide, span selection, category design, label usage, help vs note, suggestion quality, review checklist
  • [HashQL testing skill](../testing-hashql/SKILL.md) - For compiletest coverage