本文へ移動
cccskills
無料GitHub で公開

neohaskell-best-practices

Implement and review NeoHaskell framework, language, and toolchain internals. Use for Haskell API design, boundary parsing, service records, effects, concurrency, derivation, and their tests in this repository; not as an application-building guide.

日本語の概要は準備中です。原文の説明を表示しています。

neohaskell/NeoHaskellスター 348(GitHub 348 + cccskills 0)

実行スコア 未検証

インストール方法を見る

含まれるファイル(9)

  • SKILL.md8.2 KB
  • references/patterns.md14.6 KB
  • scripts/bounded_process.py9.6 KB
  • scripts/repo-root1.1 KB
  • scripts/toolchain-fp644 B
  • scripts/with-toolchain1.0 KB
  • tests/test_bounded_process.py2.2 KB
  • tests/test_execution_contracts.py16.8 KB
  • tests/test_toolchain.py9.1 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

NeoHaskell best practices

Apply NeoHaskell code guidelines for the dialect and Type System Discipline for type design. Ground API choices in the maintained module and its callers. Follow AGENTS.md for the shared workflow.

RuleSummary
Data lastDesign transformation APIs with configuration, predicates, and callbacks first and the primary transformed value last, so callers can pipe the value through stages. Read existing signatures; adapt explicitly instead of assuming every current API has this order.
Pipelines for compositionCompose transformations with |> and read them in execution order. Use it instead of (.), $, <<, >>, or nested transformation calls. Ordinary application, constructors, record field access, and Task sequencing retain their own meaning.
Explicit function parametersNo point-free definitions or aliases: name every declared input, including the final piped value. Name anonymous callback inputs explicitly too. Passing a named helper as a callback and partially applying leading arguments in a pipeline stage are valid.
Named, readable stepsGive each helper one clear job and name it by intent. Give top-level helpers explicit type signatures. Split a pipeline when its steps stop describing one coherent transformation; use named intermediates when branches or several inputs need context. Use explicit lambdas instead of clever operator sections or flip.
Boolean conditions and ADT casesUse ordinary if condition then ... else ... for Boolean checks and case for constructors of Maybe, Result, and other ADTs. Use regular else if chains when needed. Do not use MultiWayIf or case on True/False.
Algebraic data typesPut each valid case and its required data in a constructor. If fields become present or absent together, encode those states with constructors; keep genuinely independent absence as Maybe. Use named ADT modes when Boolean parameters hide domain meaning; retain Bool for genuine predicates and clearly named Boolean fields. Match constructors explicitly when adding a case should force a caller decision; preserve the build's incomplete-pattern checks.
Module-qualified API namesDesign the module, type, and operation names together. The module supplies the subject: Array.first, Array.append, and Map.get; avoid repeating that subject in function names. Match a type-centered public module and its principal type, enabling paired imports such as import Array (Array) and import Array qualified.
Intentional module APIsGroup helpers around the owning type or subsystem and export its intended contract. Keep implementation helpers private. Restrict constructor access when it protects a concrete invariant; expose constructors when caller pattern matching belongs to the contract.
Semantic newtypesDistinguish values with different meanings even when their representations coincide. A newtype alone proves no value constraint: inspect constructors, decoders, and conversions before trusting an invariant.
Constructive, total representationsPrefer a shape that carries the required guarantee, such as a head plus rest or pairs. Keep ordinary collections when the contract is total; Array.first and LinkedList.head already represent absence with Maybe. A start plus duration still needs a nonnegative-duration invariant.
Boundary parsing and errorsDecode external Text, Bytes, or Json.Value into the owning type, then establish semantic constraints the decoder does not check. Use Result for explained pure failure and Task for effects; preserve typed errors until an adapter owns their presentation. Follow Boundary Discipline.
Authoritative shapesReuse owning types, type families, and existing Generic/Template Haskell derivation. ToSchema derives a schema from a Haskell type; it is not an input validator. Keep custom decoding when the contract requires it, and check what a marker already generates before adding instances.
Necessary declarationsFollow Minimize Reader Load. Keep derived capabilities, imports and annotations for demonstrated constraints or operations. Remove automatically supplied and unused boilerplate from consumer examples.
Checked conversionsEstablish the semantic precondition as well as representation compatibility. Read conversion behavior: Int.fromInt64 clamps, so it does not prove an exact conversion. Do not replace an unexplained partial path with panic or an unsafe conversion.
Records and service ownershipUse named records for coherent configuration or easily confused arguments; retain simple positional and pipeline APIs where clear. Services are records of functions. Their constructors own captured dependencies, mutable state, and resource lifetimes; pure callers should not carry synchronization machinery.
Pure logic and deferred effectsKeep transformations and decision construction separate from effect execution. Constructing or showing a Task does not run it; constructing a Decision does not execute its capabilities. Compose with the existing interpreters and runners at their owning boundaries.
Concurrency at the ownerIdentify the shared invariant, then choose the existing module in core/concurrency/ for its atomicity, blocking, communication, and lifetime semantics. Put dependent reads and writes in one suitable atomic operation. Use Foundational Thinking.
Evaluation is part of behaviorCheck the wrapper's argument order and demand behavior before substituting a fold, collection, or stream operation. Preserve required laziness and bounded resource use. Execute effects and consume the result required by the caller; use Benchmark Checklist for performance claims.
Behavioral and compiler evidenceExercise real service operations and assert observable results. Use meaningful QuickCheck properties in the owning Hspec suite. Compile consumer fixtures for generated APIs and type guarantees; run generated behavior when the claim is behavioral. Follow Test Behavior and Prove It Works.
Framework diagnosticsUse Log.debug, Log.info, Log.warn, or Log.critical for runtime diagnostics. Framework internals can use Log.withScope for structured context. Include useful operation identifiers, preserve redaction, and make compiler/generator failures explain the expected contract and repair.

Run compiler and test commands through scripts/with-toolchain <command> <arguments...>. The wrapper uses the checked shell witness, enters the project Nix shell when needed, and labels an unpinned host fallback. It preserves argument boundaries and command exit status.

Use NeoHaskell tests for current suite, doctest and testbed entrypoints. Capture runtime or compiler contracts with Regression evidence. For event-store behavior, select relevant controlled-fault regression recipes alongside the broader maintained tests.

For framework export, TH marker or generated-API changes, follow NeoHaskell consumer verification before implementation and verification. It owns the starter and testbed migration contract. Apply the application example rules to consumer code, including fixtures that represent an app.

Read patterns when designing module APIs, functions, and pipelines or working on boundary invariants, service ownership, deferred execution, concurrency, generated consumers, or diagnostics.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

architect

無料

Sketch types, signatures, and module structure before code, then stay in the loop while implementation fills in. Use for /architect, 'architect this', 'design this', or non-trivial work where jumping to code would lock in the wrong shape.

日本語の概要は準備中です。原文の説明を表示しています。

neohaskell/NeoHaskell3482026年10月26日 更新

arena

無料

Spawn N parallel candidates at the same task, pick a base, graft the strongest parts of the losers into it. Use for /arena, 'arena this', 'throw it in the arena', or when one attempt at a non-trivial artifact would lock in the wrong shape.

日本語の概要は準備中です。原文の説明を表示しています。

neohaskell/NeoHaskell3482026年10月26日 更新

babysit

無料

Inspect or supervise a PR or stack through review and CI to merge-ready, using current GitHub evidence and the requested mode.

日本語の概要は準備中です。原文の説明を表示しています。

neohaskell/NeoHaskell3482026年10月26日 更新

Vet a perf measurement (limiter, tuning, limits, errors, repeatability, relevance, and whether the work happened) before you report or act on it. Use when you benchmark or report a measured speedup or regression, including complete framework flows and compilation of projects that consume the framework.

日本語の概要は準備中です。原文の説明を表示しています。

neohaskell/NeoHaskell3482026年10月26日 更新

bro

無料

Restate the last message in plain human language, with no jargon.

日本語の概要は準備中です。原文の説明を表示しています。

neohaskell/NeoHaskell3482026年10月26日 更新

Build or adapt a local harness to drive, inspect, and profile an interactive CLI or TUI without external services. Use for CLI UX checks, startup regressions, memory leaks, hangs, prompt flows, or terminal demos.

日本語の概要は準備中です。原文の説明を表示しています。

neohaskell/NeoHaskell3482026年10月26日 更新

neohaskell のスキルをすべて見る

このスキルの問題を報告する