本文へスキップ
Skillpedia
一般的なプログラミング48k · #4642

fp-errors

できること

このスキルは、プログラミングでエラーを整理された方法で扱う方法を教えます。あちこちでエラーを「投げる(throw)」のではなく、プログラムが理解し、管理できる情報として扱うことを学びます。

使う場面

  • ✓コードに「try/catch」のブロックが多くなりすぎて、分かりにくくなっているとき。
  • ✓どのエラーが正確に発生したのかを把握することが重要なシステムを作るとき。
  • ✓エラー処理をより予測しやすく、追いやすくしたいとき。

スキルのリンク

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fp-errors/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/fp-errors/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“try/catchを使わずに、「Either」と「TaskEither」を使ってコードのエラーを管理するにはどうすればよいですか?”

毎週5つの新しいスキル。1分で読めます。

仕組み

基本的な考え方は、エラーをデータとして扱うことです。プログラムが突然停止する代わりに、エラーを値として返すため、その関数を呼び出したコードは何が起きたかを把握し、適切に対応できます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Practical Error Handling with fp-ts

This skill teaches you how to handle errors without try/catch spaghetti. No academic jargon - just practical patterns for real problems.

The core idea: Errors are just data. Instead of throwing them into the void and hoping someone catches them, return them as values that TypeScript can track.

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use

  • You need to replace exception-heavy code with Either or TaskEither.
  • The task involves validation, domain errors, or clearer error contracts in TypeScript.
  • You want pragmatic fp-ts error-handling guidance for real application code.

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
よくある質問

「Either」と「TaskEither」とは何ですか?

関数が成功の結果とエラーの両方を、分かりやすく制御された方法で返せるようにする道具(データ型)です。

try/catchより優れている理由は何ですか?

try/catchはエラー処理をコード全体に散らばらせてしまい、読みにくく予測しづらくなることがあります。「Either」と「TaskEither」を使うと、エラー処理を一箇所にまとめ、どう扱うかを明示できます。

どのような種類のエラーにも有効ですか?

特に、バリデーションや想定された通信の失敗など、事前に予想でき、プログラムの通常の流れの一部となるエラーに役立ちます。

詳細

作者による元の説明

Stop throwing everywhere - handle errors as values using Either and TaskEither for cleaner, more predictable code

repo: sickn33/agentic-awesome-skills

人気

GitHubのスター
48k
ランキング
#4642
ライセンス
MIT
更新日
2026/10/15

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル