juspay/vira / .agents/skills/haskell
haskell
UnverifiedUse this when writing or reviewing Haskell code. Covers error handling, type safety, idiomatic patterns, HLint compliance, Aeson usage, and testing.
Haskell Development
Error Handling
- NEVER use
undefinedorerroras placeholders - Handle ALL
Maybe/Eithercases explicitly — no silent ignoring - Handle all pattern match cases — no partial matches
- Use types to make impossible states unrepresentable
Type Safety & Idioms
- Write type signatures for all top-level definitions
- Prefer
TextoverString - Use
newtypewrappers for domain types - Apply smart constructors for validation
- Write total functions — avoid
head,tail, and other partial functions - Prefer pure functions over IO
- Use explicit module exports
- Favor composition over complex functions
- Write Haddock documentation for public APIs
Records
- Use
OverloadedRecordDot(add pragma to modules that use the syntax) - Use
DisambiguateRecordFieldsandDuplicateRecordFieldsfor simple field names - Use lenses for record manipulation when appropriate
Aeson
- NEVER construct aeson objects by hand
- Create a type and use
encode/decodeon it - Prefer generic deriving; hand-write instances only when the wire format requires it
HLint
If .hlint.yaml exists in the project root, run hlint on every modified file. Fix ALL warnings before considering the task complete.
Build Workflow
If ghcid.txt exists in the project, check it after every code change for compile errors. Do not proceed until it is clean. If this file does not exist, use whatever build workflow the project documents.
When adding or deleting .hs modules: update the .cabal file, or run hpack if package.yaml exists.
Relude
If the project uses relude (check .cabal or package.yaml dependencies), also follow RELUDE.md for idiomatic substitutions.
Testing
- QuickCheck for property-based testing
- HUnit or Hspec for unit tests
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the work | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixes | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation code | Stars: 318k | Updated | Claude CodeCodex | Unverified | Install |
| skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy. | Stars: 196k | Updated | Claude CodeCodex | Verified | Install |