Chuyển đến nội dung
Skillpedia
API và máy chủ (backend)48k · #3772

api-integration

Skill này làm gì

Skill này giúp thiết kế cách các hệ thống máy tính khác nhau có thể nói chuyện với nhau. Nó tạo ra các luồng gửi dữ liệu, như trong hệ thống giao nhận tin nhắn hoặc khi kết nối nhiều công cụ.

Khi nào nên dùng

  • ✓Khi bạn cần kết nối hai hoặc nhiều hệ thống phần mềm.
  • ✓Khi bạn muốn một hệ thống thông báo cho hệ thống khác về một sự kiện đã xảy ra.
  • ✓Khi cần chuyển dữ liệu từ nơi này sang nơi khác một cách tự động.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-integration/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/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/api-integration/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àm thế nào để website của tôi thông báo cho hệ thống quản lý kho khi có đơn hàng mới?”

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

Cách hoạt động

Công cụ định nghĩa các “đường đi” để dữ liệu di chuyển giữa các hệ thống. Điều này có thể gồm gửi thông điệp (như webhook) hoặc tạo chuỗi hành động phụ thuộc lẫn nhau.

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.

API Integration Skill

When to Use

Use this skill when you need designs event-driven architectures, webhook systems, API chaining flows, ETL pipelines, and integration patterns between services. Use whenever the user asks about webhooks, event streaming, API composition, connecting two or more APIs, building pipelines, Pub/Sub, Kafka topics, ETL...

Design integration patterns, webhook flows, event pipelines, and API composition strategies.


Webhook Design

Outbound Webhook Endpoint (from your system to 3rd party)

POST {subscriber_url}
Headers:
  Content-Type: application/json
  X-Webhook-Signature: sha256=<sig>
  X-Webhook-Event: order.created
  X-Webhook-Delivery: <uuid>
  X-Webhook-Timestamp: <unix-epoch>

Payload envelope

{
  "event": "order.created",
  "delivery_id": "uuid",
  "created_at": "ISO8601",
  "data": { ... }
}

Signature verification (receiver side):

import hmac, hashlib
expected = hmac.new(secret.encode(), payload_bytes, hashlib.sha256).hexdigest()
# webhook-signature-example: do not use assert for an authorization boundary
if not hmac.compare_digest(f"sha256={expected}", request.headers.get("X-Webhook-Signature", "")):
    raise ValueError("Invalid webhook signature")

Inbound Webhook Registration API

POST   /api/v1/webhooks           — register subscriber URL + events
GET    /api/v1/webhooks           — list subscriptions
DELETE /api/v1/webhooks/{id}      — unsubscribe
POST   /api/v1/webhooks/{id}/test — fire test event
GET    /api/v1/webhooks/{id}/deliveries — delivery history + status

API Chaining / Composition Pattern

Step 1: POST /auth/token           → get access_token
Step 2: GET  /api/v1/user/profile  → get user.id (use token from step 1)
Step 3: POST /api/v1/orders        → create order (use user.id from step 2)
Step 4: POST /api/v1/payments      → charge (use order.id from step 3)

Always: handle failures at each step independently, use idempotency keys, implement retry with exponential backoff.


Event-Driven Architecture

Event Schema (CloudEvents spec)

{
  "specversion": "1.0",
  "type": "com.example.order.created",
  "source": "/orders-service",
  "id": "uuid",
  "time": "2024-01-01T00:00:00Z",
  "datacontenttype": "application/json",
  "data": { "order_id": "...", "amount": 99.99 }
}

Topics / Queues design

Topic Producers Consumers Retention
orders.created orders-svc payments-svc, email-svc 7 days
payments.completed payments-svc orders-svc, ledger-svc 30 days
users.deleted users-svc all services 90 days

Saga Pattern (Distributed Transaction)

Choreography saga for order checkout:
1. orders-svc emits order.created
2. inventory-svc reserves stock → emits inventory.reserved
3. payments-svc charges card → emits payment.completed
4. orders-svc emits order.confirmed

On failure at step 3:
← payments-svc emits payment.failed
← inventory-svc releases stock (compensating transaction)
← orders-svc emits order.cancelled

Outbox Pattern (reliable event publishing)

-- Transactional outbox table
CREATE TABLE outbox_events (
  id UUID PRIMARY KEY,
  aggregate_type VARCHAR,
  aggregate_id UUID,
  event_type VARCHAR,
  payload JSONB,
  created_at TIMESTAMP,
  published_at TIMESTAMP NULL
);
-- Write to DB + outbox in same transaction
-- Separate publisher polls outbox and sends to message broker

Integration Checklist

  • Idempotency keys on all state-changing calls
  • Retry with exponential backoff (base 1s, max 60s, jitter)
  • Circuit breaker (open after 5 failures in 10s)
  • Dead-letter queue for unprocessable events
  • Webhook delivery logging + manual replay endpoint
  • Schema versioning on all events
  • Correlation IDs on all inter-service calls

Handoff

Report the event schemas, delivery/retry policy, idempotency and compensation boundaries, and the checks actually performed. Signature verification also needs the provider's current protocol, bounded input, timestamp/replay protection and an authorized test endpoint. A design is not evidence that an integration or payment ran.

Limitations

  • Use this skill only when the task clearly matches its upstream source and local project context.
  • Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.

…

Câu hỏi thường gặp

Webhook là gì?

Đó giống như một thông báo tự động mà một hệ thống gửi cho hệ thống khác khi có điều quan trọng xảy ra, chẳng hạn một đơn hàng mới.

“API Chaining” là gì?

Đó là cách kết nối nhiều lệnh gọi API theo chuỗi, trong đó kết quả của lệnh này được dùng cho lệnh kế tiếp, giống như làm theo công thức từng bước.

“Event-Driven Architecture” là gì?

Đó là kiểu thiết kế mà các hệ thống phản ứng với “sự kiện” (những điều xảy ra), thay vì bị điều khiển trực tiếp. Hãy nghĩ đến một hệ thống chỉ hoạt động khi nhận được thông báo.

Chi tiết

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

Designs event-driven architectures, webhook systems, API chaining flows, ETL pipelines, and integration patterns between services.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#3772
Giấy phép
MIT
Cập nhật
15/10/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ự