Comprehensive Haskell CLI managing builds, tests, formatting, and dependencies through a single manifest file.

Install

mkdir -p .claude/skills/hx && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17341" && unzip -o skill.zip -d .claude/skills/hx && rm skill.zip

Installs to .claude/skills/hx

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.

Build, test, run, lint, format, and manage dependencies for Haskell projects using the hx toolchain CLI. Use whenever working in a Haskell project that has an hx.toml (or when setting one up), or when the user asks to build/test/run/typecheck Haskell code, manage GHC/Cabal versions, or add/remove Hackage dependencies.
319 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • Scaffold new Haskell projects
  • Build Haskell projects with options for release and parallelism
  • Type-check Haskell code quickly
  • Run tests with pattern matching
  • Format and check Haskell code formatting
  • Manage Hackage dependencies (add, remove, lock, sync)

How it works

The skill uses the `hx` CLI toolchain to manage Haskell projects, providing commands for building, testing, running, linting, formatting, and dependency management, replacing multiple individual tools.

Inputs & outputs

You give it
Haskell project files, commands for build/test/run/manage
You get back
Built executables, test results, formatted code, dependency changes, or diagnostic information

When to use hx

  • Build a Haskell project
  • Run tests
  • Manage Hackage dependencies

About this skill

hx — Haskell toolchain

hx is a single CLI that replaces ghcup, cabal, stack, fourmolu, hlint, and hpc. It manages GHC itself, uses an hx.toml manifest and an hx.lock lockfile, and returns meaningful exit codes.

Detecting that this skill applies

The project is an hx project if there is an hx.toml at (or above) the working directory. If the user has a .cabal/stack.yaml but no hx.toml, you can adopt it with hx init or hx import --from stack.

Core commands

GoalCommand
Scaffold a projecthx init <name>
Buildhx build (--release, -j N)
Type-check only (fast)hx check
Run testshx test (--pattern <p>)
Build & runhx run -- <args>
Format / check formathx fmt / hx fmt --check
Lint / autofixhx lint / hx lint --fix
Add / remove a dependencyhx add <pkg> "<constraint>" / hx rm <pkg>
Lock / build from lockhx lock / hx sync
Diagnose the environmenthx doctor
Install/manage GHChx toolchain install

Run hx <command> --help for flags. --quiet/--verbose are global; NO_COLOR is respected.

Interpreting results — exit codes

Decide success/failure from the exit code, not by scraping output:

  • 0 success · 1 general error · 2 bad arguments · 3 bad hx.toml
  • 4 toolchain error (GHC/Cabal missing or mismatched — run hx doctor)
  • 5 build/test failure · 6 plugin hook failure

Errors print a structured summary with a suggested fix on stderr; surface that fix to the user.

Typical workflows

# new project
hx init myapp && cd myapp && hx build && hx run

# add a dependency and rebuild
hx add aeson ">=2.0" && hx build

# pre-commit quality gate
hx fmt --check && hx lint && hx test

# reproducible build
hx lock && hx sync

Important behavior

  • Toolchain auto-install: the first hx build may download a GHC (hundreds of MB). hx doctor returns exit 4 when a required tool is missing and tells you how to install it.
  • hx build --native is experimental — a fast path for single-package, base-only projects; it falls back to cabal otherwise. Don't use it for multi-dependency projects.
  • Plugins require trust: project-local .hx/plugins/*.scm scripts do not run on a freshly cloned repo. Never run hx plugins trust on a project you don't trust.

Programmatic / MCP use

For tool-call access instead of shelling out, run hx mcp (an MCP server over stdio) — it exposes build/check/test/run/lock/sync/fmt/lint/doctor and dependency tools. See AGENTS.md in the repo.

When not to use it

  • When working on a Haskell project without an `hx.toml` and not intending to adopt `hx`
  • When using `hx build --native` for multi-dependency projects

Limitations

  • The `hx build --native` command is experimental for single-package, `base`-only projects.
  • Plugins require trust and do not run on freshly cloned repos without explicit action.
  • Errors print a structured summary with a suggested fix on stderr.

How it compares

This skill consolidates various Haskell development tasks into a single CLI tool, offering a unified workflow compared to using separate tools like ghcup, cabal, stack, and hlint.

Compared to similar skills

hx side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
hx (this skill)01moReviewIntermediate
e2e-testing-patterns82moNo flagsIntermediate
testing-workflow169moReviewIntermediate
perf-lighthouse135moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

Search skills

Search the agent skills registry