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.zipInstalls 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.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
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
| 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 - Complete message style guide, span selection, category design, label usage, help vs note, suggestion quality, review checklist
- HashQL testing skill - For compiletest coverage
When not to use it
- →Logging general application runtime info
- →Writing non-HashQL code diagnostics
Prerequisites
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.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| writing-hashql-diagnostics (this skill) | 1 | 2mo | No flags | Intermediate |
| deepwiki-rs | 25 | 9mo | Review | Intermediate |
| python-code-style | 9 | 6mo | Review | Intermediate |
| code-review-excellence | 19 | 5mo | No flags | Intermediate |
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.
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.
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.
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.
cookbook-audit
anthropics
Audit an Anthropic Cookbook notebook based on a rubric. Use whenever a notebook review or audit is requested.
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.