Agent skill

Testing Hashql

by hashintel in hashintel/hash

HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

AGPL-3.0Auto-check passedTesting & QA

Install Testing Hashql

skills CLI
$ npx skills add hashintel/hash --skill testing-hashql -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install hashintel/hash testing-hashql --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/hashintel/hash.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/testing-hashql .claude/skills/testing-hashql && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
testing-hashql
GitHub stars
1.7k
Token cost
~1.9k tokens
SKILL.md length
426 words
Files
5 (incl. references)
Skills in repo
17
Repo updated
First seen
Licence
AGPL-3.0

At a glance

HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

  • Writing tests for HashQL code
  • SKILL.md covers Quick Reference, compiletest (UI Tests), Unit Tests and insta Snapshot Tests, plus 2 more sections
  • Calls cargo
  • Using //~ annotations

What it does

Testing Hashql is an agent skill from hashintel/hash. HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests. Use when writing tests for HashQL code, using //~ annotations, running --bless, debugging test failures, or choosing the right testing approach.

Its SKILL.md is about 1.9k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including reference files (for example `references/compiletest-guide.md`, `references/mir-builder-guide.md` and `references/mir-fluent-builder.md`).

It sits in Testing & QA, covering Unit testing, Test strategy and Failing and flaky tests. The repository describes itself as: 🚀 The open-source, multi-tenant platform for self-building knowledge graphs and simulation. The licence is AGPL-3.0.

When your agent uses it

  • Writing tests for HashQL code
  • Using //~ annotations
  • Running --bless
  • Debugging test failures

Example prompts

  • “/testing-hashql”

What it can do on your machine

Read from SKILL.md and the folder at commit e189ab2. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • cargo

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Testing Hashql loads about 1.9k tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 63 tokens; SKILL.md has 426 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~63
When it runs · the whole SKILL.md, loaded when a task matches
~1.9k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from hashintel/hash at commit e189ab2, republished under its AGPL-3.0 licence (© hashintel). 426 words, ~1,916 tokens.

Download SKILL.mdSave it as .claude/skills/testing-hashql/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
testing-hashql
description
HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests. Use when writing tests for HashQL code, using //~ annotations, running --bless, debugging test failures, or choosing the right testing approach.
license
AGPL-3.0

HashQL Testing Strategies

HashQL uses three testing approaches. compiletest is the default for testing compiler behavior.

Quick Reference

ScenarioTest TypeLocation
Diagnostics/error messagescompiletesttests/ui/
Compiler pipeline phasescompiletesttests/ui/
MIR/HIR/AST pass integrationcompiletesttests/ui/
MIR/HIR/AST pass edge casesinstatests/ui/<category>/
MIR pass unit testsMIR buildersrc/**/tests.rs
Core crate (where needed)instasrc/**/snapshots/
Parser fragments (syntax-jexpr)instasrc/*/snapshots/
Internal functions/logicUnit testssrc/*.rs

compiletest (UI Tests)

Test parsing, type checking, and error reporting using J-Expr files with diagnostic annotations.

Structure:

text
package/tests/ui/
  category/
    .spec.toml        # Suite specification (required)
    test.jsonc        # Test input
    test.stdout       # Expected output (run: pass)
    test.stderr       # Expected errors (run: fail)
    test.aux.svg      # Auxiliary output (some suites)

Commands:

bash
cargo run -p hashql-compiletest run                           # Run all
cargo run -p hashql-compiletest run --filter "test(name)"     # Filter
cargo run -p hashql-compiletest run --bless                   # Update expected

Test file example:

jsonc
//@ run: fail
//@ description: Tests duplicate field detection
["type", "Bad", { "#struct": { "x": "Int", "x": "String" } }, "_"]
//~^ ERROR Field `x` first defined here

Directives (//@ at file start):

  • run: pass / run: fail (default) / run: skip
  • description: ... (encouraged)
  • name: custom_name

Annotations (//~ for expected diagnostics):

  • //~ ERROR msg - current line
  • //~^ ERROR msg - previous line
  • //~v ERROR msg - next line
  • //~| ERROR msg - same as previous annotation

📖 Full Guide: references/compiletest-guide.md

Unit Tests

Standard Rust #[test] functions for testing internal logic.

Location: #[cfg(test)] modules in source files

Example from hashql-syntax-jexpr/src/parser/state.rs:

rust
#[test]
fn peek_returns_token_without_consuming() {
    bind_context!(let context = "42");
    bind_state!(let mut state from context);

    let token = state.peek().expect("should not fail").expect("should have token");
    assert_eq!(token.kind, number("42"));
}

Commands:

bash
cargo nextest run --package hashql-<package>
cargo test --package hashql-<package> --doc    # Doc tests

insta Snapshot Tests

Use insta crate for snapshot-based output when compiletest (the preferred method) is infeasible. Three categories exist:

CategoryCratesSnapshot LocationRationale
Pipeline Cratesmir, hir, asttests/ui/<category>/*.snapColocate with compiletest tests
Corehashql-coreDefault insta (src/**/snapshots/)Separate from pipeline; prefer unit tests
Syntaxsyntax-jexprsrc/*/snapshots/Macro-based for parser fragments
Pipeline Crates (mir, hir, ast)

Snapshots colocate with compiletest UI tests. Test code lives in src/**/tests.rs, snapshots go in the appropriate tests/ui/<category>/ directory.

rust
// Example: hashql-mir/src/pass/transform/ssa_repair/tests.rs
let dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let mut settings = Settings::clone_current();
settings.set_snapshot_path(dir.join("tests/ui/pass/ssa_repair")); // matches test category
settings.set_prepend_module_to_snapshot(false);

let _drop = settings.bind_to_scope();
assert_snapshot!(name, value);

Categories vary: reify/, lower/, pass/ssa_repair/, etc.

Core

hashql-core is separate from the compilation pipeline, so it uses default insta directories. Prefer unit tests; only use snapshots where necessary.

Show full SKILL.md (176 more words)Show less
Syntax (syntax-jexpr)

Syntax crates predate compiletest and use macro-based test harnesses for testing parser fragments directly.

rust
// hashql-syntax-jexpr/src/parser/string/test.rs
pub(crate) macro test_cases($parser:ident; $($name:ident($source:expr) => $description:expr,)*) {
    $(
        #[test]
        fn $name() {
            assert_parse!($parser, $source, $description);
        }
    )*
}

Snapshots: hashql-syntax-jexpr/src/parser/*/snapshots/*.snap

Commands
bash
cargo insta test --package hashql-<package>
cargo insta review     # Interactive review
cargo insta accept     # Accept all pending

MIR Builder Tests

For testing MIR transformation and analysis passes directly with programmatically constructed MIR bodies.

Location: hashql-mir/src/pass/**/tests.rs

When to use:

  • Testing MIR passes in isolation with precise CFG control
  • Edge cases requiring specific MIR structures hard to produce from source
  • Benchmarking pass performance

Key features:

  • Transform passes return Changed enum (Yes, No, Unknown) to indicate modifications
  • Test harness captures and includes Changed value in snapshots for verification
  • Snapshot format: before MIR → Changed: Yes/No/Unknown separator → after MIR
Important: Missing Macro Features

The body! macro does not support all MIR constructs. If you need a feature that is not supported, do not work around it manually - instead, stop and request that the feature be added to the macro.

Quick Example (using body! macro)
rust
use hashql_core::{heap::Heap, r#type::environment::Environment};
use hashql_mir::{builder::body, intern::Interner};

let heap = Heap::new();
let interner = Interner::new(&heap);
let env = Environment::new(&heap);

let body = body!(interner, env; fn@0/1 -> Int {
    decl x: Int, cond: Bool;

    bb0() {
        cond = load true;
        if cond then bb1() else bb2();
    },
    bb1() {
        goto bb3(1);
    },
    bb2() {
        goto bb3(2);
    },
    bb3(x) {
        return x;
    }
});

📖 Full Guide: references/mir-builder-guide.md

References

© hashintel, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files (references) in .agents/skills/testing-hashql of hashintel/hash.

  • SKILL.md
  • references/compiletest-guide.md
  • references/mir-builder-guide.md
  • references/mir-fluent-builder.md
  • references/testing-strategies.md

Open the folder on GitHubat commit e189ab2

Compare with similar skills

Testing Hashql next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Testing Hashql compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Testing Hashql this skillhashintel/hash1.7k—~1.9kAutomated safety check: PassAGPL-3.0
Handsontable Unit Testinghandsontable/handsontable22k—~1.2kAutomated safety check: PassCustom licence
Designing TestsCloudAI-X/claude-workflow-v21.4k1 repos~1.5kAutomated safety check: PassMIT
Web Testing with Playwright and Vitestwithkynam/vibecode-pro-max-kit1.1k—~892Automated safety check: PassApache-2.0
Testing Patternssoftspark/ai-toolkit179—~1.6kAutomated safety check: PassApache-2.0
Testing OpenLogi UIAprilNEA/OpenLogi23k—~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Handsontable Unit Testing

    handsontable/handsontable

    Conventions for Handsontable's Jest unit and TypeScript type tests: where files go, how to run them, mocking limits and when to write an E2E test instead.

    22k GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Designing Tests

    CloudAI-X/claude-workflow-v2

    Designs and implements testing strategies for any codebase. An agent skill from CloudAI-X/claude-workflow-v2.

    1.4k GitHub starsUsed in 1 repo~1.5k tokens
    Testing & QAAuto-check passed
  • Web Testing with Playwright and Vitest

    withkynam/vibecode-pro-max-kit

    Covers web testing from unit to E2E, load, visual, accessibility and security checks, with Playwright, Vitest and k6 guides plus a Playwright setup script.

    1.1k GitHub stars~892 tokensUpdated 3 mo ago
    Testing & QAAuto-check passed
  • Testing Patterns

    softspark/ai-toolkit

    Testing strategy: pyramid, AAA, mocks/fakes/stubs, flaky tests, coverage.

    179 GitHub stars~1.6k tokensUpdated today
    Testing & QAAuto-check passed
  • Testing OpenLogi UI

    AprilNEA/OpenLogi

    Verifies OpenLogi's native GPUI interface with focused tests, the component gallery and a mock agent, choosing the evidence that fits each change.

    23k GitHub stars~1.1k tokensUpdated 3 days ago
    Testing & QAAuto-check passed
  • Dynamo Unit Testing

    DynamoDS/Dynamo

    Write comprehensive NUnit tests for the Dynamo codebase following Dynamo testing patterns, conventions, and architectural constraints.

    2k GitHub stars~622 tokensUpdated today
    Testing & QAAuto-check passed

More from hashintel/hash

All 17 skills in this repo
  • Documenting Rust Code

    hashintel/hash

    Rust documentation practices for HASH codebase. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Handling Rust Errors

    hashintel/hash

    HASH error handling patterns using error-stack crate. An agent skill from hashintel/hash.

    1.7k GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Cargo.toml dependency management patterns for HASH workspace.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • HashQL diagnostic writing patterns using hashql-diagnostics crate.

    1.7k GitHub stars~724 tokensUpdated today
    Auto-check passed
  • Writing Hashql Jexpr

    hashintel/hash

    HashQL J-Expr syntax for writing queries. An agent skill from hashintel/hash.

    1.7k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • A skill your agent uses when creating, moving, splitting, or organizing TypeScript files and folders.

    1.7k GitHub stars~2.2k tokensUpdated today
    Auto-check passed

Categories

Questions about Testing Hashql

What does Testing Hashql do?

HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests. Testing Hashql is an agent skill from hashintel/hash. HashQL testing strategies including compiletest (UI tests), unit tests, and snapshot tests.

When should I use Testing Hashql?

Testing Hashql fits situations like: writing tests for HashQL code; using //~ annotations; running --bless; debugging test failures.

How do I install Testing Hashql in Claude Code?

Run `npx skills add hashintel/hash --skill testing-hashql -a claude-code`. Or copy the skill folder (.agents/skills/testing-hashql in hashintel/hash) into .claude/skills/testing-hashql in your project. Claude Code loads it when a task matches its description.

How do I install Testing Hashql in Codex?

Run `npx skills add hashintel/hash --skill testing-hashql -a codex`. Or copy the skill folder (.agents/skills/testing-hashql in hashintel/hash) into .agents/skills/testing-hashql in your project. Codex loads it when a task matches its description.

Can I use Testing Hashql in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add hashintel/hash --skill testing-hashql -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/testing-hashql, .gemini/skills/testing-hashql, .github/skills/testing-hashql and .opencode/skills/testing-hashql in your project.

What does Testing Hashql need to run?

Going by SKILL.md and its folder, Testing Hashql needs the command-line tools its instructions call (cargo).

Does Testing Hashql access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Testing Hashql safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Testing Hashql use?

Testing Hashql is published under the AGPL-3.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Testing Hashql use?

About 1.9k tokens (SKILL.md is roughly 7.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 11k tokens, read only when the agent opens those files.

What are the alternatives to Testing Hashql?

Skills that share tags, products or a category with Testing Hashql: Handsontable Unit Testing (handsontable/handsontable, 22k stars), Designing Tests (CloudAI-X/claude-workflow-v2, 1.4k stars), Web Testing with Playwright and Vitest (withkynam/vibecode-pro-max-kit, 1.1k stars) and Testing Patterns (softspark/ai-toolkit, 179 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Testing Hashql?

hashintel (a GitHub organization) maintains it in hashintel/hash, which has 1,668 GitHub stars. The repository holds 17 skills in this directory. The repository was last updated on October 7, 2026.

Source: hashintel/hash on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.