WR

writing-hashql-diagnostics

This skill enforces formatting and structural standards for diagnostic messages to ensure clear, imperative error reporting.

Install

mkdir -p .claude/skills/writing-hashql-diagnostics && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2377" && unzip -o skill.zip -d .claude/skills/writing-hashql-diagnostics && rm skill.zip

Installs to .claude/skills/writing-hashql-diagnostics

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

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.
215 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Define diagnostic severity levels
  • Format code labels with spans
  • Draft actionable imperative help messages
  • Suggest code fixes via diagnostic patches
  • Enforce stylistic diagnostic writing

How it works

Uses a domain-specific crate to structure diagnostic metadata into standard Severity and Label fields.

Inputs & outputs

You give it
Write diagnostic for invalid input
You get back
Diagnostic struct with primary label and help message

When to use writing-hashql-diagnostics

  • Drafting clear error messages for HashQL users
  • Adding actionable suggestions to diagnostics
  • Improving existing compiler or runtime feedback

About this skill

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

When not to use it

  • Logging general application runtime info
  • Writing non-HashQL code diagnostics

Prerequisites

Hashql-diagnostics crate

Limitations

  • Tied to HashQL compiler/runtime
  • Requires span tracking for labels

How it compares

Forces consistency in error feedback by removing vague language and enforcing imperative phrasing.

Compared to similar skills

writing-hashql-diagnostics side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
writing-hashql-diagnostics (this skill)12moNo flagsIntermediate
deepwiki-rs259moReviewIntermediate
python-code-style96moReviewIntermediate
code-review-excellence195moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

More by hashintel

View all by hashintel

You might also like

deepwiki-rs

sopaco

AI-powered Rust documentation generation engine for comprehensive codebase analysis, C4 architecture diagrams, and automated technical documentation. Use when Claude needs to analyze source code, understand software architecture, generate technical specs, or create professional documentation from any programming language.

25170

python-code-style

wshobson

Python code style, linting, formatting, naming conventions, and documentation standards. Use when writing new code, reviewing style, configuring linters, writing docstrings, or establishing project standards.

971

code-review-excellence

wshobson

Master effective code review practices to provide constructive feedback, catch bugs early, and foster knowledge sharing while maintaining team morale. Use when reviewing pull requests, establishing review standards, or mentoring developers.

1958

code-walk-thru

pchalasani

Use this when user wants you to walk through (code or text) files in a EDITOR to either explain how some code works, or to show the user what changes you made, etc. You would typically use this repeatedly to show the user your changes or code files one by one, sometimes with specific line-numbers. This way the user is easily able to follow along in their favorite EDITOR as you point at various files possibly at specific line numbers within those files.

670

cookbook-audit

anthropics

Audit an Anthropic Cookbook notebook based on a rubric. Use whenever a notebook review or audit is requested.

568

schema-markup

davila7

When the user wants to add, fix, or optimize schema markup and structured data on their site. Also use when the user mentions "schema markup," "structured data," "JSON-LD," "rich snippets," "schema.org," "FAQ schema," "product schema," "review schema," or "breadcrumb schema." For broader SEO issues, see seo-audit.

1042

Search skills

Search the agent skills registry