webhook-transforms
できること
このスキルは、外部のサービスがブレインにイベントを送れる仕組みを設定します。各イベントは、情報源を記したページに変換され、失敗したイベントは失われずに保存されます。
使う場面
- ✓テキスト、会議の結果、ソーシャルメディアの言及を、自動でブレインに保存したいとき。
- ✓外部のイベントをどうブレインのページに変換するか定義したいとき。
- ✓変換に失敗したとき、そのイベントがどうなるか確認したいとき。
スキルのリンク
https://github.com/garrytan/gbrain/blob/master/plugin/skills/webhook-transforms/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“録音アプリが送ってくる会議の要約はすべて、ブレインのページとして保存してください。失敗したイベントは保管してください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントは、イベントのデータをブレインのページに変える変換の手順を定義し、外部のサービスが呼び出せるアドレスを登録します。変換が失敗した場合、生のデータは保留フォルダに保存され、一度再試行されます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Webhook Transforms
Contract
This skill guarantees:
- External events are transformed into brain pages with proper citations
- Raw payloads are preserved (dead-letter queue if transform fails)
- Entity extraction runs on every transformed event
- Input sanitization: no raw HTML/script passes to brain pages
- Error handling: transform failure logs raw payload, retries once
Phases
Define transform. Map event schema to brain page format:
- Input: raw webhook payload (JSON)
- Output: brain page content (markdown) + metadata (slug, type, citations)
- Must sanitize: strip HTML tags, escape script content
Register webhook URL. Provide the external service with the webhook endpoint.
On event received:
- Parse payload
- Run transform function
- Write brain page via
gbrain put - Extract entities, run enrichment
- Add timeline entries to mentioned entities
- Sync:
gbrain sync
Error handling:
- If transform throws: log raw payload to
_dead-letter/{timestamp}.md - Surface error type to agent
- Retry once
- Don't lose events
- If transform throws: log raw payload to
Example Transforms
SMS Received
Input: {from: "+1555...", body: "Meeting moved to 3pm", timestamp: "..."}
Output: Timeline entry on sender's brain page + task update if action item detected
Meeting Completed
Input: {title: "Weekly sync", attendees: [...], transcript: "...", summary: "..."}
Output: Delegate to meeting-ingestion skill
Social Mention
Input: {platform: "twitter", author: "@handle", text: "...", url: "..."}
Output: Brain page in media/ + entity extraction + backlinks
Output Format
Event transformed and written to brain. Report: "Webhook: {event_type} from {source} → {brain_page_path}"
When it fails
Follow the agent operator protocol for any gbrain error code, exit code, [AGENT] block or notice block. Specific to this skill:
- A transformed write returns
write_pending(exit 10): the event is accepted; record the request id and poll it, never replay the event under a new id. source_binding_required/insufficient_scope: the webhook's token cannot write that source; tell the user which grant the brain host's operator must add.- A malformed payload: reject it with the parse error and log it; do not write a partial page.
Anti-Patterns
- Passing raw HTML/script to brain pages (XSS risk)
- Silently dropping events when transform fails (use dead-letter queue)
- Processing webhooks without entity extraction
- Not sanitizing external input before brain writes
よくある質問
変換に失敗したらどうなりますか?
生のイベントは保留フォルダに保存され、一度再試行されるため、イベントは失われません。
保存する前にウェブの内容は整えられますか?
はい。HTMLとスクリプトの内容が取り除かれ、ブレインのページに生のコードが残らないようにします。
届いたイベントは人物や会社にリンクされますか?
はい。各イベントに対してエンティティの検出を行い、関係する人物のタイムラインに項目を追加します。
詳細
作者による元の説明
Generic framework for converting external events (SMS, meetings, social mentions) into brain-ingestible signals. Define a transform function, register a webhook URL, and incoming events get processed through the brain pipeline.
repo: garrytan/gbrain
人気
- GitHubのスター
- 31k
- ランキング
- #9318
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
gbrain
31kエージェントが、共有の社内ナレッジブレインで人、プロジェクト、決定事項についての事実を検索し、永続的なメモを保存できるようにします。
brain-ingest-gate
31k重複を避け、名前付きのエンティティを先に解決するため、新しい内容をナレッジブレインに追加する前に、既存のブレインと照合するようエージェントを支援します。
brain-link-discipline
31kエージェントが報告する各ブレインのページについて、同じメッセージの中で動くリンクを必ず含め、すぐに開けるようにします。
brain-ops
31kナレッジブレインの基本的な手順をエージェントに与えます。まず既存の文脈を確認し、出典つきで明示的なメモを保存し、関連するページをリンクします。