본문으로 건너뛰기
cccskills
무료GitHub에 공개

hx

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(1)

  • SKILL.md2.9 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

이 스킬의 문제 신고