Chuyển đến nội dung
Skillpedia
Tự động hóa31k · #9318

webhook-transforms

Skill này làm gì

Skill này thiết lập cách để các dịch vụ bên ngoài gửi sự kiện vào brain. Mỗi sự kiện được chuyển thành một trang và ghi chú nguồn, còn sự kiện lỗi được lưu lại thay vì bị mất.

Khi nào nên dùng

  • ✓Khi bạn muốn tin nhắn, kết quả cuộc họp hoặc lượt nhắc trên mạng xã hội được lưu vào brain tự động.
  • ✓Khi bạn muốn định nghĩa cách một sự kiện bên ngoài được chuyển thành trang brain.
  • ✓Khi bạn cần kiểm tra điều gì xảy ra với một sự kiện nếu việc chuyển đổi thất bại.

Liên kết skill

https://github.com/garrytan/gbrain/blob/master/plugin/skills/webhook-transforms/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/garrytan/gbrain/blob/master/plugin/skills/webhook-transforms/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Lưu mọi bản tóm tắt cuộc họp mà ứng dụng ghi âm của tôi gửi đến thành một trang trong brain, và giữ lại mọi sự kiện bị lỗi.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent định nghĩa bước chuyển đổi biến dữ liệu sự kiện thành trang brain, rồi đăng ký một địa chỉ để dịch vụ bên ngoài gọi tới. Nếu chuyển đổi thất bại, dữ liệu thô được lưu vào thư mục tạm và thử lại một lần.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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

  1. 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
  2. Register webhook URL. Provide the external service with the webhook endpoint.

  3. 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
  4. Error handling:

    • If transform throws: log raw payload to _dead-letter/{timestamp}.md
    • Surface error type to agent
    • Retry once
    • Don't lose events

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
Câu hỏi thường gặp

Điều gì xảy ra nếu chuyển đổi thất bại?

Sự kiện thô được lưu vào thư mục tạm và được thử lại một lần, nên sự kiện không bị mất.

Nội dung web có được làm sạch trước khi lưu không?

Có. Nội dung HTML và script được loại bỏ để không có mã thô nào lọt vào trang brain.

Các sự kiện đến có được liên kết với người và công ty không?

Có. Skill chạy nhận diện thực thể trên mỗi sự kiện và thêm mục dòng thời gian cho những người liên quan.

Chi tiết

Mô tả gốc của tác giả

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

Độ phổ biến

Sao GitHub
31k
Vị trí xếp hạng
#9318
Giấy phép
MIT
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự