llm-api-integration SKILL.md skillA
This file is byte-identical to the first copy the registry indexed, one of 3 indexed copies. Same content hash, so the same checks give both the same grade.
llm-api-integration from daishiman/harness-dev is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add daishiman/harness-dev/llm-api-integration@git:20261002.c0e127dPins git:20261002.c0e127d in mdr.lock. Pin the fingerprint instead.
- Audit grade
- A, 17 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- daishiman/harness-dev
- Path
.claude/skills/llm-api-integration/SKILL.md- Versions recorded
- 1
- Latest version
- git:20261002.c0e127d, committed Oct 2, 2026
- Size
- 13,438 bytes
- Repository stars
- 10
- License
- none declared
アプリケーションに LLM API(OpenAI / Anthropic / Gemini 等)を組み込む際のコスト最適化・セキュリティ・運用の必須パターン集。 「AI機能を付けて」「AIで読み取り」「画像認識」「PDFから抽出」「OCR」「自動分類」「レコメンド」「AI連携」「OpenAI APIを使う」 「チャットボット」「LLMを組み込む」などの文脈で、新規アプリ・既存アプリを問わず必ず使用する。 ユーザーが「AI」と明示しなくても、非構造データ(画像/PDF/自由文)からの情報抽出・分類・判別の要件が含まれるなら必ずこのスキルを読むこと。 AI機能のコスト見積・APIキー管理・利用量ダッシュボードの設計・レビューでもトリガーする。 実測グラウンディング付きの費用試算が必要な場合は Skill llm-cost-simulator を併用。 既定スタック(社内業務アプリ、mvp-first)の必須スキルではない optional 群。上記の AI 要件が要件定義で明示された場合、 または app-orchestrator…
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# LLM API 組み込みの必須パターン
収益不動産マッチングシステム(物件概要書PDF/名刺画像 → gpt-5.4-mini で構造化抽出)で確立したパターン。
**5つの柱: ①AIは判別にだけ使う ②miniファースト ③Structured Outputs 必須 ④利用量の記録と可視化ページ ⑤APIキーの暗号化保持(個人+共有の2段構え)。**
---
## 1. 設計原則: AIは「判別」にだけ使う
LLM呼び出しはアプリの中で**最小の一点**に絞る。生成に使う前に、分類に落とせないか必ず検討する。
### 判断フロー(上から順に検討)
1. **コードで書けるか?** → 正規表現・ルールベースで足りるなら AI 不要(郵便番号、金額パース等)
2. **無料の代替があるか?** → ブラウザ内 OCR(Tesseract.js)等をデフォルト経路にし、AI はオプトインの「高精度モード」にする
3. **分類・判別に落とせるか?** → 非構造データ → **enum(選択肢)への分岐**だけを AI にやらせる。以降の表示・処理は既存の決定的コードに流す
4. **抽出か?** → Structured Outputs で JSON スキーマに強制。自由記述はさせない
5. **本当に自由生成が必要か?** → ここまで落とせない場合のみ生成タスクとして扱う(コストは桁で増えることを明記して合意を取る)
### 「enum分岐 + 決定的な後段」パターン
AI にカテゴリ判定だけさせ、カテゴリごとの文言・処理はコード側に持つ。出力トークンが激減し、品質も安定する。
```typescript
// AI がやるのはこれだけ(出力は数トークン)
property_type: "apartment_building" | "office_building" | "hotel"
| "store" | "warehouse" | "land" | "other" | null
// 説明文・アイコン・後続処理はコード側の定義を引く(AI に書かせない)
const PROPERTY_TYPE_LABELS: Record<PropertyType, string> = { ... }
```
### 「推測禁止 + 低信頼フラグ」パターン
抽出タスクでは幻覚を仕組みで抑え、人間のレビューに繋ぐ:
- 不明・判読不能な項目は **null**(推測で埋めさせない)とプロンプトに明記
- `low_confidence_fields: string[]` をスキーマに必ず含め、換算した値・不鮮明な値のフィールド名を列挙させる
…Read the whole file at its exact version.
How to install
mdr add daishiman/harness-dev/llm-api-integration@sha256:f9508c7193ec0eaaThe line at the top of this page pins the label git:20261002.c0e127d, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_rcsivkvllcm2lyyz)
2 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 1 version of this file, committed on Oct 2, 2026.
Audit of the latest version
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (13438 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
- pass: No script tag
Source
daishiman/harness-dev · 10 stars · license none declared · pushed 2026-11-03 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_rcsivkvllcm2lyyz GET https://markdownregistry.com/api/v1/resolve?ref=daishiman/harness-dev/llm-api-integration GET https://markdownregistry.com/api/v1/blob/f9508c7193ec0eaacaf30bd8d6d143b6e9a7fdd834084b5c9bdad2658c67d6b5
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.
More from daishiman/harness-dev
Every file in daishiman/harness-dev