writing-hashql-diagnostics

Generate structured HashQL diagnostics with labels, severity, and patches.

1.6k|123|Updated Jul 15, 2019
One-click install
npx skills add https://github.com/hashintel/hash --skill writing-hashql-diagnostics
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-hashql-diagnostics
Source: https://github.com/hashintel/hash/tree/main/.claude/skills/writing-hashql-diagnostics
Command: npx skills add https://github.com/hashintel/hash --skill writing-hashql-diagnostics

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

HashQL diagnostic writing patterns using the hashql-diagnostics crate to create helpful, actionable, and well-structured diagnostics.

Core Features & Use Cases

  • Severity levels and labeled diagnostics
  • Message style guidelines and code references
  • Adding suggestions and patches to diagnostics
  • Testing and review guidelines for diagnostic quality

Quick Start

Use Diagnostic builders and patches to craft helpful messages: Diagnostic::new(category, Severity::Error).primary(Label::new(span, "expected bool, found String")).with_suggestion(...).

Frequently Asked Questions about writing-hashql-diagnostics

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I write consistent diagnostic messages for HashQL code?

Use the hashql-diagnostics crate to generate structured diagnostics with consistent formatting, severity levels, and message style. The crate enforces lowercase messages, backtick code references, imperative tone, and avoids apologetic language across errors, warnings, and notes.

What makes a diagnostic message actionable?

Actionable diagnostics combine a clear Label describing what went wrong, an appropriate Severity level, and a Suggestion or Patch showing the fix. The hashql-diagnostics crate ensures diagnostics follow this structure so users understand the problem and how to resolve it.

Can I add patch suggestions to diagnostic messages?

Yes. The Diagnostic builder supports adding both suggestions and patches. Patches provide concrete code changes users can apply, while suggestions offer guidance. This makes diagnostics more helpful for users fixing HashQL code.

How do I ensure diagnostic quality across my codebase?

Follow the hashql-diagnostics testing and review guidelines to validate that diagnostics meet style requirements: lowercase messages, proper code references, imperative language, and structured use of labels, severity levels, and patches for consistency.

What severity levels does the hashql-diagnostics crate support?

The crate provides multiple severity levels—Error, Warning, and Note—allowing you to classify diagnostics by importance. Each level helps users prioritize which issues to address first in their HashQL code.