agentleFS
sridsrid/skills/haskell/SKILL.md

haskell

Skill1 starsChanged 8 months agoMITView on GitHub

Haskell coding with relude, ghcid-based workflow, hlint compliance, and strict error handling. Use when working with .hs files, Cabal projects, or ghcid.

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. rogue-dev-studio/ai-agents-rogue★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

Show its rules and text

We split this skill into the rules it gives an agent

26 rules. About 0 are common, 15 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈15

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    CRITICAL - Error Handling in Code: NEVER write code that silently ignores errors:

    line 12
  2. Very specific:

    Do NOT use undefined or error as placeholders

    line 13
  3. Distinctive:

    Do NOT skip handling error cases in pattern matches

    line 14
  4. Very specific:

    Do NOT ignore Maybe/Either failure cases

    line 15
  5. Distinctive:

    Use types to make impossible states unrepresentable

    line 17
  6. Distinctive:

    Every error case in generated code must be handled properly.

    line 19
  7. Very specific:

    Do NOT proceed to verification or linting until ghcid.txt is clean.

    line 24
  8. Very specific:

    If it exists, you MUST run hlint on any file you modify.

    line 28
  9. Distinctive:

    Do NOT ignore hlint warnings unless explicitly instructed by the user.

    line 30
  10. Distinctive:

    Write type signatures for all top-level definitions

    line 33
  11. Very specific:

    Write total functions (avoid head, tail)

    line 34
  12. Distinctive:

    Prefer pure functions over IO when possible

    line 35
  13. Distinctive:

    Use explicit exports in modules

    line 36
  14. Distinctive:

    Write Haddock documentation for public APIs

    line 39
  15. Very specific:

    Prefer Text over String

    line 42
  16. Very specific:

    Use newtype wrappers for domain types

    line 43
  17. Distinctive:

    Use RecordDotSyntax & OverloadedRecordDot (add pragma to modules that use the syntax)

    line 46
  18. Distinctive:

    Use DisambiguateRecordFields and DuplicateRecordFields for simple field names (add pragma to modules that use the syntax)

    line 47
  19. Distinctive:

    Use lenses for record manipulation when appropriate

    line 48
  20. Very specific:

    Use Applicative and Monad appropriately

    line 49
  21. Very specific:

    Avoid trivial let bindings when inlining keeps code simple and readable

    line 50
  22. Distinctive:

    NEVER construct aeson objects by hand

    line 53
  23. Very specific:

    Instead create a type and use encode and decode on it

    line 54
  24. Very specific:

    When using relude, refer to RELUDE.md for best practices and idioms.

    line 60
  25. Distinctive:

    Use QuickCheck for property-based testing

    line 64
  26. Distinctive:

    Use HUnit or Hspec for unit tests

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Haskell Development

Expert assistance for Haskell programming.

Guidelines

CRITICAL - Error Handling in Code: NEVER write code that silently ignores errors:

  • Do NOT use undefined or error as placeholders
  • Do NOT skip handling error cases in pattern matches
  • Do NOT ignore Maybe/Either failure cases
  • Handle all possible cases explicitly
  • Use types to make impossible states unrepresentable

Every error case in generated code must be handled properly.

CRITICAL - Compile Status:

  • The code MUST compile without errors.
  • You MUST check ghcid.txt after every change and fix any errors reported there.
  • Do NOT proceed to verification or linting until ghcid.txt is clean.

CRITICAL - HLint Compliance:

  • You MUST check for .hlint.yaml in the project root.
  • If it exists, you MUST run hlint on any file you modify.
  • You MUST fix ALL hlint warnings before considering the task complete.
  • Do NOT ignore hlint warnings unless explicitly instructed by the user.

Code Quality:

  • Write type signatures for all top-level definitions
  • Write total functions (avoid head, tail)
  • Prefer pure functions over IO when possible
  • Use explicit exports in modules
  • Leverage type system for safety
  • Favor composition over complex functions
  • Write Haddock documentation for public APIs

Idiomatic Patterns:

  • Prefer Text over String
  • Use newtype wrappers for domain types
  • Apply smart constructors for validation
  • Records:
    • Use RecordDotSyntax & OverloadedRecordDot (add pragma to modules that use the syntax)
    • Use DisambiguateRecordFields and DuplicateRecordFields for simple field names (add pragma to modules that use the syntax)
  • Use lenses for record manipulation when appropriate
  • Use Applicative and Monad appropriately
  • Avoid trivial let bindings when inlining keeps code simple and readable

Working with Aeson:

  • NEVER construct aeson objects by hand
  • Instead create a type and use encode and decode on it
  • These types should generally use generic deriving of aeson (no hand deriving)

Relude Best Practices

When using relude, refer to RELUDE.md for best practices and idioms.

Testing

  • Use QuickCheck for property-based testing
  • Use HUnit or Hspec for unit tests
  • Provide good examples in documentation

Build instructions

As you make code changes, start a subagent in parallel to resolve any compile errors in ghcid.txt.

IMPORTANT: Do not run build commands yourself. The human runs ghcid in the terminal, which then updates ghcid.txt with any compile error or warning (if this file does not exist, or if ghcid has stopped, remind the human to address it). You should read ghcid.txt (in entirety) after making code changes; this file updates near-instantly.

Adding/Deleting modules: When a new .hs file is added or deleted, the .cabal file must be updated accordingly. However, if package.yaml exists in the project, run hpack instead to regenerate the .cabal file with the updated module list. This will trigger ghcid to restart automatically.

HLint warnings: MANDATORY. After ghcid.txt shows success, if .hlint.yaml exists, run hlint on the modified files. You are NOT done until hlint reports no issues.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.