exception

exception is a skill for Claude Code from ncaq/konoka. It costs 58 tokens per session (1,593 once invoked), scanned A, original, Apache-2.0.

A Haskell error-handling guideline. It recommends returning structured error values from pure code and using typed exceptions in input/output code when exceptions are appropriate.

In plain words
What is it for?
Use it when writing or reviewing Haskell functions that can fail. Check uses of `error`, `throw`, `Either`, typed exceptions, swallowed I/O errors, and temporary `undefined` implementations.
Why use it?
It avoids hidden failures, unstructured error messages, and errors that disappear without explanation. It also makes failures easier for callers to handle and debug.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the haskell-tasuke plugin — 25 skills shipped together

Good fit Use it when writing or reviewing Haskell functions that can fail. Check uses of error, throw, Either, typed exceptions, swallowed I/O errors, and temporary undefined implementations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/exception
View source ↗ ncaq/konoka
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ncaq/konoka --skill exception
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code.

Or install haskell-tasuke, the plugin that ships this one along with the rest of its 25 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for exception

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/exception/github.svg)](https://agentmods.dev/skills/ncaq/konoka/exception)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/exception"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/exception/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for exception

Your own site · 80×15
<a href="https://agentmods.dev/skills/ncaq/konoka/exception"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/exception.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,593 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.01593
Opus 5.5 $0.00023 $0.00637
Sonnet 5.5 $0.00012 $0.00319
Haiku 4.5 $0.00006 $0.00159

Measured yesterday against content hash b22efff33919, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

exception scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/haskell-tasuke/skills/exception/SKILL.md · 107 lines

How it starts

The opening of the file, as written. The whole thing — 107 lines — stays where its author put it; the contents beside it link to each section on GitHub.

例外処理の原則

純粋なコードから例外を投げない

errorは原則として使いません。 純粋なコードから投げた例外は呼び出し側で捕捉するのが難しく、 中身がStringで構造を持たないのでデバッグもしにくいためです。 捕捉が難しい理由はhaskell-tasuke:partial-functionにも書いています。

throw(導入されていれば、非純粋であることを名前で示すimpureThrow)は、 例外に型が付く点ではerrorよりましですが、 純粋なコードから例外を投げる点は同じなので、やはり推奨しません。

エラーの情報は、後述のようにMonadThrowで呼び出し側に伝播させます。

論理的に起こり得ない場所に限り、純粋なコードから例外を投げて構いません。 そこに到達するほどおかしなことが起きているなら、 アプリケーションごと終了させるのが適切だからです。 その場合も、なるべく例外の型を作って投げます。

undefinedはPRを出す前に取り除く

undefinedは、Rustのtodo!と同じように、開発中の仮の実装として使って構いません。 例えばテストを先に書くときに、 関数の本体をundefinedで埋めてコンパイルだけ通しておけます。

undefinedも純粋なコードから例外を投げるので、PRを出す前に全て取り除きます。 残っていれば警告が出るはずです。

例外に型を付ける

throwStringのような関数は使わず、例外の型を定義してthrowMなどで投げます。

例外の型のフィールドには、Textなどの文字列型ではなく、 なるべく状況を表す構造的なデータ型を持たせます。 循環importが起きる場合は、例外を投げる側でTextに変換して構いません。

失敗はEitherよりMonadThrowで伝える

失敗する可能性のある関数を定義するときは、 Either e aを返すのではなく、 なるべく(MonadThrow m) => ... -> m aの型にしてthrowMで失敗を伝えます。 検証やパースの関数を新しく書くときに特に当てはまります。

-- 避ける
parseArchitecture :: Text -> Either UnsupportedArchitecture Architecture

-- 良い
parseArchitecture :: (MonadThrow m) => Text -> m Architecture
parseArchitecture "x86_64" = pure X86_64
parseArchitecture "aarch64" = pure Aarch64
parseArchitecture other = throwM $ UnsupportedArchitecture other

IOなどの文脈から呼ぶとmがその文脈になるので、 結果をそのまま束縛でき、either throwM pureのような変換が要りません。 mをMaybeやEither SomeExceptionにすれば純粋なコードからも呼べます。 その場合は例外は投げられずNothingやLeftになるので、 純粋なコードから例外を投げないという原則とも両立します。 特定の例外型で分岐したい呼び出し側は、 tryやcatchでその型を指定して捕まえます。

失敗が例外的な状況ではなく、呼び出し側が必ず分岐して処理する正常系であれば、 後述のデータベースの例のようにMaybeやEitherを返して構いません。

テストではmをIOにして、 tryで例外型を捕まえ、得られたEitherを期待する値と直接比較します。 そのために例外型にはEqのインスタンスも導出しておきます。 直接比較する理由はhaskell-tasuke:test-equalに書いています。

try (parseArchitecture "sparc") `shouldReturn` Left (UnsupportedArchitecture "sparc")

エラーを握り潰さない

IOの文脈などで例外が起きたときに、捕捉して何もしないコードは書きません。 IOは例外が起こり得ることを既に示している文脈で、 例外が上位へ伝播することは許容されています。 握り潰すくらいなら、捕捉せずに上位に任せるほうが概ね適切です。

Read the full file on GitHub · 107 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday Changed · +38 lines · +15 tokens per session b22efff33919
  2. 6d ago Changed · -28 lines 36a28302afe9
  3. 3mo ago First seen · 97 lines · 43 tokens per session scan A 0228638f3f9b

Subscribe to this mod's changes

exception is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed 2d ago), licensed Apache-2.0. It adds 58 tokens to every session and 1,593 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

exception compared with skills from other repositories

exception next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
exceptionncaq/konokaSkill32d agoApache-2.0A58Claude Code
github-project-automationsecondsky/claude-skillsSkill2574d agoMITA45Claude Code
hono-routingsecondsky/claude-skillsSkill2574d agoMITA41Claude Code
bun-http-serversecondsky/claude-skillsSkill2574d agoMITA31Claude Code
api-testingsecondsky/claude-skillsSkill2574d agoMITA39Claude Code
bun-jest-migrationsecondsky/claude-skillsSkill2574d agoMITA25Claude Code
cloudflare-workers-migrationsecondsky/claude-skillsSkill2574d agoMITA49Claude Code